You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
27 KiB
JavaScript

1 year ago
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[4474],{6421:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>c,default:()=>x,frontMatter:()=>s,metadata:()=>i,toc:()=>l});var r=t(5893),o=t(1151);const s={id:"entity",title:"9.4 \u6570\u636e\u5e93\u5b9e\u4f53",sidebar_label:"9.4 \u6570\u636e\u5e93\u5b9e\u4f53"},c=void 0,i={id:"entity",title:"9.4 \u6570\u636e\u5e93\u5b9e\u4f53",description:"\u4e00\u65e6\u5b9a\u4e49\u4e86\u5b9e\u4f53\u6216\u6539\u53d8\u4e86\u5b9e\u4f53\u7ed3\u6784\u6216\u5b9e\u4f53\u914d\u7f6e\uff0c\u9700\u8981\u91cd\u65b0\u6267\u884c Add-Migration \u548c Update-Database \u547d\u4ee4\u3002",source:"@site/docs/entity.mdx",sourceDirName:".",slug:"/entity",permalink:"/docs/entity",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/entity.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1682389320,formattedLastUpdatedAt:"Apr 25, 2023",frontMatter:{id:"entity",title:"9.4 \u6570\u636e\u5e93\u5b9e\u4f53",sidebar_label:"9.4 \u6570\u636e\u5e93\u5b9e\u4f53"},sidebar:"docs",previous:{title:"9.3 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",permalink:"/docs/dbcontext-locator"},next:{title:"9.5 \u4ed3\u50a8\u6a21\u5f0f (Repository)",permalink:"/docs/dbcontext-repository"}},a={},l=[{value:"9.4.1 \u6570\u636e\u5e93\u5b9e\u4f53",id:"941-\u6570\u636e\u5e93\u5b9e\u4f53",level:2},{value:"9.4.2 \u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53",id:"942-\u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53",level:2},{value:"9.4.2.1 \u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219",id:"9421-\u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219",level:3},{value:"9.4.2.2 <code>IEntity</code> \u793a\u8303\uff1a",id:"9422-ientity-\u793a\u8303",level:3},{value:"9.4.2.3 <code>EntityBase</code> \u793a\u8303\uff1a",id:"9423-entitybase-\u793a\u8303",level:3},{value:"9.4.2.4 <code>Entity</code> \u793a\u8303\uff1a",id:"9424-entity-\u793a\u8303",level:3},{value:"9.4.2.5 <code>EntityNotKey</code> \u793a\u8303\uff1a",id:"9425-entitynotkey-\u793a\u8303",level:3},{value:"9.4.3 \u81ea\u5b9a\u4e49\u516c\u5171\u5b9e\u4f53",id:"943-\u81ea\u5b9a\u4e49\u516c\u5171\u5b9e\u4f53",level:2},{value:"9.4.4 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e",id:"944-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e",level:2},{value:"9.4.4.1 \u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e",id:"9441-\u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e",level:3},{value:"9.4.4.2 \u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e",id:"9442-\u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e",level:3},{value:"9.4.5 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e",id:"945-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e",level:2},{value:"9.4.6 \u914d\u7f6e\u5217\u540d\u53ca\u5217\u7c7b\u578b",id:"946-\u914d\u7f6e\u5217\u540d\u53ca\u5217\u7c7b\u578b",level:2},{value:"9.4.7 \u914d\u7f6e\u6570\u636e\u5e93\u8868\u540d\u548c <code>Schema</code>",id:"947-\u914d\u7f6e\u6570\u636e\u5e93\u8868\u540d\u548c-schema",level:2},{value:"9.4.8 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"948-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function d(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.admonition,{title:"\u7279\u522b\u63d0\u9192",type:"important",children:(0,r.jsxs)(n.p,{children:["\u4e00\u65e6\u5b9a\u4e49\u4e86\u5b9e\u4f53\u6216\u6539\u53d8\u4e86\u5b9e\u4f53\u7ed3\u6784\u6216\u5b9e\u4f53\u914d\u7f6e\uff0c\u9700\u8981\u91cd\u65b0\u6267\u884c ",(0,r.jsx)(n.code,{children:"Add-Migration"})," \u548c ",(0,r.jsx)(n.code,{children:"Update-Database"})," \u547d\u4ee4\u3002"]})}),"\n",(0,r.jsx)(n.h2,{id:"941-\u6570\u636e\u5e93\u5b9e\u4f53",children:"9.4.1 \u6570\u636e\u5e93\u5b9e\u4f53"}),"\n",(0,r.jsxs)(n.p,{children:["\u5728\u9762\u5411\u5bf9\u8c61\u5f00\u53d1\u601d\u60f3\u4e2d\uff0c\u6700\u91cd\u8981\u5c24\u4e3a",(0,r.jsx)(n.strong,{children:"\u5bf9\u8c61"}),"\u4e8c\u5b57\uff0c\u5728 .NET \u5f00\u53d1\u8fc7\u53bb\uff0c\u64cd\u4f5c\u6570\u636e\u5e93\u5f80\u5f80\u91c7\