ASP.NET Core项目中的数据模型和架构在哪些文件中声明? [英] In what files are the Data Model and Schema declared in ASP.NET Core projects?

查看:63
本文介绍了ASP.NET Core项目中的数据模型和架构在哪些文件中声明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照 answer 进行操作,我知道如果ASP.NET Core项目具有数据库,则它必须具有数据模型和数据库架构。

Going by this answer, I know that an ASP.NET Core project must have a data model and a database schema, if it has a database.

几个月来,我认为数据模型驻留在从DbContext继承的Context类中。但是我碰到了一个教程,说该类是Schema所在的地方。

For months, I thought the data model resided in a Context class that inherited from DbContext. But I've come cross a tutorial that says this class is where the Schema lives.

ASP.NET Core项目的数据模型和模式在哪里声明?

Where does the Data Model and Schema get declared for ASP.NET Core projects?

推荐答案

它使用EF Core(O / RM)。它使用元数据映射来基于域模型

It uses EF Core (an O/RM). It uses metadata mapping to define that database schema based on the domain model.

这篇关于ASP.NET Core项目中的数据模型和架构在哪些文件中声明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆