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

12 months ago
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[7132],{7618:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>o,default:()=>u,frontMatter:()=>i,metadata:()=>c,toc:()=>d});var s=r(5893),t=r(1151);const i={id:"dbcontext-view",title:"9.13 \u89c6\u56fe\u64cd\u4f5c",sidebar_label:"9.13 \u89c6\u56fe\u64cd\u4f5c"},o=void 0,c={id:"dbcontext-view",title:"9.13 \u89c6\u56fe\u64cd\u4f5c",description:"9.13.1 \u5173\u4e8e\u89c6\u56fe",source:"@site/docs/dbcontext-view.mdx",sourceDirName:".",slug:"/dbcontext-view",permalink:"/docs/dbcontext-view",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/dbcontext-view.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1682389320,formattedLastUpdatedAt:"Apr 25, 2023",frontMatter:{id:"dbcontext-view",title:"9.13 \u89c6\u56fe\u64cd\u4f5c",sidebar_label:"9.13 \u89c6\u56fe\u64cd\u4f5c"},sidebar:"docs",previous:{title:"9.12 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-hight-query"},next:{title:"9.14 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",permalink:"/docs/dbcontext-proc"}},a={},d=[{value:"9.13.1 \u5173\u4e8e\u89c6\u56fe",id:"9131-\u5173\u4e8e\u89c6\u56fe",level:2},{value:"9.13.2 \u89c6\u56fe\u7684\u4f7f\u7528",id:"9132-\u89c6\u56fe\u7684\u4f7f\u7528",level:2},{value:"9.13.2.1 \u521b\u5efa\u89c6\u56fe <code>SQL</code>",id:"91321-\u521b\u5efa\u89c6\u56fe-sql",level:3},{value:"9.13.2.2 \u89c6\u56fe\u6a21\u578b",id:"91322-\u89c6\u56fe\u6a21\u578b",level:3},{value:"9.13.3 \u89c6\u56fe\u4f7f\u7528",id:"9133-\u89c6\u56fe\u4f7f\u7528",level:2},{value:"9.13.4 \u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f \u2714",id:"9134-\u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f-",level:2},{value:"9.13.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9135-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function l(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,t.a)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"9131-\u5173\u4e8e\u89c6\u56fe",children:"9.13.1 \u5173\u4e8e\u89c6\u56fe"}),"\n",(0,s.jsx)(n.p,{children:"\u89c6\u56fe\u662f\u6570\u636e\u5e93\u4e2d\u975e\u5e38\u91cd\u8981\u7684\u5bf9\u8c61\uff0c\u662f\u4e00\u5f20\u865a\u62df\u8868\uff0c\u901a\u8fc7\u89c6\u56fe\u6211\u4eec\u53ef\u4ee5\u5bf9\u7ed3\u679c\u8fdb\u884c\u7b5b\u9009\u7f13\u5b58\uff0c\u540c\u65f6\u8fd8\u80fd\u5b9e\u73b0\u9897\u7c92\u5316\u6743\u9650\u63a7\u5236\uff0c\u5982\u63a7\u5236\u6307\u5b9a\u884c\uff0c\u6307\u5b9a\u5217\u3002"}),"\n",(0,s.jsx)(n.h2,{id:"9132-\u89c6\u56fe\u7684\u4f7f\u7528",children:"9.13.2 \u89c6\u56fe\u7684\u4f7f\u7528"}),"\n",(0,s.jsxs)(n.p,{children:["\u5728 ",(0,s.jsx)(n.code,{children:"Furion"})," \u4e2d\u5b9e\u73b0\u89c6\u56fe\u7684\u64cd\u4f5c\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u521b\u5efa\u89c6\u56fe\u6a21\u578b\uff0c\u5e76\u7ee7\u627f ",(0,s.jsx)(n.code,{children:"EntityNotKey"})," \u57fa\u7c7b\u5373\u53ef\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"]}),"\n",(0,s.jsxs)(n.h3,{id:"91321-\u521b\u5efa\u89c6\u56fe-sql",children:["9.13.2.1 \u521b\u5efa\u89c6\u56fe ",(0,s.jsx)(n.code,{children:"SQL"})]}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-sql",metastring:"showLineNumbers",children:"CREATE VIEW V_Person AS\r\nSELECT Id,Name,Age,Address FROM person\n"})}),"\n",(0,s.jsx)(n.h3,{id:"91322-\u89c6\u56fe\u6a21\u578b",children:"9.13.2.2 \u89c6\u56fe\u6a21\u578b"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers {5,10}",children:'using Furion.DatabaseAccessor;\r\n\r\nnamespace Furion.Core\r\n{\r\n public class V_Person : EntityNotKey\r\n {\r\n /// <summary>\r\n /// \u914d\u7f6e\u89c6\u56fe\u540d\r\n /// </summary>\r\n public V_Person() : base("V_Person")\r\n {\r\n }\r\n\r\n /// <summary>\r\n /// \u4e3b\u952eId\r\n /// </summary>\r\n public int Id { get; set; }\r\n\r\n /// <summary>\r\n /// \u59d3\u540d\r\n /// </summary>\r\n public string Name { get; set; }\r\n\r\n /// <s