Showing posts with label Entity FW. Show all posts
Showing posts with label Entity FW. Show all posts

Using Entity Framework Core to access Stored Procedures having User Defined Table Types as Parameters

Last week while conducting a .NET Core Full Stack training, my client asked me to explain the mechanism of accessing SQL Server Stored Procedures using Entity Framework (EF) Core. They were creating an ASP.NET Core 2.2 WEB API app.

I have explained the entire process with examples and demonstrations. My attendees even requested me to show an example to access a stored procedure that accepts a User Defined Table (UDT) Type as input parameter.       

Entity Framework Core (EF Core) is an ORM for building the data access layer of modern applications.

EF Core provides Database First and Code First approaches to generate entity classes from database and generate Db Tables from entity classes respectively. The object model of EF Core provides methods to connect to a relational database and perform database transactions.

In most of the cases, we use Entity classes to perform all CRUD operations with the database. In this case, we will write all the logic for database operations in the .NET application by creating various repositories.

Entity Framework 4.2 Beta 1 Released with Bug Fix - The given assembly name or codebase was invalid

The Entity Framework 4.1 Update announced in July contained a bug that affected third party EF providers using a generic class for their provider factory implementation. A FileLoadException occurred with the message “The given assembly name or codebase was invalid”. Microsoft recently announced EF 4.2 Beta 1 which fixes this bug.

To refresh your memory, with EF 4.1 Update 1 there’s no need to specify ‘Persist Security Info=True’ in the connection string when using SQL authentication for Code First development. New types DbContextInfo and IDbContextFactory<TContext> have been added to make it easier to interact with DbContexts.

You can download this update using the EntityFramework.Preview package.

If you are interested in developing data apps using Entity Framework, make sure you read my article series Learn ADO.NET Entity Framework 4 – Free Tutorials

Entity Framework 4.1 Update

If you are using Entity Framework to create data access applications, then there’s a new update to Entity Framework 4.1. EF 4.1 was announced in April. Microsoft has just released EF 4.1 Update 1 to fix some bugs as well as introduced some new types.

There is no more the need to specify ‘Persist Security Info=True’ in the connection string when using SQL authentication for Code First development. New types DbContextInfo and IDbContextFactory<TContext> have been added to make it easier to interact with DbContexts.

Download the Entity Framework 4.1 Update (standalone update)

‘EntityFramework’ NuGet package

If you are interested in developing data apps using Entity Framework, make sure you read
Learn ADO.NET Entity Framework 4 – Free Tutorials

Free Entity Framework Book and Sample Project

If you are amongst those who want to learn the Entity Framework or have been working on LINQ to SQL and have now decided to move to Entity Framework, then here's a New Year present from Zeeshan Irani. Zeeshan has published a Free Book on Entity Framework in his blog post. This is what he says:

"May be the reader base can get the same perception about EF and the mapping scenarios it offers even in version 1 as I did, after reading the PDF that contains 500 pages of content about entity framework."


You can download the Free Ebook (514 pages) and a sample project from his blog post over here:


Contributions to Entity framework community