Oct 16, 2016

How to call stored procedure from Entity framework core and apply AsNoTracking

The latest version of Microsoft Asp.Net Core and Entity Framework Core is a hot topic in the market. Today, I am talking about how to call stored procedure from Entity Framework Core.

Here I am not teaching you. How to create stored procedure. Hope you already know it.

The support for stored procedure in Entity Framework Core is similar to the earlier versions of Entity Framework.
Let's see example
_context.Set<Products>().FromSql("GetAllProducts @CategoryId = {0}", categoryId).AsNoTracking().ToList()
We are calling "GetAllProducts" stored procedure passing categoryId.

Before calling stored procedure using Entity Framework Core. You require to include package "Microsoft.EntityFrameworkCore.SqlServer" to support calling stored procedure on the project.json file.

AsNoTracking
Disabling change tracking is useful for read-only scenarios because it avoids the overhead of setting up change tracking for each entity instance.

You should not disable change tracking if you want to manipulate entity instances and persist those changes to the database using Microsoft.EntityFrameworkCore.DbContext.SaveChanges.

Hope you like this post and keep reading!!

Oct 9, 2016

Microsoft MVP 2016 - Kalpesh Satasiya

Friends, 1st October 2016. It's memorable day for me and my family. I got below email from Microsoft  for "Congratulations 2016 Microsoft MVP!"



I have been awarded for Microsoft Most Valuable Professional 2016 for Visual Studio and Development Technologies.

I would like to thanks,  Mr. Gadharv Rawat and Microsoft MVP community for their support and guidance.  I would also like to thanks, MvpAward team for considering me to become a Microsoft MVP. As always there has been great support from friends and family.

Last but not the list, thanks to my beautiful wife, Mr. Jalpesh Vadagama and my blog reader for your constant support, encourage and guidance to me.

Thank you very much!!