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
9.8 KiB
JavaScript
1 line
9.8 KiB
JavaScript
1 year ago
|
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[3942],{4733:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>d,default:()=>u,frontMatter:()=>i,metadata:()=>o,toc:()=>c});var r=t(5893),s=t(1151);const i={id:"dbcontext-seed-data",title:"9.22 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",sidebar_label:"9.22 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e"},d=void 0,o={id:"dbcontext-seed-data",title:"9.22 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",description:"\u4e00\u65e6\u5b9a\u4e49\u4e86\u79cd\u5b50\u6570\u636e\u6216\u6539\u53d8\u4e86\u79cd\u5b50\u6570\u636e\uff0c\u9700\u8981\u91cd\u65b0\u6267\u884c Add-Migration \u548c Update-Database \u547d\u4ee4\u3002",source:"@site/docs/dbcontext-seed-data.mdx",sourceDirName:".",slug:"/dbcontext-seed-data",permalink:"/docs/dbcontext-seed-data",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/dbcontext-seed-data.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1682389320,formattedLastUpdatedAt:"Apr 25, 2023",frontMatter:{id:"dbcontext-seed-data",title:"9.22 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",sidebar_label:"9.22 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e"},sidebar:"docs",previous:{title:"9.21 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93 (Code First)",permalink:"/docs/dbcontext-code-first"},next:{title:"9.23 \u5ba1\u8ba1\u65e5\u5fd7 (Audit)",permalink:"/docs/dbcontext-audit"}},a={},c=[{value:"9.22.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",id:"9221-\u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",level:2},{value:"9.22.2 \u5982\u4f55\u914d\u7f6e",id:"9222-\u5982\u4f55\u914d\u7f6e",level:2},{value:"9.22.2.1 \u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528",id:"92221-\u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528",level:3},{value:"9.22.2.2 \u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528",id:"92222-\u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528",level:3},{value:"9.22.3 \u5bfc\u822a\u5c5e\u6027",id:"9223-\u5bfc\u822a\u5c5e\u6027",level:2},{value:"9.22.4 \u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e",id:"9224-\u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e",level:2},{value:"9.22.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9225-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",...(0,s.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\u79cd\u5b50\u6570\u636e\u6216\u6539\u53d8\u4e86\u79cd\u5b50\u6570\u636e\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:"9221-\u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",children:"9.22.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e"}),"\n",(0,r.jsxs)(n.p,{children:["\u5728 ",(0,r.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u4e2d\uff0c\u79cd\u5b50\u6570\u636e\u901a\u5e38\u6307\u7684\u662f\u901a\u8fc7\u7a0b\u5e8f\u4e3a\u6570\u636e\u5e93\u9884\u5148\u8bbe\u7f6e\u4e00\u4e9b\u521d\u59cb\u5316\u6570\u636e\uff0c\u6bd4\u5982\u6211\u4eec\u7684\u6570\u636e\u5b57\u5178\u8868\uff0c\u6211\u4eec\u53ef\u80fd\u5e0c\u671b\u5728\u7cfb\u7edf\u6784\u5efa\u521d\u671f\u5c31\u81ea\u52a8\u5c06\u4e00\u4e9b\u89c4\u8303\u5316\u6570\u636e\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u4e2d\u3002"]}),"\n",(0,r.jsx)(n.p,{children:"\u5982\u6027\u522b\uff1a\u7537/\u5973\uff0c\u5730\u533a\uff0c\u884c\u4e1a\u4fe1\u606f\u7b49\u7b49\u3002"}),"\n",(0,r.jsx)(n.h2,{id:"9222-\u5982\u4f55\u914d\u7f6e",children:"9.22.2 \u5982\u4f55\u914d\u7f6e"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"Furion"})," \u63d0\u4f9b\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684 ",(0,r.jsx)(n.code,{children:"IEntitySeedData<TEntity>"})," \u4f9d\u8d56\u63a5\u53e3\u53ef\u4ee5\u5feb\u901f\u7684\u6784\u5efa\u79cd\u5b50\u6570\u636e\uff0c\u652f\u6301\u4efb\u4f55\u65e0\u53c2\u6784\u9020\u51fd\u6570\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528\u
|