EF Core

Entity Framework Core 3.1 - Part 4

In my previous post, we talked about interacting with related entities using entity framework. Introduction Time to look at some special cases where you would want entity framework to work with views, stored procedures and plain old SQL statements. There is a wide minconception that developers raise, “Oh it is a stored procedure, that can’t be good”. There is nothing inherently wrong with using stored procedures. It is nice to have all business logic in one place. However, sometimes complex business needs might result in complex SQL queries, and you are better-off writing such queries with the help of someone who is familiar with SQL instead of doing it in EntityFramework. Which is probably why you have applications which has a few references to some well written stored procedures. ...

October 25, 2020 · 9 min · 1729 words · eakangk
EF Core

Entity Framework Core 3.1 - Part 3

In my previous post, we talked about data access and updates in entity framework. Updating Related Data A naive way to update related data, especially when the context isn’t tracking your object, as in, you send data about an existing entity in the database, from the UI, and EF has to figure out what part of the updated record has changed and needs an update in the database. If you ever encounter a situation where you are to update only one related object of a primary entity, then you might be in for a surprise. I am going to use an example that I followed to understand this from Julie Lerman’s Pluralsight course on EFCore 3. I have never had to do this personally in the round-about way that the example states. However, I am pretty sure I might end up with tricky situations as I spend more time with EF. ...

October 25, 2020 · 7 min · 1464 words · eakangk
EF Core

Entity Framework Core 3.1 - Part 2

In my previous post, we talked looked at an introduction into entity framework core 3. Read and Write Data As I mentioned in the earlier one, I don’t really like writing posts that take longer than 10 minutes to read. It is just too much information. So let us continue with the next part. To learn more about entity framework mappings always refer to this amazing course on Pluralsight titled: Entity Framework Core 2: Mappings, by Julie Lerman ...

October 25, 2020 · 9 min · 1825 words · eakangk
EF Core

Entity Framework Core 3.1 - Part 1

What is this about? This post is one of many in a series of posts on Entity Framework Core. I have attempted to summarise what I learned while working with Entity Framework Core, from stackoverflow answers, to entity framework official docs to courses on pluralsight. In this journey, I found, the pluralsight course, Entity Framework Core: Getting Started by @julielerman most useful. As someone who spent the past few years primarily on managing people, I missed out a lot on the tech side of things. So these days, I have been playing catchup. And guess what? There is a lot to catchup! But as with any learning, it isn’t a sprint, it is a marathon and a pretty long one. ...

October 25, 2020 · 9 min · 1836 words · eakangk