当前位置: 首页 > 编程语言 > C#

如何将类映射到数据库表?分享

时间:2023-04-11 11:29:19 C#

如何将类映射到数据库表?我有课,需要按照第1类制作数据表publicclassEventType{publicStringId{get;私有集;}publicint严重程度{get;放;}publicEventTypeTemplate模板{get;放;}publicIDictionaryParams{get;放;}publicEventType(stringid){Id=id;参数=新字典();}}和第二类publicclassEventTypeTemplate{publicStringId{get;私有集;}publicint严重程度{get;放;}publicString}publicStringDescription{get;放;}公共IList类别{得到;私有集;}公共IList查询{得到;私有集;}publicEventTypeTemplate(stringid){Id=id;Categories=newList();查询=新列表();对于第1类(EventType),我将表创建为表名EventTypeColumntypeIdstringSeverityint我不知道如何将这些属性输入表列名并键入publicEventTypeTemplateTemplate{get;放;}publicIDictionaryParams{get;放;对于第二类,我创建了表名EventTypeTemplateColumnTypeIdstringSeverityintTitlestringDescriptionstring但我不知道如何设置follow属性输入表列名称和类型publicIListCategories{get;私有集;}公共IList查询{得到;私有集;任何帮助将不胜感激对于模板,在EventType表中,将外键添加到EventTypeTemplate(EventTypeTemplateId):三列:Params------ColumnTypeEventTypeIdstringKeystringValuestringForCategoriescreateatablenamedCategories表:Categories----------EventTypeTemplateIdstringCategoryNamestringCreateatablenamedQueriesforQueries:以上是C#学习教程:如何将类映射到数据库表?分享的所有内容,如果对你有用,需要了解更多C#学习教程,希望大家多多关注—Queries----------EventTypeTemplateIdstringQuerystring本文采集自互联网,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处: