Skip to Main Content

Entity Framework, LINQ and Model-First for the Oracle Database OBE (demo) - Error in code provided?

lead1111Jul 8 2021

I'm working through the demo (OBE) "Entity Framework, LINQ and Model-First for the Oracle Database" (
It's working to a point until the following:
//Update salary using a stored procedure function import
foreach (var result in ctx.UPDATE_AND_RETURN_SALARY(id, salary)) {
Console.WriteLine("Name: " + result.FIRST_NAME + " Updated Salary: " + result.SALARY);
Here's the error:
CS1579 foreach statement cannot operate on variables of type 'int' because 'int' does not contain a public instance or extension definition for 'GetEnumerator'

I'm using:
Visual Studio 2019 (16.10.0)
ODP.NET 19.3 (32 bit)
Oracle.ManagedDataAccess.EntityFramework.19.7.0 (NuGet)

Any ideas how to fix this? Is this demo (OBE) still relevant and using best recommended practices?

I ran this ODB first: Entity Framework Code First and Code First Migrations for Oracle Database
With no issues.


This post has been answered by Alex Keh-Oracle on Jul 9 2021
Jump to Answer
Post Details
Added on Jul 8 2021