Entity Framework Core 1.0

Sign in to queue

Description

Entity Framework (EF) is a popular data access technology for .NET applications. Entity Framework Core is a lightweight and extensible version of EF that brings new features, new platforms, and improved performance. In this new version EF can be used in ASP.NET Core, Universal Windows Platform (UWP), OSX, Linux, and traditional desktop applications.
For more information, check out these courses on Microsoft Virtual Academy:

Day:

3

Session Type:

Breakout

Code:

B852

Room:

Marriott Salon 8

Embed

Download

Download this episode

Download captions

For more information, check out these courses on Microsoft Virtual Academy:

The Discussion

  • User profile image
    AnilApex

    Please add support for Xamarin Forms.

  • User profile image
    Southern​Software​Wizard

    Really excited to learn about the future of Entity Framework. Will EF Core 1 get released after this talk or is there still some time to wait for it to be ready for public use?

  • User profile image
    romiller

    @AnilApex: We will be supporting Xamarin.Forms, we just need to wait for all the changes in NuGet package layout to stabilize and for Xamarin tooling to move to a build of NuGet that supports them. This should all fall into place over the coming months.

  • User profile image
    romiller

    @SouthernSoftwareWizard: There is still some time needed before we ship the RTM of v1.0.0. We share the same schedule as ASP.NET Core, which you can find here https://github.com/aspnet/Home/wiki/Roadmap#schedule.

  • User profile image
    romiller

    Here are the links from the session:

  • User profile image
    Southern​Software​Wizard

     Thanks for the information. Looking forward to seeing the talk when it is posted in the next couple of days.

  • User profile image
    revocengiz

    Awesome talk. Thank you.

  • User profile image
    shaggygi

    @romiller As usual, good job on presenting. You mentioned SqlClient is planned for UWP (in the later part of video). Will this support be after v1?

  • User profile image
    Carsten Petersen

    Great talk Rowan!

  • User profile image
    Satyajit

    Awesome @romiller. Eagerly waiting for the release of EF Core with complete set of features including all the variation of inheritance. Thanks and kudos to the team.

  • User profile image
    churchillsd​ude01

    Rowan, I attended your Friday morning build session on EF Core 1.0. You did not have time to go over much with regard to eager loading now that lazy loading is not included in EF Core 1.0. I have a specific issue that I am trying to work through where I have a relationship of products sold in various regions around the world. Typically I would have something like this in my context setup to do the mapping in EF 6:

    HasMany(t => t.Products)
    .WithMany(t => t.Zones)
    .Map(m =>
    {
    m.ToTable("ProductZone");
    m.MapLeftKey("ProductID");
    m.MapRightKey("ZoneID");
    });

    Note that the ProductZone table is just a simple cross reference table with foreign keys. How do I need to do this in EF Core 1.0 if I read a records from the ProductZone table to insure that the related info such as product name and zone description is available to show in my view ?

    Example  

    var productZones = _productZoneQueryRepository.GetAll() ...?????

     

     

  • User profile image
    copernicus

    Throughout the demos the performance percentages were wrongly calculated. It was radically BETTER than Rowan reported! So for instance, at the 22:00 mark ff, 

    EF6:       941 ms
    EFCore: 174ms

    Rowan reported that as "Improvement: 82%"

    Rather, improvement was 941/174 = 5.4 times faster!

    82% faster would have been: 174 + (174*.82)  = 316ms (EF6 would have been at 316ms, it's rather at 941)

  • User profile image
    Kevin

    How can I the new Entity Framework to call a single stored procedure that returns multiple resultsets e.g(Select * from table1,Select * from table2,Select * from table3) . Is this supported?

  • User profile image
    Kevin

    How can I use the new Entity Framework to call a single stored procedure that returns multiple resultsets e.g(Select * from table1,Select * from table2,Select * from table3) . Is this supported?

  • User profile image
    Dave

    Awesome talk and great session. Thanks.

  • User profile image
    jolleekin

    @copernicus (941 - 174) / 941 = 82%

  • User profile image
    churchillsd​ude01

    Rowan, Just wanted to let you know that we have figured out how to eager load what we need using EF Core and setting up the proper overrides on our Get functions to pull in the related data. I just did not want you to spend any time replying to the question I posed a couple of days ago regarding lazy loading. Thanks again for the great talk at Build!

  • User profile image
    Arad

    Such a great talk. Thanks Rowan.

  • User profile image
    stingraydev

    Hi.  Nice stuff!  When I open the EFCore101 project, and I ask the package manager to restore dependencies,  it seems as though it cannot pull the rc2 bits.  I get a lot of messages such as "Unable to find version 1.0.0-rc2-20270' of package Microsoft.AspNetCore.Hosting.Abstrations, etc.

    Are there instructions somewhere that I can use to manually get all the bits required to run the demo projects?

    Thank you,

  • User profile image
    romiller

    ...You mentioned SqlClient is planned for UWP (in the later part of video). Will this support be after v1?

    There aren't specific plans/timelines on this as yet. There is general consensus between our teams (EF, SQL Client, and UWP) that it will be a good thing to enable, but we need to focus on what we are already delivering first.

  • User profile image
    romiller

    , churchillsd​ude01 wrote

    ...I have a specific issue that I am trying to work through where I have a relationship of products sold in various regions around the world. Typically I would have something like this in my context setup to do the mapping in EF 6...

    Many-to-many relationships are currently modelled with a join entity - though we do plan to support it without an entity in the future (https://github.com/aspnet/EntityFramework/issues/1368). Here is some more info on how to map at the moment http://docs.efproject.net/en/latest/modeling/relationships.html#many-to-many.

     

  • User profile image
    romiller

    How can I the new Entity Framework to call a single stored procedure that returns multiple resultsets e.g(Select * from table1,Select * from table2,Select * from table3) . Is this supported?

    This is not currently supported in EF Core (and there is no good workaround for it either). Proper stored procedure support is one of our top priorities post-v1.0.0 and will be one of the most compelling reasons for some folks to stick with EF6.x for a while.

  • User profile image
    romiller

    , stingraydev wrote

    Hi.  Nice stuff!  When I open the EFCore101 project, and I ask the package manager to restore dependencies,  it seems as though it cannot pull the rc2 bits.  I get a lot of messages such as "Unable to find version 1.0.0-rc2-20270' of package Microsoft.AspNetCore.Hosting.Abstrations, etc.

    Are there instructions somewhere that I can use to manually get all the bits required to run the demo projects?

     

    Unfortunately those packages got archived off our nightly build feed (https://www.myget.org/F/aspnetvnext/). You should be able to upgrade to the latest build from that feed. I will do this to the projects on GitHub and also try to come up with a better solution to this issue - as it will happen again. Though obviously once RC2 is released I can just pin to that.

  • User profile image
    romiller

    , copernicus wrote

    Throughout the demos the performance percentages were wrongly calculated. It was radically BETTER than Rowan reported! So for instance, at the 22:00 mark ff, 

    EF6:       941 ms
    EFCore: 174ms

    Rowan reported that as "Improvement: 82%"

    Rather, improvement was 941/174 = 5.4 times faster!

    82% faster would have been: 174 + (174*.82)  = 316ms (EF6 would have been at 316ms, it's rather at 941)

    I guess there could be more than one way to think of the "percentage improvement". I was thinking of the improvement as a percentage of the EF6 value - as jolleekin mentioned (941 - 174) / 941 = 82%. I think "x times faster" is also a good way to think about the speed up.

  • User profile image
    MikeDowd

    Excellent talk! Thanks!

  • User profile image
    Belt aftan

    entity framework everywhere? It is a Joke, It does not exit in Orchard CMS, Even it is Microsoft's product.

  • User profile image
    Stilgar

    I don't understand why people always focus on generating the database or generating the model with EF. There is certainly one more way to use EF and in my experience it is the most robust one and results in least amount of headaches - create your database and write your model by fact.

  • User profile image
    Ahmed

    Hi romiller, Great Talk
    I want to ask a bout Migrations from EF 6 TO EF Core. Is easy to migrate or not. and when EF Core will be ready for Prduction

  • User profile image
    Brian Swiger

    Thank you for a great presentation and for going above and beyond in providing not only the source code of the demo, yet the slides and all the extras to allow us to present to others. Well done!

  • User profile image
    Jeremy Wesley

    So what is the realistic release date for EFcore1 that will work with Xamarin.

    Its been seeming like all this magic is about to come togeather for almost 2 years now...
    I've post ponded my projects for as long as I can, but now I have to start moving forward...


    Realistic Delivery Date?

  • User profile image
    Aluan

    "You can think of Service Collection as a really bad name for Service Provider Builder"

     

    That was priceless:)

Add Your 2 Cents