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" (https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/EntityFrameworkOBE_2/EntityFrameworkOBE.html)
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
https://www.oracle.com/webfolder/technetwork/tutorials/obe/db/dotnet/2015/codefirstandcodefirstmigrations/Entity%20Framework%20Code%20First%20and%20Code%20First%20Migrations%20for%20Oracle%20Database.html
With no issues.

Thanks!
Chris

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