none
EF Core for desktop applications on windows :) RRS feed

  • Question

  • hi,

    i am developping a windows desktop using WPF and EF 6.13 with VS 2017

    in my solution i have a class library project wich is my DAL and that use EF dbfirst  EDMX to access my data .

    now the new EFCore is really tempting to me for various reasons ...

    is it possible to replace my DAL project with a new one that use EFCore ? it's ok for me to use code first ...

    also please note that i develop exclusively on windows for this project .

    any idea on what i can do is welcome , thanks

    Wednesday, August 16, 2017 3:17 AM

All replies

  • Hi issam1975,

    >>is it possible to replace my DAL project with a new one that use EFCore ? it's ok for me to use code first ...

    Yes, it is, but EF Core is a new code base and not as mature as EF6.

    >>any idea on what i can do is welcome , thanks

    This is a list of features not currently implemented in EF Core that are likely to impact your ability to use it in a given application. This is by no means an exhaustive list of possible O/RM features, but the features that we feel have the highest impact on developers.+

    • Creating a Model

      • Complex/value types are types that do not have a primary key and are used to represent a set of properties on an entity type.
      • Visualizing a model to see a graphical representation of the code-based model.
      • Simple type conversions such as string => xml.
      • Spatial data types such as SQL Server's geography & geometry.
      • Many-to-many relationships without join entity. You can already model a many-to-many relationship with a join entity, see Relationships for details.
      • Alternate inheritance mapping patterns for relational databases, such as table per type (TPT) and table per concrete type (TPC). Table per hierarchy (TPH) is already supported.
    • Querying Data

      • Improved translation to enable more queries to successfully execute, with more logic being evaluated in the database (rather than in-memory).
      • GroupBy translation in particular will move translation of the LINQ GroupBy operator to the database, rather than in-memory.
      • Lazy loading enables navigation properties to be automatically populated from the database when they are accessed.
      • Raw SQL queries for non-model types allows a raw SQL query to be used to populate types that are not part of the model (typically for denormalized view-model data).
    • Saving Data

      • Simple command interception provides an easy way to read/write commands before/after they are sent to the database.
      • Stored procedure mapping allows EF to use stored procedures to persist changes to the database (FromSql already provides good support for using a stored procedure to query, see Raw SQL Queries for details).
    • Database Schema Management

      • Visual Studio wizard for reverse engineer that allows you to visually configure connection, select tables, etc. when creating a model from an existing database.
      • Update model from database allows a model that was previously reverse engineered from the database to be refreshed with changes made to the schema.
      • Seed data allows a set of data to be easily upserted to the database.

    For more information, please refer to:

    https://docs.microsoft.com/en-us/ef/efcore-and-ef6/features

    You could also refer to the following document to get started.

    https://docs.microsoft.com/en-us/ef/core/get-started/

    Best regards,

    Cole


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, August 16, 2017 5:54 AM
    Moderator
  • hi Cole, and thanks for the good news  :)

    so pratically what i have to do now ? i am a little confused ...

    - download and install .net Core 2.0 ?

    - create a new class library that target it instead of the full .Net 4.6 ?

    - add EFcore to the DAL project from nuget ?

    - i assume that the WPF project need that EFCore assemblies too ...

    - can my WPF full .net project add a .net core reference (DAL project) ?

    - i assume that we cannot use efcore with the full .net project (tried it but got an error when downloading with nuget )

    - what about deployement for assemblies ?

    ps : i have VS 2017 (version 15.2 )

    sorry for the scattered questions but i told you , i am a little confused :p

    thanks again

    Wednesday, August 16, 2017 5:59 PM
  • Hi issam1975,

    >>- download and install .net Core 2.0 ?

    If you use WPF, I don't recommend you use .net core 2.0, because NET Framework projects cannot reference .NET Core libraries. Only higher .NET Standard versions.

    >>- can my WPF full .net project add a .net core reference (DAL project) ?

    It seems that .NET Framework projects cannot reference .NET Core libraries.

    >>- what about deployement for assemblies ?

    If you want to use entity framework core, I would suggest that you could use ef core 1.1, which support .net framework 4.5.1 and later version.

    Best regards,

    Cole


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, August 21, 2017 1:44 AM
    Moderator