Entity Framework Core: Cross Platform ORM for .NET Core

[vc_row full_width=”stretch_row” equal_height=”yes” bg_type=”bg_color” bg_override=”ex-full” bg_color_value=”#f3f6f9″ css=”.vc_custom_1588427211229{padding-top: 20px !important;padding-bottom: 20px !important;}”][vc_column][vc_row_inner][vc_column_inner width=”2/3″][ultimate_spacer height=”48″ height_on_tabs=”24″ height_on_tabs_portrait=”32″ height_on_mob_landscape=”8″ height_on_mob=”16″][vc_column_text]We are just now getting into connecting to the database. This is a good time to talk about Entity Framework (EF) core.

Entity Framework maps the objects of the source code to the tables of the relational database. The tedious way of connecting to DB was easily automated by EF that kept the database in sync with source code. The improved revisions of EF were comparable with open-source ORM that were cross-platform.

EF core, the new version is built as open-source, cross-platform applications for .NET applications. EF Core is a light-weight, extensible, open-source consisting of multiple packages that can be installed using NuGet manager. The latest major version of EF Core is v3.0 and soon we will have next release EF Core v5.0.  

The major release of EF Core v3.0 has boosting features as cross-platform ORM. 

1) Shadow Properties: There are situations where the data is not displayed in the application but are used for auditing purposes  Eg: LastUpdatedDate, LastVisited, blog id. These types of properties are called Shadow Properties or Navigation, Auditing, or Tracking properties. These are helpful to create the domain models. 

2) Client-side primary key generation:  Primary keys are essential to track the data from various sources. While we submit details to the database, the primary key is generated by databases. Sometimes the client creates a temporary id before submitting the details to the database. This key can be replaced by DB once it creates a new ID. 

3) LINQ to Entities:  Language Integrated Queries (LINQ) queries are part of .NET framework. They provide a standard way of querying with readable syntax. Introduced in EF Core they fill the gap between relational and object-oriented approaches. They include IntelliSense and debugging support and further support the LINQ query expressions.

4) Change Tracker: Accesses change tracking information for entity instances the context is tracking. In short, if any entity is changed the change is persisted to the database and is saved during SaveChanges().  EF core also fixes the navigation properties between entities, that is needed for tracking query. 

5) Lazy Loading: EF core can load the data and eliminates writing an additional query. This is a pattern where loading is different until its needed and in some cases, it helps in improving the performance. 

6) Data Seeding: Seeding is the process of populating the database with an initial set of data. The data seeding is required during the migration process. There are 3 ways 

1) Model seed data

2) Manual Migration customization

3) Custom initialization logic.

Features like Asynchronous saving, multiple Saves in single transactions, cascade delete that are quite useful for cross-platform applications. 

EF Core connects with databases like SQL database, MySQL, PostgreSQL, Azure cosmos DB, SQLite. 

By the end of 2020, we’ll have the .NET 5 that is the next version of .NET Core, along the same line we’ll be having EF Core 5 with advanced features like database collation, migration improvements. Having these frameworks will increase the efficiency and efficacy of .NET apps in a cross-platform environment.

TakeAway:

Entity Framework Core is paired with .NET Core apps. It being a cross-platform ORM, the open-source and light-weight are surely an advantage.


.NET 5 which is scheduled for the release at the end of this year will now bring all the .NET Core features as one platform and will be a big plus for .NET Apps.
[/vc_column_text][vc_column_text]

At BundleN, we experiment with stack combinations on our own time.
For potential clients interested in this stack, we can always give a demo of what we have up until that point of time. You can reach us at sales@BundleN.com

For more details on this stack, click here

[/vc_column_text][/vc_column_inner][vc_column_inner width=”1/3″][vc_single_image image=”607″][/vc_column_inner][/vc_row_inner][/vc_column][/vc_row][vc_row equal_height=”yes” bg_type=”image” parallax_style=”vcpb-default” bg_image_new=”id^73|url^https://dev.techreshape.com/marines/feb/atlas/wp-content/uploads/2020/01/contact-us124.png|caption^null|alt^null|title^contact-us124|description^null” bg_image_repeat=”no-repeat” bg_override=”ex-full” enable_overlay=”enable_overlay_value” overlay_color=”rgba(255,255,255,0.73)” css=”.vc_custom_1582001396087{padding-top: 35px !important;padding-bottom: 35px !important;}”][vc_column width=”5/12″][ultimate_heading main_heading=”Get In Touch” alignment=”left” main_heading_margin=”margin-bottom:20px;” main_heading_font_family=”font_family:Raleway|font_call:Raleway|variant:600″ main_heading_style=”font-weight:600;” main_heading_font_size=”desktop:40px;” main_heading_line_height=”desktop:50px;”][/ultimate_heading][bsf-info-box icon_type=”custom” icon_img=”id^51|url^https://bundlen.com/wp-content/uploads/2020/02/phone1.png|caption^null|alt^null|title^phone1|description^null” img_width=”55″ hover_effect=”style_2″ pos=”left”](615) 619-3000[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^49|url^https://bundlen.com/wp-content/uploads/2020/02/email1.png|caption^null|alt^null|title^email1|description^null” img_width=”55″ hover_effect=”style_2″ pos=”left”]sales@BundleN.com

[/bsf-info-box][bsf-info-box icon_type=”custom” icon_img=”id^27|url^https://bundlen.com/wp-content/uploads/2020/02/time-1.png|caption^null|alt^null|title^time (1)|description^null” img_width=”55″ hover_effect=”style_2″ pos=”left”]Monday to Friday 7:00 am – 5:00 pm CST[/bsf-info-box][/vc_column][vc_column width=”7/12″][ultimate_heading main_heading=”Send Message” alignment=”left” main_heading_margin=”margin-bottom:20px;” main_heading_font_family=”font_family:Raleway|font_call:Raleway|variant:600″ main_heading_style=”font-weight:600;” main_heading_font_size=”desktop:40px;” main_heading_line_height=”desktop:50px;”][/ultimate_heading][contact-form-7 id=”117″][/vc_column][/vc_row]