Persistance datalayer in EF core ,dynamic EF. Separate EF from models

后端 未结 1 1600
星月不相逢
星月不相逢 2021-01-07 14:40

I want to separate EF layer from my model .

I need a EF Builder to send my model to it like this(I found this code for mongodb but i need for EF core) :



        
相关标签:
1条回答
  • 2021-01-07 15:45

    First of all, I believe there is a little confusion :

    • MongoDB is a database
    • Entity Core is an ORM. It allows you to access to data in a storage

    That said, you can use EF Core with several data storages, such as MongoDB or SQL Server for instance.

    To want a separated layer between your entities (Data Access Layer) and your business model is a good practice, and should be encouraged.

    Because the topic is wide, and because lot of documentations and tutorials exists and the subject, I prefer to give you some links rather than to give you a complete architecture.

    You can check this documentation from Microsoft to see the related layers, and what they should contains.

    Also, I advise you to consult this github repo, which provide tons of clean architectures based on .net core.

    Feel free to dig a bit into those links, they are providing a lot of precious informations.

    Hope it helps.

    0 讨论(0)
提交回复
热议问题