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
14 KiB
JavaScript

1 year ago
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[8854],{3616:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>s,default:()=>a,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var o=t(5893),r=t(1151);const i={id:"dbcontext-locator",title:"9.3 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",sidebar_label:"9.3 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},s=void 0,c={id:"dbcontext-locator",title:"9.3 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",description:"\u53ea\u8981\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c\u7ed1\u5b9a\u4e86\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u90a3\u4e48\u6240\u6709\u7684\u4ed3\u50a8\u3001\u5b9e\u4f53\u3001\u79cd\u5b50\u3001\u914d\u7f6e\u3001\u89c6\u56fe\u3001\u51fd\u6570\u7b49\u6570\u636e\u5e93\u76f8\u5173\u7684\u7c7b\u3001\u63a5\u53e3\u3001\u65b9\u6cd5\u90fd\u9700\u8981\u6307\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u9664\u5916\u3002",source:"@site/docs/dbcontext-locator.mdx",sourceDirName:".",slug:"/dbcontext-locator",permalink:"/docs/dbcontext-locator",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/dbcontext-locator.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1682389320,formattedLastUpdatedAt:"Apr 25, 2023",frontMatter:{id:"dbcontext-locator",title:"9.3 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",sidebar_label:"9.3 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},sidebar:"docs",previous:{title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",permalink:"/docs/dbcontext"},next:{title:"9.4 \u6570\u636e\u5e93\u5b9e\u4f53",permalink:"/docs/entity"}},l={},d=[{value:"9.3.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"931-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",level:2},{value:"9.3.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528",id:"932-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528",level:2},{value:"9.3.3 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"933-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",level:2},{value:"9.3.4 \u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"934-\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",level:2},{value:"9.3.5 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61",id:"935-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61",level:2},{value:"9.3.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"936-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function x(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,r.a)(),...e.components};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.admonition,{title:"\u5c0f\u63d0\u9192",type:"important",children:[(0,o.jsxs)(n.p,{children:["\u53ea\u8981\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c\u7ed1\u5b9a\u4e86\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u90a3\u4e48\u6240\u6709\u7684",(0,o.jsx)(n.strong,{children:"\u4ed3\u50a8\u3001\u5b9e\u4f53\u3001\u79cd\u5b50\u3001\u914d\u7f6e\u3001\u89c6\u56fe\u3001\u51fd\u6570"}),"\u7b49\u6570\u636e\u5e93\u76f8\u5173\u7684",(0,o.jsx)(n.strong,{children:"\u7c7b\u3001\u63a5\u53e3\u3001\u65b9\u6cd5"}),"\u90fd\u9700\u8981\u6307\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u9664\u5916\u3002"]}),(0,o.jsxs)(n.p,{children:["\u5982\u679c\u6539\u53d8\u4e86\u548c\u6570\u636e\u5e93\u5b9e\u4f53\u76f8\u5173\u7684\u6240\u6709\u914d\u7f6e\u63a5\u53e3\u7684\u5b9a\u4f4d\u5668\uff0c\u8fd8\u9700\u6267\u884c ",(0,o.jsx)(n.code,{children:"Add-Migration"})," \u548c ",(0,o.jsx)(n.code,{children:"Update-Database"})," \u547d\u4ee4\u3002"]})]}),"\n",(0,o.jsx)(n.h2,{id:"931-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",children:"9.3.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a