diff --git a/docs/0111aaca.71d9cedd.js b/docs/0111aaca.329206e3.js similarity index 94% rename from docs/0111aaca.71d9cedd.js rename to docs/0111aaca.329206e3.js index 1cec72a2458..a3c521f0a33 100644 --- a/docs/0111aaca.71d9cedd.js +++ b/docs/0111aaca.329206e3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=a.a.createContext({}),p=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=p(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=p(n),d=r,m=s["".concat(i,".").concat(d)]||s[d]||b[d]||c;return n?a.a.createElement(m,o(o({ref:t},l),{},{components:n})):a.a.createElement(m,o({ref:t},l))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=d;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},73:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(3),a=n(7),c=(n(0),n(192)),i=n(193),o={id:"virtual-deploy",title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",sidebar_label:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72"},u={unversionedId:"virtual-deploy",id:"virtual-deploy",isDocsHomePage:!1,title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",description:"27.4.1 \u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55",source:"@site/docs\\virtual-deploy.mdx",slug:"/virtual-deploy",permalink:"/docs/virtual-deploy",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/virtual-deploy.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",sidebar:"docs",previous:{title:"27.3 \u5728 Nginx \u90e8\u7f72",permalink:"/docs/deploy-nginx"},next:{title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",permalink:"/docs/devops"}},l=[{value:"27.4.1 \u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55",id:"2741-\u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55",children:[{value:"27.4.1.2 \u914d\u7f6e Startup.cs",id:"27412-\u914d\u7f6e-startupcs",children:[]},{value:"27.4.1.3 \u542f\u7528 Swagger \u865a\u62df\u76ee\u5f55\u652f\u6301",id:"27413-\u542f\u7528-swagger-\u865a\u62df\u76ee\u5f55\u652f\u6301",children:[]}]},{value:"27.4.2 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2742-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function s(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"2741-\u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55"},"27.4.1 \u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u7684\u7ad9\u70b9\u90fd\u662f\u90e8\u7f72\u5728\u7f51\u7ad9\u7684\u6839\u76ee\u5f55\u4e0b\u7684\uff0c\u4f46\u662f\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u5c06\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u7684\u76ee\u5f55\u4f5c\u4e3a\u4e8c\u7ea7\u7ad9\u70b9\u6216\u5b50\u7ad9\u70b9\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u5c31\u4f1a\u51fa\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"404")," \u9519\u8bef\u4e86\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u7279\u6b8a\u914d\u7f6e\u4e86\u3002"),Object(c.b)("h3",{id:"27412-\u914d\u7f6e-startupcs"},"27.4.1.2 \u914d\u7f6e ",Object(c.b)("inlineCode",{parentName:"h3"},"Startup.cs")),Object(c.b)("p",null,"\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6e ",Object(c.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Configure"),"\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),'public void Configure(IApplicationBuilder application, IWebHostEnvironment env)\n{\n application.Map("/\u4e8c\u7ea7\u76ee\u5f55", app=>\n {\n // \u5176\u4ed6\u4e2d\u95f4\u4ef6\u4ee3\u7801\u5168\u90e8\u5728\u8fd9\u91cc\u9762\u5199\n });\n}\n')),Object(c.b)("h3",{id:"27413-\u542f\u7528-swagger-\u865a\u62df\u76ee\u5f55\u652f\u6301"},"27.4.1.3 \u542f\u7528 ",Object(c.b)("inlineCode",{parentName:"h3"},"Swagger")," \u865a\u62df\u76ee\u5f55\u652f\u6301"),Object(c.b)("p",null,"\u7b2c\u4e8c\u6b65\uff0c\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u6587\u4ef6\uff08\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\u4e5f\u53ef\u4ee5\uff09\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json",metastring:"{2-3}","{2-3}":!0}),'{\n "SpecificationDocumentSettings": {\n "VirtualPath": "/\u4e8c\u7ea7\u76ee\u5f55"\n }\n}\n')),Object(c.b)("h2",{id:"2742-\u53cd\u9988\u4e0e\u5efa\u8bae"},"27.4.2 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=a.a.createContext({}),p=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=p(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=p(n),d=r,m=s["".concat(i,".").concat(d)]||s[d]||b[d]||c;return n?a.a.createElement(m,o(o({ref:t},l),{},{components:n})):a.a.createElement(m,o({ref:t},l))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=d;var o={};for(var u in t)hasOwnProperty.call(t,u)&&(o[u]=t[u]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},73:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(3),a=n(7),c=(n(0),n(196)),i=n(197),o={id:"virtual-deploy",title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",sidebar_label:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72"},u={unversionedId:"virtual-deploy",id:"virtual-deploy",isDocsHomePage:!1,title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",description:"27.4.1 \u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55",source:"@site/docs\\virtual-deploy.mdx",slug:"/virtual-deploy",permalink:"/docs/virtual-deploy",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/virtual-deploy.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",sidebar:"docs",previous:{title:"27.3 \u5728 Nginx \u90e8\u7f72",permalink:"/docs/deploy-nginx"},next:{title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",permalink:"/docs/devops"}},l=[{value:"27.4.1 \u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55",id:"2741-\u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55",children:[{value:"27.4.1.2 \u914d\u7f6e Startup.cs",id:"27412-\u914d\u7f6e-startupcs",children:[]},{value:"27.4.1.3 \u542f\u7528 Swagger \u865a\u62df\u76ee\u5f55\u652f\u6301",id:"27413-\u542f\u7528-swagger-\u865a\u62df\u76ee\u5f55\u652f\u6301",children:[]}]},{value:"27.4.2 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2742-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function s(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"2741-\u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55"},"27.4.1 \u5173\u4e8e\u4e8c\u7ea7\u865a\u62df\u76ee\u5f55"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u7684\u7ad9\u70b9\u90fd\u662f\u90e8\u7f72\u5728\u7f51\u7ad9\u7684\u6839\u76ee\u5f55\u4e0b\u7684\uff0c\u4f46\u662f\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u80fd\u5c06\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u7684\u76ee\u5f55\u4f5c\u4e3a\u4e8c\u7ea7\u7ad9\u70b9\u6216\u5b50\u7ad9\u70b9\uff0c\u8fd9\u4e2a\u65f6\u5019\uff0c\u5c31\u4f1a\u51fa\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"404")," \u9519\u8bef\u4e86\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u7279\u6b8a\u914d\u7f6e\u4e86\u3002"),Object(c.b)("h3",{id:"27412-\u914d\u7f6e-startupcs"},"27.4.1.2 \u914d\u7f6e ",Object(c.b)("inlineCode",{parentName:"h3"},"Startup.cs")),Object(c.b)("p",null,"\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u914d\u7f6e ",Object(c.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Configure"),"\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),'public void Configure(IApplicationBuilder application, IWebHostEnvironment env)\n{\n application.Map("/\u4e8c\u7ea7\u76ee\u5f55", app=>\n {\n // \u5176\u4ed6\u4e2d\u95f4\u4ef6\u4ee3\u7801\u5168\u90e8\u5728\u8fd9\u91cc\u9762\u5199\n });\n}\n')),Object(c.b)("h3",{id:"27413-\u542f\u7528-swagger-\u865a\u62df\u76ee\u5f55\u652f\u6301"},"27.4.1.3 \u542f\u7528 ",Object(c.b)("inlineCode",{parentName:"h3"},"Swagger")," \u865a\u62df\u76ee\u5f55\u652f\u6301"),Object(c.b)("p",null,"\u7b2c\u4e8c\u6b65\uff0c\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u6587\u4ef6\uff08\u5176\u4ed6\u914d\u7f6e\u6587\u4ef6\u4e5f\u53ef\u4ee5\uff09\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json",metastring:"{2-3}","{2-3}":!0}),'{\n "SpecificationDocumentSettings": {\n "VirtualPath": "/\u4e8c\u7ea7\u76ee\u5f55"\n }\n}\n')),Object(c.b)("h2",{id:"2742-\u53cd\u9988\u4e0e\u5efa\u8bae"},"27.4.2 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/handbook/build/01a85c17.dccd41f4.js b/docs/01a85c17.d65ac636.js similarity index 88% rename from handbook/build/01a85c17.dccd41f4.js rename to docs/01a85c17.d65ac636.js index 7d3d81b10a7..fdf70dfa186 100644 --- a/handbook/build/01a85c17.dccd41f4.js +++ b/docs/01a85c17.d65ac636.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{210:function(e,a,t){"use strict";t.d(a,"a",(function(){return m}));var n=t(0),r=t.n(n),l=t(194),s=t(198),c=t(61),i=t.n(c);function m({sidebar:e}){return 0===e.items.length?null:r.a.createElement("div",{className:Object(l.a)(i.a.sidebar,"thin-scrollbar")},r.a.createElement("h3",{className:i.a.sidebarItemTitle},e.title),r.a.createElement("ul",{className:i.a.sidebarItemList},e.items.map(e=>r.a.createElement("li",{key:e.permalink,className:i.a.sidebarItem},r.a.createElement(s.a,{isNavLink:!0,to:e.permalink,className:i.a.sidebarItemLink,activeClassName:i.a.sidebarItemLinkActive},e.title)))))}},74:function(e,a,t){"use strict";t.r(a);var n=t(0),r=t.n(n),l=t(203),s=t(198),c=t(210);a.default=function(e){const{tags:a,sidebar:t}=e,n={};Object.keys(a).forEach(e=>{const a=function(e){return e[0].toUpperCase()}(e);n[a]=n[a]||[],n[a].push(e)});const i=Object.entries(n).sort(([e],[a])=>e===a?0:e>a?1:-1).map(([e,t])=>r.a.createElement("div",{key:e},r.a.createElement("h3",null,e),t.map(e=>r.a.createElement(s.a,{className:"padding-right--md",href:a[e].permalink,key:e},a[e].name," (",a[e].count,")")),r.a.createElement("hr",null))).filter(e=>null!=e);return r.a.createElement(l.a,{title:"Tags",description:"Blog Tags",wrapperClassName:"blog-wrapper"},r.a.createElement("div",{className:"container margin-vert--lg"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col col--2"},r.a.createElement(c.a,{sidebar:t})),r.a.createElement("main",{className:"col col--8"},r.a.createElement("h1",null,"Tags"),r.a.createElement("div",{className:"margin-vert--lg"},i)))))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{214:function(e,a,t){"use strict";t.d(a,"a",(function(){return m}));var n=t(0),r=t.n(n),l=t(198),s=t(202),c=t(61),i=t.n(c);function m({sidebar:e}){return 0===e.items.length?null:r.a.createElement("div",{className:Object(l.a)(i.a.sidebar,"thin-scrollbar")},r.a.createElement("h3",{className:i.a.sidebarItemTitle},e.title),r.a.createElement("ul",{className:i.a.sidebarItemList},e.items.map(e=>r.a.createElement("li",{key:e.permalink,className:i.a.sidebarItem},r.a.createElement(s.a,{isNavLink:!0,to:e.permalink,className:i.a.sidebarItemLink,activeClassName:i.a.sidebarItemLinkActive},e.title)))))}},74:function(e,a,t){"use strict";t.r(a);var n=t(0),r=t.n(n),l=t(207),s=t(202),c=t(214);a.default=function(e){const{tags:a,sidebar:t}=e,n={};Object.keys(a).forEach(e=>{const a=function(e){return e[0].toUpperCase()}(e);n[a]=n[a]||[],n[a].push(e)});const i=Object.entries(n).sort(([e],[a])=>e===a?0:e>a?1:-1).map(([e,t])=>r.a.createElement("div",{key:e},r.a.createElement("h3",null,e),t.map(e=>r.a.createElement(s.a,{className:"padding-right--md",href:a[e].permalink,key:e},a[e].name," (",a[e].count,")")),r.a.createElement("hr",null))).filter(e=>null!=e);return r.a.createElement(l.a,{title:"Tags",description:"Blog Tags",wrapperClassName:"blog-wrapper"},r.a.createElement("div",{className:"container margin-vert--lg"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col col--2"},r.a.createElement(c.a,{sidebar:t})),r.a.createElement("main",{className:"col col--8"},r.a.createElement("h1",null,"Tags"),r.a.createElement("div",{className:"margin-vert--lg"},i)))))}}}]); \ No newline at end of file diff --git a/docs/03ebb857.b0063028.js b/docs/03ebb857.ed86141e.js similarity index 98% rename from docs/03ebb857.b0063028.js rename to docs/03ebb857.ed86141e.js index e760e79e431..0850cc4c458 100644 --- a/docs/03ebb857.b0063028.js +++ b/docs/03ebb857.ed86141e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{190:function(e,t,a){"use strict";a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return i}));var n=a(21),b=a(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return t+a;const i=a.startsWith(t)?a:t+a.replace(/^\//,"");return c?e+i:i}(t,e,a,n)}}function i(e,t={}){const{withBaseUrl:a}=c();return a(e,t)}},191:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function b(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return b}))},192:function(e,t,a){"use strict";a.d(t,"a",(function(){return d})),a.d(t,"b",(function(){return m}));var n=a(0),b=a.n(n);function c(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t=0||(b[a]=e[a]);return b}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(b[a]=e[a])}return b}var p=b.a.createContext({}),o=function(e){var t=b.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},d=function(e){var t=o(e.components);return b.a.createElement(p.Provider,{value:t},e.children)},O={inlineCode:"code",wrapper:function(e){var t=e.children;return b.a.createElement(b.a.Fragment,{},t)}},j=b.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,c=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=o(a),j=n,m=d["".concat(i,".").concat(j)]||d[j]||O[j]||c;return a?b.a.createElement(m,r(r({ref:t},p),{},{components:a})):b.a.createElement(m,r({ref:t},p))}));function m(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=a.length,i=new Array(c);i[0]=j;var r={};for(var l in t)hasOwnProperty.call(t,l)&&(r[l]=t[l]);r.originalType=e,r.mdxType="string"==typeof e?e:n,i[1]=r;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},75:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return l})),a.d(t,"metadata",(function(){return p})),a.d(t,"toc",(function(){return o})),a.d(t,"default",(function(){return O}));var n=a(3),b=a(7),c=(a(0),a(192)),i=a(190),r=a(193),l={id:"split-db",title:"9.28 \u5206\u8868\u5206\u5e93",sidebar_label:"9.28 \u5206\u8868\u5206\u5e93"},p={unversionedId:"split-db",id:"split-db",isDocsHomePage:!1,title:"9.28 \u5206\u8868\u5206\u5e93",description:"\u672c\u7ae0 9.28.2 \u81f3 9.28.5 \u5c0f\u8282\u632a\u7528\u535a\u4e3b\uff1a\u96e8\u70b9\u7684\u540d\u5b57 \u7684 \u5206\u5e93\u5206\u8868 - \u7406\u8bba \u535a\u5ba2\u5185\u5bb9\u3002\u7279\u6b64\u58f0\u660e\u3002",source:"@site/docs\\split-db.mdx",slug:"/split-db",permalink:"/docs/split-db",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/split-db.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.28 \u5206\u8868\u5206\u5e93",sidebar:"docs",previous:{title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",permalink:"/docs/dbcontext-read-write"},next:{title:"10.1. SqlSugar \u96c6\u6210",permalink:"/docs/sqlsugar"}},o=[{value:"9.28.1 \u5e94\u7528\u573a\u666f",id:"9281-\u5e94\u7528\u573a\u666f",children:[]},{value:"9.28.2 \u5782\u76f4\u5207\u5206",id:"9282-\u5782\u76f4\u5207\u5206",children:[{value:"9.28.2.1 \u5782\u76f4\u5206\u5e93",id:"92821-\u5782\u76f4\u5206\u5e93",children:[]},{value:"9.28.2.2 \u5782\u76f4\u5206\u8868",id:"92822-\u5782\u76f4\u5206\u8868",children:[]},{value:"9.28.2.3 \u4f18\u7f3a\u70b9",id:"92823-\u4f18\u7f3a\u70b9",children:[]}]},{value:"9.28.3 \u6c34\u5e73\u5207\u5206",id:"9283-\u6c34\u5e73\u5207\u5206",children:[{value:"9.28.3.1 \u6c34\u5e73\u5206\u5e93",id:"92831-\u6c34\u5e73\u5206\u5e93",children:[]},{value:"9.28.3.2 \u6c34\u5e73\u5206\u8868",id:"92832-\u6c34\u5e73\u5206\u8868",children:[]},{value:"9.28.3.3 \u4f18\u7f3a\u70b9",id:"92833-\u4f18\u7f3a\u70b9",children:[]}]},{value:"9.28.4 \u6570\u636e\u5206\u7247\u89c4\u5219",id:"9284-\u6570\u636e\u5206\u7247\u89c4\u5219",children:[{value:"9.28.4.1 Hash \u53d6\u6a21\u5206\u8868",id:"92841-hash-\u53d6\u6a21\u5206\u8868",children:[]},{value:"9.28.4.2 \u6570\u503c Range \u5206\u8868",id:"92842-\u6570\u503c-range-\u5206\u8868",children:[]},{value:"9.28.4.3 \u4e00\u81f4\u6027 Hash \u7b97\u6cd5",id:"92843-\u4e00\u81f4\u6027-hash-\u7b97\u6cd5",children:[]}]},{value:"9.28.5 \u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898",id:"9285-\u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898",children:[{value:"9.28.5.1 \u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898",id:"92851-\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898",children:[]},{value:"9.28.5.2 \u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2 Join \u95ee\u9898",id:"92852-\u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2-join-\u95ee\u9898",children:[]},{value:"9.28.5.3 \u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898",id:"92853-\u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898",children:[]},{value:"9.28.5.4 \u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898",id:"92854-\u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898",children:[]},{value:"9.28.5.5 \u6570\u636e\u8fc1\u79fb\u95ee\u9898",id:"92855-\u6570\u636e\u8fc1\u79fb\u95ee\u9898",children:[]}]},{value:"9.28.6 \u5982\u4f55\u5b9e\u73b0",id:"9286-\u5982\u4f55\u5b9e\u73b0",children:[]},{value:"9.28.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9287-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:o};function O(e){var t=e.components,a=Object(b.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},d,a,{components:t,mdxType:"MDXLayout"}),Object(c.b)(r.a,{mdxType:"JoinGroup"}),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u6b64\u58f0\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u672c\u7ae0 ",Object(c.b)("inlineCode",{parentName:"p"},"9.28.2")," \u81f3 ",Object(c.b)("inlineCode",{parentName:"p"},"9.28.5")," \u5c0f\u8282\u632a\u7528\u535a\u4e3b\uff1a",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/qdhxhz/"}),"\u96e8\u70b9\u7684\u540d\u5b57")," \u7684 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/qdhxhz/p/11608222.html"}),"\u5206\u5e93\u5206\u8868 - \u7406\u8bba")," \u535a\u5ba2\u5185\u5bb9\u3002",Object(c.b)("strong",{parentName:"p"},"\u7279\u6b64\u58f0\u660e\u3002")))),Object(c.b)("h2",{id:"9281-\u5e94\u7528\u573a\u666f"},"9.28.1 \u5e94\u7528\u573a\u666f"),Object(c.b)("p",null,"\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u91cf\u4e0d\u4e00\u5b9a\u662f\u53ef\u63a7\u7684\uff0c\u5728\u672a\u8fdb\u884c\u5206\u5e93\u5206\u8868\u7684\u60c5\u51b5\u4e0b\uff0c\u968f\u7740\u65f6\u95f4\u548c\u4e1a\u52a1\u7684\u53d1\u5c55\uff0c\u5e93\u4e2d\u7684\u8868\u4f1a\u8d8a\u6765\u8d8a\u591a\uff0c\u8868\u4e2d\u7684\u6570\u636e\u91cf\u4e5f\u4f1a\u8d8a\u6765\u8d8a\u5927\uff0c\u76f8\u5e94\u5730\uff0c\u6570\u636e\u64cd\u4f5c\u589e\u5220\u6539\u67e5\u7684\u5f00\u9500\u4e5f\u4f1a\u8d8a\u6765\u8d8a\u5927\u3002"),Object(c.b)("p",null,"\u53e6\u5916\uff0c\u7531\u4e8e\u65e0\u6cd5\u8fdb\u884c\u5206\u5e03\u5f0f\u5f0f\u90e8\u7f72\uff0c\u800c\u4e00\u53f0\u670d\u52a1\u5668\u7684\u8d44\u6e90\uff08CPU\u3001\u78c1\u76d8\u3001\u5185\u5b58\u3001IO \u7b49\uff09\u662f\u6709\u9650\u7684\uff0c\u6700\u7ec8\u6570\u636e\u5e93\u6240\u80fd\u627f\u8f7d\u7684\u6570\u636e\u91cf\u3001\u6570\u636e\u5904\u7406\u80fd\u529b\u90fd\u5c06\u906d\u9047\u74f6\u9888\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u5bf9\u6570\u636e\u5e93\u6216\u6570\u636e\u8868\u8fdb\u884c\u62c6\u5206\u3002"),Object(c.b)("p",null,"\u6570\u636e\u5207\u5206\u53ef\u4ee5\u5206\u4e3a\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"\u5782\u76f4\u5207\u5206")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"\u6c34\u5e73\u5207\u5206"),"\u3002"),Object(c.b)("h2",{id:"9282-\u5782\u76f4\u5207\u5206"},"9.28.2 \u5782\u76f4\u5207\u5206"),Object(c.b)("p",null,"\u5782\u76f4\u5207\u5206\u53c8\u53ef\u4ee5\u5206\u4e3a: \u5782\u76f4\u5206\u5e93\u548c\u5782\u76f4\u5206\u8868\u3002"),Object(c.b)("h3",{id:"92821-\u5782\u76f4\u5206\u5e93"},"9.28.2.1 \u5782\u76f4\u5206\u5e93"),Object(c.b)("p",null,'\u6839\u636e\u4e1a\u52a1\u8026\u5408\u6027\uff0c\u5c06\u5173\u8054\u5ea6\u4f4e\u7684\u4e0d\u540c\u8868\u5b58\u50a8\u5728\u4e0d\u540c\u7684\u6570\u636e\u5e93\u3002\u505a\u6cd5\u4e0e\u5927\u7cfb\u7edf\u62c6\u5206\u4e3a\u591a\u4e2a\u5c0f\u7cfb\u7edf\u7c7b\u4f3c\uff0c\u6309\u4e1a\u52a1\u5206\u7c7b\u8fdb\u884c\u72ec\u7acb\u5212\u5206\u3002\u4e0e"\u5fae\u670d\u52a1\u6cbb\u7406"\u7684\u505a\u6cd5\u76f8\u4f3c\uff0c\u6bcf\u4e2a\u5fae\u670d\u52a1\u4f7f\u7528\u5355\u72ec\u7684\u4e00\u4e2a\u6570\u636e\u5e93\u3002'),Object(c.b)("img",{src:Object(i.a)("img/dbsplit1.jpg")}),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u4e00\u5f00\u59cb\u6211\u4eec\u662f\u5355\u4f53\u670d\u52a1\uff0c\u6240\u4ee5\u53ea\u6709\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u6240\u6709\u7684\u8868\u90fd\u5728\u8fd9\u4e2a\u5e93\u91cc\u3002"),Object(c.b)("p",{parentName:"div"},"\u540e\u6765\u56e0\u4e3a\u4e1a\u52a1\u9700\u6c42,\u5355\u4f53\u670d\u52a1\u53d8\u6210\u5fae\u670d\u52a1\u6cbb\u7406\u3002\u6240\u4ee5\u5c06\u4e4b\u524d\u7684\u4e00\u4e2a\u5546\u54c1\u5e93\uff0c\u62c6\u5206\u6210\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6bcf\u4e2a\u5fae\u670d\u52a1\u5bf9\u4e8e\u4e00\u4e2a\u6570\u636e\u5e93\u3002"))),Object(c.b)("h3",{id:"92822-\u5782\u76f4\u5206\u8868"},"9.28.2.2 \u5782\u76f4\u5206\u8868"),Object(c.b)("p",null,"\u628a\u4e00\u4e2a\u8868\u7684\u591a\u4e2a\u5b57\u6bb5\u5206\u522b\u62c6\u6210\u591a\u4e2a\u8868\uff0c\u4e00\u822c\u6309\u5b57\u6bb5\u7684\u51b7\u70ed\u62c6\u5206\uff0c\u70ed\u5b57\u6bb5\u4e00\u4e2a\u8868\uff0c\u51b7\u5b57\u6bb5\u4e00\u4e2a\u8868\u3002\u4ece\u800c\u63d0\u5347\u4e86\u6570\u636e\u5e93\u6027\u80fd\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit2.jpg")}),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u4e00\u5f00\u59cb\u5546\u54c1\u8868\u4e2d\u5305\u542b\u5546\u54c1\u7684\u6240\u6709\u5b57\u6bb5\uff0c\u4f46\u662f\u6211\u4eec\u53d1\u73b0:"),Object(c.b)("p",{parentName:"div"},"1.\u5546\u54c1\u8be6\u60c5\u548c\u5546\u54c1\u5c5e\u6027\u5b57\u6bb5\u8f83\u957f\u30022.\u5546\u54c1\u5217\u8868\u7684\u65f6\u5019\u6211\u4eec\u662f\u4e0d\u9700\u8981\u663e\u793a\u5546\u54c1\u8be6\u60c5\u548c\u5546\u54c1\u5c5e\u6027\u4fe1\u606f\uff0c\u53ea\u6709\u5728\u70b9\u8fdb\u5546\u54c1\u5546\u54c1\u7684\u65f6\u5019\u624d\u4f1a\u5c55\u793a\u5546\u54c1\u8be6\u60c5\u4fe1\u606f\u3002"),Object(c.b)("p",{parentName:"div"},"\u6240\u4ee5\u53ef\u4ee5\u8003\u8651\u628a\u5546\u54c1\u8be6\u60c5\u548c\u5546\u54c1\u5c5e\u6027\u5355\u72ec\u5207\u5206\u4e00\u5f20\u8868\uff0c\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002"))),Object(c.b)("h3",{id:"92823-\u4f18\u7f3a\u70b9"},"9.28.2.3 \u4f18\u7f3a\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u89e3\u51b3\u4e1a\u52a1\u7cfb\u7edf\u5c42\u9762\u7684\u8026\u5408\uff0c\u4e1a\u52a1\u6e05\u6670"),Object(c.b)("li",{parentName:"ul"},"\u4e0e\u5fae\u670d\u52a1\u7684\u6cbb\u7406\u7c7b\u4f3c\uff0c\u4e5f\u80fd\u5bf9\u4e0d\u540c\u4e1a\u52a1\u7684\u6570\u636e\u8fdb\u884c\u5206\u7ea7\u7ba1\u7406\u3001\u7ef4\u62a4\u3001\u76d1\u63a7\u3001\u6269\u5c55\u7b49"),Object(c.b)("li",{parentName:"ul"},"\u9ad8\u5e76\u53d1\u573a\u666f\u4e0b\uff0c\u5782\u76f4\u5207\u5206\u4e00\u5b9a\u7a0b\u5ea6\u7684\u63d0\u5347 IO\u3001\u6570\u636e\u5e93\u8fde\u63a5\u6570\u3001\u5355\u673a\u786c\u4ef6\u8d44\u6e90\u7684\u74f6\u9888"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5206\u5e93\u540e\u65e0\u6cd5 Join\uff0c\u53ea\u80fd\u901a\u8fc7\u63a5\u53e3\u805a\u5408\u65b9\u5f0f\u89e3\u51b3\uff0c\u63d0\u5347\u4e86\u5f00\u53d1\u7684\u590d\u6742\u5ea6"),Object(c.b)("li",{parentName:"ul"},"\u5206\u5e93\u540e\u5206\u5e03\u5f0f\u4e8b\u52a1\u5904\u7406\u590d\u6742"),Object(c.b)("li",{parentName:"ul"},"\u4f9d\u7136\u5b58\u5728\u5355\u8868\u6570\u636e\u91cf\u8fc7\u5927\u7684\u95ee\u9898\uff08\u9700\u8981\u6c34\u5e73\u5207\u5206\uff09")))),Object(c.b)("h2",{id:"9283-\u6c34\u5e73\u5207\u5206"},"9.28.3 \u6c34\u5e73\u5207\u5206"),Object(c.b)("p",null,"\u5f53\u4e00\u4e2a\u5e94\u7528\u96be\u4ee5\u518d\u7ec6\u7c92\u5ea6\u7684\u5782\u76f4\u5207\u5206\u6216\u5207\u5206\u540e\u6570\u636e\u91cf\u884c\u6570\u5de8\u5927\uff0c\u5b58\u5728\u5355\u5e93\u8bfb\u5199\u3001\u5b58\u50a8\u6027\u80fd\u74f6\u9888\uff0c\u8fd9\u65f6\u5019\u5c31\u9700\u8981\u8fdb\u884c\u6c34\u5e73\u5207\u5206\u4e86\u3002"),Object(c.b)("p",null,"\u6c34\u5e73\u5207\u5206\u4e5f\u53ef\u4ee5\u5206\u4e3a\uff1a\u6c34\u5e73\u5206\u5e93\u548c\u6c34\u5e73\u5206\u8868\u3002"),Object(c.b)("h3",{id:"92831-\u6c34\u5e73\u5206\u5e93"},"9.28.3.1 \u6c34\u5e73\u5206\u5e93"),Object(c.b)("p",null,"\u4e0a\u9762\u867d\u7136\u5df2\u7ecf\u628a\u5546\u54c1\u5e93\u5206\u6210 3 \u4e2a\u5e93\uff0c\u4f46\u662f\u968f\u7740\u4e1a\u52a1\u7684\u589e\u52a0\u4e00\u4e2a\u8ba2\u5355\u5e93\u4e5f\u51fa\u73b0 QPS \u8fc7\u9ad8\uff0c\u6570\u636e\u5e93\u54cd\u5e94\u901f\u5ea6\u6765\u4e0d\u53ca\uff0c\u4e00\u822c mysql \u5355\u673a\u4e5f\u5c31 1000 \u5de6\u53f3\u7684 QPS\uff0c\u5982\u679c\u8d85\u8fc7 1000 \u5c31\u8981\u8003\u8651\u5206\u5e93\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit3.jpg")}),Object(c.b)("h3",{id:"92832-\u6c34\u5e73\u5206\u8868"},"9.28.3.2 \u6c34\u5e73\u5206\u8868"),Object(c.b)("p",null,"\u4e00\u822c\u6211\u4eec\u4e00\u5f20\u8868\u7684\u6570\u636e\u4e0d\u8981\u8d85\u8fc7 1 \u5343\u4e07,\u5982\u679c\u8868\u6570\u636e\u8d85\u8fc7 1 \u5343\u4e07\uff0c\u5e76\u4e14\u8fd8\u5728\u4e0d\u65ad\u589e\u52a0\u6570\u636e\uff0c\u90a3\u5c31\u53ef\u4ee5\u8003\u8651\u5206\u8868\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit4.jpg")}),Object(c.b)("h3",{id:"92833-\u4f18\u7f3a\u70b9"},"9.28.3.3 \u4f18\u7f3a\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u4e0d\u5b58\u5728\u5355\u5e93\u6570\u636e\u91cf\u8fc7\u5927\u3001\u9ad8\u5e76\u53d1\u7684\u6027\u80fd\u74f6\u9888\uff0c\u63d0\u5347\u7cfb\u7edf\u7a33\u5b9a\u6027\u548c\u8d1f\u8f7d\u80fd\u529b"),Object(c.b)("li",{parentName:"ul"},"\u5e94\u7528\u7aef\u6539\u9020\u8f83\u5c0f\uff0c\u4e0d\u9700\u8981\u62c6\u5206\u4e1a\u52a1\u6a21\u5757"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u8de8\u5206\u7247\u7684\u4e8b\u52a1\u4e00\u81f4\u6027\u96be\u4ee5\u4fdd\u8bc1"),Object(c.b)("li",{parentName:"ul"},"\u8de8\u5e93\u7684 Join \u5173\u8054\u67e5\u8be2\u6027\u80fd\u8f83\u5dee"),Object(c.b)("li",{parentName:"ul"},"\u6570\u636e\u591a\u6b21\u6269\u5c55\u96be\u5ea6\u548c\u7ef4\u62a4\u91cf\u6781\u5927")))),Object(c.b)("h2",{id:"9284-\u6570\u636e\u5206\u7247\u89c4\u5219"},"9.28.4 \u6570\u636e\u5206\u7247\u89c4\u5219"),Object(c.b)("p",null,"\u6211\u4eec\u8003\u8651\u53bb\u6c34\u5e73\u5207\u5206\u8868\uff0c\u5c06\u4e00\u5f20\u8868\u6c34\u5e73\u5207\u5206\u6210\u591a\u5f20\u8868\uff0c\u8fd9\u5c31\u6d89\u53ca\u5230\u6570\u636e\u5206\u7247\u7684\u89c4\u5219\uff0c\u6bd4\u8f83\u5e38\u89c1\u7684\u6709\uff1aHash \u53d6\u6a21\u5206\u8868\u3001\u6570\u503c Range \u5206\u8868\u3001\u4e00\u81f4\u6027 Hash \u7b97\u6cd5\u5206\u8868\u3002"),Object(c.b)("h3",{id:"92841-hash-\u53d6\u6a21\u5206\u8868"},"9.28.4.1 Hash \u53d6\u6a21\u5206\u8868"),Object(c.b)("p",null,"\u4e00\u822c\u91c7\u7528 Hash \u53d6\u6a21\u7684\u5207\u5206\u65b9\u5f0f\uff0c\u4f8b\u5982\uff1a\u5047\u8bbe\u6309 goods_id \u5206 4 \u5f20\u8868\u3002\uff08goods_id%4 \u53d6\u6574\u786e\u5b9a\u8868\uff09"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit5.jpg")}),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4f18\u7f3a\u70b9")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u6570\u636e\u5206\u7247\u76f8\u5bf9\u6bd4\u8f83\u5747\u5300\uff0c\u4e0d\u5bb9\u6613\u51fa\u73b0\u70ed\u70b9\u548c\u5e76\u53d1\u8bbf\u95ee\u7684\u74f6\u9888\u3002"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u540e\u671f\u5206\u7247\u96c6\u7fa4\u6269\u5bb9\u65f6\uff0c\u9700\u8981\u8fc1\u79fb\u65e7\u7684\u6570\u636e\u5f88\u96be\u3002"),Object(c.b)("li",{parentName:"ul"},"\u5bb9\u6613\u9762\u4e34\u8de8\u5206\u7247\u67e5\u8be2\u7684\u590d\u6742\u95ee\u9898\u3002\u6bd4\u5982\u4e0a\u4f8b\u4e2d\uff0c\u5982\u679c\u9891\u7e41\u7528\u5230\u7684\u67e5\u8be2\u6761\u4ef6\u4e2d\u4e0d\u5e26 goods_id \u65f6\uff0c\u5c06\u4f1a\u5bfc\u81f4\u65e0\u6cd5\u5b9a\u4f4d\u6570\u636e\u5e93\uff0c\u4ece\u800c\u9700\u8981\u540c\u65f6\u5411 4 \u4e2a\u5e93\u53d1\u8d77\u67e5\u8be2\uff0c\n\u518d\u5728\u5185\u5b58\u4e2d\u5408\u5e76\u6570\u636e\uff0c\u53d6\u6700\u5c0f\u96c6\u8fd4\u56de\u7ed9\u5e94\u7528\uff0c\u5206\u5e93\u53cd\u800c\u6210\u4e3a\u62d6\u7d2f\u3002")))),Object(c.b)("h3",{id:"92842-\u6570\u503c-range-\u5206\u8868"},"9.28.4.2 \u6570\u503c Range \u5206\u8868"),Object(c.b)("p",null,"\u6309\u7167\u65f6\u95f4\u533a\u95f4\u6216 ID \u533a\u95f4\u6765\u5207\u5206\u3002\u4f8b\u5982\uff1a\u5c06 goods_id \u4e3a 1-1000 \u7684\u8bb0\u5f55\u5206\u5230\u7b2c\u4e00\u4e2a\u8868\uff0c1000-2000 \u7684\u5206\u5230\u7b2c\u4e8c\u4e2a\u8868\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit6.jpg")}),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4f18\u7f3a\u70b9")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5355\u8868\u5927\u5c0f\u53ef\u63a7"),Object(c.b)("li",{parentName:"ul"},"\u5929\u7136\u4fbf\u4e8e\u6c34\u5e73\u6269\u5c55\uff0c\u540e\u671f\u5982\u679c\u60f3\u5bf9\u6574\u4e2a\u5206\u7247\u96c6\u7fa4\u6269\u5bb9\u65f6\uff0c\u53ea\u9700\u8981\u6dfb\u52a0\u8282\u70b9\u5373\u53ef\uff0c\u65e0\u9700\u5bf9\u5176\u4ed6\u5206\u7247\u7684\u6570\u636e\u8fdb\u884c\u8fc1\u79fb"),Object(c.b)("li",{parentName:"ul"},"\u4f7f\u7528\u5206\u7247\u5b57\u6bb5\u8fdb\u884c\u8303\u56f4\u67e5\u627e\u65f6\uff0c\u8fde\u7eed\u5206\u7247\u53ef\u5feb\u901f\u5b9a\u4f4d\u5206\u7247\u8fdb\u884c\u5feb\u901f\u67e5\u8be2\uff0c\u6709\u6548\u907f\u514d\u8de8\u5206\u7247\u67e5\u8be2\u7684\u95ee\u9898\u3002"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u70ed\u70b9\u6570\u636e\u6210\u4e3a\u6027\u80fd\u74f6\u9888\u3002\n\u4f8b\u5982\u6309\u65f6\u95f4\u5b57\u6bb5\u5206\u7247\uff0c\u6709\u4e9b\u5206\u7247\u5b58\u50a8\u6700\u8fd1\u65f6\u95f4\u6bb5\u5185\u7684\u6570\u636e\uff0c\u53ef\u80fd\u4f1a\u88ab\u9891\u7e41\u7684\u8bfb\u5199\uff0c\u800c\u6709\u4e9b\u5206\u7247\u5b58\u50a8\u7684\u5386\u53f2\u6570\u636e\uff0c\u5219\u5f88\u5c11\u88ab\u67e5\u8be2")))),Object(c.b)("h3",{id:"92843-\u4e00\u81f4\u6027-hash-\u7b97\u6cd5"},"9.28.4.3 \u4e00\u81f4\u6027 Hash \u7b97\u6cd5"),Object(c.b)("p",null,"\u4e00\u81f4\u6027 Hash \u7b97\u6cd5\u80fd\u5f88\u597d\u7684\u89e3\u51b3\u56e0\u4e3a Hash \u53d6\u6a21\u800c\u4ea7\u751f\u7684\u5206\u7247\u96c6\u7fa4\u6269\u5bb9\u65f6\uff0c\u9700\u8981\u8fc1\u79fb\u65e7\u7684\u6570\u636e\u7684\u96be\u9898\u3002\u5177\u4f53\u539f\u7406\u53ef\u53c2\u8003 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/duhuo/p/4996105.html"}),"https://www.cnblogs.com/duhuo/p/4996105.html")),Object(c.b)("h2",{id:"9285-\u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898"},"9.28.5 \u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898"),Object(c.b)("p",null,"\u4efb\u4f55\u4e8b\u60c5\u90fd\u6709\u4e24\u9762\u6027\uff0c\u5206\u5e93\u5206\u8868\u4e5f\u4e0d\u4f8b\u5916\uff0c\u5982\u679c\u91c7\u7528\u5206\u5e93\u5206\u8868\uff0c\u4f1a\u5f15\u5165\u65b0\u7684\u7684\u95ee\u9898\uff1a"),Object(c.b)("h3",{id:"92851-\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898"},"9.28.5.1 \u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898"),Object(c.b)("p",null,"\u4f7f\u7528\u5206\u5e03\u5f0f\u4e8b\u52a1\u4e2d\u95f4\u4ef6\u89e3\u51b3\uff0c\u5177\u4f53\u662f\u901a\u8fc7\u6700\u7ec8\u4e00\u81f4\u6027\u8fd8\u662f\u5f3a\u4e00\u81f4\u6027\u5206\u5e03\u5f0f\u4e8b\u52a1\uff0c\u770b\u4e1a\u52a1\u9700\u6c42\uff0c\u8fd9\u91cc\u5c31\u4e0d\u591a\u8bf4\u3002"),Object(c.b)("h3",{id:"92852-\u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2-join-\u95ee\u9898"},"9.28.5.2 \u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2 Join \u95ee\u9898"),Object(c.b)("p",null,"\u5207\u5206\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 Join \u6765\u5b8c\u6210\u3002\u800c\u5207\u5206\u4e4b\u540e\uff0c\u6570\u636e\u53ef\u80fd\u5206\u5e03\u5728\u4e0d\u540c\u7684\u8282\u70b9\u4e0a\uff0c\u6b64\u65f6 Join \u5e26\u6765\u7684\u95ee\u9898\u5c31\u6bd4\u8f83\u9ebb\u70e6\u4e86\uff0c\u8003\u8651\u5230\u6027\u80fd\uff0c\u5c3d\u91cf\u907f\u514d\u4f7f\u7528 Join \u67e5\u8be2\u3002"),Object(c.b)("p",null,"\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u4e00\u4e9b\u65b9\u6cd5\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u5168\u5c40\u8868"))),Object(c.b)("p",null,'\u5168\u5c40\u8868\uff0c\u4e5f\u53ef\u770b\u505a\u662f "\u6570\u636e\u5b57\u5178\u8868"\uff0c\u5c31\u662f\u7cfb\u7edf\u4e2d\u6240\u6709\u6a21\u5757\u90fd\u53ef\u80fd\u4f9d\u8d56\u7684\u4e00\u4e9b\u8868\uff0c\u4e3a\u4e86\u907f\u514d\u8de8\u5e93 Join \u67e5\u8be2\uff0c\u53ef\u4ee5\u5c06 \u8fd9\u7c7b\u8868\u5728\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u90fd\u4fdd\u5b58\u4e00\u4efd\u3002\u8fd9\u4e9b\u6570\u636e\u901a\u5e38\u5f88\u5c11\u4f1a\u8fdb\u884c\u4fee\u6539\uff0c\u6240\u4ee5\u4e5f\u4e0d\u62c5\u5fc3\u4e00\u81f4\u6027\u7684\u95ee\u9898\u3002'),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u5b57\u6bb5\u5197\u4f59"))),Object(c.b)("p",null,'\u5229\u7528\u7a7a\u95f4\u6362\u65f6\u95f4\uff0c\u4e3a\u4e86\u6027\u80fd\u800c\u907f\u514d join \u67e5\u8be2\u3002\u4f8b\uff1a\u8ba2\u5355\u8868\u4fdd\u5b58 userId \u65f6\u5019,\u4e5f\u5c06 userName \u5197\u4f59\u4fdd\u5b58\u4e00\u4efd\uff0c\u8fd9\u6837\u67e5\u8be2\u8ba2\u5355\u8be6\u60c5\u65f6\u5c31\u4e0d\u9700\u8981\u518d\u53bb\u67e5\u8be2"\u4e70\u5bb6 user \u8868"\u4e86\u3002'),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u6570\u636e\u7ec4\u88c5"))),Object(c.b)("p",null,"\u5728\u7cfb\u7edf\u5c42\u9762\uff0c\u5206\u4e24\u6b21\u67e5\u8be2\u3002\u7b2c\u4e00\u6b21\u67e5\u8be2\u7684\u7ed3\u679c\u96c6\u4e2d\u627e\u51fa\u5173\u8054\u6570\u636e id\uff0c\u7136\u540e\u6839\u636e id \u53d1\u8d77\u7b2c\u4e8c\u6b21\u8bf7\u6c42\u5f97\u5230\u5173\u8054\u6570\u636e\u3002\u6700\u540e\u5c06\u83b7\u5f97\u5230\u7684\u6570\u636e\u8fdb\u884c\u5b57\u6bb5\u62fc\u88c5\u3002"),Object(c.b)("h3",{id:"92853-\u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898"},"9.28.5.3 \u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898"),Object(c.b)("p",null,"\u8de8\u8282\u70b9\u591a\u5e93\u8fdb\u884c\u67e5\u8be2\u65f6\uff0c\u4f1a\u51fa\u73b0 Limit \u5206\u9875\u3001Order by \u6392\u5e8f\u7b49\u95ee\u9898\u3002\u5206\u9875\u9700\u8981\u6309\u7167\u6307\u5b9a\u5b57\u6bb5\u8fdb\u884c\u6392\u5e8f\uff0c\u5f53\u6392\u5e8f\u5b57\u6bb5\u5c31\u662f\u5206\u7247\u5b57\u6bb5\u65f6\uff0c\u901a\u8fc7\u5206\u7247\u89c4\u5219\u5c31\u6bd4\u8f83\u5bb9\u6613\u5b9a\u4f4d\u5230\u6307\u5b9a\u7684\u5206\u7247\uff1b"),Object(c.b)("p",null,"\u5f53\u6392\u5e8f\u5b57\u6bb5\u975e\u5206\u7247\u5b57\u6bb5\u65f6\uff0c\u5c31\u53d8\u5f97\u6bd4\u8f83\u590d\u6742\u4e86\u3002\u9700\u8981\u5148\u5728\u4e0d\u540c\u7684\u5206\u7247\u8282\u70b9\u4e2d\u5c06\u6570\u636e\u8fdb\u884c\u6392\u5e8f\u5e76\u8fd4\u56de\uff0c\u7136\u540e\u5c06\u4e0d\u540c\u5206\u7247\u8fd4\u56de\u7684\u7ed3\u679c\u96c6\u8fdb\u884c\u6c47\u603b\u548c\u518d\u6b21\u6392\u5e8f\uff0c\u6700\u7ec8\u8fd4\u56de\u7ed9\u7528\u6237\u3002"),Object(c.b)("h3",{id:"92854-\u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898"},"9.28.5.4 \u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898"),Object(c.b)("p",null,"\u5982\u679c\u90fd\u7528\u4e3b\u952e\u81ea\u589e\u80af\u5b9a\u4e0d\u5408\u7406\uff0c\u5982\u679c\u7528 UUID \u90a3\u4e48\u65e0\u6cd5\u505a\u5230\u6839\u636e\u4e3b\u952e\u6392\u5e8f\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u8003\u8651\u901a\u8fc7",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/qdhxhz/p/11372658.html"}),"\u96ea\u82b1 ID")," \u6765\u4f5c\u4e3a\u6570\u636e\u5e93\u7684\u4e3b\u952e\uff0c"),Object(c.b)("h3",{id:"92855-\u6570\u636e\u8fc1\u79fb\u95ee\u9898"},"9.28.5.5 \u6570\u636e\u8fc1\u79fb\u95ee\u9898"),Object(c.b)("p",null,"\u91c7\u7528\u53cc\u5199\u7684\u65b9\u5f0f\uff0c\u4fee\u6539\u4ee3\u7801\uff0c\u6240\u6709\u6d89\u53ca\u5230\u5206\u5e93\u5206\u8868\u7684\u8868\u7684\u589e\u3001\u5220\u3001\u6539\u7684\u4ee3\u7801\uff0c\u90fd\u8981\u5bf9\u65b0\u5e93\u8fdb\u884c\u589e\u5220\u6539\u3002\u540c\u65f6\uff0c\u518d\u6709\u4e00\u4e2a\u6570\u636e\u62bd\u53d6\u670d\u52a1\uff0c\u4e0d\u65ad\u5730\u4ece\u8001\u5e93\u62bd\u6570\u636e\uff0c\u5f80\u65b0\u5e93\u5199\uff0c"),Object(c.b)("p",null,"\u8fb9\u5199\u8fb9\u6309\u65f6\u95f4\u6bd4\u8f83\u6570\u636e\u662f\u4e0d\u662f\u6700\u65b0\u7684\u3002"),Object(c.b)("h2",{id:"9286-\u5982\u4f55\u5b9e\u73b0"},"9.28.6 \u5982\u4f55\u5b9e\u73b0"),Object(c.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7531\u4e8e\u5206\u8868\u5206\u5e93\u4e0d\u4ec5\u4ec5\u9700\u8981\u5185\u7f6e\u4ee3\u7801\u7684\u652f\u6301\uff0c\u540c\u65f6\u8fd8\u9700\u8981\u96c6\u6210\u6570\u636e\u5e93\u4e2d\u95f4\u4ef6\uff0c\u8fd9\u91cc\u63a8\u8350 ",Object(c.b)("inlineCode",{parentName:"p"},"MyCat")," \u4e2d\u95f4\u4ef6\u3002",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"http://www.mycat.org.cn/"}),"MyCat \u5b98\u65b9\u7f51\u7ad9")))),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u63d0\u4f9b\u4e86\u8f7b\u91cf\u7ea7\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"\u5206\u8868\u5206\u5e93")," \u652f\u6301\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93"))),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'// \u76f4\u63a5\u6539\u53d8\u6570\u636e\u5e93\nrepository.ChangeDatabase("\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32");\n\n// \u901a\u8fc7\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5207\u6362\nrepository.Change();\n')),Object(c.b)("p",null,"\u5982\u9700\u8de8\u5e93\u67e5\u8be2\uff0c\u9700\u7528\u5230\u6570\u636e\u5e93\u6280\u672f\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"SqlServer")," \u94fe\u63a5\u670d\u52a1\u5668\u6216\u540c\u4e49\u8bcd\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u8868"))),Object(c.b)("p",null,"\u7b2c\u4e00\u6b65\u3001\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u7279\u6027",Object(c.b)("inlineCode",{parentName:"p"},"[AppDbContext( Mode=DbContextMode.Dynamic)]")),Object(c.b)("p",null,"\u7b2c\u4e8c\u6b65\u3001\u9700\u8981\u52a8\u6001\u4fee\u6539\u8868\u540d\u7684\u5b9e\u4f53\u7ee7\u627f ",Object(c.b)("inlineCode",{parentName:"p"},"IEntityMutableTable")," \u63a5\u53e3\uff0c\u5e76\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"GetTableName()")," \u8fd4\u56de\u8868\u540d\u65b9\u6cd5"),Object(c.b)("p",null,"\u6700\u540e\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"BuildChange")," \u5207\u6362\u5373\u53ef\u3002"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var rep = repository.BuildChange();\n")),Object(c.b)("p",null,"\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"BuildChange")," \u65b9\u6cd5\u4e4b\u540e\u4f1a\u81ea\u52a8\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"GetTableName()")," \u65b9\u6cd5\u3002"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"DynamicModelCacheKeyFactory")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/modeling/dynamic-model"}),"EF Core - \u591a\u4e2a\u6a21\u578b\u4e4b\u95f4\u4ea4\u66ff")," \u7ae0\u8282\u3002"))),Object(c.b)("h2",{id:"9287-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.28.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}O.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{194:function(e,t,a){"use strict";a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return i}));var n=a(21),b=a(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return t+a;const i=a.startsWith(t)?a:t+a.replace(/^\//,"");return c?e+i:i}(t,e,a,n)}}function i(e,t={}){const{withBaseUrl:a}=c();return a(e,t)}},195:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function b(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return b}))},196:function(e,t,a){"use strict";a.d(t,"a",(function(){return d})),a.d(t,"b",(function(){return m}));var n=a(0),b=a.n(n);function c(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t=0||(b[a]=e[a]);return b}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(b[a]=e[a])}return b}var p=b.a.createContext({}),o=function(e){var t=b.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):r(r({},t),e)),a},d=function(e){var t=o(e.components);return b.a.createElement(p.Provider,{value:t},e.children)},O={inlineCode:"code",wrapper:function(e){var t=e.children;return b.a.createElement(b.a.Fragment,{},t)}},j=b.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,c=e.originalType,i=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),d=o(a),j=n,m=d["".concat(i,".").concat(j)]||d[j]||O[j]||c;return a?b.a.createElement(m,r(r({ref:t},p),{},{components:a})):b.a.createElement(m,r({ref:t},p))}));function m(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=a.length,i=new Array(c);i[0]=j;var r={};for(var l in t)hasOwnProperty.call(t,l)&&(r[l]=t[l]);r.originalType=e,r.mdxType="string"==typeof e?e:n,i[1]=r;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},75:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return l})),a.d(t,"metadata",(function(){return p})),a.d(t,"toc",(function(){return o})),a.d(t,"default",(function(){return O}));var n=a(3),b=a(7),c=(a(0),a(196)),i=a(194),r=a(197),l={id:"split-db",title:"9.28 \u5206\u8868\u5206\u5e93",sidebar_label:"9.28 \u5206\u8868\u5206\u5e93"},p={unversionedId:"split-db",id:"split-db",isDocsHomePage:!1,title:"9.28 \u5206\u8868\u5206\u5e93",description:"\u672c\u7ae0 9.28.2 \u81f3 9.28.5 \u5c0f\u8282\u632a\u7528\u535a\u4e3b\uff1a\u96e8\u70b9\u7684\u540d\u5b57 \u7684 \u5206\u5e93\u5206\u8868 - \u7406\u8bba \u535a\u5ba2\u5185\u5bb9\u3002\u7279\u6b64\u58f0\u660e\u3002",source:"@site/docs\\split-db.mdx",slug:"/split-db",permalink:"/docs/split-db",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/split-db.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.28 \u5206\u8868\u5206\u5e93",sidebar:"docs",previous:{title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",permalink:"/docs/dbcontext-read-write"},next:{title:"10.1. SqlSugar \u96c6\u6210",permalink:"/docs/sqlsugar"}},o=[{value:"9.28.1 \u5e94\u7528\u573a\u666f",id:"9281-\u5e94\u7528\u573a\u666f",children:[]},{value:"9.28.2 \u5782\u76f4\u5207\u5206",id:"9282-\u5782\u76f4\u5207\u5206",children:[{value:"9.28.2.1 \u5782\u76f4\u5206\u5e93",id:"92821-\u5782\u76f4\u5206\u5e93",children:[]},{value:"9.28.2.2 \u5782\u76f4\u5206\u8868",id:"92822-\u5782\u76f4\u5206\u8868",children:[]},{value:"9.28.2.3 \u4f18\u7f3a\u70b9",id:"92823-\u4f18\u7f3a\u70b9",children:[]}]},{value:"9.28.3 \u6c34\u5e73\u5207\u5206",id:"9283-\u6c34\u5e73\u5207\u5206",children:[{value:"9.28.3.1 \u6c34\u5e73\u5206\u5e93",id:"92831-\u6c34\u5e73\u5206\u5e93",children:[]},{value:"9.28.3.2 \u6c34\u5e73\u5206\u8868",id:"92832-\u6c34\u5e73\u5206\u8868",children:[]},{value:"9.28.3.3 \u4f18\u7f3a\u70b9",id:"92833-\u4f18\u7f3a\u70b9",children:[]}]},{value:"9.28.4 \u6570\u636e\u5206\u7247\u89c4\u5219",id:"9284-\u6570\u636e\u5206\u7247\u89c4\u5219",children:[{value:"9.28.4.1 Hash \u53d6\u6a21\u5206\u8868",id:"92841-hash-\u53d6\u6a21\u5206\u8868",children:[]},{value:"9.28.4.2 \u6570\u503c Range \u5206\u8868",id:"92842-\u6570\u503c-range-\u5206\u8868",children:[]},{value:"9.28.4.3 \u4e00\u81f4\u6027 Hash \u7b97\u6cd5",id:"92843-\u4e00\u81f4\u6027-hash-\u7b97\u6cd5",children:[]}]},{value:"9.28.5 \u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898",id:"9285-\u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898",children:[{value:"9.28.5.1 \u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898",id:"92851-\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898",children:[]},{value:"9.28.5.2 \u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2 Join \u95ee\u9898",id:"92852-\u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2-join-\u95ee\u9898",children:[]},{value:"9.28.5.3 \u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898",id:"92853-\u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898",children:[]},{value:"9.28.5.4 \u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898",id:"92854-\u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898",children:[]},{value:"9.28.5.5 \u6570\u636e\u8fc1\u79fb\u95ee\u9898",id:"92855-\u6570\u636e\u8fc1\u79fb\u95ee\u9898",children:[]}]},{value:"9.28.6 \u5982\u4f55\u5b9e\u73b0",id:"9286-\u5982\u4f55\u5b9e\u73b0",children:[]},{value:"9.28.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9287-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:o};function O(e){var t=e.components,a=Object(b.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},d,a,{components:t,mdxType:"MDXLayout"}),Object(c.b)(r.a,{mdxType:"JoinGroup"}),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u6b64\u58f0\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u672c\u7ae0 ",Object(c.b)("inlineCode",{parentName:"p"},"9.28.2")," \u81f3 ",Object(c.b)("inlineCode",{parentName:"p"},"9.28.5")," \u5c0f\u8282\u632a\u7528\u535a\u4e3b\uff1a",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/qdhxhz/"}),"\u96e8\u70b9\u7684\u540d\u5b57")," \u7684 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/qdhxhz/p/11608222.html"}),"\u5206\u5e93\u5206\u8868 - \u7406\u8bba")," \u535a\u5ba2\u5185\u5bb9\u3002",Object(c.b)("strong",{parentName:"p"},"\u7279\u6b64\u58f0\u660e\u3002")))),Object(c.b)("h2",{id:"9281-\u5e94\u7528\u573a\u666f"},"9.28.1 \u5e94\u7528\u573a\u666f"),Object(c.b)("p",null,"\u6570\u636e\u5e93\u4e2d\u7684\u6570\u636e\u91cf\u4e0d\u4e00\u5b9a\u662f\u53ef\u63a7\u7684\uff0c\u5728\u672a\u8fdb\u884c\u5206\u5e93\u5206\u8868\u7684\u60c5\u51b5\u4e0b\uff0c\u968f\u7740\u65f6\u95f4\u548c\u4e1a\u52a1\u7684\u53d1\u5c55\uff0c\u5e93\u4e2d\u7684\u8868\u4f1a\u8d8a\u6765\u8d8a\u591a\uff0c\u8868\u4e2d\u7684\u6570\u636e\u91cf\u4e5f\u4f1a\u8d8a\u6765\u8d8a\u5927\uff0c\u76f8\u5e94\u5730\uff0c\u6570\u636e\u64cd\u4f5c\u589e\u5220\u6539\u67e5\u7684\u5f00\u9500\u4e5f\u4f1a\u8d8a\u6765\u8d8a\u5927\u3002"),Object(c.b)("p",null,"\u53e6\u5916\uff0c\u7531\u4e8e\u65e0\u6cd5\u8fdb\u884c\u5206\u5e03\u5f0f\u5f0f\u90e8\u7f72\uff0c\u800c\u4e00\u53f0\u670d\u52a1\u5668\u7684\u8d44\u6e90\uff08CPU\u3001\u78c1\u76d8\u3001\u5185\u5b58\u3001IO \u7b49\uff09\u662f\u6709\u9650\u7684\uff0c\u6700\u7ec8\u6570\u636e\u5e93\u6240\u80fd\u627f\u8f7d\u7684\u6570\u636e\u91cf\u3001\u6570\u636e\u5904\u7406\u80fd\u529b\u90fd\u5c06\u906d\u9047\u74f6\u9888\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u5bf9\u6570\u636e\u5e93\u6216\u6570\u636e\u8868\u8fdb\u884c\u62c6\u5206\u3002"),Object(c.b)("p",null,"\u6570\u636e\u5207\u5206\u53ef\u4ee5\u5206\u4e3a\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"\u5782\u76f4\u5207\u5206")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"\u6c34\u5e73\u5207\u5206"),"\u3002"),Object(c.b)("h2",{id:"9282-\u5782\u76f4\u5207\u5206"},"9.28.2 \u5782\u76f4\u5207\u5206"),Object(c.b)("p",null,"\u5782\u76f4\u5207\u5206\u53c8\u53ef\u4ee5\u5206\u4e3a: \u5782\u76f4\u5206\u5e93\u548c\u5782\u76f4\u5206\u8868\u3002"),Object(c.b)("h3",{id:"92821-\u5782\u76f4\u5206\u5e93"},"9.28.2.1 \u5782\u76f4\u5206\u5e93"),Object(c.b)("p",null,'\u6839\u636e\u4e1a\u52a1\u8026\u5408\u6027\uff0c\u5c06\u5173\u8054\u5ea6\u4f4e\u7684\u4e0d\u540c\u8868\u5b58\u50a8\u5728\u4e0d\u540c\u7684\u6570\u636e\u5e93\u3002\u505a\u6cd5\u4e0e\u5927\u7cfb\u7edf\u62c6\u5206\u4e3a\u591a\u4e2a\u5c0f\u7cfb\u7edf\u7c7b\u4f3c\uff0c\u6309\u4e1a\u52a1\u5206\u7c7b\u8fdb\u884c\u72ec\u7acb\u5212\u5206\u3002\u4e0e"\u5fae\u670d\u52a1\u6cbb\u7406"\u7684\u505a\u6cd5\u76f8\u4f3c\uff0c\u6bcf\u4e2a\u5fae\u670d\u52a1\u4f7f\u7528\u5355\u72ec\u7684\u4e00\u4e2a\u6570\u636e\u5e93\u3002'),Object(c.b)("img",{src:Object(i.a)("img/dbsplit1.jpg")}),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u4e00\u5f00\u59cb\u6211\u4eec\u662f\u5355\u4f53\u670d\u52a1\uff0c\u6240\u4ee5\u53ea\u6709\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u6240\u6709\u7684\u8868\u90fd\u5728\u8fd9\u4e2a\u5e93\u91cc\u3002"),Object(c.b)("p",{parentName:"div"},"\u540e\u6765\u56e0\u4e3a\u4e1a\u52a1\u9700\u6c42,\u5355\u4f53\u670d\u52a1\u53d8\u6210\u5fae\u670d\u52a1\u6cbb\u7406\u3002\u6240\u4ee5\u5c06\u4e4b\u524d\u7684\u4e00\u4e2a\u5546\u54c1\u5e93\uff0c\u62c6\u5206\u6210\u591a\u4e2a\u6570\u636e\u5e93\u3002\u6bcf\u4e2a\u5fae\u670d\u52a1\u5bf9\u4e8e\u4e00\u4e2a\u6570\u636e\u5e93\u3002"))),Object(c.b)("h3",{id:"92822-\u5782\u76f4\u5206\u8868"},"9.28.2.2 \u5782\u76f4\u5206\u8868"),Object(c.b)("p",null,"\u628a\u4e00\u4e2a\u8868\u7684\u591a\u4e2a\u5b57\u6bb5\u5206\u522b\u62c6\u6210\u591a\u4e2a\u8868\uff0c\u4e00\u822c\u6309\u5b57\u6bb5\u7684\u51b7\u70ed\u62c6\u5206\uff0c\u70ed\u5b57\u6bb5\u4e00\u4e2a\u8868\uff0c\u51b7\u5b57\u6bb5\u4e00\u4e2a\u8868\u3002\u4ece\u800c\u63d0\u5347\u4e86\u6570\u636e\u5e93\u6027\u80fd\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit2.jpg")}),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u4e00\u5f00\u59cb\u5546\u54c1\u8868\u4e2d\u5305\u542b\u5546\u54c1\u7684\u6240\u6709\u5b57\u6bb5\uff0c\u4f46\u662f\u6211\u4eec\u53d1\u73b0:"),Object(c.b)("p",{parentName:"div"},"1.\u5546\u54c1\u8be6\u60c5\u548c\u5546\u54c1\u5c5e\u6027\u5b57\u6bb5\u8f83\u957f\u30022.\u5546\u54c1\u5217\u8868\u7684\u65f6\u5019\u6211\u4eec\u662f\u4e0d\u9700\u8981\u663e\u793a\u5546\u54c1\u8be6\u60c5\u548c\u5546\u54c1\u5c5e\u6027\u4fe1\u606f\uff0c\u53ea\u6709\u5728\u70b9\u8fdb\u5546\u54c1\u5546\u54c1\u7684\u65f6\u5019\u624d\u4f1a\u5c55\u793a\u5546\u54c1\u8be6\u60c5\u4fe1\u606f\u3002"),Object(c.b)("p",{parentName:"div"},"\u6240\u4ee5\u53ef\u4ee5\u8003\u8651\u628a\u5546\u54c1\u8be6\u60c5\u548c\u5546\u54c1\u5c5e\u6027\u5355\u72ec\u5207\u5206\u4e00\u5f20\u8868\uff0c\u63d0\u9ad8\u67e5\u8be2\u6548\u7387\u3002"))),Object(c.b)("h3",{id:"92823-\u4f18\u7f3a\u70b9"},"9.28.2.3 \u4f18\u7f3a\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u89e3\u51b3\u4e1a\u52a1\u7cfb\u7edf\u5c42\u9762\u7684\u8026\u5408\uff0c\u4e1a\u52a1\u6e05\u6670"),Object(c.b)("li",{parentName:"ul"},"\u4e0e\u5fae\u670d\u52a1\u7684\u6cbb\u7406\u7c7b\u4f3c\uff0c\u4e5f\u80fd\u5bf9\u4e0d\u540c\u4e1a\u52a1\u7684\u6570\u636e\u8fdb\u884c\u5206\u7ea7\u7ba1\u7406\u3001\u7ef4\u62a4\u3001\u76d1\u63a7\u3001\u6269\u5c55\u7b49"),Object(c.b)("li",{parentName:"ul"},"\u9ad8\u5e76\u53d1\u573a\u666f\u4e0b\uff0c\u5782\u76f4\u5207\u5206\u4e00\u5b9a\u7a0b\u5ea6\u7684\u63d0\u5347 IO\u3001\u6570\u636e\u5e93\u8fde\u63a5\u6570\u3001\u5355\u673a\u786c\u4ef6\u8d44\u6e90\u7684\u74f6\u9888"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5206\u5e93\u540e\u65e0\u6cd5 Join\uff0c\u53ea\u80fd\u901a\u8fc7\u63a5\u53e3\u805a\u5408\u65b9\u5f0f\u89e3\u51b3\uff0c\u63d0\u5347\u4e86\u5f00\u53d1\u7684\u590d\u6742\u5ea6"),Object(c.b)("li",{parentName:"ul"},"\u5206\u5e93\u540e\u5206\u5e03\u5f0f\u4e8b\u52a1\u5904\u7406\u590d\u6742"),Object(c.b)("li",{parentName:"ul"},"\u4f9d\u7136\u5b58\u5728\u5355\u8868\u6570\u636e\u91cf\u8fc7\u5927\u7684\u95ee\u9898\uff08\u9700\u8981\u6c34\u5e73\u5207\u5206\uff09")))),Object(c.b)("h2",{id:"9283-\u6c34\u5e73\u5207\u5206"},"9.28.3 \u6c34\u5e73\u5207\u5206"),Object(c.b)("p",null,"\u5f53\u4e00\u4e2a\u5e94\u7528\u96be\u4ee5\u518d\u7ec6\u7c92\u5ea6\u7684\u5782\u76f4\u5207\u5206\u6216\u5207\u5206\u540e\u6570\u636e\u91cf\u884c\u6570\u5de8\u5927\uff0c\u5b58\u5728\u5355\u5e93\u8bfb\u5199\u3001\u5b58\u50a8\u6027\u80fd\u74f6\u9888\uff0c\u8fd9\u65f6\u5019\u5c31\u9700\u8981\u8fdb\u884c\u6c34\u5e73\u5207\u5206\u4e86\u3002"),Object(c.b)("p",null,"\u6c34\u5e73\u5207\u5206\u4e5f\u53ef\u4ee5\u5206\u4e3a\uff1a\u6c34\u5e73\u5206\u5e93\u548c\u6c34\u5e73\u5206\u8868\u3002"),Object(c.b)("h3",{id:"92831-\u6c34\u5e73\u5206\u5e93"},"9.28.3.1 \u6c34\u5e73\u5206\u5e93"),Object(c.b)("p",null,"\u4e0a\u9762\u867d\u7136\u5df2\u7ecf\u628a\u5546\u54c1\u5e93\u5206\u6210 3 \u4e2a\u5e93\uff0c\u4f46\u662f\u968f\u7740\u4e1a\u52a1\u7684\u589e\u52a0\u4e00\u4e2a\u8ba2\u5355\u5e93\u4e5f\u51fa\u73b0 QPS \u8fc7\u9ad8\uff0c\u6570\u636e\u5e93\u54cd\u5e94\u901f\u5ea6\u6765\u4e0d\u53ca\uff0c\u4e00\u822c mysql \u5355\u673a\u4e5f\u5c31 1000 \u5de6\u53f3\u7684 QPS\uff0c\u5982\u679c\u8d85\u8fc7 1000 \u5c31\u8981\u8003\u8651\u5206\u5e93\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit3.jpg")}),Object(c.b)("h3",{id:"92832-\u6c34\u5e73\u5206\u8868"},"9.28.3.2 \u6c34\u5e73\u5206\u8868"),Object(c.b)("p",null,"\u4e00\u822c\u6211\u4eec\u4e00\u5f20\u8868\u7684\u6570\u636e\u4e0d\u8981\u8d85\u8fc7 1 \u5343\u4e07,\u5982\u679c\u8868\u6570\u636e\u8d85\u8fc7 1 \u5343\u4e07\uff0c\u5e76\u4e14\u8fd8\u5728\u4e0d\u65ad\u589e\u52a0\u6570\u636e\uff0c\u90a3\u5c31\u53ef\u4ee5\u8003\u8651\u5206\u8868\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit4.jpg")}),Object(c.b)("h3",{id:"92833-\u4f18\u7f3a\u70b9"},"9.28.3.3 \u4f18\u7f3a\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u4e0d\u5b58\u5728\u5355\u5e93\u6570\u636e\u91cf\u8fc7\u5927\u3001\u9ad8\u5e76\u53d1\u7684\u6027\u80fd\u74f6\u9888\uff0c\u63d0\u5347\u7cfb\u7edf\u7a33\u5b9a\u6027\u548c\u8d1f\u8f7d\u80fd\u529b"),Object(c.b)("li",{parentName:"ul"},"\u5e94\u7528\u7aef\u6539\u9020\u8f83\u5c0f\uff0c\u4e0d\u9700\u8981\u62c6\u5206\u4e1a\u52a1\u6a21\u5757"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u8de8\u5206\u7247\u7684\u4e8b\u52a1\u4e00\u81f4\u6027\u96be\u4ee5\u4fdd\u8bc1"),Object(c.b)("li",{parentName:"ul"},"\u8de8\u5e93\u7684 Join \u5173\u8054\u67e5\u8be2\u6027\u80fd\u8f83\u5dee"),Object(c.b)("li",{parentName:"ul"},"\u6570\u636e\u591a\u6b21\u6269\u5c55\u96be\u5ea6\u548c\u7ef4\u62a4\u91cf\u6781\u5927")))),Object(c.b)("h2",{id:"9284-\u6570\u636e\u5206\u7247\u89c4\u5219"},"9.28.4 \u6570\u636e\u5206\u7247\u89c4\u5219"),Object(c.b)("p",null,"\u6211\u4eec\u8003\u8651\u53bb\u6c34\u5e73\u5207\u5206\u8868\uff0c\u5c06\u4e00\u5f20\u8868\u6c34\u5e73\u5207\u5206\u6210\u591a\u5f20\u8868\uff0c\u8fd9\u5c31\u6d89\u53ca\u5230\u6570\u636e\u5206\u7247\u7684\u89c4\u5219\uff0c\u6bd4\u8f83\u5e38\u89c1\u7684\u6709\uff1aHash \u53d6\u6a21\u5206\u8868\u3001\u6570\u503c Range \u5206\u8868\u3001\u4e00\u81f4\u6027 Hash \u7b97\u6cd5\u5206\u8868\u3002"),Object(c.b)("h3",{id:"92841-hash-\u53d6\u6a21\u5206\u8868"},"9.28.4.1 Hash \u53d6\u6a21\u5206\u8868"),Object(c.b)("p",null,"\u4e00\u822c\u91c7\u7528 Hash \u53d6\u6a21\u7684\u5207\u5206\u65b9\u5f0f\uff0c\u4f8b\u5982\uff1a\u5047\u8bbe\u6309 goods_id \u5206 4 \u5f20\u8868\u3002\uff08goods_id%4 \u53d6\u6574\u786e\u5b9a\u8868\uff09"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit5.jpg")}),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4f18\u7f3a\u70b9")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u6570\u636e\u5206\u7247\u76f8\u5bf9\u6bd4\u8f83\u5747\u5300\uff0c\u4e0d\u5bb9\u6613\u51fa\u73b0\u70ed\u70b9\u548c\u5e76\u53d1\u8bbf\u95ee\u7684\u74f6\u9888\u3002"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u540e\u671f\u5206\u7247\u96c6\u7fa4\u6269\u5bb9\u65f6\uff0c\u9700\u8981\u8fc1\u79fb\u65e7\u7684\u6570\u636e\u5f88\u96be\u3002"),Object(c.b)("li",{parentName:"ul"},"\u5bb9\u6613\u9762\u4e34\u8de8\u5206\u7247\u67e5\u8be2\u7684\u590d\u6742\u95ee\u9898\u3002\u6bd4\u5982\u4e0a\u4f8b\u4e2d\uff0c\u5982\u679c\u9891\u7e41\u7528\u5230\u7684\u67e5\u8be2\u6761\u4ef6\u4e2d\u4e0d\u5e26 goods_id \u65f6\uff0c\u5c06\u4f1a\u5bfc\u81f4\u65e0\u6cd5\u5b9a\u4f4d\u6570\u636e\u5e93\uff0c\u4ece\u800c\u9700\u8981\u540c\u65f6\u5411 4 \u4e2a\u5e93\u53d1\u8d77\u67e5\u8be2\uff0c\n\u518d\u5728\u5185\u5b58\u4e2d\u5408\u5e76\u6570\u636e\uff0c\u53d6\u6700\u5c0f\u96c6\u8fd4\u56de\u7ed9\u5e94\u7528\uff0c\u5206\u5e93\u53cd\u800c\u6210\u4e3a\u62d6\u7d2f\u3002")))),Object(c.b)("h3",{id:"92842-\u6570\u503c-range-\u5206\u8868"},"9.28.4.2 \u6570\u503c Range \u5206\u8868"),Object(c.b)("p",null,"\u6309\u7167\u65f6\u95f4\u533a\u95f4\u6216 ID \u533a\u95f4\u6765\u5207\u5206\u3002\u4f8b\u5982\uff1a\u5c06 goods_id \u4e3a 1-1000 \u7684\u8bb0\u5f55\u5206\u5230\u7b2c\u4e00\u4e2a\u8868\uff0c1000-2000 \u7684\u5206\u5230\u7b2c\u4e8c\u4e2a\u8868\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002"),Object(c.b)("img",{src:Object(i.a)("img/dbsplit6.jpg")}),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4f18\u7f3a\u70b9")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5355\u8868\u5927\u5c0f\u53ef\u63a7"),Object(c.b)("li",{parentName:"ul"},"\u5929\u7136\u4fbf\u4e8e\u6c34\u5e73\u6269\u5c55\uff0c\u540e\u671f\u5982\u679c\u60f3\u5bf9\u6574\u4e2a\u5206\u7247\u96c6\u7fa4\u6269\u5bb9\u65f6\uff0c\u53ea\u9700\u8981\u6dfb\u52a0\u8282\u70b9\u5373\u53ef\uff0c\u65e0\u9700\u5bf9\u5176\u4ed6\u5206\u7247\u7684\u6570\u636e\u8fdb\u884c\u8fc1\u79fb"),Object(c.b)("li",{parentName:"ul"},"\u4f7f\u7528\u5206\u7247\u5b57\u6bb5\u8fdb\u884c\u8303\u56f4\u67e5\u627e\u65f6\uff0c\u8fde\u7eed\u5206\u7247\u53ef\u5feb\u901f\u5b9a\u4f4d\u5206\u7247\u8fdb\u884c\u5feb\u901f\u67e5\u8be2\uff0c\u6709\u6548\u907f\u514d\u8de8\u5206\u7247\u67e5\u8be2\u7684\u95ee\u9898\u3002"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u70ed\u70b9\u6570\u636e\u6210\u4e3a\u6027\u80fd\u74f6\u9888\u3002\n\u4f8b\u5982\u6309\u65f6\u95f4\u5b57\u6bb5\u5206\u7247\uff0c\u6709\u4e9b\u5206\u7247\u5b58\u50a8\u6700\u8fd1\u65f6\u95f4\u6bb5\u5185\u7684\u6570\u636e\uff0c\u53ef\u80fd\u4f1a\u88ab\u9891\u7e41\u7684\u8bfb\u5199\uff0c\u800c\u6709\u4e9b\u5206\u7247\u5b58\u50a8\u7684\u5386\u53f2\u6570\u636e\uff0c\u5219\u5f88\u5c11\u88ab\u67e5\u8be2")))),Object(c.b)("h3",{id:"92843-\u4e00\u81f4\u6027-hash-\u7b97\u6cd5"},"9.28.4.3 \u4e00\u81f4\u6027 Hash \u7b97\u6cd5"),Object(c.b)("p",null,"\u4e00\u81f4\u6027 Hash \u7b97\u6cd5\u80fd\u5f88\u597d\u7684\u89e3\u51b3\u56e0\u4e3a Hash \u53d6\u6a21\u800c\u4ea7\u751f\u7684\u5206\u7247\u96c6\u7fa4\u6269\u5bb9\u65f6\uff0c\u9700\u8981\u8fc1\u79fb\u65e7\u7684\u6570\u636e\u7684\u96be\u9898\u3002\u5177\u4f53\u539f\u7406\u53ef\u53c2\u8003 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/duhuo/p/4996105.html"}),"https://www.cnblogs.com/duhuo/p/4996105.html")),Object(c.b)("h2",{id:"9285-\u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898"},"9.28.5 \u5206\u5e93\u5206\u8868\u5e26\u6765\u7684\u95ee\u9898"),Object(c.b)("p",null,"\u4efb\u4f55\u4e8b\u60c5\u90fd\u6709\u4e24\u9762\u6027\uff0c\u5206\u5e93\u5206\u8868\u4e5f\u4e0d\u4f8b\u5916\uff0c\u5982\u679c\u91c7\u7528\u5206\u5e93\u5206\u8868\uff0c\u4f1a\u5f15\u5165\u65b0\u7684\u7684\u95ee\u9898\uff1a"),Object(c.b)("h3",{id:"92851-\u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898"},"9.28.5.1 \u5206\u5e03\u5f0f\u4e8b\u52a1\u95ee\u9898"),Object(c.b)("p",null,"\u4f7f\u7528\u5206\u5e03\u5f0f\u4e8b\u52a1\u4e2d\u95f4\u4ef6\u89e3\u51b3\uff0c\u5177\u4f53\u662f\u901a\u8fc7\u6700\u7ec8\u4e00\u81f4\u6027\u8fd8\u662f\u5f3a\u4e00\u81f4\u6027\u5206\u5e03\u5f0f\u4e8b\u52a1\uff0c\u770b\u4e1a\u52a1\u9700\u6c42\uff0c\u8fd9\u91cc\u5c31\u4e0d\u591a\u8bf4\u3002"),Object(c.b)("h3",{id:"92852-\u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2-join-\u95ee\u9898"},"9.28.5.2 \u8de8\u8282\u70b9\u5173\u8054\u67e5\u8be2 Join \u95ee\u9898"),Object(c.b)("p",null,"\u5207\u5206\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 Join \u6765\u5b8c\u6210\u3002\u800c\u5207\u5206\u4e4b\u540e\uff0c\u6570\u636e\u53ef\u80fd\u5206\u5e03\u5728\u4e0d\u540c\u7684\u8282\u70b9\u4e0a\uff0c\u6b64\u65f6 Join \u5e26\u6765\u7684\u95ee\u9898\u5c31\u6bd4\u8f83\u9ebb\u70e6\u4e86\uff0c\u8003\u8651\u5230\u6027\u80fd\uff0c\u5c3d\u91cf\u907f\u514d\u4f7f\u7528 Join \u67e5\u8be2\u3002"),Object(c.b)("p",null,"\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u7684\u4e00\u4e9b\u65b9\u6cd5\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u5168\u5c40\u8868"))),Object(c.b)("p",null,'\u5168\u5c40\u8868\uff0c\u4e5f\u53ef\u770b\u505a\u662f "\u6570\u636e\u5b57\u5178\u8868"\uff0c\u5c31\u662f\u7cfb\u7edf\u4e2d\u6240\u6709\u6a21\u5757\u90fd\u53ef\u80fd\u4f9d\u8d56\u7684\u4e00\u4e9b\u8868\uff0c\u4e3a\u4e86\u907f\u514d\u8de8\u5e93 Join \u67e5\u8be2\uff0c\u53ef\u4ee5\u5c06 \u8fd9\u7c7b\u8868\u5728\u6bcf\u4e2a\u6570\u636e\u5e93\u4e2d\u90fd\u4fdd\u5b58\u4e00\u4efd\u3002\u8fd9\u4e9b\u6570\u636e\u901a\u5e38\u5f88\u5c11\u4f1a\u8fdb\u884c\u4fee\u6539\uff0c\u6240\u4ee5\u4e5f\u4e0d\u62c5\u5fc3\u4e00\u81f4\u6027\u7684\u95ee\u9898\u3002'),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u5b57\u6bb5\u5197\u4f59"))),Object(c.b)("p",null,'\u5229\u7528\u7a7a\u95f4\u6362\u65f6\u95f4\uff0c\u4e3a\u4e86\u6027\u80fd\u800c\u907f\u514d join \u67e5\u8be2\u3002\u4f8b\uff1a\u8ba2\u5355\u8868\u4fdd\u5b58 userId \u65f6\u5019,\u4e5f\u5c06 userName \u5197\u4f59\u4fdd\u5b58\u4e00\u4efd\uff0c\u8fd9\u6837\u67e5\u8be2\u8ba2\u5355\u8be6\u60c5\u65f6\u5c31\u4e0d\u9700\u8981\u518d\u53bb\u67e5\u8be2"\u4e70\u5bb6 user \u8868"\u4e86\u3002'),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u6570\u636e\u7ec4\u88c5"))),Object(c.b)("p",null,"\u5728\u7cfb\u7edf\u5c42\u9762\uff0c\u5206\u4e24\u6b21\u67e5\u8be2\u3002\u7b2c\u4e00\u6b21\u67e5\u8be2\u7684\u7ed3\u679c\u96c6\u4e2d\u627e\u51fa\u5173\u8054\u6570\u636e id\uff0c\u7136\u540e\u6839\u636e id \u53d1\u8d77\u7b2c\u4e8c\u6b21\u8bf7\u6c42\u5f97\u5230\u5173\u8054\u6570\u636e\u3002\u6700\u540e\u5c06\u83b7\u5f97\u5230\u7684\u6570\u636e\u8fdb\u884c\u5b57\u6bb5\u62fc\u88c5\u3002"),Object(c.b)("h3",{id:"92853-\u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898"},"9.28.5.3 \u8de8\u8282\u70b9\u5206\u9875\u3001\u6392\u5e8f\u3001\u51fd\u6570\u95ee\u9898"),Object(c.b)("p",null,"\u8de8\u8282\u70b9\u591a\u5e93\u8fdb\u884c\u67e5\u8be2\u65f6\uff0c\u4f1a\u51fa\u73b0 Limit \u5206\u9875\u3001Order by \u6392\u5e8f\u7b49\u95ee\u9898\u3002\u5206\u9875\u9700\u8981\u6309\u7167\u6307\u5b9a\u5b57\u6bb5\u8fdb\u884c\u6392\u5e8f\uff0c\u5f53\u6392\u5e8f\u5b57\u6bb5\u5c31\u662f\u5206\u7247\u5b57\u6bb5\u65f6\uff0c\u901a\u8fc7\u5206\u7247\u89c4\u5219\u5c31\u6bd4\u8f83\u5bb9\u6613\u5b9a\u4f4d\u5230\u6307\u5b9a\u7684\u5206\u7247\uff1b"),Object(c.b)("p",null,"\u5f53\u6392\u5e8f\u5b57\u6bb5\u975e\u5206\u7247\u5b57\u6bb5\u65f6\uff0c\u5c31\u53d8\u5f97\u6bd4\u8f83\u590d\u6742\u4e86\u3002\u9700\u8981\u5148\u5728\u4e0d\u540c\u7684\u5206\u7247\u8282\u70b9\u4e2d\u5c06\u6570\u636e\u8fdb\u884c\u6392\u5e8f\u5e76\u8fd4\u56de\uff0c\u7136\u540e\u5c06\u4e0d\u540c\u5206\u7247\u8fd4\u56de\u7684\u7ed3\u679c\u96c6\u8fdb\u884c\u6c47\u603b\u548c\u518d\u6b21\u6392\u5e8f\uff0c\u6700\u7ec8\u8fd4\u56de\u7ed9\u7528\u6237\u3002"),Object(c.b)("h3",{id:"92854-\u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898"},"9.28.5.4 \u5168\u5c40\u4e3b\u952e\u907f\u91cd\u95ee\u9898"),Object(c.b)("p",null,"\u5982\u679c\u90fd\u7528\u4e3b\u952e\u81ea\u589e\u80af\u5b9a\u4e0d\u5408\u7406\uff0c\u5982\u679c\u7528 UUID \u90a3\u4e48\u65e0\u6cd5\u505a\u5230\u6839\u636e\u4e3b\u952e\u6392\u5e8f\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u8003\u8651\u901a\u8fc7",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.cnblogs.com/qdhxhz/p/11372658.html"}),"\u96ea\u82b1 ID")," \u6765\u4f5c\u4e3a\u6570\u636e\u5e93\u7684\u4e3b\u952e\uff0c"),Object(c.b)("h3",{id:"92855-\u6570\u636e\u8fc1\u79fb\u95ee\u9898"},"9.28.5.5 \u6570\u636e\u8fc1\u79fb\u95ee\u9898"),Object(c.b)("p",null,"\u91c7\u7528\u53cc\u5199\u7684\u65b9\u5f0f\uff0c\u4fee\u6539\u4ee3\u7801\uff0c\u6240\u6709\u6d89\u53ca\u5230\u5206\u5e93\u5206\u8868\u7684\u8868\u7684\u589e\u3001\u5220\u3001\u6539\u7684\u4ee3\u7801\uff0c\u90fd\u8981\u5bf9\u65b0\u5e93\u8fdb\u884c\u589e\u5220\u6539\u3002\u540c\u65f6\uff0c\u518d\u6709\u4e00\u4e2a\u6570\u636e\u62bd\u53d6\u670d\u52a1\uff0c\u4e0d\u65ad\u5730\u4ece\u8001\u5e93\u62bd\u6570\u636e\uff0c\u5f80\u65b0\u5e93\u5199\uff0c"),Object(c.b)("p",null,"\u8fb9\u5199\u8fb9\u6309\u65f6\u95f4\u6bd4\u8f83\u6570\u636e\u662f\u4e0d\u662f\u6700\u65b0\u7684\u3002"),Object(c.b)("h2",{id:"9286-\u5982\u4f55\u5b9e\u73b0"},"9.28.6 \u5982\u4f55\u5b9e\u73b0"),Object(c.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7531\u4e8e\u5206\u8868\u5206\u5e93\u4e0d\u4ec5\u4ec5\u9700\u8981\u5185\u7f6e\u4ee3\u7801\u7684\u652f\u6301\uff0c\u540c\u65f6\u8fd8\u9700\u8981\u96c6\u6210\u6570\u636e\u5e93\u4e2d\u95f4\u4ef6\uff0c\u8fd9\u91cc\u63a8\u8350 ",Object(c.b)("inlineCode",{parentName:"p"},"MyCat")," \u4e2d\u95f4\u4ef6\u3002",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"http://www.mycat.org.cn/"}),"MyCat \u5b98\u65b9\u7f51\u7ad9")))),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u63d0\u4f9b\u4e86\u8f7b\u91cf\u7ea7\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"\u5206\u8868\u5206\u5e93")," \u652f\u6301\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93"))),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'// \u76f4\u63a5\u6539\u53d8\u6570\u636e\u5e93\nrepository.ChangeDatabase("\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32");\n\n// \u901a\u8fc7\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5207\u6362\nrepository.Change();\n')),Object(c.b)("p",null,"\u5982\u9700\u8de8\u5e93\u67e5\u8be2\uff0c\u9700\u7528\u5230\u6570\u636e\u5e93\u6280\u672f\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"SqlServer")," \u94fe\u63a5\u670d\u52a1\u5668\u6216\u540c\u4e49\u8bcd\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u8868"))),Object(c.b)("p",null,"\u7b2c\u4e00\u6b65\u3001\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u7279\u6027",Object(c.b)("inlineCode",{parentName:"p"},"[AppDbContext( Mode=DbContextMode.Dynamic)]")),Object(c.b)("p",null,"\u7b2c\u4e8c\u6b65\u3001\u9700\u8981\u52a8\u6001\u4fee\u6539\u8868\u540d\u7684\u5b9e\u4f53\u7ee7\u627f ",Object(c.b)("inlineCode",{parentName:"p"},"IEntityMutableTable")," \u63a5\u53e3\uff0c\u5e76\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"GetTableName()")," \u8fd4\u56de\u8868\u540d\u65b9\u6cd5"),Object(c.b)("p",null,"\u6700\u540e\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"BuildChange")," \u5207\u6362\u5373\u53ef\u3002"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var rep = repository.BuildChange();\n")),Object(c.b)("p",null,"\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"BuildChange")," \u65b9\u6cd5\u4e4b\u540e\u4f1a\u81ea\u52a8\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"GetTableName()")," \u65b9\u6cd5\u3002"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"DynamicModelCacheKeyFactory")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/modeling/dynamic-model"}),"EF Core - \u591a\u4e2a\u6a21\u578b\u4e4b\u95f4\u4ea4\u66ff")," \u7ae0\u8282\u3002"))),Object(c.b)("h2",{id:"9287-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.28.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}O.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/0ddd808e.9d6ca268.js b/docs/0ddd808e.13142fb9.js similarity index 99% rename from docs/0ddd808e.9d6ca268.js rename to docs/0ddd808e.13142fb9.js index aaad1c85b33..a1f50afcd16 100644 --- a/docs/0ddd808e.9d6ca268.js +++ b/docs/0ddd808e.13142fb9.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{190:function(e,n,t){"use strict";t.d(n,"b",(function(){return b})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(191);function b(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:b=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return b?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=b();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return m})),t.d(n,"b",(function(){return O}));var a=t(0),i=t.n(a);function b(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var p=i.a.createContext({}),o=function(e){var n=i.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},m=function(e){var n=o(e.components);return i.a.createElement(p.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,b=e.originalType,r=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=o(t),d=a,O=m["".concat(r,".").concat(d)]||m[d]||s[d]||b;return t?i.a.createElement(O,c(c({ref:n},p),{},{components:t})):i.a.createElement(O,c({ref:n},p))}));function O(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var b=t.length,r=new Array(b);r[0]=d;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,r[1]=c;for(var p=2;pn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&N(e)}const C=e=>{N(e),null!=s&&j(s,e)},v=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(r.a)("tabs",{"tabs--block":t},d)},m.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":u===e,className:Object(r.a)("tabs__item",l.a.tabItem,{"tabs__item--active":u===e}),key:e,ref:e=>v.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case o:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case p:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(v,e.target,e)},onFocus:()=>C(e),onClick:()=>{C(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===u)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==u}))))}},200:function(e,n,t){"use strict";var a=t(3),i=t(0),b=t.n(i);n.a=function({children:e,hidden:n,className:t}){return b.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}},76:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return m})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return O}));var a=t(3),i=t(7),b=(t(0),t(192)),r=t(190),c=t(199),l=t(200),p=t(193),o={id:"dynamic-api-controller",title:"5. \u52a8\u6001 WebAPI",sidebar_label:"5. \u52a8\u6001 WebAPI"},m={unversionedId:"dynamic-api-controller",id:"dynamic-api-controller",isDocsHomePage:!1,title:"5. \u52a8\u6001 WebAPI",description:"\u52a8\u6001WebAPI \u5b9e\u9645\u4e0a\u5c31\u662f\u5c06\u666e\u901a\u7684\u7c7b\u53d8\u4e3a Controller\uff0c\u4e5f\u5c31\u662f \u52a8\u6001WebAPI \u5c31\u662f\u63a7\u5236\u5668\uff0c\u652f\u6301\u63a7\u5236\u5668\u4e00\u5207\u529f\u80fd\u3002",source:"@site/docs\\dynamic-api-controller.mdx",slug:"/dynamic-api-controller",permalink:"/docs/dynamic-api-controller",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dynamic-api-controller.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"5. \u52a8\u6001 WebAPI",sidebar:"docs",previous:{title:"4.2 \u9009\u9879",permalink:"/docs/options"},next:{title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",permalink:"/docs/specification-document"}},s=[{value:"5.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668",id:"51-\u4ec0\u4e48\u662f\u63a7\u5236\u5668",children:[]},{value:"5.2 Mvc \u63a7\u5236\u5668 \u7ea6\u5b9a\u548c\u7f3a\u70b9",id:"52-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9",children:[{value:"5.2.1 WebAPI \u7ea6\u5b9a",id:"521-webapi-\u7ea6\u5b9a",children:[]},{value:"5.2.2 .NET Core WebAPI \u7f3a\u70b9",id:"522-net-core-webapi-\u7f3a\u70b9",children:[]}]},{value:"5.3 \u52a8\u6001 WebAPI \u63a7\u5236\u5668",id:"53-\u52a8\u6001-webapi-\u63a7\u5236\u5668",children:[]},{value:"5.4 \u6ce8\u518c\u52a8\u6001 WebAPI \u670d\u52a1",id:"54-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1",children:[]},{value:"5.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50",id:"55-\u7b2c\u4e00\u4e2a\u4f8b\u5b50",children:[]},{value:"5.6 \u52a8\u6001 WebAPI \u539f\u7406\u89e3\u6790",id:"56-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790",children:[{value:"5.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",id:"561-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",children:[]},{value:"5.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",id:"562-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",children:[]}]},{value:"5.7 \u52a8\u6001 WebAPI \u914d\u7f6e\u7ea6\u5b9a",id:"57-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a",children:[{value:"5.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",id:"571-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",id:"572-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",id:"573-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",id:"574-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.5 \u5176\u4ed6\u7ea6\u5b9a",id:"575-\u5176\u4ed6\u7ea6\u5b9a",children:[]}]},{value:"5.8 \u66f4\u591a\u4f8b\u5b50",id:"58-\u66f4\u591a\u4f8b\u5b50",children:[{value:"5.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",id:"581-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",children:[]},{value:"5.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",id:"582-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",id:"583-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.4 GET/HEAD \u7c7b\u7c7b\u578b\u53c2\u6570",id:"584-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570",children:[]},{value:"5.8.5 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",id:"585-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",children:[]},{value:"5.8.6 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",id:"586-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",children:[]},{value:"5.8.7 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd",id:"587-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd",children:[]},{value:"5.8.8 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",id:"588-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",children:[]},{value:"5.8.9 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",id:"589-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",children:[]},{value:"5.8.10 \u652f\u6301\u7248\u672c\u63a7\u5236",id:"5810-\u652f\u6301\u7248\u672c\u63a7\u5236",children:[]},{value:"5.8.11 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",id:"5811-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.12 \u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d",id:"5812-\u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d",children:[]},{value:"5.8.13 \u65b9\u6cd5\u53c2\u6570 [FromQuery] \u5316",id:"5813-\u65b9\u6cd5\u53c2\u6570-fromquery-\u5316",children:[]},{value:"5.8.14 \u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e",id:"5814-\u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e",children:[]},{value:"5.8.15 \u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210 [HttpMethod] \u89c4\u5219",id:"5815-\u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210-httpmethod-\u89c4\u5219",children:[]}]},{value:"5.9 [ApiDescriptionSettings]",id:"59-apidescriptionsettings",children:[{value:"5.9.1 \u5185\u7f6e\u914d\u7f6e",id:"591-\u5185\u7f6e\u914d\u7f6e",children:[]},{value:"5.9.2 Name \u914d\u7f6e",id:"592-name-\u914d\u7f6e",children:[]},{value:"5.9.3 KeepName \u914d\u7f6e",id:"593-keepname-\u914d\u7f6e",children:[]},{value:"5.9.4 SplitCamelCase \u914d\u7f6e",id:"594-splitcamelcase-\u914d\u7f6e",children:[]},{value:"5.9.5 KeepVerb \u914d\u7f6e",id:"595-keepverb-\u914d\u7f6e",children:[]},{value:"5.9.6 Enabled \u914d\u7f6e",id:"596-enabled-\u914d\u7f6e",children:[]},{value:"5.9.7 Module \u914d\u7f6e",id:"597-module-\u914d\u7f6e",children:[]},{value:"5.9.8 Version \u914d\u7f6e",id:"598-version-\u914d\u7f6e",children:[]},{value:"5.9.9 Groups \u914d\u7f6e",id:"599-groups-\u914d\u7f6e",children:[]},{value:"5.9.10 Tag \u914d\u7f6e",id:"5910-tag-\u914d\u7f6e",children:[]}]},{value:"5.10 DynamicApiControllerSettings \u914d\u7f6e",id:"510-dynamicapicontrollersettings-\u914d\u7f6e",children:[{value:"5.10.1 \u652f\u6301 Mvc \u63a7\u5236\u5668 \u52a8\u6001\u914d\u7f6e",id:"5101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e",children:[]}]},{value:"5.11 \u5173\u4e8e AOP \u62e6\u622a",id:"511-\u5173\u4e8e-aop-\u62e6\u622a",children:[]},{value:"5.12 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"512-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:s};function O(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(b.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(b.b)(p.a,{mdxType:"JoinGroup"}),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"\u52a8\u6001WebAPI")," \u5b9e\u9645\u4e0a\u5c31\u662f\u5c06\u666e\u901a\u7684\u7c7b\u53d8\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"Controller"),"\uff0c\u4e5f\u5c31\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"\u52a8\u6001WebAPI")," \u5c31\u662f\u63a7\u5236\u5668\uff0c\u652f\u6301\u63a7\u5236\u5668\u4e00\u5207\u529f\u80fd\u3002"))),Object(b.b)("h2",{id:"51-\u4ec0\u4e48\u662f\u63a7\u5236\u5668"},"5.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668"),Object(b.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u63a7\u5236\u5668\u662f\u4e00\u4e2a\u627f\u4e0a\u542f\u4e0b\u7684\u4f5c\u7528\uff0c\u6839\u636e\u7528\u6237\u8f93\u5165\uff0c\u6267\u884c\u54cd\u5e94\u884c\u4e3a\uff08\u52a8\u4f5c\u65b9\u6cd5\uff09\uff0c\u540c\u65f6\u5728\u884c\u4e3a\u4e2d\u8c03\u7528\u6a21\u578b\u7684\u4e1a\u52a1\u903b\u8f91\uff0c\u8fd4\u56de\u7ed9\u7528\u6237\u7ed3\u679c\uff08\u89c6\u56fe\uff09\u3002"),Object(b.b)("img",{src:Object(r.a)("img/kzq.png")}),Object(b.b)("p",null),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u63a7\u5236\u5668\u6709\u4e24\u79cd\u8868\u73b0\u5f62\u5f0f\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Mvc"),"\uff08\u5e26\u89c6\u56fe\uff09"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"WebAPI"),"\uff08RESTful API\uff09")),Object(b.b)(c.a,{defaultValue:"mvc",values:[{label:"Mvc \u63a7\u5236\u5668",value:"mvc"},{label:"WebAPI \u63a7\u5236\u5668",value:"webapi"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"mvc",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7}","{1,5,7}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n public class MvcController : Controller\n {\n public IActionResult Index()\n {\n return View();\n }\n }\n}\n"))),Object(b.b)(l.a,{value:"webapi",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,6,8,9}","{1,5,6,8,9}":!0}),'using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class WebApiController : ControllerBase\n {\n [HttpGet]\n public IActionResult Get()\n {\n return Content(nameof(Furion));\n }\n }\n}\n')))),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Mvc")," \u63a7\u5236\u5668\u548c ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u6700\u5927\u7684\u533a\u522b\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u4e0d\u5e26 ",Object(b.b)("strong",{parentName:"p"},"\u89c6\u56fe")," \u548c\u901a\u8fc7 ",Object(b.b)("strong",{parentName:"p"},"\u8bf7\u6c42\u8c13\u8bcd\u548c\u8def\u7531\u5730\u5740\u54cd\u5e94\u884c\u4e3a"),"\u3002"),Object(b.b)("h2",{id:"52-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9"},"5.2 ",Object(b.b)("inlineCode",{parentName:"h2"},"Mvc \u63a7\u5236\u5668")," \u7ea6\u5b9a\u548c\u7f3a\u70b9"),Object(b.b)("p",null,"\u5728\u5b66\u4e60\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u4e4b\u524d\uff0c\u9996\u5148\u4e86\u89e3 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u7684\u4e00\u4e9b\u7ea6\u5b9a\u548c\u6ce8\u610f\u4e8b\u9879\u3002"),Object(b.b)("h3",{id:"521-webapi-\u7ea6\u5b9a"},"5.2.1 ",Object(b.b)("inlineCode",{parentName:"h3"},"WebAPI")," \u7ea6\u5b9a"),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u4e2d\uff0c\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u9700\u9075\u5faa\u4ee5\u4e0b\u7ea6\u5b9a\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u7c7b",Object(b.b)("strong",{parentName:"li"},"\u5fc5\u987b\u7ee7\u627f ",Object(b.b)("inlineCode",{parentName:"strong"},"ControllerBase")," \u6216\u95f4\u63a5\u7ee7\u627f")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5",Object(b.b)("strong",{parentName:"li"},"\u5fc5\u987b\u8d34\u6709 ",Object(b.b)("inlineCode",{parentName:"strong"},"[HttpMethod]")," \u7279\u6027\uff0c\u5982\uff1a",Object(b.b)("inlineCode",{parentName:"strong"},"[HttpGet]"))),Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",Object(b.b)("strong",{parentName:"li"},"\u81f3\u5c11\u6709\u4e00\u4e2a\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"strong"},"[Route]")," \u7279\u6027")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"li"},"WebAPI")," \u8def\u7531\u5730\u5740\u65f6\u4f1a\u81ea\u52a8\u53bb\u6389\u63a7\u5236\u5668\u540d\u79f0 ",Object(b.b)("inlineCode",{parentName:"li"},"Controller")," \u540e\u7f00\uff0c\u540c\u65f6\u4e5f\u4f1a\u53bb\u6389\u52a8\u4f5c\u65b9\u6cd5\u5339\u914d\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"HttpVerb")," \u8c13\u8bcd\uff0c\u5982 ",Object(b.b)("inlineCode",{parentName:"li"},"GET\uff0cPOST\uff0cDELETE\uff0cPUT")," \u7b49"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u4e0d\u652f\u6301\u8fd4\u56de\u975e ",Object(b.b)("inlineCode",{parentName:"strong"},"IEnumerable")," \u6cdb\u578b\u5bf9\u8c61")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u4e0d\u652f\u6301\u7c7b\u7c7b\u578b\u53c2\u6570\u5728 ",Object(b.b)("inlineCode",{parentName:"strong"},"GET\uff0cHEAD")," \u8bf7\u6c42\u4e0b\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"strong"},"Query")," \u53c2\u6570"))),Object(b.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0\u7ea6\u5b9a\u5916\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u8def\u7531\u5730\u5740",Object(b.b)("strong",{parentName:"p"},"\u57fa\u672c\u9760\u624b\u5de5\u5b8c\u6210"),"\uff0c\u4e0d\u5229\u4e8e\u4e66\u5199\uff0c\u4e0d\u5229\u4e8e\u7ef4\u62a4\uff0c\u518d\u8005\uff0c\u5728\u79fb\u52a8\u5e94\u7528\u5bf9\u63a5\u4e2d\u96be\u4ee5\u8fdb\u884c\u591a\u7248\u672c\u63a7\u5236\u3002"),Object(b.b)("h3",{id:"522-net-core-webapi-\u7f3a\u70b9"},"5.2.2 ",Object(b.b)("inlineCode",{parentName:"h3"},".NET Core WebAPI")," \u7f3a\u70b9"),Object(b.b)("p",null,"\u901a\u8fc7\u4e0a\u4e00\u7ae0\u8282\u53ef\u4ee5\u770b\u51fa\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u5b9e\u73b0 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u9700\u8981\u9075\u5faa\u79cd\u79cd\u7ea6\u5b9a\uff0c\u800c\u4e14\u5bb9\u6613\u51fa\u9519\u3002"),Object(b.b)("p",null,"\u9664\u4e86\u8fd9\u4e9b\u7ea6\u5b9a\uff0c",Object(b.b)("inlineCode",{parentName:"p"},".NET Core WebAPI")," \u6709\u4ee5\u4e0b\u7f3a\u70b9\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u8def\u7531\u5730\u5740\u57fa\u672c\u9760\u624b\u5de5\u5b8c\u6210"),Object(b.b)("li",{parentName:"ul"},"\u5728\u73b0\u5728\u79fb\u52a8\u4e3a\u738b\u7684\u65f6\u4ee3\uff0c\u4e0d\u5229\u4e8e\u8fdb\u884c\u591a\u7248\u672c\u63a7\u5236"),Object(b.b)("li",{parentName:"ul"},"\u5bf9\u63a5 ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u6587\u6863\u5206\u7ec4\u6bd4\u8f83\u590d\u6742"),Object(b.b)("li",{parentName:"ul"},"\u5b9e\u73b0 ",Object(b.b)("inlineCode",{parentName:"li"},"Policy")," \u7b56\u7565\u6388\u6743\u4e5f\u6bd4\u8f83\u590d\u6742"),Object(b.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u63a7\u5236\u5668\u70ed\u62d4\u63d2\u63d2\u4ef6\u5316"),Object(b.b)("li",{parentName:"ul"},"\u96be\u4ee5\u5b9e\u73b0\u590d\u6742\u81ea\u5b9a\u4e49\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"RESTful API")," \u98ce\u683c")),Object(b.b)("h2",{id:"53-\u52a8\u6001-webapi-\u63a7\u5236\u5668"},"5.3 \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u63a7\u5236\u5668"),Object(b.b)("p",null,"\u9488\u5bf9\u4ee5\u4e0a ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63d0\u4f9b\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u5fc5\u987b\u9075\u5faa\u7684\u7ea6\u5b9a\u548c\u4e0d\u53ef\u907f\u514d\u7684\u7f3a\u70b9\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u521b\u9020\u51fa\u4e00\u79cd\u66f4\u52a0\u7075\u6d3b\u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u7684\u65b9\u5f0f\u3002"),Object(b.b)("p",null,"\u8fd9\u4e2a\u65b9\u5f0f\u5728\u7ee7\u627f\u4e86 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core WebAPI")," \u6240\u6709\u4f18\u70b9\uff0c\u540c\u65f6\u8fdb\u884c\u4e86\u5927\u91cf\u62d3\u5c55\u548c\u4f18\u5316\u3002\u4f18\u5316\u540e\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u5177\u5907\u539f\u6709\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u6240\u6709\u529f\u80fd"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301",Object(b.b)("strong",{parentName:"li"},"\u4efb\u610f\u516c\u5f00 \u975e\u9759\u6001 \u975e\u62bd\u8c61 \u975e\u6cdb\u578b\u7c7b"),"\u8f6c\u63a7\u5236\u5668"),Object(b.b)("li",{parentName:"ul"},"\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u65b9\u4fbf\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"IDynamicApiController")," \u7a7a\u63a5\u53e3\u6216 ",Object(b.b)("inlineCode",{parentName:"li"},"[DynamicApiController]")," \u7279\u6027\u66ff\u4ee3 ",Object(b.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u62bd\u8c61\u7c7b"),Object(b.b)("li",{parentName:"ul"},"\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpMethod]")," \u7279\u6027\uff0c\u540c\u65f6\u652f\u6301\u4e00\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u591a\u4e2a ",Object(b.b)("inlineCode",{parentName:"li"},"HttpVerb")),Object(b.b)("li",{parentName:"ul"},"\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"li"},"[Route]")," \u7279\u6027\uff0c\u652f\u6301\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u53ca\u81ea\u52a8\u8def\u7531\u751f\u6210"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301\u8fd4\u56de\u6cdb\u578b\u63a5\u53e3\uff0c\u6cdb\u578b\u7c7b"),Object(b.b)("li",{parentName:"ul"},"\u548c ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u6df1\u5ea6\u7ed3\u5408\uff0c\u63d0\u4f9b\u6781\u5176\u65b9\u4fbf\u7684\u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u5206\u7ec4\u914d\u7f6e"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"li"},"Basic Auth\uff0cJwt\uff0cApiKey")," \u7b49\u591a\u79cd\u6743\u9650\u7075\u6d3b\u914d\u7f6e"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301\u63a7\u5236\u5668\u3001\u52a8\u4f5c\u65b9\u6cd5",Object(b.b)("strong",{parentName:"li"},"\u7248\u672c\u63a7\u5236"),"\u529f\u80fd"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"li"},"GET\u3001HEAD")," \u8bf7\u6c42\u81ea\u52a8\u8f6c\u6362 ",Object(b.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570")),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"li"},"OAS3")," \u63a5\u53e3\u89c4\u8303")),Object(b.b)("h2",{id:"54-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1"},"5.4 \u6ce8\u518c\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u670d\u52a1"),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u9ed8\u8ba4\u5df2\u7ecf\u96c6\u6210\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002\u4e5f\u5c31\u662f\u4e0b\u5217\u4ee3\u7801\u53ef\u4e0d\u914d\u7f6e\u3002"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddDynamicApiControllers();\n }\n }\n}\n")),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u5fc5\u987b\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u540e\u6ce8\u518c\u3002"))),Object(b.b)("h2",{id:"55-\u7b2c\u4e00\u4e2a\u4f8b\u5b50"},"5.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50"),Object(b.b)("p",null,"\u521b\u5efa\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"FurAppService")," \u7c7b\u7ee7\u627f ",Object(b.b)("inlineCode",{parentName:"p"},"IDynamicApiController")," \u63a5\u53e3 \u6216 \u8d34 ",Object(b.b)("inlineCode",{parentName:"p"},"[DynamicApiController]")," \u7279\u6027\uff0c\u5e76\u5728\u8fd9\u4e2a\u7c7b\u4e2d\u7f16\u5199\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"Get")," \u65b9\u6cd5\u3002"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},Object(b.b)("inlineCode",{parentName:"strong"},"IDynamicApiController")," \u65b9\u5f0f"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7}","{1,5,7}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return $"Hello {nameof(Furion)}";\n }\n }\n}\n')),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},Object(b.b)("inlineCode",{parentName:"strong"},"[DynamicApiController]")," \u65b9\u5f0f"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,8}","{1,5,8}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [DynamicApiController]\n public class FurAppService\n {\n public string Get()\n {\n return $"Hello {nameof(Furion)}";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u5c31\u8fd9\u4e48\u751f\u6210\u4e86\u3002"),Object(b.b)("img",{src:Object(r.a)("img/dyglz.gif")}),Object(b.b)("h2",{id:"56-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790"},"5.6 \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u539f\u7406\u89e3\u6790"),Object(b.b)("h3",{id:"561-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668"},"5.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",Object(b.b)("inlineCode",{parentName:"p"},"DynamicApiControllerFeatureProvider")," \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668\uff0c\u8be5\u63d0\u4f9b\u5668\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"p"},"ControllerFeatureProvider")," \u7c7b\u3002"),Object(b.b)("p",null,"\u63a5\u7740\u91cd\u5199 ",Object(b.b)("inlineCode",{parentName:"p"},"bool IsController(TypeInfo typeInfo)")," \u65b9\u6cd5\uff0c\u7528\u6765\u6807\u8bc6\u63a7\u5236\u5668\u7c7b\u578b\u3002\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c",Object(b.b)("strong",{parentName:"p"},"\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"strong"},"ControllerBase")," \u7c7b\u6216 ",Object(b.b)("inlineCode",{parentName:"strong"},"IDynamicApiController")," \u63a5\u53e3\u6216 ",Object(b.b)("inlineCode",{parentName:"strong"},"[DynamicApiController]")," \u7279\u6027\u90fd\u4f1a\u88ab\u6807\u8bb0\u4e3a\u63a7\u5236\u5668\u7c7b\u578b\u3002")),Object(b.b)("h3",{id:"562-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668"},"5.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u540c\u65f6\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",Object(b.b)("inlineCode",{parentName:"p"},"DynamicApiControllerApplicationModelConvention")," \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668\uff0c\u8be5\u8f6c\u6362\u5668\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"p"},"IApplicationModelConvention")," \u63a5\u53e3\u3002"),Object(b.b)("p",null,"\u63a5\u7740\u5b9e\u73b0 ",Object(b.b)("inlineCode",{parentName:"p"},"void Apply(ApplicationModel application)")," \u63a5\u53e3\u65b9\u6cd5\u3002\u5728\u8be5\u65b9\u6cd5\u4e2d\u914d\u7f6e\u63a7\u5236\u5668\u540d\u79f0\u3001\u8def\u7531\u3001\u5bfc\u51fa\u53ef\u89c1\u6027\u53ca\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3001\u8def\u7531\u3001\u5bfc\u51fa\u53ef\u89c1\u6027\u7b49\u3002"),Object(b.b)("p",null,"\u5b9e\u9645\u4e0a\u8be5\u65b9\u6cd5\u505a\u7684\u5c31\u662f\u6309\u7167 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"strong"},{href:"#521-webapi-%E7%BA%A6%E5%AE%9A"}),"WebAPI \u7ea6\u5b9a"))," \u63d0\u524d\u5e2e\u6211\u4eec\u914d\u7f6e\u597d\u8def\u7531\u3001\u8bf7\u6c42\u8c13\u8bcd\u7b49\u4fe1\u606f\u3002\u907f\u514d\u4e86\u624b\u52a8\u914d\u7f6e\u7684\u540c\u65f6\u8fd8\u589e\u52a0\u4e86\u8bb8\u591a\u65b0\u7279\u6027\uff0c\u5982",Object(b.b)("strong",{parentName:"p"},"\u7248\u672c\u63a7\u5236\u3002")),Object(b.b)("h2",{id:"57-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a"},"5.7 \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u914d\u7f6e\u7ea6\u5b9a"),Object(b.b)("h3",{id:"571-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u63a7\u5236\u5668\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"AppServices\uff0cAppService\uff0cApiController\uff0cController\uff0cServices\uff0cService")," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002\u89c1\u7b2c\u4e00\u4e2a\u4f8b\u5b50\u4e2d\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"FurAppService -> Furion")," ",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u540d\u79f0\u5e26 ",Object(b.b)("inlineCode",{parentName:"li"},"V[0-9_]")," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u63a7\u5236\u5668\u7248\u672c\u53f7\uff0c\u5982 ",Object(b.b)("inlineCode",{parentName:"li"},"FurAppServiceV2 -> Furion@2"),"\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"FurAppServiceV1_1_0 -> Furion@1.1.0"),"\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u540d\u79f0\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"\u9a86\u9a7c\u547d\u540d\uff08CamelCase\uff09")," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",Object(b.b)("inlineCode",{parentName:"li"},"-")," \u8fde\u63a5\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h3",{id:"572-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit\uff0cGetAll/GetList/Get/Find/Fetch/Query/Search\uff0cPut/Update\uff0cDelete/Remove/Clear\uff0cPatch")," \u5f00\u5934\u7684\u5b57\u7b26\u4e32\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Async")," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u5e26 ",Object(b.b)("inlineCode",{parentName:"li"},"V[0-9_]")," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c\u53f7\uff0c\u5982 ",Object(b.b)("inlineCode",{parentName:"li"},"ChangePasswordV2 -> ChangePassword@2"),"\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"ChangePasswordV1_1_0 -> ChangePassword@1.1.0"),"\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"\u9a86\u9a7c\u547d\u540d\uff08CamelCase\uff09")," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",Object(b.b)("inlineCode",{parentName:"li"},"-")," \u8fde\u63a5\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u53c2\u6570\u5c06\u81ea\u52a8\u8f6c\u4e3a\u5c0f\u5199\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h3",{id:"573-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"GetAll/GetList/Get/Find/Fetch/Query")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpGet]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Put/Update")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPut]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Delete/Remove/Clear")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpDelete]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Patch")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPatch]")," \u7279\u6027"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")))),Object(b.b)("li",{parentName:"ul"},"\u5982\u679c\u4e0d\u5728\u4e0a\u9762\u7ea6\u5b9a\u4e2d\uff0c\u5219\u9ed8\u8ba4\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h3",{id:"574-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"api")," \u5f00\u5934\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u8f6c\u6362\u4e3a\u5c0f\u5199\u8def\u7531\u5730\u5740\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u63a7\u5236\u5668\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"api/\u524d\u7f6e\u53c2\u6570\u5217\u8868/\u6a21\u5757\u540d\u6216\u9ed8\u8ba4\u533a\u57df\u540d/[controller@\u7248\u672c\u53f7]/\u540e\u7f6e\u53c2\u6570\u5217\u8868")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"\u524d\u7f6e\u53c2\u6570\u5217\u8868/\u6a21\u5757\u540d/[action@\u7248\u672c\u53f7]/\u540e\u7f6e\u53c2\u6570\u5217\u8868"))),Object(b.b)("h3",{id:"575-\u5176\u4ed6\u7ea6\u5b9a"},"5.7.5 \u5176\u4ed6\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4e0d\u5904\u7406 ",Object(b.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u63a7\u5236\u5668\u7c7b\u578b\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4e0d\u5904\u7406 ",Object(b.b)("inlineCode",{parentName:"li"},"GET\uff0cHEAD")," \u8bf7\u6c42\u7684\u5f15\u7528\u7c7b\u578b\u53c2\u6570\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h2",{id:"58-\u66f4\u591a\u4f8b\u5b50"},"5.8 \u66f4\u591a\u4f8b\u5b50"),Object(b.b)("h3",{id:"581-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5"},"5.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17,22,27}","{7,12,17,22,27}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return $"GET \u8bf7\u6c42";\n }\n\n public string Post()\n {\n return $"POST \u8bf7\u6c42";\n }\n\n public string Delete()\n {\n return $"DELETE \u8bf7\u6c42";\n }\n\n public string Put()\n {\n return $"PUT \u8bf7\u6c42";\n }\n\n public string Patch()\n {\n return $"PATCH \u8bf7\u6c42";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dgqqwc.png")}),Object(b.b)("h3",{id:"582-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5"},"5.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17}","{7,12,17}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string GetVersion()\n {\n return $"v1.0.0";\n }\n\n public string ChangeProfile()\n {\n return "\u4fee\u6539\u6210\u529f";\n }\n\n public string DeleteUser()\n {\n return "\u5220\u9664\u6210\u529f";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dzmc.png")}),Object(b.b)("h3",{id:"583-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5"},"5.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17}","{7,12,17}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string GetUser(int id)\n {\n return $"{id}";\n }\n\n public string GetUser(int id, string name)\n {\n return $"{id} {name}";\n }\n\n public TestDto Add(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dcsff.gif")}),Object(b.b)("h3",{id:"584-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570"},"5.8.4 ",Object(b.b)("inlineCode",{parentName:"h3"},"GET/HEAD")," \u7c7b\u7c7b\u578b\u53c2\u6570"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4f1a\u5c06 ",Object(b.b)("inlineCode",{parentName:"p"},"GET/HEAD")," \u8bf7\u6c42\u4e2d\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b\u53c2\u6570")," \u8bbe\u7f6e\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"[FromBody]")," \u7ed1\u5b9a\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public TestDto GetTest(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/getyycs.png")}),Object(b.b)("p",null,"\u4f46\u662f\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"GET\u3001HEAD")," \u8bf7\u6c42\u4e0d\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"p"},"From Body")," \u7ed1\u5b9a\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8f6c\u6362\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"Query")," \u67e5\u8be2\u53c2\u6570\u3002"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u652f\u6301\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff1a"),Object(b.b)(c.a,{defaultValue:"fromquery",values:[{label:"[FromQuery] \u7279\u6027",value:"fromquery"},{label:"\u914d\u7f6e DynamicApiControllerSettings",value:"DynamicApiControllerSettings"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"fromquery",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),"using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public TestDto GetTest([FromQuery] TestDto testDto)\n {\n return testDto;\n }\n }\n}\n"))),Object(b.b)(l.a,{value:"DynamicApiControllerSettings",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "DynamicApiControllerSettings": {\n "ModelToQuery": true\n }\n}\n')))),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/modeltoquery.png")}),Object(b.b)("h3",{id:"585-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e"},"5.8.5 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u7684\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e\u7684\u7279\u6027 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiSeat]"),"\uff0c\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiSeat]")," \u53ef\u914d\u7f6e\u53c2\u6570\u4f4d\u7f6e\uff0c\u652f\u6301\u4ee5\u4e0b\u56db\u79cd\u4f4d\u7f6e\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ControllerStart"),"\uff1a\u63a7\u5236\u5668\u4e4b\u524d"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ControllerEnd"),"\uff1a\u63a7\u5236\u5668\u4e4b\u540e"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ActionStart"),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u524d"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ActionEnd"),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u540e\u3002",Object(b.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8-9,15-20}","{8-9,15-20}":!0}),'using Furion.DynamicApiController;\nusing System;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n // \u53c2\u6570\u9ed8\u8ba4\u4e3a ApiSeats.ActionEnd\n public string RouteSeat(int id, string name)\n {\n return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\n }\n\n public string RouteSeat(\n [ApiSeat(ApiSeats.ControllerStart)] int id, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u524d\n [ApiSeat(ApiSeats.ControllerEnd)] string name, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\n [ApiSeat(ApiSeats.ControllerEnd)] int age, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\n [ApiSeat(ApiSeats.ActionStart)] decimal weight, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\n [ApiSeat(ApiSeats.ActionStart)] float height, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\n [ApiSeat(ApiSeats.ActionEnd)] DateTime birthday) // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u540e\uff08\u9ed8\u8ba4\u503c\uff09\n {\n return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/cswz.png")}),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u591a\u4e2a ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"\u540c\u4f4d\u7f6e"))," \u914d\u7f6e\u7684\u53c2\u6570\u5c06\u6309\u7167 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"\u5b9a\u4e49\u53c2\u6570\u987a\u5e8f"))," \u8fdb\u884c\u6392\u5e8f\u3002"))),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"[ApiSeat]")," \u53ea\u80fd\u5e94\u7528\u4e8e\u8d34\u4e86 ",Object(b.b)("inlineCode",{parentName:"p"},"[FromRoute]")," \u7279\u6027\u7684\u53c2\u6570\u6216 ",Object(b.b)("inlineCode",{parentName:"p"},"\u57fa\u5143\u7c7b\u578b\u3001\u503c\u7c7b\u578b\u3001\u53ef\u7a7a\u57fa\u5143\u7c7b\u578b\u548c\u53ef\u7a7a\u503c\u7c7b\u578b"),"\u3002"))),Object(b.b)("h3",{id:"586-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd"},"5.8.6 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [HttpPost]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/zdywc.png")}),Object(b.b)("h3",{id:"587-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd"},"5.8.7 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [HttpPost, HttpGet, AcceptVerbs("PUT", "DELETE")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dgwc.png")}),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u5982\u679c\u52a8\u4f5c\u65b9\u6cd5\u4e2d\u542b\u6709 ",Object(b.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b\u53c2\u6570"),"\uff0c\u4e14\u542b\u6709 ",Object(b.b)("inlineCode",{parentName:"p"},"POST/PUT/DELETE")," \u4efb\u610f\u8bf7\u6c42\u8c13\u8bcd\uff0c\u90a3\u4e48\u8be5\u53c2\u6570\u4f1a\u81ea\u52a8\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"[FromBody]")," \u53c2\u6570\uff0c\u5373\u4f7f\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"GET/HEAD")," \u8bf7\u6c42\u4e2d\u4e0d\u652f\u6301\u3002"))),Object(b.b)("h3",{id:"588-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531"},"5.8.8 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531"),Object(b.b)("p",null,"\u652f\u6301\u63a7\u5236\u5668\u548c\u52a8\u4f5c\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\uff1a"),Object(b.b)(c.a,{defaultValue:"kzqrl",values:[{label:"\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u8def\u7531",value:"kzqrl"},{label:"\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5\u8def\u7531",value:"dzffrl"},{label:"\u540c\u65f6\u81ea\u5b9a\u4e49\u8def\u7531",value:"allrl"},{label:"\u8c13\u8bcd\u81ea\u5b9a\u4e49\u8def\u7531",value:"vcrl"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"kzqrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6}","{2,6}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("customapi/mobile/[controller]")]\n public class FurAppService : IDynamicApiController\n {\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/kzqrl.png")})),Object(b.b)(l.a,{value:"dzffrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [Route("customapi/[action]")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dzffrl.png")})),Object(b.b)(l.a,{value:"allrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6,9}","{2,6,9}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("customapi/mobile/[controller]")]\n public class FurAppService : IDynamicApiController\n {\n [Route("get/[action]")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/allrl.png")})),Object(b.b)(l.a,{value:"vcrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9}","{9}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("api/[controller]")]\n public class FurAppService : IDynamicApiController\n {\n [HttpGet("get/[action]")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/wcrl.png")}))),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5c0f\u63d0\u793a")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u52a8\u6001\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u4ee5 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"/"))," \u5f00\u5934\uff0c\u5219\u4e0d\u4f1a\u5408\u5e76\u63a7\u5236\u5668\u8def\u7531\u3002"))),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u914d\u7f6e")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u9700\u8981\u7528\u5230 ",Object(b.b)("strong",{parentName:"p"},"\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0"),"\uff0c\u63a8\u8350\u4f7f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"[controller]")," \u6216 ",Object(b.b)("inlineCode",{parentName:"p"},"[action]")," \u5360\u4f4d\u7b26\uff0c\u56e0\u4e3a\u8be5\u5360\u4f4d\u7b26\u5df2\u7ecf\u81ea\u52a8\u5904\u7406\u4e86 ",Object(b.b)("strong",{parentName:"p"},"\u524d\u540e\u7f00\u3001\u7248\u672c\u53f7\u3001\u6a21\u5757\u540d\u79f0"),"\u7b49\u3002"))),Object(b.b)("h3",{id:"589-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408"},"5.8.9 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u5404\u79cd\u8def\u7531\u7ec4\u5408\u65b9\u5f0f\uff0c\u652f\u6301\u4e00\u5bf9\u591a\uff0c\u591a\u5bf9\u591a\u8def\u7531\u7ec4\u5408\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6-8,11-14}","{6-8,11-14}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("api/[controller]")]\n [Route("api/[controller]/second")]\n [Route("api/[controller]/three")]\n public class FurAppService : IDynamicApiController\n {\n [HttpGet]\n [HttpGet("get/[action]")]\n [HttpPost]\n [HttpPost("post/cus-version")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dlrzh.gif")}),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u52a8\u4f5c\u65b9\u6cd5\u4e0d\u80fd\u540c\u65f6\u8d34 ",Object(b.b)("inlineCode",{parentName:"p"},"[Route]")," \u548c ",Object(b.b)("inlineCode",{parentName:"p"},"[HttpMethod]")," \u7279\u6027\uff0c\u53ea\u80fd\u4e8c\u53d6\u4e00\u3002"))),Object(b.b)("h3",{id:"5810-\u652f\u6301\u7248\u672c\u63a7\u5236"},"5.8.10 \u652f\u6301\u7248\u672c\u63a7\u5236"),Object(b.b)(c.a,{defaultValue:"kzqbb",values:[{label:"\u63a7\u5236\u5668\u7248\u672c",value:"kzqbb"},{label:"\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c",value:"dzffbb"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"kzqbb",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,13,21}","{5,13,21}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppServiceV1 : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n\n public class FurAppServiceV1_2 : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n\n public class FurAppServiceV1_2_1 : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/kzqbb.png")})),Object(b.b)(l.a,{value:"dzffbb",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,16}","{7,12,16}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public string GetV1()\n {\n return nameof(Furion);\n }\n public string GetV2_1()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dzffbb.png")}))),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7248\u672c\u751f\u6210\u539f\u7406")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"V[0-9_]"))," \u7ed3\u5c3e\u7684\u547d\u540d\u81ea\u52a8\u89e3\u6790\u6210\u7248\u672c\u53f7\uff0c\u5982 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"FurAppServiceV2 -> Furion@2")),"\u3002"))),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u7248\u672c\u590d\u5199")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u9664\u4e86\u901a\u8fc7\u7279\u5b9a\u540e\u7f00\u65b9\u5f0f\u4ee5\u5916\uff0c\u7248\u672c\u8fd8\u76f4\u63a5\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings]")," \u8fdb\u884c\u590d\u5199\u3002\u5982\uff1a"),Object(b.b)("pre",{parentName:"div"},Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,2}","{1,2}":!0}),'[ApiDescriptionSettings(Version = "4.0")]\npublic string GetV1()\n{\n return nameof(Furion);\n}\n')),Object(b.b)("p",{parentName:"div"},"\u8fd9\u65f6\uff0c\u751f\u6210\u7248\u672c\u5c06\u91c7\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"4.0")," \u66ff\u4ee3 ",Object(b.b)("inlineCode",{parentName:"p"},"1")))),Object(b.b)("h3",{id:"5811-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5"},"5.8.11 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5"),Object(b.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u65e0\u9700\u5bfc\u51fa\u67d0\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u6216\u63a7\u5236\u5668\uff08",Object(b.b)("strong",{parentName:"p"},"\u4e0d\u663e\u793a\u5230 Swagger"),"\uff09\uff0c\u53ea\u9700\u8981\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(false)]")," \u6216 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiExplorerSettings(IgnoreApi = true)]"),"\u5373\u53ef\u3002"),Object(b.b)("p",null,"\u53e6\u5916\u52a8\u4f5c\u65b9\u6cd5\u8fd8\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"p"},"[NonAction]")," \u6807\u8bb0\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u63a7\u5236\u5668\u6216 Action\u3002"),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u4f7f\u7528")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u63a8\u8350\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u8bbe\u7f6e\u4e0d\u5bfc\u51fa\u4f7f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(false)]")," \u7279\u6027\u3002\u8be5\u7279\u6027\u9ed8\u8ba4\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"p"},"ApiExplorerSettingsAttribute")," \u7c7b\u3002"))),Object(b.b)("h3",{id:"5812-\u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d"},"5.8.12 \u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u52a8\u6001 API \u4f1a\u5c06\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u540d\u8f93\u51fa\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"RESTFul")," \u98ce\u683c\u7684\u8def\u7531\uff0c\u5982\u9700\u4fdd\u7559\u539f\u6709\u8bbe\u8ba1\uff0c\u53ea\u9700\u914d\u7f6e\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "DynamicApiControllerSettings": {\n "KeepName": true,\n "LowercaseRoute": false\n }\n}\n')),Object(b.b)("h3",{id:"5813-\u65b9\u6cd5\u53c2\u6570-fromquery-\u5316"},"5.8.13 \u65b9\u6cd5\u53c2\u6570 ",Object(b.b)("inlineCode",{parentName:"h3"},"[FromQuery]")," \u5316"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u7684\u57fa\u5143\u7c7b\u578b\u53c2\u6570\u90fd\u4f1a\u8d34\u4e0a ",Object(b.b)("inlineCode",{parentName:"p"},"[FromRoute]")," \u7279\u6027\uff0c\u5982\u679c\u9700\u8981\u5c06\u53c2\u6570\u8c03\u6574\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"[FromQuery]")," \u4fee\u9970\uff0c\u53ea\u9700\u8981\u5728\u65b9\u6cd5\u4e0a\u9762\u8d34 ",Object(b.b)("inlineCode",{parentName:"p"},"[QueryParameters]")," \u7279\u6027\u5373\u53ef\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[QueryParameters]\npublic string Get(int id, string name)\n{\n return nameof($"{id} {name}");\n}\n')),Object(b.b)("p",null,"\u751f\u6210\u7684\u8def\u7531\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"https://xxx.com?id=1&name=Furion")),Object(b.b)("h3",{id:"5814-\u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e"},"5.8.14 \u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u591a\u79cd\u53c2\u6570\u7279\u6027\u914d\u7f6e\u53c2\u6570\u7ed1\u5b9a\u89c4\u5219\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromRoute]"),"\uff1a\u901a\u8fc7\u8def\u7531\u53c2\u6570\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromQuery]"),"\uff1a\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"li"},"Url")," \u5730\u5740\u53c2\u6570\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromBody]"),"\uff1a\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"li"},"Request Body")," \u53c2\u6570\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromForm]"),"\uff1a\u901a\u8fc7\u8868\u5355\u63d0\u4ea4\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromHeader]"),"\uff1a\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"li"},"Request Header")," \u53c2\u6570\u7ed1\u5b9a\u503c")),Object(b.b)("h3",{id:"5815-\u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210-httpmethod-\u89c4\u5219"},"5.8.15 \u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"h3"},"[HttpMethod]")," \u89c4\u5219"),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5728\u6ca1\u6709\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"[HttpMethod]")," \u7279\u6027\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u81ea\u52a8\u6839\u636e\u65b9\u6cd5\u540d\u7b2c\u4e00\u4e2a\u53c2\u6570\u8fdb\u884c\u5206\u6790\uff0c\u5e76\u751f\u6210\u5bf9\u5e94\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"[HttpMethod]")," \u7279\u6027\uff0c\u89c4\u5219\u5982\u4e0b\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"GetAll/GetList/Get/Find/Fetch/Query")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpGet]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Put/Update")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPut]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Delete/Remove/Clear")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpDelete]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Patch")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPatch]")," \u7279\u6027"),Object(b.b)("li",{parentName:"ul"},"\u5df2 ",Object(b.b)("inlineCode",{parentName:"li"},"Head")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpHead]")," \u7279\u6027"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")))),Object(b.b)("li",{parentName:"ul"},"\u5982\u679c\u4e0d\u5728\u4e0a\u9762\u7ea6\u5b9a\u4e2d\uff0c\u5219\u9ed8\u8ba4\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u4f46\u662f\uff0c\u6709\u4e9b\u65f6\u5019\u8fd9\u4e0d\u662f\u6211\u4eec\u60f3\u8981\u7684\u89c4\u5219"),"\uff0c\u8fd9\u65f6\u6211\u4eec\u53ea\u9700\u8981\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2,3}","{2,3}":!0}),'{\n "DynamicApiControllerSettings": {\n "VerbToHttpMethods": [\n ["getall", "HEAD"], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\n ["other", "PUT"] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\n ]\n }\n}\n')),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u4e8c\u7ef4\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20",Object(b.b)("strong",{parentName:"p"},"\u5fc5\u987b\u662f\u5168\u5c0f\u5199"),"\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20",Object(b.b)("strong",{parentName:"p"},"\u5fc5\u987b\u662f\u5168\u5927\u5199\u5927\u5199"),"\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u53d6\u503c\u6709\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"HEAD, GET, PUT, POST, PATCH, DELETE")))),Object(b.b)("h2",{id:"59-apidescriptionsettings"},"5.9 ",Object(b.b)("inlineCode",{parentName:"h2"},"[ApiDescriptionSettings]")),Object(b.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63d0\u4f9b\u7684\u914d\u7f6e\u5916\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u5f3a\u5927\u4e14\u7075\u6d3b\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings]")," \u7279\u6027\u3002"),Object(b.b)("h3",{id:"591-\u5185\u7f6e\u914d\u7f6e"},"5.9.1 \u5185\u7f6e\u914d\u7f6e"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Name"),"\uff1a\u81ea\u5b9a\u4e49\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u5426\u4fdd\u6301\u539f\u6709\u540d\u79f0\u4e0d\u5904\u7406\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"SplitCamelCase"),"\uff1a\u5207\u5272\u9a86\u9a7c\u547d\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"true")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u65b9\u6cd5\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Enabled"),"\uff1a\u662f\u5426\u5bfc\u51fa\u63a5\u53e3\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"true")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Module"),"\uff1a\u6a21\u5757\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Version"),"\uff1a\u7248\u672c\u53f7\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Groups"),"\uff1a\u63a5\u53e3\u5206\u7ec4\uff0c\u53ef\u7ed3\u5408 ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u4e00\u8d77\u4f7f\u7528\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Tags"),"\uff1a\u63a5\u53e3\u6807\u7b7e\uff0c\u53ef\u7ed3\u5408 ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u4e00\u8d77\u4f7f\u7528\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u914d\u7f6e\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u6392\u5e8f")),Object(b.b)("h3",{id:"592-name-\u914d\u7f6e"},"5.9.2 ",Object(b.b)("inlineCode",{parentName:"h3"},"Name")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Name")," \u53c2\u6570\u53ef\u4ee5\u8986\u76d6\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u81ea\u52a8\u751f\u6210\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Name = "MyFur")]\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(Name = "MyGet")]\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/namepz.png")}),Object(b.b)("h3",{id:"593-keepname-\u914d\u7f6e"},"5.9.3 ",Object(b.b)("inlineCode",{parentName:"h3"},"KeepName")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"KeepName")," \u53c2\u6570\u53ef\u4ee5\u4fdd\u7559\u539f\u6709\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(KeepName = true)]\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(KeepName = true)]\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/keepnamepz.png")}),Object(b.b)("h3",{id:"594-splitcamelcase-\u914d\u7f6e"},"5.9.4 ",Object(b.b)("inlineCode",{parentName:"h3"},"SplitCamelCase")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"SplitCamelCase")," \u53c2\u6570\u9ed8\u8ba4\u5c06\u9a86\u9a7c\u547d\u540d\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd\u5e76\u901a\u8fc7\u6307\u5b9a ",Object(b.b)("inlineCode",{parentName:"p"},"\u5360\u4f4d\u7b26")," \u8fde\u63a5\u8d77\u6765\u3002\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"p"},"\u5360\u4f4d\u7b26")," \u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"-"),"\u3002\u9ed8\u8ba4\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"true"),"\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(SplitCamelCase = false)]\n public class MyFurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(SplitCamelCase = true)]\n public string ChangeUserName()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/splitnamepz.png")}),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"KeepName")," \u4f18\u5148\u7ea7\u9ad8\u4e8e ",Object(b.b)("inlineCode",{parentName:"p"},"SplitCamelCase"),"\uff0c\u4e5f\u5c31\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"KeepName")," \u8bbe\u7f6e\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"true"),"\uff0c\u5219\u4e0d\u4f1a\u5904\u7406 ",Object(b.b)("inlineCode",{parentName:"p"},"SplitCamelCase")," \u53c2\u6570\u3002"))),Object(b.b)("h3",{id:"595-keepverb-\u914d\u7f6e"},"5.9.5 ",Object(b.b)("inlineCode",{parentName:"h3"},"KeepVerb")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"KeepVerb")," \u53c2\u6570\u4f5c\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u6807\u8bc6\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(KeepVerb = true)]\n public string GetVersion()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/keepverbpz.png")}),Object(b.b)("h3",{id:"596-enabled-\u914d\u7f6e"},"5.9.6 ",Object(b.b)("inlineCode",{parentName:"h3"},"Enabled")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Enabled")," \u53c2\u6570\u914d\u7f6e\u63a5\u53e3\u662f\u5426\u5bfc\u51fa\u3002\u901a\u5e38\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u5982\u679c\u7528\u4e8e\u63a7\u5236\u5668\u5b9e\u9645\u4f5c\u7528\u4e0d\u5927\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12}","{12}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string GetVersion()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings(false)]\n public string NoExport()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/enablepz.png")}),Object(b.b)("h3",{id:"597-module-\u914d\u7f6e"},"5.9.7 ",Object(b.b)("inlineCode",{parentName:"h3"},"Module")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Module")," \u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u8def\u7531\u5206\u79bb\uff0c\u7c7b\u4f3c\u4e8e ",Object(b.b)("inlineCode",{parentName:"p"},"Mvc \u533a\u57df")," \u7684\u4f5c\u7528\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Module = "mobile")]\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(Module = "user")]\n public string GetVersion()\n {\n return nameof(Furion);\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/modulepz.png")}),Object(b.b)("h3",{id:"598-version-\u914d\u7f6e"},"5.9.8 ",Object(b.b)("inlineCode",{parentName:"h3"},"Version")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Version")," \u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u63a5\u53e3\u7248\u672c\uff0c\u540c\u65f6\u53c8\u53ef\u4ee5\u590d\u5199\u7279\u6b8a\u7248\u672c\u547d\u540d\u914d\u7f6e\u3002\u9ed8\u8ba4\u7248\u672c\u53f7\u5206\u9694\u7b26\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"@"),"\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,9-10}","{5,9-10}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Version = "1.0")]\n public class FurAppService : IDynamicApiController\n {\n // V2.0.0 \u88ab\u590d\u5199\u6210 V2.1.1\n [ApiDescriptionSettings(Version = "2.1.1")]\n public string GetVersionV2_0_0()\n {\n return nameof(Furion);\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/versionpz.png")}),Object(b.b)("h3",{id:"599-groups-\u914d\u7f6e"},"5.9.9 ",Object(b.b)("inlineCode",{parentName:"h3"},"Groups")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Groups")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"Swagger")," \u5206\u7ec4\u4fe1\u606f\u3002"),Object(b.b)("p",null,"\u901a\u8fc7\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"Groups")," \u53c2\u6570\u53ef\u4ee5\u5c06",Object(b.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u5668\u548c\u52a8\u4f5c\u65b9\u6cd5")," \u8fdb\u884c\u5f52\u7c7b\u548c\u591a\u4e2a\u5206\u7ec4\u76f4\u63a5\u5171\u4eab\u3002\u53ef\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(params Groups)]")," \u6784\u9020\u51fd\u6570\u4f20\u5165\u6216\u6307\u5b9a ",Object(b.b)("inlineCode",{parentName:"p"},"Groups")," \u53c2\u6570\u914d\u7f6e\u63a5\u53e3\u662f\u5426\u5bfc\u51fa\u3002\u901a\u5e38\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u5982\u679c\u7528\u4e8e\u63a7\u5236\u5668\u5b9e\u9645\u4f5c\u7528\u4e0d\u5927\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,13}","{5,13}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings("Default", "Common")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings("Custom")]\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dfz.gif")}),Object(b.b)("h3",{id:"5910-tag-\u914d\u7f6e"},"5.9.10 ",Object(b.b)("inlineCode",{parentName:"h3"},"Tag")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Tag")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"Swagger")," \u6807\u7b7e\u5206\u7ec4\u4fe1\u606f\u53ca\u5408\u5e76\u6807\u7b7e\u3002\u4e5f\u5c31\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"\u7ec4\u4e2d\u7ec4"),":"),Object(b.b)(c.a,{defaultValue:"tag1",values:[{label:"\u6807\u7b7e\u547d\u540d",value:"tag1"},{label:"\u5408\u5e76\u6807\u7b7e",value:"tag2"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"tag1",mdxType:"TabItem"},Object(b.b)("h4",{id:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"},"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n")),Object(b.b)("h4",{id:"\u8d34\u6807\u7b7e\u4e4b\u540e"},"\u8d34\u6807\u7b7e\u4e4b\u540e"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e00")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e8c")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/tag1.png")})),Object(b.b)(l.a,{value:"tag2",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/tag2.png")}))),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u5982\u679c ",Object(b.b)("inlineCode",{parentName:"p"},"Tag")," \u540d\u5b57\u4e00\u6837\uff0c\u5219\u4f1a\u81ea\u52a8\u5408\u5e76\uff0c\u5426\u5219\u53ea\u662f\u547d\u540d\u3002"))),Object(b.b)("h2",{id:"510-dynamicapicontrollersettings-\u914d\u7f6e"},"5.10 ",Object(b.b)("inlineCode",{parentName:"h2"},"DynamicApiControllerSettings")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u8fd8\u63d0\u4f9b\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u4e00\u4e9b\u5168\u5c40\u914d\u7f6e\u9009\u9879\uff0c\u5982\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultRoutePrefix"),"\uff1a\u9ed8\u8ba4\u8def\u7531\u524d\u7f00\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"api")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultHttpMethod"),"\uff1a\u9ed8\u8ba4\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"POST")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultModule"),"\uff1a\u9ed8\u8ba4\u6a21\u5757\u540d\u79f0\uff08\u533a\u57df\uff09\uff0c\u53ef\u7528\u4f5c\u63a5\u53e3\u7248\u672c\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"v1")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"LowercaseRoute"),"\uff1a\u5c0f\u5199\u8def\u7531\u683c\u5f0f\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"true")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u5426\u4fdd\u7559\u9ed8\u8ba4\u540d\u79f0\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"fasle")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"CamelCaseSeparator"),"\uff1a\u9a86\u9a7c\u547d\u540d\u5206\u9694\u7b26\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"-")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"VersionSeparator"),"\uff1a\u7248\u672c\u5206\u9694\u7b26\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"@")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ModelToQuery"),"\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"GET/HEAD")," \u8bf7\u6c42\u5c06 ",Object(b.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570\u8f6c\u67e5\u8be2\u53c2\u6570"),"\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"SupportedMvcController"),"\uff1a\u662f\u5426\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"li"},"Mvc Controller")," \u52a8\u6001\u914d\u7f6e\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AbandonControllerAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u63a7\u5236\u5668\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AppServices")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AppService")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiController")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Controller")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Services")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Service")))),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AbandonActionAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Async")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"VerbToHttpMethods"),"\uff1a\u590d\u5199\u9ed8\u8ba4\u65b9\u6cd5\u540d\u8f6c ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpMethod]")," \u89c4\u5219\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[][]")," \u4e8c\u7ef4\u6570\u7ec4\u7c7b\u578b\uff0c\u5185\u7f6e\u5339\u914d\u89c4\u5219\u4e3a\uff1a",Object(b.b)("pre",{parentName:"li"},Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'["post"] = "POST",\n["add"] = "POST",\n["create"] = "POST",\n["insert"] = "POST",\n["submit"] = "POST",\n["get"] = "GET",\n["find"] = "GET",\n["fetch"] = "GET",\n["query"] = "GET",\n["getlist"] = "GET",\n["getall"] = "GET",\n["put"] = "PUT",\n["update"] = "PUT",\n["delete"] = "DELETE",\n["remove"] = "DELETE",\n["clear"] = "DELETE",\n["patch"] = "PATCH"\n')),Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},"\u590d\u5199\u793a\u4f8b")),Object(b.b)("pre",{parentName:"li"},Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"DynamicApiControllerSettings": {\n "VerbToHttpMethods": [\n [ "getall", "HEAD" ], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\n [ "other", "PUT" ] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\n ]\n }\n')))))),Object(b.b)("h3",{id:"5101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e"},"5.10.1 \u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"h3"},"Mvc \u63a7\u5236\u5668")," \u52a8\u6001\u914d\u7f6e"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u4e0d\u5bf9 ",Object(b.b)("inlineCode",{parentName:"p"},"ControllerBase")," \u7c7b\u578b\u8fdb\u884c\u4efb\u4f55\u5904\u7406\u3002\u5f53\u7136\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u624b\u52a8\u542f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"ControllerBase")," \u652f\u6301\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "DynamicApiControllerSettings": {\n "SupportedMvcController": true\n }\n}\n')),Object(b.b)("p",null,"\u8bbe\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"SupportedMvcController: true")," \u540e\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Mvc ControllerBase")," \u7c7b\u578b\u4e5f\u80fd\u548c\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u4e00\u6837\u7684\u7075\u6d3b\u4e86\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n public class MvcController : ControllerBase\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n\n")),Object(b.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u6ce8\u610f\u4e8b\u9879")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u542f\u7528\u8be5\u914d\u7f6e\u540e\uff0c\u5982\u679c ",Object(b.b)("inlineCode",{parentName:"p"},"Mvc \u63a7\u5236\u5668")," \u6ca1\u6709\u4efb\u4f55 ",Object(b.b)("inlineCode",{parentName:"p"},"[Route]")," \u7279\u6027\uff0c\u4f46\u662f\u8d34\u4e86 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u7279\u6027\u5c06\u4f1a\u62a5\u9519\u3002\u539f\u56e0\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u7279\u6027\u5185\u90e8\u505a\u4e86\u8def\u7531\u7279\u6027\u68c0\u6d4b\u3002\u6240\u4ee5\u5efa\u8bae\u4f7f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDataValidation]")," \u4ee3\u66ff\u3002"),Object(b.b)("p",{parentName:"div"},"\u67e5\u770b ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/dotnet/aspnetcore/blob/c565386a3ed135560bc2e9017aa54a950b4e35dd/src/Mvc/Mvc.Core/src/ApplicationModels/ApiBehaviorApplicationModelProvider.cs#L90"}),"ASP.NET Core - ApiBehaviorApplicationModelProvider \u6e90\u7801")))),Object(b.b)("h2",{id:"511-\u5173\u4e8e-aop-\u62e6\u622a"},"5.11 \u5173\u4e8e AOP \u62e6\u622a"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"\u52a8\u6001WebAPI")," \u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"p"},"Controller")," \u7684\u6240\u6709\u8fc7\u6ee4\u5668/\u7b5b\u9009\u5668\u62e6\u622a\uff0c\u4e5f\u5c31\u662f\u53ef\u4ee5\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"ActionFilter"),"\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"ResultFilter")," \u8fdb\u884c\u62e6\u622a\u64cd\u4f5c\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3}","{1,3}":!0}),"public class SampleAsyncActionFilter : IAsyncActionFilter\n{\n public async Task OnActionExecutionAsync(ActionExecutingContext context,ActionExecutionDelegate next)\n {\n // \u62e6\u622a\u4e4b\u524d\n\n var resultContext = await next();\n\n // \u62e6\u622a\u4e4b\u540e\n\n // \u5f02\u5e38\u62e6\u622a\n if(resultContext.Exception != null)\n {\n\n }\n }\n}\n")),Object(b.b)("p",null,"\u8be6\u7ec6\u7528\u6cd5\u53ef\u53c2\u89c1 ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/mvc/controllers/filters?view=aspnetcore-5.0"}),"ASP.NET Core 5.0 - \u7b5b\u9009\u5668")),Object(b.b)("h2",{id:"512-\u53cd\u9988\u4e0e\u5efa\u8bae"},"5.12 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}O.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{194:function(e,n,t){"use strict";t.d(n,"b",(function(){return b})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(195);function b(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:b=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return b?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=b();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return m})),t.d(n,"b",(function(){return O}));var a=t(0),i=t.n(a);function b(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var p=i.a.createContext({}),o=function(e){var n=i.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},m=function(e){var n=o(e.components);return i.a.createElement(p.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,b=e.originalType,r=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),m=o(t),d=a,O=m["".concat(r,".").concat(d)]||m[d]||s[d]||b;return t?i.a.createElement(O,c(c({ref:n},p),{},{components:t})):i.a.createElement(O,c({ref:n},p))}));function O(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var b=t.length,r=new Array(b);r[0]=d;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,r[1]=c;for(var p=2;pn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&N(e)}const C=e=>{N(e),null!=s&&j(s,e)},v=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(r.a)("tabs",{"tabs--block":t},d)},m.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":u===e,className:Object(r.a)("tabs__item",l.a.tabItem,{"tabs__item--active":u===e}),key:e,ref:e=>v.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case o:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case p:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(v,e.target,e)},onFocus:()=>C(e),onClick:()=>{C(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===u)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==u}))))}},204:function(e,n,t){"use strict";var a=t(3),i=t(0),b=t.n(i);n.a=function({children:e,hidden:n,className:t}){return b.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}},76:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return m})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return O}));var a=t(3),i=t(7),b=(t(0),t(196)),r=t(194),c=t(203),l=t(204),p=t(197),o={id:"dynamic-api-controller",title:"5. \u52a8\u6001 WebAPI",sidebar_label:"5. \u52a8\u6001 WebAPI"},m={unversionedId:"dynamic-api-controller",id:"dynamic-api-controller",isDocsHomePage:!1,title:"5. \u52a8\u6001 WebAPI",description:"\u52a8\u6001WebAPI \u5b9e\u9645\u4e0a\u5c31\u662f\u5c06\u666e\u901a\u7684\u7c7b\u53d8\u4e3a Controller\uff0c\u4e5f\u5c31\u662f \u52a8\u6001WebAPI \u5c31\u662f\u63a7\u5236\u5668\uff0c\u652f\u6301\u63a7\u5236\u5668\u4e00\u5207\u529f\u80fd\u3002",source:"@site/docs\\dynamic-api-controller.mdx",slug:"/dynamic-api-controller",permalink:"/docs/dynamic-api-controller",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dynamic-api-controller.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"5. \u52a8\u6001 WebAPI",sidebar:"docs",previous:{title:"4.2 \u9009\u9879",permalink:"/docs/options"},next:{title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",permalink:"/docs/specification-document"}},s=[{value:"5.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668",id:"51-\u4ec0\u4e48\u662f\u63a7\u5236\u5668",children:[]},{value:"5.2 Mvc \u63a7\u5236\u5668 \u7ea6\u5b9a\u548c\u7f3a\u70b9",id:"52-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9",children:[{value:"5.2.1 WebAPI \u7ea6\u5b9a",id:"521-webapi-\u7ea6\u5b9a",children:[]},{value:"5.2.2 .NET Core WebAPI \u7f3a\u70b9",id:"522-net-core-webapi-\u7f3a\u70b9",children:[]}]},{value:"5.3 \u52a8\u6001 WebAPI \u63a7\u5236\u5668",id:"53-\u52a8\u6001-webapi-\u63a7\u5236\u5668",children:[]},{value:"5.4 \u6ce8\u518c\u52a8\u6001 WebAPI \u670d\u52a1",id:"54-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1",children:[]},{value:"5.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50",id:"55-\u7b2c\u4e00\u4e2a\u4f8b\u5b50",children:[]},{value:"5.6 \u52a8\u6001 WebAPI \u539f\u7406\u89e3\u6790",id:"56-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790",children:[{value:"5.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",id:"561-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668",children:[]},{value:"5.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",id:"562-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668",children:[]}]},{value:"5.7 \u52a8\u6001 WebAPI \u914d\u7f6e\u7ea6\u5b9a",id:"57-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a",children:[{value:"5.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",id:"571-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",id:"572-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",id:"573-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",id:"574-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a",children:[]},{value:"5.7.5 \u5176\u4ed6\u7ea6\u5b9a",id:"575-\u5176\u4ed6\u7ea6\u5b9a",children:[]}]},{value:"5.8 \u66f4\u591a\u4f8b\u5b50",id:"58-\u66f4\u591a\u4f8b\u5b50",children:[{value:"5.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",id:"581-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5",children:[]},{value:"5.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",id:"582-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",id:"583-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.4 GET/HEAD \u7c7b\u7c7b\u578b\u53c2\u6570",id:"584-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570",children:[]},{value:"5.8.5 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",id:"585-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e",children:[]},{value:"5.8.6 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",id:"586-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd",children:[]},{value:"5.8.7 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd",id:"587-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd",children:[]},{value:"5.8.8 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",id:"588-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531",children:[]},{value:"5.8.9 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",id:"589-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408",children:[]},{value:"5.8.10 \u652f\u6301\u7248\u672c\u63a7\u5236",id:"5810-\u652f\u6301\u7248\u672c\u63a7\u5236",children:[]},{value:"5.8.11 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",id:"5811-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",children:[]},{value:"5.8.12 \u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d",id:"5812-\u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d",children:[]},{value:"5.8.13 \u65b9\u6cd5\u53c2\u6570 [FromQuery] \u5316",id:"5813-\u65b9\u6cd5\u53c2\u6570-fromquery-\u5316",children:[]},{value:"5.8.14 \u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e",id:"5814-\u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e",children:[]},{value:"5.8.15 \u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210 [HttpMethod] \u89c4\u5219",id:"5815-\u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210-httpmethod-\u89c4\u5219",children:[]}]},{value:"5.9 [ApiDescriptionSettings]",id:"59-apidescriptionsettings",children:[{value:"5.9.1 \u5185\u7f6e\u914d\u7f6e",id:"591-\u5185\u7f6e\u914d\u7f6e",children:[]},{value:"5.9.2 Name \u914d\u7f6e",id:"592-name-\u914d\u7f6e",children:[]},{value:"5.9.3 KeepName \u914d\u7f6e",id:"593-keepname-\u914d\u7f6e",children:[]},{value:"5.9.4 SplitCamelCase \u914d\u7f6e",id:"594-splitcamelcase-\u914d\u7f6e",children:[]},{value:"5.9.5 KeepVerb \u914d\u7f6e",id:"595-keepverb-\u914d\u7f6e",children:[]},{value:"5.9.6 Enabled \u914d\u7f6e",id:"596-enabled-\u914d\u7f6e",children:[]},{value:"5.9.7 Module \u914d\u7f6e",id:"597-module-\u914d\u7f6e",children:[]},{value:"5.9.8 Version \u914d\u7f6e",id:"598-version-\u914d\u7f6e",children:[]},{value:"5.9.9 Groups \u914d\u7f6e",id:"599-groups-\u914d\u7f6e",children:[]},{value:"5.9.10 Tag \u914d\u7f6e",id:"5910-tag-\u914d\u7f6e",children:[]}]},{value:"5.10 DynamicApiControllerSettings \u914d\u7f6e",id:"510-dynamicapicontrollersettings-\u914d\u7f6e",children:[{value:"5.10.1 \u652f\u6301 Mvc \u63a7\u5236\u5668 \u52a8\u6001\u914d\u7f6e",id:"5101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e",children:[]}]},{value:"5.11 \u5173\u4e8e AOP \u62e6\u622a",id:"511-\u5173\u4e8e-aop-\u62e6\u622a",children:[]},{value:"5.12 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"512-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:s};function O(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(b.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(b.b)(p.a,{mdxType:"JoinGroup"}),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"\u52a8\u6001WebAPI")," \u5b9e\u9645\u4e0a\u5c31\u662f\u5c06\u666e\u901a\u7684\u7c7b\u53d8\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"Controller"),"\uff0c\u4e5f\u5c31\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"\u52a8\u6001WebAPI")," \u5c31\u662f\u63a7\u5236\u5668\uff0c\u652f\u6301\u63a7\u5236\u5668\u4e00\u5207\u529f\u80fd\u3002"))),Object(b.b)("h2",{id:"51-\u4ec0\u4e48\u662f\u63a7\u5236\u5668"},"5.1 \u4ec0\u4e48\u662f\u63a7\u5236\u5668"),Object(b.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u63a7\u5236\u5668\u662f\u4e00\u4e2a\u627f\u4e0a\u542f\u4e0b\u7684\u4f5c\u7528\uff0c\u6839\u636e\u7528\u6237\u8f93\u5165\uff0c\u6267\u884c\u54cd\u5e94\u884c\u4e3a\uff08\u52a8\u4f5c\u65b9\u6cd5\uff09\uff0c\u540c\u65f6\u5728\u884c\u4e3a\u4e2d\u8c03\u7528\u6a21\u578b\u7684\u4e1a\u52a1\u903b\u8f91\uff0c\u8fd4\u56de\u7ed9\u7528\u6237\u7ed3\u679c\uff08\u89c6\u56fe\uff09\u3002"),Object(b.b)("img",{src:Object(r.a)("img/kzq.png")}),Object(b.b)("p",null),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u63a7\u5236\u5668\u6709\u4e24\u79cd\u8868\u73b0\u5f62\u5f0f\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Mvc"),"\uff08\u5e26\u89c6\u56fe\uff09"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"WebAPI"),"\uff08RESTful API\uff09")),Object(b.b)(c.a,{defaultValue:"mvc",values:[{label:"Mvc \u63a7\u5236\u5668",value:"mvc"},{label:"WebAPI \u63a7\u5236\u5668",value:"webapi"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"mvc",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7}","{1,5,7}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n public class MvcController : Controller\n {\n public IActionResult Index()\n {\n return View();\n }\n }\n}\n"))),Object(b.b)(l.a,{value:"webapi",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,6,8,9}","{1,5,6,8,9}":!0}),'using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class WebApiController : ControllerBase\n {\n [HttpGet]\n public IActionResult Get()\n {\n return Content(nameof(Furion));\n }\n }\n}\n')))),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Mvc")," \u63a7\u5236\u5668\u548c ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u6700\u5927\u7684\u533a\u522b\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u4e0d\u5e26 ",Object(b.b)("strong",{parentName:"p"},"\u89c6\u56fe")," \u548c\u901a\u8fc7 ",Object(b.b)("strong",{parentName:"p"},"\u8bf7\u6c42\u8c13\u8bcd\u548c\u8def\u7531\u5730\u5740\u54cd\u5e94\u884c\u4e3a"),"\u3002"),Object(b.b)("h2",{id:"52-mvc-\u63a7\u5236\u5668-\u7ea6\u5b9a\u548c\u7f3a\u70b9"},"5.2 ",Object(b.b)("inlineCode",{parentName:"h2"},"Mvc \u63a7\u5236\u5668")," \u7ea6\u5b9a\u548c\u7f3a\u70b9"),Object(b.b)("p",null,"\u5728\u5b66\u4e60\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u4e4b\u524d\uff0c\u9996\u5148\u4e86\u89e3 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u7684\u4e00\u4e9b\u7ea6\u5b9a\u548c\u6ce8\u610f\u4e8b\u9879\u3002"),Object(b.b)("h3",{id:"521-webapi-\u7ea6\u5b9a"},"5.2.1 ",Object(b.b)("inlineCode",{parentName:"h3"},"WebAPI")," \u7ea6\u5b9a"),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u4e2d\uff0c\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u9700\u9075\u5faa\u4ee5\u4e0b\u7ea6\u5b9a\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u7c7b",Object(b.b)("strong",{parentName:"li"},"\u5fc5\u987b\u7ee7\u627f ",Object(b.b)("inlineCode",{parentName:"strong"},"ControllerBase")," \u6216\u95f4\u63a5\u7ee7\u627f")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5",Object(b.b)("strong",{parentName:"li"},"\u5fc5\u987b\u8d34\u6709 ",Object(b.b)("inlineCode",{parentName:"strong"},"[HttpMethod]")," \u7279\u6027\uff0c\u5982\uff1a",Object(b.b)("inlineCode",{parentName:"strong"},"[HttpGet]"))),Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5",Object(b.b)("strong",{parentName:"li"},"\u81f3\u5c11\u6709\u4e00\u4e2a\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"strong"},"[Route]")," \u7279\u6027")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"li"},"WebAPI")," \u8def\u7531\u5730\u5740\u65f6\u4f1a\u81ea\u52a8\u53bb\u6389\u63a7\u5236\u5668\u540d\u79f0 ",Object(b.b)("inlineCode",{parentName:"li"},"Controller")," \u540e\u7f00\uff0c\u540c\u65f6\u4e5f\u4f1a\u53bb\u6389\u52a8\u4f5c\u65b9\u6cd5\u5339\u914d\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"HttpVerb")," \u8c13\u8bcd\uff0c\u5982 ",Object(b.b)("inlineCode",{parentName:"li"},"GET\uff0cPOST\uff0cDELETE\uff0cPUT")," \u7b49"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u4e0d\u652f\u6301\u8fd4\u56de\u975e ",Object(b.b)("inlineCode",{parentName:"strong"},"IEnumerable")," \u6cdb\u578b\u5bf9\u8c61")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u4e0d\u652f\u6301\u7c7b\u7c7b\u578b\u53c2\u6570\u5728 ",Object(b.b)("inlineCode",{parentName:"strong"},"GET\uff0cHEAD")," \u8bf7\u6c42\u4e0b\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"strong"},"Query")," \u53c2\u6570"))),Object(b.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0\u7ea6\u5b9a\u5916\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u8def\u7531\u5730\u5740",Object(b.b)("strong",{parentName:"p"},"\u57fa\u672c\u9760\u624b\u5de5\u5b8c\u6210"),"\uff0c\u4e0d\u5229\u4e8e\u4e66\u5199\uff0c\u4e0d\u5229\u4e8e\u7ef4\u62a4\uff0c\u518d\u8005\uff0c\u5728\u79fb\u52a8\u5e94\u7528\u5bf9\u63a5\u4e2d\u96be\u4ee5\u8fdb\u884c\u591a\u7248\u672c\u63a7\u5236\u3002"),Object(b.b)("h3",{id:"522-net-core-webapi-\u7f3a\u70b9"},"5.2.2 ",Object(b.b)("inlineCode",{parentName:"h3"},".NET Core WebAPI")," \u7f3a\u70b9"),Object(b.b)("p",null,"\u901a\u8fc7\u4e0a\u4e00\u7ae0\u8282\u53ef\u4ee5\u770b\u51fa\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u5b9e\u73b0 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u9700\u8981\u9075\u5faa\u79cd\u79cd\u7ea6\u5b9a\uff0c\u800c\u4e14\u5bb9\u6613\u51fa\u9519\u3002"),Object(b.b)("p",null,"\u9664\u4e86\u8fd9\u4e9b\u7ea6\u5b9a\uff0c",Object(b.b)("inlineCode",{parentName:"p"},".NET Core WebAPI")," \u6709\u4ee5\u4e0b\u7f3a\u70b9\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u8def\u7531\u5730\u5740\u57fa\u672c\u9760\u624b\u5de5\u5b8c\u6210"),Object(b.b)("li",{parentName:"ul"},"\u5728\u73b0\u5728\u79fb\u52a8\u4e3a\u738b\u7684\u65f6\u4ee3\uff0c\u4e0d\u5229\u4e8e\u8fdb\u884c\u591a\u7248\u672c\u63a7\u5236"),Object(b.b)("li",{parentName:"ul"},"\u5bf9\u63a5 ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u6587\u6863\u5206\u7ec4\u6bd4\u8f83\u590d\u6742"),Object(b.b)("li",{parentName:"ul"},"\u5b9e\u73b0 ",Object(b.b)("inlineCode",{parentName:"li"},"Policy")," \u7b56\u7565\u6388\u6743\u4e5f\u6bd4\u8f83\u590d\u6742"),Object(b.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u63a7\u5236\u5668\u70ed\u62d4\u63d2\u63d2\u4ef6\u5316"),Object(b.b)("li",{parentName:"ul"},"\u96be\u4ee5\u5b9e\u73b0\u590d\u6742\u81ea\u5b9a\u4e49\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"RESTful API")," \u98ce\u683c")),Object(b.b)("h2",{id:"53-\u52a8\u6001-webapi-\u63a7\u5236\u5668"},"5.3 \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u63a7\u5236\u5668"),Object(b.b)("p",null,"\u9488\u5bf9\u4ee5\u4e0a ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63d0\u4f9b\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u5fc5\u987b\u9075\u5faa\u7684\u7ea6\u5b9a\u548c\u4e0d\u53ef\u907f\u514d\u7684\u7f3a\u70b9\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u521b\u9020\u51fa\u4e00\u79cd\u66f4\u52a0\u7075\u6d3b\u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a7\u5236\u5668\u7684\u65b9\u5f0f\u3002"),Object(b.b)("p",null,"\u8fd9\u4e2a\u65b9\u5f0f\u5728\u7ee7\u627f\u4e86 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core WebAPI")," \u6240\u6709\u4f18\u70b9\uff0c\u540c\u65f6\u8fdb\u884c\u4e86\u5927\u91cf\u62d3\u5c55\u548c\u4f18\u5316\u3002\u4f18\u5316\u540e\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u5177\u5907\u539f\u6709\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u6240\u6709\u529f\u80fd"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301",Object(b.b)("strong",{parentName:"li"},"\u4efb\u610f\u516c\u5f00 \u975e\u9759\u6001 \u975e\u62bd\u8c61 \u975e\u6cdb\u578b\u7c7b"),"\u8f6c\u63a7\u5236\u5668"),Object(b.b)("li",{parentName:"ul"},"\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u65b9\u4fbf\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"IDynamicApiController")," \u7a7a\u63a5\u53e3\u6216 ",Object(b.b)("inlineCode",{parentName:"li"},"[DynamicApiController]")," \u7279\u6027\u66ff\u4ee3 ",Object(b.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u62bd\u8c61\u7c7b"),Object(b.b)("li",{parentName:"ul"},"\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpMethod]")," \u7279\u6027\uff0c\u540c\u65f6\u652f\u6301\u4e00\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u591a\u4e2a ",Object(b.b)("inlineCode",{parentName:"li"},"HttpVerb")),Object(b.b)("li",{parentName:"ul"},"\u65e0\u9700\u624b\u52a8\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"li"},"[Route]")," \u7279\u6027\uff0c\u652f\u6301\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u53ca\u81ea\u52a8\u8def\u7531\u751f\u6210"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301\u8fd4\u56de\u6cdb\u578b\u63a5\u53e3\uff0c\u6cdb\u578b\u7c7b"),Object(b.b)("li",{parentName:"ul"},"\u548c ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u6df1\u5ea6\u7ed3\u5408\uff0c\u63d0\u4f9b\u6781\u5176\u65b9\u4fbf\u7684\u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u5206\u7ec4\u914d\u7f6e"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"li"},"Basic Auth\uff0cJwt\uff0cApiKey")," \u7b49\u591a\u79cd\u6743\u9650\u7075\u6d3b\u914d\u7f6e"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301\u63a7\u5236\u5668\u3001\u52a8\u4f5c\u65b9\u6cd5",Object(b.b)("strong",{parentName:"li"},"\u7248\u672c\u63a7\u5236"),"\u529f\u80fd"),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"li"},"GET\u3001HEAD")," \u8bf7\u6c42\u81ea\u52a8\u8f6c\u6362 ",Object(b.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570")),Object(b.b)("li",{parentName:"ul"},"\u652f\u6301\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"li"},"OAS3")," \u63a5\u53e3\u89c4\u8303")),Object(b.b)("h2",{id:"54-\u6ce8\u518c\u52a8\u6001-webapi-\u670d\u52a1"},"5.4 \u6ce8\u518c\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u670d\u52a1"),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u9ed8\u8ba4\u5df2\u7ecf\u96c6\u6210\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002\u4e5f\u5c31\u662f\u4e0b\u5217\u4ee3\u7801\u53ef\u4e0d\u914d\u7f6e\u3002"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddDynamicApiControllers();\n }\n }\n}\n")),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u5fc5\u987b\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u540e\u6ce8\u518c\u3002"))),Object(b.b)("h2",{id:"55-\u7b2c\u4e00\u4e2a\u4f8b\u5b50"},"5.5 \u7b2c\u4e00\u4e2a\u4f8b\u5b50"),Object(b.b)("p",null,"\u521b\u5efa\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"FurAppService")," \u7c7b\u7ee7\u627f ",Object(b.b)("inlineCode",{parentName:"p"},"IDynamicApiController")," \u63a5\u53e3 \u6216 \u8d34 ",Object(b.b)("inlineCode",{parentName:"p"},"[DynamicApiController]")," \u7279\u6027\uff0c\u5e76\u5728\u8fd9\u4e2a\u7c7b\u4e2d\u7f16\u5199\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"Get")," \u65b9\u6cd5\u3002"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},Object(b.b)("inlineCode",{parentName:"strong"},"IDynamicApiController")," \u65b9\u5f0f"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7}","{1,5,7}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return $"Hello {nameof(Furion)}";\n }\n }\n}\n')),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},Object(b.b)("inlineCode",{parentName:"strong"},"[DynamicApiController]")," \u65b9\u5f0f"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,8}","{1,5,8}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [DynamicApiController]\n public class FurAppService\n {\n public string Get()\n {\n return $"Hello {nameof(Furion)}";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u5c31\u8fd9\u4e48\u751f\u6210\u4e86\u3002"),Object(b.b)("img",{src:Object(r.a)("img/dyglz.gif")}),Object(b.b)("h2",{id:"56-\u52a8\u6001-webapi-\u539f\u7406\u89e3\u6790"},"5.6 \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u539f\u7406\u89e3\u6790"),Object(b.b)("h3",{id:"561-\u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668"},"5.6.1 \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",Object(b.b)("inlineCode",{parentName:"p"},"DynamicApiControllerFeatureProvider")," \u63a7\u5236\u5668\u7279\u6027\u63d0\u4f9b\u5668\uff0c\u8be5\u63d0\u4f9b\u5668\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"p"},"ControllerFeatureProvider")," \u7c7b\u3002"),Object(b.b)("p",null,"\u63a5\u7740\u91cd\u5199 ",Object(b.b)("inlineCode",{parentName:"p"},"bool IsController(TypeInfo typeInfo)")," \u65b9\u6cd5\uff0c\u7528\u6765\u6807\u8bc6\u63a7\u5236\u5668\u7c7b\u578b\u3002\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c",Object(b.b)("strong",{parentName:"p"},"\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"strong"},"ControllerBase")," \u7c7b\u6216 ",Object(b.b)("inlineCode",{parentName:"strong"},"IDynamicApiController")," \u63a5\u53e3\u6216 ",Object(b.b)("inlineCode",{parentName:"strong"},"[DynamicApiController]")," \u7279\u6027\u90fd\u4f1a\u88ab\u6807\u8bb0\u4e3a\u63a7\u5236\u5668\u7c7b\u578b\u3002")),Object(b.b)("h3",{id:"562-\u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668"},"5.6.2 \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u540c\u65f6\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c ",Object(b.b)("inlineCode",{parentName:"p"},"DynamicApiControllerApplicationModelConvention")," \u5e94\u7528\u6a21\u578b\u8f6c\u6362\u5668\uff0c\u8be5\u8f6c\u6362\u5668\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"p"},"IApplicationModelConvention")," \u63a5\u53e3\u3002"),Object(b.b)("p",null,"\u63a5\u7740\u5b9e\u73b0 ",Object(b.b)("inlineCode",{parentName:"p"},"void Apply(ApplicationModel application)")," \u63a5\u53e3\u65b9\u6cd5\u3002\u5728\u8be5\u65b9\u6cd5\u4e2d\u914d\u7f6e\u63a7\u5236\u5668\u540d\u79f0\u3001\u8def\u7531\u3001\u5bfc\u51fa\u53ef\u89c1\u6027\u53ca\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3001\u8def\u7531\u3001\u5bfc\u51fa\u53ef\u89c1\u6027\u7b49\u3002"),Object(b.b)("p",null,"\u5b9e\u9645\u4e0a\u8be5\u65b9\u6cd5\u505a\u7684\u5c31\u662f\u6309\u7167 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("a",Object(a.a)({parentName:"strong"},{href:"#521-webapi-%E7%BA%A6%E5%AE%9A"}),"WebAPI \u7ea6\u5b9a"))," \u63d0\u524d\u5e2e\u6211\u4eec\u914d\u7f6e\u597d\u8def\u7531\u3001\u8bf7\u6c42\u8c13\u8bcd\u7b49\u4fe1\u606f\u3002\u907f\u514d\u4e86\u624b\u52a8\u914d\u7f6e\u7684\u540c\u65f6\u8fd8\u589e\u52a0\u4e86\u8bb8\u591a\u65b0\u7279\u6027\uff0c\u5982",Object(b.b)("strong",{parentName:"p"},"\u7248\u672c\u63a7\u5236\u3002")),Object(b.b)("h2",{id:"57-\u52a8\u6001-webapi-\u914d\u7f6e\u7ea6\u5b9a"},"5.7 \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"h2"},"WebAPI")," \u914d\u7f6e\u7ea6\u5b9a"),Object(b.b)("h3",{id:"571-\u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.1 \u63a7\u5236\u5668\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u63a7\u5236\u5668\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"AppServices\uff0cAppService\uff0cApiController\uff0cController\uff0cServices\uff0cService")," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002\u89c1\u7b2c\u4e00\u4e2a\u4f8b\u5b50\u4e2d\u7684 ",Object(b.b)("inlineCode",{parentName:"li"},"FurAppService -> Furion")," ",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u5668\u540d\u79f0\u5e26 ",Object(b.b)("inlineCode",{parentName:"li"},"V[0-9_]")," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u63a7\u5236\u5668\u7248\u672c\u53f7\uff0c\u5982 ",Object(b.b)("inlineCode",{parentName:"li"},"FurAppServiceV2 -> Furion@2"),"\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"FurAppServiceV1_1_0 -> Furion@1.1.0"),"\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u63a7\u5236\u540d\u79f0\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"\u9a86\u9a7c\u547d\u540d\uff08CamelCase\uff09")," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",Object(b.b)("inlineCode",{parentName:"li"},"-")," \u8fde\u63a5\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h3",{id:"572-\u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.2 \u52a8\u4f5c\u65b9\u6cd5\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit\uff0cGetAll/GetList/Get/Find/Fetch/Query/Search\uff0cPut/Update\uff0cDelete/Remove/Clear\uff0cPatch")," \u5f00\u5934\u7684\u5b57\u7b26\u4e32\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u7684\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u9ed8\u8ba4\u53bb\u9664\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Async")," \u4f5c\u4e3a\u524d\u540e\u7f00\u7684\u5b57\u7b26\u4e32\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u5e26 ",Object(b.b)("inlineCode",{parentName:"li"},"V[0-9_]")," \u7ed3\u5c3e\u7684\uff0c\u4f1a\u81ea\u52a8\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c\u53f7\uff0c\u5982 ",Object(b.b)("inlineCode",{parentName:"li"},"ChangePasswordV2 -> ChangePassword@2"),"\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"ChangePasswordV1_1_0 -> ChangePassword@1.1.0"),"\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u7248\u672c\u5206\u9694\u7b26\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"\u9a86\u9a7c\u547d\u540d\uff08CamelCase\uff09")," \u4f1a\u81ea\u52a8\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd ",Object(b.b)("inlineCode",{parentName:"li"},"-")," \u8fde\u63a5\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u53c2\u6570\u5c06\u81ea\u52a8\u8f6c\u4e3a\u5c0f\u5199\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h3",{id:"573-\u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.3 \u8bf7\u6c42\u8c13\u8bcd\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"GetAll/GetList/Get/Find/Fetch/Query")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpGet]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Put/Update")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPut]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Delete/Remove/Clear")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpDelete]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Patch")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPatch]")," \u7279\u6027"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")))),Object(b.b)("li",{parentName:"ul"},"\u5982\u679c\u4e0d\u5728\u4e0a\u9762\u7ea6\u5b9a\u4e2d\uff0c\u5219\u9ed8\u8ba4\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h3",{id:"574-\u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a"},"5.7.4 \u8def\u7531\u5730\u5740\u9ed8\u8ba4\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"api")," \u5f00\u5934\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u8f6c\u6362\u4e3a\u5c0f\u5199\u8def\u7531\u5730\u5740\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u63a7\u5236\u5668\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"api/\u524d\u7f6e\u53c2\u6570\u5217\u8868/\u6a21\u5757\u540d\u6216\u9ed8\u8ba4\u533a\u57df\u540d/[controller@\u7248\u672c\u53f7]/\u540e\u7f6e\u53c2\u6570\u5217\u8868")),Object(b.b)("li",{parentName:"ul"},"\u751f\u6210\u52a8\u4f5c\u65b9\u6cd5\u8def\u7531\u6a21\u677f\u683c\u5f0f\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"\u524d\u7f6e\u53c2\u6570\u5217\u8868/\u6a21\u5757\u540d/[action@\u7248\u672c\u53f7]/\u540e\u7f6e\u53c2\u6570\u5217\u8868"))),Object(b.b)("h3",{id:"575-\u5176\u4ed6\u7ea6\u5b9a"},"5.7.5 \u5176\u4ed6\u7ea6\u5b9a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4e0d\u5904\u7406 ",Object(b.b)("inlineCode",{parentName:"li"},"ControllerBase")," \u63a7\u5236\u5668\u7c7b\u578b\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")),Object(b.b)("li",{parentName:"ul"},"\u9ed8\u8ba4\u4e0d\u5904\u7406 ",Object(b.b)("inlineCode",{parentName:"li"},"GET\uff0cHEAD")," \u8bf7\u6c42\u7684\u5f15\u7528\u7c7b\u578b\u53c2\u6570\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("h2",{id:"58-\u66f4\u591a\u4f8b\u5b50"},"5.8 \u66f4\u591a\u4f8b\u5b50"),Object(b.b)("h3",{id:"581-\u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5"},"5.8.1 \u591a\u79cd\u8bf7\u6c42\u8c13\u8bcd\u65b9\u6cd5"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17,22,27}","{7,12,17,22,27}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return $"GET \u8bf7\u6c42";\n }\n\n public string Post()\n {\n return $"POST \u8bf7\u6c42";\n }\n\n public string Delete()\n {\n return $"DELETE \u8bf7\u6c42";\n }\n\n public string Put()\n {\n return $"PUT \u8bf7\u6c42";\n }\n\n public string Patch()\n {\n return $"PATCH \u8bf7\u6c42";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dgqqwc.png")}),Object(b.b)("h3",{id:"582-\u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5"},"5.8.2 \u591a\u4e2a\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17}","{7,12,17}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string GetVersion()\n {\n return $"v1.0.0";\n }\n\n public string ChangeProfile()\n {\n return "\u4fee\u6539\u6210\u529f";\n }\n\n public string DeleteUser()\n {\n return "\u5220\u9664\u6210\u529f";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dzmc.png")}),Object(b.b)("h3",{id:"583-\u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5"},"5.8.3 \u5e26\u53c2\u6570\u52a8\u4f5c\u65b9\u6cd5"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,17}","{7,12,17}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string GetUser(int id)\n {\n return $"{id}";\n }\n\n public string GetUser(int id, string name)\n {\n return $"{id} {name}";\n }\n\n public TestDto Add(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dcsff.gif")}),Object(b.b)("h3",{id:"584-gethead-\u7c7b\u7c7b\u578b\u53c2\u6570"},"5.8.4 ",Object(b.b)("inlineCode",{parentName:"h3"},"GET/HEAD")," \u7c7b\u7c7b\u578b\u53c2\u6570"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4f1a\u5c06 ",Object(b.b)("inlineCode",{parentName:"p"},"GET/HEAD")," \u8bf7\u6c42\u4e2d\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b\u53c2\u6570")," \u8bbe\u7f6e\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"[FromBody]")," \u7ed1\u5b9a\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public TestDto GetTest(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/getyycs.png")}),Object(b.b)("p",null,"\u4f46\u662f\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"GET\u3001HEAD")," \u8bf7\u6c42\u4e0d\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"p"},"From Body")," \u7ed1\u5b9a\u3002\u6240\u4ee5\u6211\u4eec\u9700\u8981\u8f6c\u6362\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"Query")," \u67e5\u8be2\u53c2\u6570\u3002"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u652f\u6301\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff1a"),Object(b.b)(c.a,{defaultValue:"fromquery",values:[{label:"[FromQuery] \u7279\u6027",value:"fromquery"},{label:"\u914d\u7f6e DynamicApiControllerSettings",value:"DynamicApiControllerSettings"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"fromquery",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),"using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public TestDto GetTest([FromQuery] TestDto testDto)\n {\n return testDto;\n }\n }\n}\n"))),Object(b.b)(l.a,{value:"DynamicApiControllerSettings",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "DynamicApiControllerSettings": {\n "ModelToQuery": true\n }\n}\n')))),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/modeltoquery.png")}),Object(b.b)("h3",{id:"585-\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e"},"5.8.5 \u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u7684\u81ea\u5b9a\u4e49\u53c2\u6570\u4f4d\u7f6e\u7684\u7279\u6027 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiSeat]"),"\uff0c\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiSeat]")," \u53ef\u914d\u7f6e\u53c2\u6570\u4f4d\u7f6e\uff0c\u652f\u6301\u4ee5\u4e0b\u56db\u79cd\u4f4d\u7f6e\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ControllerStart"),"\uff1a\u63a7\u5236\u5668\u4e4b\u524d"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ControllerEnd"),"\uff1a\u63a7\u5236\u5668\u4e4b\u540e"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ActionStart"),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u524d"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiSeats.ActionEnd"),"\uff1a\u52a8\u4f5c\u65b9\u6cd5\u4e4b\u540e\u3002",Object(b.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c"))),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8-9,15-20}","{8-9,15-20}":!0}),'using Furion.DynamicApiController;\nusing System;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n // \u53c2\u6570\u9ed8\u8ba4\u4e3a ApiSeats.ActionEnd\n public string RouteSeat(int id, string name)\n {\n return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\n }\n\n public string RouteSeat(\n [ApiSeat(ApiSeats.ControllerStart)] int id, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u524d\n [ApiSeat(ApiSeats.ControllerEnd)] string name, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\n [ApiSeat(ApiSeats.ControllerEnd)] int age, // \u63a7\u5236\u5668\u540d\u79f0\u4e4b\u540e\n [ApiSeat(ApiSeats.ActionStart)] decimal weight, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\n [ApiSeat(ApiSeats.ActionStart)] float height, // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u524d\n [ApiSeat(ApiSeats.ActionEnd)] DateTime birthday) // \u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u4e4b\u540e\uff08\u9ed8\u8ba4\u503c\uff09\n {\n return "\u914d\u7f6e\u8def\u7531\u53c2\u6570\u4f4d\u7f6e";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/cswz.png")}),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u591a\u4e2a ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"\u540c\u4f4d\u7f6e"))," \u914d\u7f6e\u7684\u53c2\u6570\u5c06\u6309\u7167 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"\u5b9a\u4e49\u53c2\u6570\u987a\u5e8f"))," \u8fdb\u884c\u6392\u5e8f\u3002"))),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"[ApiSeat]")," \u53ea\u80fd\u5e94\u7528\u4e8e\u8d34\u4e86 ",Object(b.b)("inlineCode",{parentName:"p"},"[FromRoute]")," \u7279\u6027\u7684\u53c2\u6570\u6216 ",Object(b.b)("inlineCode",{parentName:"p"},"\u57fa\u5143\u7c7b\u578b\u3001\u503c\u7c7b\u578b\u3001\u53ef\u7a7a\u57fa\u5143\u7c7b\u578b\u548c\u53ef\u7a7a\u503c\u7c7b\u578b"),"\u3002"))),Object(b.b)("h3",{id:"586-\u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd"},"5.8.6 \u81ea\u5b9a\u4e49\u8bf7\u6c42\u8c13\u8bcd"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [HttpPost]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/zdywc.png")}),Object(b.b)("h3",{id:"587-\u652f\u6301\u591a\u4e2a\u8c13\u8bcd"},"5.8.7 \u652f\u6301\u591a\u4e2a\u8c13\u8bcd"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [HttpPost, HttpGet, AcceptVerbs("PUT", "DELETE")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dgwc.png")}),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u5982\u679c\u52a8\u4f5c\u65b9\u6cd5\u4e2d\u542b\u6709 ",Object(b.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b\u53c2\u6570"),"\uff0c\u4e14\u542b\u6709 ",Object(b.b)("inlineCode",{parentName:"p"},"POST/PUT/DELETE")," \u4efb\u610f\u8bf7\u6c42\u8c13\u8bcd\uff0c\u90a3\u4e48\u8be5\u53c2\u6570\u4f1a\u81ea\u52a8\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"[FromBody]")," \u53c2\u6570\uff0c\u5373\u4f7f\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"GET/HEAD")," \u8bf7\u6c42\u4e2d\u4e0d\u652f\u6301\u3002"))),Object(b.b)("h3",{id:"588-\u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531"},"5.8.8 \u652f\u6301\u81ea\u5b9a\u4e49\u8def\u7531"),Object(b.b)("p",null,"\u652f\u6301\u63a7\u5236\u5668\u548c\u52a8\u4f5c\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\uff1a"),Object(b.b)(c.a,{defaultValue:"kzqrl",values:[{label:"\u81ea\u5b9a\u4e49\u63a7\u5236\u5668\u8def\u7531",value:"kzqrl"},{label:"\u81ea\u5b9a\u4e49\u52a8\u4f5c\u65b9\u6cd5\u8def\u7531",value:"dzffrl"},{label:"\u540c\u65f6\u81ea\u5b9a\u4e49\u8def\u7531",value:"allrl"},{label:"\u8c13\u8bcd\u81ea\u5b9a\u4e49\u8def\u7531",value:"vcrl"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"kzqrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6}","{2,6}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("customapi/mobile/[controller]")]\n public class FurAppService : IDynamicApiController\n {\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/kzqrl.png")})),Object(b.b)(l.a,{value:"dzffrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8}","{2,8}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [Route("customapi/[action]")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dzffrl.png")})),Object(b.b)(l.a,{value:"allrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6,9}","{2,6,9}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("customapi/mobile/[controller]")]\n public class FurAppService : IDynamicApiController\n {\n [Route("get/[action]")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/allrl.png")})),Object(b.b)(l.a,{value:"vcrl",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9}","{9}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("api/[controller]")]\n public class FurAppService : IDynamicApiController\n {\n [HttpGet("get/[action]")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/wcrl.png")}))),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5c0f\u63d0\u793a")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u52a8\u6001\u65b9\u6cd5\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u4ee5 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"/"))," \u5f00\u5934\uff0c\u5219\u4e0d\u4f1a\u5408\u5e76\u63a7\u5236\u5668\u8def\u7531\u3002"))),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u914d\u7f6e")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u81ea\u5b9a\u4e49\u8def\u7531\u5982\u679c\u9700\u8981\u7528\u5230 ",Object(b.b)("strong",{parentName:"p"},"\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0"),"\uff0c\u63a8\u8350\u4f7f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"[controller]")," \u6216 ",Object(b.b)("inlineCode",{parentName:"p"},"[action]")," \u5360\u4f4d\u7b26\uff0c\u56e0\u4e3a\u8be5\u5360\u4f4d\u7b26\u5df2\u7ecf\u81ea\u52a8\u5904\u7406\u4e86 ",Object(b.b)("strong",{parentName:"p"},"\u524d\u540e\u7f00\u3001\u7248\u672c\u53f7\u3001\u6a21\u5757\u540d\u79f0"),"\u7b49\u3002"))),Object(b.b)("h3",{id:"589-\u591a\u8def\u7531\u968f\u610f\u7ec4\u5408"},"5.8.9 \u591a\u8def\u7531\u968f\u610f\u7ec4\u5408"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u5404\u79cd\u8def\u7531\u7ec4\u5408\u65b9\u5f0f\uff0c\u652f\u6301\u4e00\u5bf9\u591a\uff0c\u591a\u5bf9\u591a\u8def\u7531\u7ec4\u5408\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6-8,11-14}","{6-8,11-14}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n [Route("api/[controller]")]\n [Route("api/[controller]/second")]\n [Route("api/[controller]/three")]\n public class FurAppService : IDynamicApiController\n {\n [HttpGet]\n [HttpGet("get/[action]")]\n [HttpPost]\n [HttpPost("post/cus-version")]\n public string GetVersion()\n {\n return "1.0.0";\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dlrzh.gif")}),Object(b.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u52a8\u4f5c\u65b9\u6cd5\u4e0d\u80fd\u540c\u65f6\u8d34 ",Object(b.b)("inlineCode",{parentName:"p"},"[Route]")," \u548c ",Object(b.b)("inlineCode",{parentName:"p"},"[HttpMethod]")," \u7279\u6027\uff0c\u53ea\u80fd\u4e8c\u53d6\u4e00\u3002"))),Object(b.b)("h3",{id:"5810-\u652f\u6301\u7248\u672c\u63a7\u5236"},"5.8.10 \u652f\u6301\u7248\u672c\u63a7\u5236"),Object(b.b)(c.a,{defaultValue:"kzqbb",values:[{label:"\u63a7\u5236\u5668\u7248\u672c",value:"kzqbb"},{label:"\u52a8\u4f5c\u65b9\u6cd5\u7248\u672c",value:"dzffbb"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"kzqbb",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,13,21}","{5,13,21}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppServiceV1 : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n\n public class FurAppServiceV1_2 : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n\n public class FurAppServiceV1_2_1 : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/kzqbb.png")})),Object(b.b)(l.a,{value:"dzffbb",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12,16}","{7,12,16}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public string GetV1()\n {\n return nameof(Furion);\n }\n public string GetV2_1()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dzffbb.png")}))),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7248\u672c\u751f\u6210\u539f\u7406")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"V[0-9_]"))," \u7ed3\u5c3e\u7684\u547d\u540d\u81ea\u52a8\u89e3\u6790\u6210\u7248\u672c\u53f7\uff0c\u5982 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"FurAppServiceV2 -> Furion@2")),"\u3002"))),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u7248\u672c\u590d\u5199")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u9664\u4e86\u901a\u8fc7\u7279\u5b9a\u540e\u7f00\u65b9\u5f0f\u4ee5\u5916\uff0c\u7248\u672c\u8fd8\u76f4\u63a5\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings]")," \u8fdb\u884c\u590d\u5199\u3002\u5982\uff1a"),Object(b.b)("pre",{parentName:"div"},Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,2}","{1,2}":!0}),'[ApiDescriptionSettings(Version = "4.0")]\npublic string GetV1()\n{\n return nameof(Furion);\n}\n')),Object(b.b)("p",{parentName:"div"},"\u8fd9\u65f6\uff0c\u751f\u6210\u7248\u672c\u5c06\u91c7\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"4.0")," \u66ff\u4ee3 ",Object(b.b)("inlineCode",{parentName:"p"},"1")))),Object(b.b)("h3",{id:"5811-\u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5"},"5.8.11 \u4e0d\u516c\u5f00\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5"),Object(b.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u65e0\u9700\u5bfc\u51fa\u67d0\u4e2a\u52a8\u4f5c\u65b9\u6cd5\u6216\u63a7\u5236\u5668\uff08",Object(b.b)("strong",{parentName:"p"},"\u4e0d\u663e\u793a\u5230 Swagger"),"\uff09\uff0c\u53ea\u9700\u8981\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(false)]")," \u6216 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiExplorerSettings(IgnoreApi = true)]"),"\u5373\u53ef\u3002"),Object(b.b)("p",null,"\u53e6\u5916\u52a8\u4f5c\u65b9\u6cd5\u8fd8\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"p"},"[NonAction]")," \u6807\u8bb0\u4e0d\u662f\u4e00\u4e2a\u6709\u6548\u7684\u63a7\u5236\u5668\u6216 Action\u3002"),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u4f7f\u7528")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u63a8\u8350\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u8bbe\u7f6e\u4e0d\u5bfc\u51fa\u4f7f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(false)]")," \u7279\u6027\u3002\u8be5\u7279\u6027\u9ed8\u8ba4\u7ee7\u627f\u81ea ",Object(b.b)("inlineCode",{parentName:"p"},"ApiExplorerSettingsAttribute")," \u7c7b\u3002"))),Object(b.b)("h3",{id:"5812-\u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d"},"5.8.12 \u4fdd\u6301\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u547d\u540d"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u52a8\u6001 API \u4f1a\u5c06\u63a7\u5236\u5668\u548c\u65b9\u6cd5\u540d\u8f93\u51fa\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"RESTFul")," \u98ce\u683c\u7684\u8def\u7531\uff0c\u5982\u9700\u4fdd\u7559\u539f\u6709\u8bbe\u8ba1\uff0c\u53ea\u9700\u914d\u7f6e\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "DynamicApiControllerSettings": {\n "KeepName": true,\n "LowercaseRoute": false\n }\n}\n')),Object(b.b)("h3",{id:"5813-\u65b9\u6cd5\u53c2\u6570-fromquery-\u5316"},"5.8.13 \u65b9\u6cd5\u53c2\u6570 ",Object(b.b)("inlineCode",{parentName:"h3"},"[FromQuery]")," \u5316"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u7684\u57fa\u5143\u7c7b\u578b\u53c2\u6570\u90fd\u4f1a\u8d34\u4e0a ",Object(b.b)("inlineCode",{parentName:"p"},"[FromRoute]")," \u7279\u6027\uff0c\u5982\u679c\u9700\u8981\u5c06\u53c2\u6570\u8c03\u6574\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"[FromQuery]")," \u4fee\u9970\uff0c\u53ea\u9700\u8981\u5728\u65b9\u6cd5\u4e0a\u9762\u8d34 ",Object(b.b)("inlineCode",{parentName:"p"},"[QueryParameters]")," \u7279\u6027\u5373\u53ef\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[QueryParameters]\npublic string Get(int id, string name)\n{\n return nameof($"{id} {name}");\n}\n')),Object(b.b)("p",null,"\u751f\u6210\u7684\u8def\u7531\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"https://xxx.com?id=1&name=Furion")),Object(b.b)("h3",{id:"5814-\u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e"},"5.8.14 \u53c2\u6570\u7ed1\u5b9a\u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u591a\u79cd\u53c2\u6570\u7279\u6027\u914d\u7f6e\u53c2\u6570\u7ed1\u5b9a\u89c4\u5219\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromRoute]"),"\uff1a\u901a\u8fc7\u8def\u7531\u53c2\u6570\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromQuery]"),"\uff1a\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"li"},"Url")," \u5730\u5740\u53c2\u6570\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromBody]"),"\uff1a\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"li"},"Request Body")," \u53c2\u6570\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromForm]"),"\uff1a\u901a\u8fc7\u8868\u5355\u63d0\u4ea4\u7ed1\u5b9a\u503c"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"[FromHeader]"),"\uff1a\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"li"},"Request Header")," \u53c2\u6570\u7ed1\u5b9a\u503c")),Object(b.b)("h3",{id:"5815-\u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210-httpmethod-\u89c4\u5219"},"5.8.15 \u81ea\u5b9a\u4e49\u6839\u636e\u65b9\u6cd5\u540d\u751f\u6210 ",Object(b.b)("inlineCode",{parentName:"h3"},"[HttpMethod]")," \u89c4\u5219"),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5728\u6ca1\u6709\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"[HttpMethod]")," \u7279\u6027\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u81ea\u52a8\u6839\u636e\u65b9\u6cd5\u540d\u7b2c\u4e00\u4e2a\u53c2\u6570\u8fdb\u884c\u5206\u6790\uff0c\u5e76\u751f\u6210\u5bf9\u5e94\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"[HttpMethod]")," \u7279\u6027\uff0c\u89c4\u5219\u5982\u4e0b\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u52a8\u4f5c\u65b9\u6cd5\u540d",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Post/Add/Create/Insert/Submit")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"GetAll/GetList/Get/Find/Fetch/Query")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpGet]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Put/Update")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPut]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Delete/Remove/Clear")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpDelete]")," \u7279\u6027\u3002"),Object(b.b)("li",{parentName:"ul"},"\u4ee5 ",Object(b.b)("inlineCode",{parentName:"li"},"Patch")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPatch]")," \u7279\u6027"),Object(b.b)("li",{parentName:"ul"},"\u5df2 ",Object(b.b)("inlineCode",{parentName:"li"},"Head")," \u5f00\u5934\uff0c\u5219\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpHead]")," \u7279\u6027"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e")))),Object(b.b)("li",{parentName:"ul"},"\u5982\u679c\u4e0d\u5728\u4e0a\u9762\u7ea6\u5b9a\u4e2d\uff0c\u5219\u9ed8\u8ba4\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpPost]")," \u7279\u6027\u3002",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"))),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u4f46\u662f\uff0c\u6709\u4e9b\u65f6\u5019\u8fd9\u4e0d\u662f\u6211\u4eec\u60f3\u8981\u7684\u89c4\u5219"),"\uff0c\u8fd9\u65f6\u6211\u4eec\u53ea\u9700\u8981\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2,3}","{2,3}":!0}),'{\n "DynamicApiControllerSettings": {\n "VerbToHttpMethods": [\n ["getall", "HEAD"], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\n ["other", "PUT"] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\n ]\n }\n}\n')),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u4e8c\u7ef4\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20",Object(b.b)("strong",{parentName:"p"},"\u5fc5\u987b\u662f\u5168\u5c0f\u5199"),"\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20",Object(b.b)("strong",{parentName:"p"},"\u5fc5\u987b\u662f\u5168\u5927\u5199\u5927\u5199"),"\uff0c\u7b2c\u4e8c\u4e2a\u5143\u7d20\u53d6\u503c\u6709\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"HEAD, GET, PUT, POST, PATCH, DELETE")))),Object(b.b)("h2",{id:"59-apidescriptionsettings"},"5.9 ",Object(b.b)("inlineCode",{parentName:"h2"},"[ApiDescriptionSettings]")),Object(b.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0 ",Object(b.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63d0\u4f9b\u7684\u914d\u7f6e\u5916\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u5f3a\u5927\u4e14\u7075\u6d3b\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings]")," \u7279\u6027\u3002"),Object(b.b)("h3",{id:"591-\u5185\u7f6e\u914d\u7f6e"},"5.9.1 \u5185\u7f6e\u914d\u7f6e"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Name"),"\uff1a\u81ea\u5b9a\u4e49\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u5426\u4fdd\u6301\u539f\u6709\u540d\u79f0\u4e0d\u5904\u7406\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"SplitCamelCase"),"\uff1a\u5207\u5272\u9a86\u9a7c\u547d\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"true")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u65b9\u6cd5\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Enabled"),"\uff1a\u662f\u5426\u5bfc\u51fa\u63a5\u53e3\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"true")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Module"),"\uff1a\u6a21\u5757\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Version"),"\uff1a\u7248\u672c\u53f7\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Groups"),"\uff1a\u63a5\u53e3\u5206\u7ec4\uff0c\u53ef\u7ed3\u5408 ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u4e00\u8d77\u4f7f\u7528\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Tags"),"\uff1a\u63a5\u53e3\u6807\u7b7e\uff0c\u53ef\u7ed3\u5408 ",Object(b.b)("inlineCode",{parentName:"li"},"Swagger")," \u4e00\u8d77\u4f7f\u7528\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"null")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u914d\u7f6e\u63a7\u5236\u5668/\u52a8\u4f5c\u65b9\u6cd5\u6392\u5e8f")),Object(b.b)("h3",{id:"592-name-\u914d\u7f6e"},"5.9.2 ",Object(b.b)("inlineCode",{parentName:"h3"},"Name")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Name")," \u53c2\u6570\u53ef\u4ee5\u8986\u76d6\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u81ea\u52a8\u751f\u6210\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Name = "MyFur")]\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(Name = "MyGet")]\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/namepz.png")}),Object(b.b)("h3",{id:"593-keepname-\u914d\u7f6e"},"5.9.3 ",Object(b.b)("inlineCode",{parentName:"h3"},"KeepName")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"KeepName")," \u53c2\u6570\u53ef\u4ee5\u4fdd\u7559\u539f\u6709\u7684\u63a7\u5236\u5668\u6216\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(KeepName = true)]\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(KeepName = true)]\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/keepnamepz.png")}),Object(b.b)("h3",{id:"594-splitcamelcase-\u914d\u7f6e"},"5.9.4 ",Object(b.b)("inlineCode",{parentName:"h3"},"SplitCamelCase")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"SplitCamelCase")," \u53c2\u6570\u9ed8\u8ba4\u5c06\u9a86\u9a7c\u547d\u540d\u5207\u5272\u6210\u591a\u4e2a\u5355\u8bcd\u5e76\u901a\u8fc7\u6307\u5b9a ",Object(b.b)("inlineCode",{parentName:"p"},"\u5360\u4f4d\u7b26")," \u8fde\u63a5\u8d77\u6765\u3002\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"p"},"\u5360\u4f4d\u7b26")," \u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"-"),"\u3002\u9ed8\u8ba4\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"true"),"\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(SplitCamelCase = false)]\n public class MyFurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(SplitCamelCase = true)]\n public string ChangeUserName()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/splitnamepz.png")}),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"KeepName")," \u4f18\u5148\u7ea7\u9ad8\u4e8e ",Object(b.b)("inlineCode",{parentName:"p"},"SplitCamelCase"),"\uff0c\u4e5f\u5c31\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"KeepName")," \u8bbe\u7f6e\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"true"),"\uff0c\u5219\u4e0d\u4f1a\u5904\u7406 ",Object(b.b)("inlineCode",{parentName:"p"},"SplitCamelCase")," \u53c2\u6570\u3002"))),Object(b.b)("h3",{id:"595-keepverb-\u914d\u7f6e"},"5.9.5 ",Object(b.b)("inlineCode",{parentName:"h3"},"KeepVerb")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"KeepVerb")," \u53c2\u6570\u4f5c\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u6807\u8bc6\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(KeepVerb = true)]\n public string GetVersion()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/keepverbpz.png")}),Object(b.b)("h3",{id:"596-enabled-\u914d\u7f6e"},"5.9.6 ",Object(b.b)("inlineCode",{parentName:"h3"},"Enabled")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Enabled")," \u53c2\u6570\u914d\u7f6e\u63a5\u53e3\u662f\u5426\u5bfc\u51fa\u3002\u901a\u5e38\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u5982\u679c\u7528\u4e8e\u63a7\u5236\u5668\u5b9e\u9645\u4f5c\u7528\u4e0d\u5927\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12}","{12}":!0}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string GetVersion()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings(false)]\n public string NoExport()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/enablepz.png")}),Object(b.b)("h3",{id:"597-module-\u914d\u7f6e"},"5.9.7 ",Object(b.b)("inlineCode",{parentName:"h3"},"Module")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Module")," \u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u8def\u7531\u5206\u79bb\uff0c\u7c7b\u4f3c\u4e8e ",Object(b.b)("inlineCode",{parentName:"p"},"Mvc \u533a\u57df")," \u7684\u4f5c\u7528\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,8}","{5,8}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Module = "mobile")]\n public class FurAppService : IDynamicApiController\n {\n [ApiDescriptionSettings(Module = "user")]\n public string GetVersion()\n {\n return nameof(Furion);\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/modulepz.png")}),Object(b.b)("h3",{id:"598-version-\u914d\u7f6e"},"5.9.8 ",Object(b.b)("inlineCode",{parentName:"h3"},"Version")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Version")," \u53c2\u6570\u53ef\u4ee5\u914d\u7f6e\u63a5\u53e3\u7248\u672c\uff0c\u540c\u65f6\u53c8\u53ef\u4ee5\u590d\u5199\u7279\u6b8a\u7248\u672c\u547d\u540d\u914d\u7f6e\u3002\u9ed8\u8ba4\u7248\u672c\u53f7\u5206\u9694\u7b26\u4e3a ",Object(b.b)("inlineCode",{parentName:"p"},"@"),"\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,9-10}","{5,9-10}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Version = "1.0")]\n public class FurAppService : IDynamicApiController\n {\n // V2.0.0 \u88ab\u590d\u5199\u6210 V2.1.1\n [ApiDescriptionSettings(Version = "2.1.1")]\n public string GetVersionV2_0_0()\n {\n return nameof(Furion);\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/versionpz.png")}),Object(b.b)("h3",{id:"599-groups-\u914d\u7f6e"},"5.9.9 ",Object(b.b)("inlineCode",{parentName:"h3"},"Groups")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Groups")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"Swagger")," \u5206\u7ec4\u4fe1\u606f\u3002"),Object(b.b)("p",null,"\u901a\u8fc7\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"Groups")," \u53c2\u6570\u53ef\u4ee5\u5c06",Object(b.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u5668\u548c\u52a8\u4f5c\u65b9\u6cd5")," \u8fdb\u884c\u5f52\u7c7b\u548c\u591a\u4e2a\u5206\u7ec4\u76f4\u63a5\u5171\u4eab\u3002\u53ef\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDescriptionSettings(params Groups)]")," \u6784\u9020\u51fd\u6570\u4f20\u5165\u6216\u6307\u5b9a ",Object(b.b)("inlineCode",{parentName:"p"},"Groups")," \u53c2\u6570\u914d\u7f6e\u63a5\u53e3\u662f\u5426\u5bfc\u51fa\u3002\u901a\u5e38\u7528\u4e8e\u52a8\u4f5c\u65b9\u6cd5\uff0c\u5982\u679c\u7528\u4e8e\u63a7\u5236\u5668\u5b9e\u9645\u4f5c\u7528\u4e0d\u5927\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,13}","{5,13}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings("Default", "Common")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings("Custom")]\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/dfz.gif")}),Object(b.b)("h3",{id:"5910-tag-\u914d\u7f6e"},"5.9.10 ",Object(b.b)("inlineCode",{parentName:"h3"},"Tag")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Tag")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"Swagger")," \u6807\u7b7e\u5206\u7ec4\u4fe1\u606f\u53ca\u5408\u5e76\u6807\u7b7e\u3002\u4e5f\u5c31\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"\u7ec4\u4e2d\u7ec4"),":"),Object(b.b)(c.a,{defaultValue:"tag1",values:[{label:"\u6807\u7b7e\u547d\u540d",value:"tag1"},{label:"\u5408\u5e76\u6807\u7b7e",value:"tag2"}],mdxType:"Tabs"},Object(b.b)(l.a,{value:"tag1",mdxType:"TabItem"},Object(b.b)("h4",{id:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"},"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n")),Object(b.b)("h4",{id:"\u8d34\u6807\u7b7e\u4e4b\u540e"},"\u8d34\u6807\u7b7e\u4e4b\u540e"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e00")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e8c")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/tag1.png")})),Object(b.b)(l.a,{value:"tag2",mdxType:"TabItem"},Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(b.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/tag2.png")}))),Object(b.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u5982\u679c ",Object(b.b)("inlineCode",{parentName:"p"},"Tag")," \u540d\u5b57\u4e00\u6837\uff0c\u5219\u4f1a\u81ea\u52a8\u5408\u5e76\uff0c\u5426\u5219\u53ea\u662f\u547d\u540d\u3002"))),Object(b.b)("h2",{id:"510-dynamicapicontrollersettings-\u914d\u7f6e"},"5.10 ",Object(b.b)("inlineCode",{parentName:"h2"},"DynamicApiControllerSettings")," \u914d\u7f6e"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u8fd8\u63d0\u4f9b\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u4e00\u4e9b\u5168\u5c40\u914d\u7f6e\u9009\u9879\uff0c\u5982\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultRoutePrefix"),"\uff1a\u9ed8\u8ba4\u8def\u7531\u524d\u7f00\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"api")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultHttpMethod"),"\uff1a\u9ed8\u8ba4\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"POST")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultModule"),"\uff1a\u9ed8\u8ba4\u6a21\u5757\u540d\u79f0\uff08\u533a\u57df\uff09\uff0c\u53ef\u7528\u4f5c\u63a5\u53e3\u7248\u672c\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"v1")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"LowercaseRoute"),"\uff1a\u5c0f\u5199\u8def\u7531\u683c\u5f0f\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"true")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u5426\u4fdd\u7559\u9ed8\u8ba4\u540d\u79f0\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"fasle")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"CamelCaseSeparator"),"\uff1a\u9a86\u9a7c\u547d\u540d\u5206\u9694\u7b26\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"-")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"VersionSeparator"),"\uff1a\u7248\u672c\u5206\u9694\u7b26\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"@")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ModelToQuery"),"\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"GET/HEAD")," \u8bf7\u6c42\u5c06 ",Object(b.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570\u8f6c\u67e5\u8be2\u53c2\u6570"),"\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"SupportedMvcController"),"\uff1a\u662f\u5426\u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"li"},"Mvc Controller")," \u52a8\u6001\u914d\u7f6e\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"false")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AbandonControllerAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u63a7\u5236\u5668\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AppServices")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AppService")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ApiController")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Controller")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Services")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Service")))),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"AbandonActionAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Async")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"VerbToHttpMethods"),"\uff1a\u590d\u5199\u9ed8\u8ba4\u65b9\u6cd5\u540d\u8f6c ",Object(b.b)("inlineCode",{parentName:"li"},"[HttpMethod]")," \u89c4\u5219\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[][]")," \u4e8c\u7ef4\u6570\u7ec4\u7c7b\u578b\uff0c\u5185\u7f6e\u5339\u914d\u89c4\u5219\u4e3a\uff1a",Object(b.b)("pre",{parentName:"li"},Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'["post"] = "POST",\n["add"] = "POST",\n["create"] = "POST",\n["insert"] = "POST",\n["submit"] = "POST",\n["get"] = "GET",\n["find"] = "GET",\n["fetch"] = "GET",\n["query"] = "GET",\n["getlist"] = "GET",\n["getall"] = "GET",\n["put"] = "PUT",\n["update"] = "PUT",\n["delete"] = "DELETE",\n["remove"] = "DELETE",\n["clear"] = "DELETE",\n["patch"] = "PATCH"\n')),Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},"\u590d\u5199\u793a\u4f8b")),Object(b.b)("pre",{parentName:"li"},Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"DynamicApiControllerSettings": {\n "VerbToHttpMethods": [\n [ "getall", "HEAD" ], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\n [ "other", "PUT" ] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\n ]\n }\n')))))),Object(b.b)("h3",{id:"5101-\u652f\u6301-mvc-\u63a7\u5236\u5668-\u52a8\u6001\u914d\u7f6e"},"5.10.1 \u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"h3"},"Mvc \u63a7\u5236\u5668")," \u52a8\u6001\u914d\u7f6e"),Object(b.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u63a5\u53e3\u4e0d\u5bf9 ",Object(b.b)("inlineCode",{parentName:"p"},"ControllerBase")," \u7c7b\u578b\u8fdb\u884c\u4efb\u4f55\u5904\u7406\u3002\u5f53\u7136\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u624b\u52a8\u542f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"ControllerBase")," \u652f\u6301\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "DynamicApiControllerSettings": {\n "SupportedMvcController": true\n }\n}\n')),Object(b.b)("p",null,"\u8bbe\u7f6e ",Object(b.b)("inlineCode",{parentName:"p"},"SupportedMvcController: true")," \u540e\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"Mvc ControllerBase")," \u7c7b\u578b\u4e5f\u80fd\u548c\u52a8\u6001 ",Object(b.b)("inlineCode",{parentName:"p"},"WebAPI")," \u4e00\u6837\u7684\u7075\u6d3b\u4e86\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n public class MvcController : ControllerBase\n {\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n\n")),Object(b.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u6ce8\u610f\u4e8b\u9879")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u542f\u7528\u8be5\u914d\u7f6e\u540e\uff0c\u5982\u679c ",Object(b.b)("inlineCode",{parentName:"p"},"Mvc \u63a7\u5236\u5668")," \u6ca1\u6709\u4efb\u4f55 ",Object(b.b)("inlineCode",{parentName:"p"},"[Route]")," \u7279\u6027\uff0c\u4f46\u662f\u8d34\u4e86 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u7279\u6027\u5c06\u4f1a\u62a5\u9519\u3002\u539f\u56e0\u662f ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u7279\u6027\u5185\u90e8\u505a\u4e86\u8def\u7531\u7279\u6027\u68c0\u6d4b\u3002\u6240\u4ee5\u5efa\u8bae\u4f7f\u7528 ",Object(b.b)("inlineCode",{parentName:"p"},"[ApiDataValidation]")," \u4ee3\u66ff\u3002"),Object(b.b)("p",{parentName:"div"},"\u67e5\u770b ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/dotnet/aspnetcore/blob/c565386a3ed135560bc2e9017aa54a950b4e35dd/src/Mvc/Mvc.Core/src/ApplicationModels/ApiBehaviorApplicationModelProvider.cs#L90"}),"ASP.NET Core - ApiBehaviorApplicationModelProvider \u6e90\u7801")))),Object(b.b)("h2",{id:"511-\u5173\u4e8e-aop-\u62e6\u622a"},"5.11 \u5173\u4e8e AOP \u62e6\u622a"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"\u52a8\u6001WebAPI")," \u652f\u6301 ",Object(b.b)("inlineCode",{parentName:"p"},"Controller")," \u7684\u6240\u6709\u8fc7\u6ee4\u5668/\u7b5b\u9009\u5668\u62e6\u622a\uff0c\u4e5f\u5c31\u662f\u53ef\u4ee5\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"ActionFilter"),"\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"ResultFilter")," \u8fdb\u884c\u62e6\u622a\u64cd\u4f5c\u3002\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3}","{1,3}":!0}),"public class SampleAsyncActionFilter : IAsyncActionFilter\n{\n public async Task OnActionExecutionAsync(ActionExecutingContext context,ActionExecutionDelegate next)\n {\n // \u62e6\u622a\u4e4b\u524d\n\n var resultContext = await next();\n\n // \u62e6\u622a\u4e4b\u540e\n\n // \u5f02\u5e38\u62e6\u622a\n if(resultContext.Exception != null)\n {\n\n }\n }\n}\n")),Object(b.b)("p",null,"\u8be6\u7ec6\u7528\u6cd5\u53ef\u53c2\u89c1 ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/mvc/controllers/filters?view=aspnetcore-5.0"}),"ASP.NET Core 5.0 - \u7b5b\u9009\u5668")),Object(b.b)("h2",{id:"512-\u53cd\u9988\u4e0e\u5efa\u8bae"},"5.12 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(b.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(b.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}O.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/handbook/build/1.f7cb6107.js b/docs/1.9f7a0c86.js similarity index 88% rename from handbook/build/1.f7cb6107.js rename to docs/1.9f7a0c86.js index a734b7dcf2f..255c0da6aa5 100644 --- a/handbook/build/1.f7cb6107.js +++ b/docs/1.9f7a0c86.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return c}));var a=n(21),r=n(191);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+c:c}(t,e,n,a)}}function c(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},194:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{}});var l=n(190),u=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);re.startsWith("/"))(_)?p(_):_):void 0;var _;const C=Object(a.useRef)(!1),w=n?o.e:o.c,D=s.a.canUseIntersectionObserver;let P;Object(a.useEffect)(()=>(!D&&y&&window.docusaurus.prefetch(k),()=>{D&&P&&P.disconnect()}),[k,D,y]);const S=null!==(t=null==k?void 0:k.startsWith("#"))&&void 0!==t&&t,N=!k||!y||S;return k&&y&&!S&&!b&&O.collectLink(k),N?r.a.createElement("a",Object.assign({href:k},E&&!y&&{target:"_blank",rel:"noopener noreferrer"},g)):r.a.createElement(w,Object.assign({},g,{onMouseEnter:()=>{C.current||(window.docusaurus.preload(k),C.current=!0)},innerRef:e=>{var t,n;D&&e&&y&&(t=e,n=()=>{window.docusaurus.prefetch(k)},P=new window.IntersectionObserver(e=>{e.forEach(e=>{t===e.target&&(e.isIntersecting||e.intersectionRatio>0)&&(P.unobserve(t),P.disconnect(),n())})}),P.observe(t))},to:k||""},n&&{isActive:h,activeClassName:m}))}},201:function(e,t,n){try{e.exports=n(218)}catch(a){e.exports={}}},202:function(e,t,n){"use strict";n.r(t);var a=n(10);n.d(t,"MemoryRouter",(function(){return a.d})),n.d(t,"Prompt",(function(){return a.f})),n.d(t,"Redirect",(function(){return a.g})),n.d(t,"Route",(function(){return a.h})),n.d(t,"Router",(function(){return a.i})),n.d(t,"StaticRouter",(function(){return a.j})),n.d(t,"Switch",(function(){return a.k})),n.d(t,"generatePath",(function(){return a.l})),n.d(t,"matchPath",(function(){return a.m})),n.d(t,"useHistory",(function(){return a.n})),n.d(t,"useLocation",(function(){return a.o})),n.d(t,"useParams",(function(){return a.p})),n.d(t,"useRouteMatch",(function(){return a.q})),n.d(t,"withRouter",(function(){return a.r})),n.d(t,"BrowserRouter",(function(){return a.a})),n.d(t,"HashRouter",(function(){return a.b})),n.d(t,"Link",(function(){return a.c})),n.d(t,"NavLink",(function(){return a.e}))},203:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(194),c=n(65),s=n.n(c);var i=function(){return r.a.createElement("nav",{"aria-label":"Skip navigation links"},r.a.createElement("button",{type:"button",tabIndex:0,className:s.a.skipToContent,onKeyDown:e=>{if(13!==e.keyCode)return;document.activeElement.blur();const t=document.querySelector("main:first-of-type");t&&t.scrollIntoView()}},"Skip to main content"))},l=n(195),u=n(196),d=n(66),f=n.n(d);var m=function(){const{isAnnouncementBarClosed:e,closeAnnouncementBar:t}=Object(u.a)(),{announcementBar:n}=Object(l.useThemeConfig)();if(!n)return null;const{content:a,backgroundColor:c,textColor:s,isCloseable:i}=n;return!a||i&&e?null:r.a.createElement("div",{className:f.a.announcementBar,style:{backgroundColor:c,color:s},role:"banner"},r.a.createElement("div",{className:Object(o.a)(f.a.announcementBarContent,{[f.a.announcementBarCloseable]:i}),dangerouslySetInnerHTML:{__html:a}}),i?r.a.createElement("button",{type:"button",className:f.a.announcementBarClose,onClick:t,"aria-label":"Close"},r.a.createElement("span",{"aria-hidden":"true"},"\xd7")):null)},h=n(3),b=n(24),v=n(21),g=n(202),p=n(190),O=n(198),E=n(23),y=n(233);function j(){return r.a.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.a.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var k=n(234);function _(){return(_=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.isLast),u=null!==(o=null!=c?c:s)&&void 0!==o?o:i;return Object(l.docVersionSearchTag)(e,u.name)}))];return{locale:e.currentLocale,tags:r}}();return["language:"+e,t.map(e=>"docusaurus_tag:"+e)]}let A=null;function L({hit:e,children:t}){return r.a.createElement(O.a,{to:e.url},t)}function V({state:e,onClose:t}){const{generateSearchPageLink:n}=Object(y.a)();return r.a.createElement(O.a,{to:n(e.query),onClick:t},"See all ",e.context.nbHits," results")}function T({contextualSearch:e,...t}){var o,c;const{siteMetadata:s}=Object(v.default)(),i=N(),l=null!==(o=null===(c=t.searchParameters)||void 0===c?void 0:c.facetFilters)&&void 0!==o?o:[],u=e?[...i,...l]:l,d={...t.searchParameters,facetFilters:u},{withBaseUrl:f}=Object(p.b)(),m=Object(g.useHistory)(),O=Object(a.useRef)(null),[y,j]=Object(a.useState)(!1),[k,_]=Object(a.useState)(null),C=Object(a.useCallback)(()=>A?Promise.resolve():Promise.all([n.e(114).then(n.bind(null,273)),Promise.all([n.e(0),n.e(115)]).then(n.bind(null,272)),n.e(0).then(n.t.bind(null,189,7))]).then(([{DocSearchModal:e}])=>{A=e}),[]),w=Object(a.useCallback)(()=>{C().then(()=>{j(!0)})},[C,j]),D=Object(a.useCallback)(()=>{j(!1)},[j]),S=Object(a.useCallback)(e=>{C().then(()=>{j(!0),_(e.key)})},[C,j,_]),T=Object(a.useRef)({navigate({itemUrl:e}){m.push(e)}}).current,I=Object(a.useRef)(e=>e.map(e=>{const t=document.createElement("a");return t.href=e.url,{...e,url:f(`${t.pathname}${t.hash}`)}})).current,x=Object(a.useMemo)(()=>e=>r.a.createElement(V,Object(h.a)({},e,{onClose:D})),[D]),M=Object(a.useCallback)(e=>(e.addAlgoliaAgent("docusaurus",s.docusaurusVersion),e),[s.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,c=e.searchButtonRef;r.a.useEffect((function(){function e(e){(27===e.keyCode&&t||"k"===e.key&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),c&&c.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,c])}({isOpen:y,onOpen:w,onClose:D,onInput:S,searchButtonRef:O}),r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,null,r.a.createElement("link",{rel:"preconnect",href:`https://${t.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})),r.a.createElement(P,{onTouchStart:C,onFocus:C,onMouseOver:C,onClick:w,ref:O}),y&&Object(b.createPortal)(r.a.createElement(A,Object(h.a)({onClose:D,initialScrollY:window.scrollY,initialQuery:k,navigator:T,transformItems:I,hitComponent:L,resultsFooterComponent:x,transformSearchClient:M},t,{searchParameters:d})),document.body))}var I=function(){const{siteConfig:e}=Object(v.default)();return r.a.createElement(T,e.themeConfig.algolia)},x=n(249),M=n.n(x),B=n(67),R=n.n(B);const U=({icon:e,style:t})=>r.a.createElement("span",{className:Object(o.a)(R.a.toggle,R.a.dark),style:t},e),F=({icon:e,style:t})=>r.a.createElement("span",{className:Object(o.a)(R.a.toggle,R.a.light),style:t},e);var $=function(e){const{colorMode:{switchConfig:{darkIcon:t,darkIconStyle:n,lightIcon:a,lightIconStyle:o}}}=Object(l.useThemeConfig)(),{isClient:c}=Object(v.default)();return r.a.createElement(M.a,Object(h.a)({disabled:!c,icons:{checked:r.a.createElement(U,{icon:t,style:n}),unchecked:r.a.createElement(F,{icon:a,style:o})}},e))},H=n(205),X=n(236);var G=e=>{const t=Object(g.useLocation)(),[n,r]=Object(a.useState)(!e),o=Object(a.useRef)(!1),[c,s]=Object(a.useState)(0),[i,l]=Object(a.useState)(0),u=Object(a.useCallback)(e=>{null!==e&&l(e.getBoundingClientRect().height)},[]);return Object(X.a)(({scrollY:t})=>{if(!e)return;if(t=c?r(!1):t+a{e&&c&&r(!0)},[t.pathname]),Object(a.useEffect)(()=>{e&&(o.current=!0)},[t.hash]),{navbarRef:u,isNavbarVisible:n}},K=n(237),W=n(238),q=n(209);function Y({mobile:e,...t}){const{siteConfig:{baseUrl:n},i18n:{defaultLocale:a,currentLocale:o,locales:c,localeConfigs:s}}=Object(v.default)(),{pathname:i}=Object(g.useLocation)();function l(e){return s[e].label}const u=o===a?n:n.replace(`/${o}/`,"/"),d=i.replace(n,"");const f=c.map(e=>{const t=`${function(e){return e===a?""+u:`${u}${e}/`}(e)}${d}`;return{isNavLink:!0,label:l(e),to:"pathname://"+t,target:"_self",autoAddBaseUrl:!1,className:e===o?"dropdown__link--active":""}}),m=e?"Languages":l(o);return r.a.createElement(q.a,Object(h.a)({},t,{mobile:e,label:m,items:f}))}const z={default:()=>q.a,localeDropdown:()=>Y,docsVersion:()=>n(254).default,docsVersionDropdown:()=>n(255).default,doc:()=>n(256).default};function J({type:e,...t}){const n=((e="default")=>{const t=z[e];if(!t)throw new Error(`No NavbarItem component found for type=${e}.`);return t()})(e);return r.a.createElement(n,t)}var Q=n(248),Z=n(239),ee=n(69),te=n.n(ee);const ne="right";var ae=function(){const{navbar:{items:e,hideOnScroll:t,style:n},colorMode:{disableSwitch:c}}=Object(l.useThemeConfig)(),[s,i]=Object(a.useState)(!1),[u,d]=Object(a.useState)(!1),{isDarkTheme:f,setLightTheme:m,setDarkTheme:b}=Object(H.a)(),{navbarRef:v,isNavbarVisible:g}=G(t);Object(K.a)(s);const p=Object(a.useCallback)(()=>{i(!0)},[i]),O=Object(a.useCallback)(()=>{i(!1)},[i]),E=Object(a.useCallback)(e=>e.target.checked?b():m(),[m,b]),y=Object(W.a)();Object(a.useEffect)(()=>{y===W.b.desktop&&i(!1)},[y]);const{leftItems:j,rightItems:k}=function(e){return{leftItems:e.filter(e=>{var t;return"left"===(null!==(t=e.position)&&void 0!==t?t:ne)}),rightItems:e.filter(e=>{var t;return"right"===(null!==(t=e.position)&&void 0!==t?t:ne)})}}(e);return r.a.createElement("nav",{ref:v,className:Object(o.a)("navbar","navbar--fixed-top",{"navbar--dark":"dark"===n,"navbar--primary":"primary"===n,"navbar-sidebar--show":s,[te.a.navbarHideable]:t,[te.a.navbarHidden]:!g})},r.a.createElement("div",{className:"navbar__inner"},r.a.createElement("div",{className:"navbar__items"},null!=e&&0!==e.length&&r.a.createElement("div",{"aria-label":"Navigation bar toggle",className:"navbar__toggle",role:"button",tabIndex:0,onClick:p,onKeyDown:p},r.a.createElement(Z.a,null)),r.a.createElement(Q.a,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:Object(o.a)("navbar__title",{[te.a.hideLogoText]:u})}),j.map((e,t)=>r.a.createElement(J,Object(h.a)({},e,{key:t})))),r.a.createElement("div",{className:"navbar__items navbar__items--right"},k.map((e,t)=>r.a.createElement(J,Object(h.a)({},e,{key:t}))),!c&&r.a.createElement($,{className:te.a.displayOnlyInLargeViewport,"aria-label":"Dark mode toggle",checked:f,onChange:E}),r.a.createElement(I,{handleSearchBarToggle:d,isSearchBarExpanded:u}))),r.a.createElement("div",{role:"presentation",className:"navbar-sidebar__backdrop",onClick:O}),r.a.createElement("div",{className:"navbar-sidebar"},r.a.createElement("div",{className:"navbar-sidebar__brand"},r.a.createElement(Q.a,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title",onClick:O}),!c&&s&&r.a.createElement($,{"aria-label":"Dark mode toggle in sidebar",checked:f,onChange:E})),r.a.createElement("div",{className:"navbar-sidebar__items"},r.a.createElement("div",{className:"menu"},r.a.createElement("ul",{className:"menu__list"},e.map((e,t)=>r.a.createElement(J,Object(h.a)({mobile:!0},e,{onClick:O,key:t}))))))))},re=n(70),oe=n.n(re);function ce({to:e,href:t,label:n,prependBaseUrlToHref:a,...o}){const c=Object(p.a)(e),s=Object(p.a)(t,{forcePrependBaseUrl:!0});return r.a.createElement(O.a,Object(h.a)({className:"footer__link-item"},t?{target:"_blank",rel:"noopener noreferrer",href:a?s:t}:{to:c},o),n)}const se=({url:e,alt:t})=>r.a.createElement("img",{className:"footer__logo",alt:t,src:e});var ie=function(){const{footer:e}=Object(l.useThemeConfig)(),{copyright:t,links:n=[],logo:a={}}=e||{},c=Object(p.a)(a.src);return e?r.a.createElement("footer",{className:Object(o.a)("footer",{"footer--dark":"dark"===e.style})},r.a.createElement("div",{className:"container"},n&&n.length>0&&r.a.createElement("div",{className:"row footer__links"},n.map((e,t)=>r.a.createElement("div",{key:t,className:"col footer__col"},null!=e.title?r.a.createElement("h4",{className:"footer__title"},e.title):null,null!=e.items&&Array.isArray(e.items)&&e.items.length>0?r.a.createElement("ul",{className:"footer__items"},e.items.map((e,t)=>e.html?r.a.createElement("li",{key:t,className:"footer__item",dangerouslySetInnerHTML:{__html:e.html}}):r.a.createElement("li",{key:e.href||e.to,className:"footer__item"},r.a.createElement(ce,e)))):null))),(a||t)&&r.a.createElement("div",{className:"footer__bottom text--center"},a&&a.src&&r.a.createElement("div",{className:"margin-bottom--sm"},a.href?r.a.createElement("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:oe.a.footerLogoLink},r.a.createElement(se,{alt:a.alt,url:c})):r.a.createElement(se,{alt:a.alt,url:c})),t?r.a.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}}):null))):null},le=n(11);const ue="light",de="dark",fe=e=>e===de?de:ue,me=()=>le.a.canUseDOM?fe(document.documentElement.getAttribute("data-theme")):ue,he=e=>{try{localStorage.setItem("theme",fe(e))}catch(t){console.error(t)}};var be=()=>{const{colorMode:{disableSwitch:e,respectPrefersColorScheme:t}}=Object(l.useThemeConfig)(),[n,r]=Object(a.useState)(me),o=Object(a.useCallback)(()=>{r(ue),he(ue)},[]),c=Object(a.useCallback)(()=>{r(de),he(de)},[]);return Object(a.useEffect)(()=>{document.documentElement.setAttribute("data-theme",fe(n))},[n]),Object(a.useEffect)(()=>{if(!e)try{const e=localStorage.getItem("theme");null!==e&&r(fe(e))}catch(t){console.error(t)}},[r]),Object(a.useEffect)(()=>{e&&!t||window.matchMedia("(prefers-color-scheme: dark)").addListener(({matches:e})=>{r(e?de:ue)})},[]),{isDarkTheme:n===de,setLightTheme:o,setDarkTheme:c}},ve=n(235);var ge=function(e){const{isDarkTheme:t,setLightTheme:n,setDarkTheme:a}=be();return r.a.createElement(ve.a.Provider,{value:{isDarkTheme:t,setLightTheme:n,setDarkTheme:a}},e.children)};const pe="docusaurus.tab.";var Oe=()=>{const[e,t]=Object(a.useState)({}),n=Object(a.useCallback)((e,t)=>{try{localStorage.setItem("docusaurus.tab."+e,t)}catch(n){console.error(n)}},[]);return Object(a.useEffect)(()=>{try{const e={};for(let t=0;t{t(t=>({...t,[e]:a})),n(e,a)}}};const Ee="docusaurus.announcement.dismiss",ye="docusaurus.announcement.id";var je=()=>{const{announcementBar:e}=Object(l.useThemeConfig)(),[t,n]=Object(a.useState)(!0),r=Object(a.useCallback)(()=>{localStorage.setItem(Ee,"true"),n(!0)},[]);return Object(a.useEffect)(()=>{if(!e)return;const{id:t}=e;let a=localStorage.getItem(ye);"annoucement-bar"===a&&(a="announcement-bar");const r=t!==a;localStorage.setItem(ye,t),r&&localStorage.setItem(Ee,"false"),(r||"false"===localStorage.getItem(Ee))&&n(!1)},[]),{isAnnouncementBarClosed:t,closeAnnouncementBar:r}},ke=n(197);var _e=function(e){const{tabGroupChoices:t,setTabGroupChoices:n}=Oe(),{isAnnouncementBarClosed:a,closeAnnouncementBar:o}=je();return r.a.createElement(ke.a.Provider,{value:{tabGroupChoices:t,setTabGroupChoices:n,isAnnouncementBarClosed:a,closeAnnouncementBar:o}},e.children)};function Ce({children:e}){return r.a.createElement(ge,null,r.a.createElement(_e,null,r.a.createElement(l.DocsPreferredVersionContextProvider,null,e)))}function we({locale:e,version:t,tag:n}){const a=e;return r.a.createElement(E.a,null,a&&r.a.createElement("meta",{name:"docsearch:language",content:a}),t&&r.a.createElement("meta",{name:"docsearch:version",content:t}),n&&r.a.createElement("meta",{name:"docsearch:docusaurus_tag",content:n}))}function De(e){const{siteConfig:t,i18n:{currentLocale:n}}=Object(v.default)(),{favicon:a,themeConfig:{image:o,metadatas:c},url:s}=t,{title:i,description:u,image:d,keywords:f,permalink:m,searchMetadatas:b}=e,g=Object(l.useTitleFormatter)(i),O=d||o,y=Object(p.a)(O,{absolute:!0}),j=Object(p.a)(a),k=n.split("-")[0];return r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,null,r.a.createElement("html",{lang:k}),g&&r.a.createElement("title",null,g),g&&r.a.createElement("meta",{property:"og:title",content:g}),a&&r.a.createElement("link",{rel:"shortcut icon",href:j}),u&&r.a.createElement("meta",{name:"description",content:u}),u&&r.a.createElement("meta",{property:"og:description",content:u}),f&&f.length&&r.a.createElement("meta",{name:"keywords",content:f.join(",")}),O&&r.a.createElement("meta",{property:"og:image",content:y}),O&&r.a.createElement("meta",{name:"twitter:image",content:y}),O&&r.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+g}),m&&r.a.createElement("meta",{property:"og:url",content:s+m}),m&&r.a.createElement("link",{rel:"canonical",href:s+m}),r.a.createElement("meta",{name:"twitter:card",content:"summary_large_image"})),r.a.createElement(we,Object(h.a)({tag:l.DEFAULT_SEARCH_TAG,locale:n},b)),r.a.createElement(E.a,null,c.map((e,t)=>r.a.createElement("meta",Object(h.a)({key:"metadata_"+t},e)))))}n(71);var Pe=function(){Object(a.useEffect)(()=>{const e="navigation-with-keyboard";function t(t){"keydown"===t.type&&"Tab"===t.key&&document.body.classList.add(e),"mousedown"===t.type&&document.body.classList.remove(e)}return document.addEventListener("keydown",t),document.addEventListener("mousedown",t),()=>{document.body.classList.remove(e),document.removeEventListener("keydown",t),document.removeEventListener("mousedown",t)}},[])};n(72);t.a=function(e){const{children:t,noFooter:n,wrapperClassName:a}=e;return Pe(),r.a.createElement(Ce,null,r.a.createElement(De,e),r.a.createElement(i,null),r.a.createElement(m,null),r.a.createElement(ae,null),r.a.createElement("div",{className:Object(o.a)("main-wrapper",a)},t),!n&&r.a.createElement(ie,null))}},205:function(e,t,n){"use strict";var a=n(0),r=n(235);t.a=function(){const e=Object(a.useContext)(r.a);if(null==e)throw new Error("`useThemeContext` is used outside of `Layout` Component. See https://v2.docusaurus.io/docs/theme-classic#usethemecontext.");return e}},206:function(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useThemeConfig=void 0;const r=a(n(21));t.useThemeConfig=function(){return r.default().siteConfig.themeConfig}},207:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDocsPluginEnabled=void 0;const a=n(201);t.isDocsPluginEnabled=!!a.useAllDocsData},208:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&a(t,e,n);return r(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionContext=t.DocsPreferredVersionContextProvider=void 0;const s=o(n(0)),i=n(206),l=n(207),u=n(201),d=c(n(224));function f({pluginIds:e,versionPersistence:t,allDocsData:n}){const a={};return e.forEach(e=>{a[e]=function(e){const a=d.default.read(e,t);return n[e].versions.some(e=>e.name===a)?{preferredVersionName:a}:(d.default.clear(e,t),{preferredVersionName:null})}(e)}),a}function m(){const e=u.useAllDocsData(),t=i.useThemeConfig().docs.versionPersistence,n=s.useMemo(()=>Object.keys(e),[e]),[a,r]=s.useState(()=>function(e){const t={};return e.forEach(e=>{t[e]={preferredVersionName:null}}),t}(n));s.useEffect(()=>{r(f({allDocsData:e,versionPersistence:t,pluginIds:n}))},[e,t,n]);return[a,s.useMemo(()=>({savePreferredVersion:function(e,n){d.default.save(e,t,n),r(t=>Object.assign(Object.assign({},t),{[e]:{preferredVersionName:n}}))}}),[r])]}const h=s.createContext(null);function b({children:e}){const t=m();return s.default.createElement(h.Provider,{value:t},e)}t.DocsPreferredVersionContextProvider=function({children:e}){return l.isDocsPluginEnabled?s.default.createElement(b,null,e):s.default.createElement(s.default.Fragment,null,e)},t.useDocsPreferredVersionContext=function(){const e=s.useContext(h);if(!e)throw new Error("Can't find docs preferred context, maybe you forgot to use the DocsPreferredVersionContextProvider ?");return e}},209:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r),c=n(194),s=n(198),i=n(190),l=n(202),u=n(195);function d({activeBasePath:e,activeBaseRegex:t,to:n,href:r,label:c,activeClassName:l="navbar__link--active",prependBaseUrlToHref:u,...d}){const f=Object(i.a)(n),m=Object(i.a)(e),h=Object(i.a)(r,{forcePrependBaseUrl:!0});return o.a.createElement(s.a,Object(a.a)({},r?{target:"_blank",rel:"noopener noreferrer",href:u?h:r}:{isNavLink:!0,activeClassName:l,to:f,...e||t?{isActive:(e,n)=>t?new RegExp(t).test(n.pathname):n.pathname.startsWith(m)}:null},d),c)}function f({items:e,position:t,className:n,...s}){const i=Object(r.useRef)(null),l=Object(r.useRef)(null),[u,f]=Object(r.useState)(!1);Object(r.useEffect)(()=>{const e=e=>{i.current&&!i.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[i]);const m=(e,t=!1)=>Object(c.a)({"navbar__item navbar__link":!t,dropdown__link:t},e);return e?o.a.createElement("div",{ref:i,className:Object(c.a)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--left":"left"===t,"dropdown--right":"right"===t,"dropdown--show":u})},o.a.createElement(d,Object(a.a)({className:m(n)},s,{onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),f(!u))}}),s.label),o.a.createElement("ul",{ref:l,className:"dropdown__menu"},e.map(({className:t,...n},r)=>o.a.createElement("li",{key:r},o.a.createElement(d,Object(a.a)({onKeyDown:t=>{if(r===e.length-1&&"Tab"===t.key){t.preventDefault(),f(!1);const e=i.current.nextElementSibling;e&&e.focus()}},activeClassName:"dropdown__link--active",className:m(t,!0)},n)))))):o.a.createElement(d,Object(a.a)({className:m(n)},s))}function m({items:e,className:t,position:n,...s}){var i,f;const m=Object(r.useRef)(null),{pathname:h}=Object(l.useLocation)(),[b,v]=Object(r.useState)(()=>{var t;return null===(t=!(null!=e&&e.some(e=>Object(u.isSamePath)(e.to,h))))||void 0===t||t}),g=(e,t=!1)=>Object(c.a)("menu__link",{"menu__link--sublist":t},e);if(!e)return o.a.createElement("li",{className:"menu__list-item"},o.a.createElement(d,Object(a.a)({className:g(t)},s)));const p=null!==(i=m.current)&&void 0!==i&&i.scrollHeight?(null===(f=m.current)||void 0===f?void 0:f.scrollHeight)+"px":void 0;return o.a.createElement("li",{className:Object(c.a)("menu__list-item",{"menu__list-item--collapsed":b})},o.a.createElement(d,Object(a.a)({role:"button",className:g(t,!0)},s,{onClick:()=>{v(e=>!e)}}),s.label),o.a.createElement("ul",{className:"menu__list",ref:m,style:{height:b?void 0:p}},e.map(({className:e,...t},n)=>o.a.createElement("li",{className:"menu__list-item",key:n},o.a.createElement(d,Object(a.a)({activeClassName:"menu__link--active",className:g(e)},t,{onClick:s.onClick}))))))}t.a=function({mobile:e=!1,...t}){const n=e?m:f;return o.a.createElement(n,t)}},217:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.docVersionSearchTag=t.DEFAULT_SEARCH_TAG=void 0,t.DEFAULT_SEARCH_TAG="default",t.docVersionSearchTag=function(e,t){return`docs-${e}-${t}`}},218:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocVersionSuggestions=t.useActiveDocContext=t.useActiveVersion=t.useLatestVersion=t.useVersions=t.useActivePluginAndVersion=t.useActivePlugin=t.useDocsData=t.useAllDocsData=void 0;const a=n(202),r=n(219),o=n(220);t.useAllDocsData=()=>r.useAllPluginInstancesData("docusaurus-plugin-content-docs"),t.useDocsData=e=>r.usePluginData("docusaurus-plugin-content-docs",e),t.useActivePlugin=(e={})=>{const n=t.useAllDocsData(),{pathname:r}=a.useLocation();return o.getActivePlugin(n,r,e)},t.useActivePluginAndVersion=(e={})=>{const n=t.useActivePlugin(e),{pathname:r}=a.useLocation();if(n){return{activePlugin:n,activeVersion:o.getActiveVersion(n.pluginData,r)}}},t.useVersions=e=>t.useDocsData(e).versions,t.useLatestVersion=e=>{const n=t.useDocsData(e);return o.getLatestVersion(n)},t.useActiveVersion=e=>{const n=t.useDocsData(e),{pathname:r}=a.useLocation();return o.getActiveVersion(n,r)},t.useActiveDocContext=e=>{const n=t.useDocsData(e),{pathname:r}=a.useLocation();return o.getActiveDocContext(n,r)},t.useDocVersionSuggestions=e=>{const n=t.useDocsData(e),{pathname:r}=a.useLocation();return o.getDocVersionSuggestions(n,r)}},219:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r})),n.d(t,"useAllPluginInstancesData",(function(){return o})),n.d(t,"usePluginData",(function(){return c}));var a=n(21);function r(){const{globalData:e}=Object(a.default)();if(!e)throw new Error("Docusaurus global data not found");return e}function o(e){const t=r()[e];if(!t)throw new Error("Docusaurus plugin global data not found for pluginName="+e);return t}function c(e,t="default"){const n=o(e)[t];if(!n)throw new Error(`Docusaurus plugin global data not found for pluginName=${e} and pluginId=${t}`);return n}},220:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDocVersionSuggestions=t.getActiveDocContext=t.getActiveVersion=t.getLatestVersion=t.getActivePlugin=void 0;const a=n(202);t.getActivePlugin=function(e,t,n={}){const r=Object.entries(e).find(([e,n])=>!!a.matchPath(t,{path:n.path,exact:!1,strict:!1})),o=r?{pluginId:r[0],pluginData:r[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for pathname=${t}, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map(e=>e.path).join(", ")}`);return o},t.getLatestVersion=e=>e.versions.find(e=>e.isLast),t.getActiveVersion=(e,n)=>{const r=t.getLatestVersion(e);return[...e.versions.filter(e=>e!==r),r].find(e=>!!a.matchPath(n,{path:e.path,exact:!1,strict:!1}))},t.getActiveDocContext=(e,n)=>{const r=t.getActiveVersion(e,n),o=null==r?void 0:r.docs.find(e=>!!a.matchPath(n,{path:e.path,exact:!0,strict:!1}));return{activeVersion:r,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach(e=>{e.docs.forEach(a=>{a.id===t&&(n[e.name]=a)})}),n}(o.id):{}}},t.getDocVersionSuggestions=(e,n)=>{const a=t.getLatestVersion(e),r=t.getActiveDocContext(e,n),o=r.activeVersion!==a;return{latestDocSuggestion:o?null==r?void 0:r.alternateDocVersions[a.name]:void 0,latestVersionSuggestion:o?a:void 0}}},221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSamePath=void 0,t.isSamePath=(e,t)=>{const n=e=>!e||(null==e?void 0:e.endsWith("/"))?e:e+"/";return n(e)===n(t)}},222:function(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTitleFormatter=void 0;const r=a(n(21));t.useTitleFormatter=e=>{const{siteConfig:t={}}=r.default(),{title:n,titleDelimiter:a="|"}=t;return e&&e.trim().length?`${e.trim()} ${a} ${n}`:n}},223:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionByPluginId=t.useDocsPreferredVersion=void 0;const a=n(0),r=n(208),o=n(201),c=n(225);t.useDocsPreferredVersion=function(e=c.DEFAULT_PLUGIN_ID){const t=o.useDocsData(e),[n,s]=r.useDocsPreferredVersionContext(),{preferredVersionName:i}=n[e];return{preferredVersion:i?t.versions.find(e=>e.name===i):null,savePreferredVersionName:a.useCallback(t=>{s.savePreferredVersion(e,t)},[s])}},t.useDocsPreferredVersionByPluginId=function(){const e=o.useAllDocsData(),[t]=r.useDocsPreferredVersionContext(),n=Object.keys(e),a={};return n.forEach(n=>{a[n]=function(n){const a=e[n],{preferredVersionName:r}=t[n];return r?a.versions.find(e=>e.name===r):null}(n)}),a}},224:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=e=>"docs-preferred-version-"+e,r={save:(e,t,n)=>{"none"===t||window.localStorage.setItem(a(e),n)},read:(e,t)=>"none"===t?null:window.localStorage.getItem(a(e)),clear:(e,t)=>{"none"===t||window.localStorage.removeItem(a(e))}};t.default=r},225:function(e,t,n){"use strict";n.r(t),n.d(t,"DEFAULT_PLUGIN_ID",(function(){return a}));const a="default"},233:function(e,t,n){"use strict";var a=n(202),r=n(11),o=n(21);t.a=function(){const e=Object(a.useHistory)(),t=Object(a.useLocation)(),{siteConfig:{baseUrl:n}={}}=Object(o.default)();return{searchValue:r.a.canUseDOM&&new URLSearchParams(t.search).get("q")||"",updateSearchPath:n=>{const a=new URLSearchParams(t.search);n?a.set("q",n):a.delete("q"),e.replace({search:a.toString()})},generateSearchPageLink:e=>`${n}search?q=${encodeURIComponent(e)}`}}},234:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(0),r=n.n(a);function o(){return r.a.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.a.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},235:function(e,t,n){"use strict";var a=n(0);const r=n.n(a).a.createContext(void 0);t.a=r},236:function(e,t,n){"use strict";var a=n(0),r=n(11);const o=()=>({scrollX:r.a.canUseDOM?window.pageXOffset:0,scrollY:r.a.canUseDOM?window.pageYOffset:0});t.a=(e,t=[])=>{const[n,r]=Object(a.useState)(o()),c=()=>{const t=o();r(t),e&&e(t)};return Object(a.useEffect)(()=>{const e={passive:!0};return window.addEventListener("scroll",c,e),()=>window.removeEventListener("scroll",c,e)},t),n}},237:function(e,t,n){"use strict";var a=n(0);t.a=function(e=!0){Object(a.useEffect)(()=>(document.body.style.overflow=e?"hidden":"visible",()=>{document.body.style.overflow="visible"}),[e])}},238:function(e,t,n){"use strict";n.d(t,"b",(function(){return r}));var a=n(0);const r={desktop:"desktop",mobile:"mobile"};t.a=function(){const e="undefined"!=typeof window;function t(){if(e)return window.innerWidth>996?r.desktop:r.mobile}const[n,o]=Object(a.useState)(t);return Object(a.useEffect)(()=>{if(e)return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n);function n(){o(t())}},[]),n}},239:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r);t.a=({width:e=30,height:t=30,className:n,...r})=>o.a.createElement("svg",Object(a.a)({"aria-label":"Menu",className:n,width:e,height:t,viewBox:"0 0 30 30",role:"img",focusable:"false"},r),o.a.createElement("title",null,"Menu"),o.a.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))},248:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r),c=n(198),s=n(194),i=n(21),l=n(205),u=n(68),d=n.n(u);var f=e=>{const{isClient:t}=Object(i.default)(),{isDarkTheme:n}=Object(l.a)(),{sources:r,className:c,alt:u="",...f}=e,m=t?n?["dark"]:["light"]:["light","dark"];return o.a.createElement(o.a.Fragment,null,m.map(e=>o.a.createElement("img",Object(a.a)({key:e,src:r[e],alt:u,className:Object(s.a)(d.a.themedImage,d.a["themedImage--"+e],c)},f))))},m=n(190),h=n(195),b=n(191);t.a=e=>{const{isClient:t}=Object(i.default)(),{navbar:{title:n,logo:r={src:""}}}=Object(h.useThemeConfig)(),{imageClassName:s,titleClassName:l,...u}=e,d=Object(m.a)(r.href||"/"),v=r.target?{target:r.target}:Object(b.a)(d)?{}:{rel:"noopener noreferrer",target:"_blank"},g={light:Object(m.a)(r.src),dark:Object(m.a)(r.srcDark||r.src)};return o.a.createElement(c.a,Object(a.a)({to:d},u,v),r.src&&o.a.createElement(f,{key:t,className:s,sources:g,alt:r.alt||n||"Logo"}),null!=n&&o.a.createElement("strong",{className:l},n))}},249:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;tthis.startX&&(this.setState({checked:!0}),this.startX=t,this.activated=tn?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,t.click()):this.startX-4=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}(t,["className","icons"])),o=(0,s.default)("react-toggle",{"react-toggle--checked":this.state.checked,"react-toggle--focus":this.state.hasFocus,"react-toggle--disabled":this.props.disabled},n);return c.default.createElement("div",{className:o,onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd},c.default.createElement("div",{className:"react-toggle-track"},c.default.createElement("div",{className:"react-toggle-track-check"},this.getIcon("checked")),c.default.createElement("div",{className:"react-toggle-track-x"},this.getIcon("unchecked"))),c.default.createElement("div",{className:"react-toggle-thumb"}),c.default.createElement("input",a({},r,{ref:function(t){e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur,className:"react-toggle-screenreader-only",type:"checkbox"})))}}]),t}(o.PureComponent);t.default=m,m.displayName="Toggle",m.defaultProps={icons:{checked:c.default.createElement(l.default,null),unchecked:c.default.createElement(u.default,null)}},m.propTypes={checked:i.default.bool,disabled:i.default.bool,defaultChecked:i.default.bool,onChange:i.default.func,onFocus:i.default.func,onBlur:i.default.func,className:i.default.string,name:i.default.string,value:i.default.string,id:i.default.string,"aria-labelledby":i.default.string,"aria-label":i.default.string,icons:i.default.oneOfType([i.default.bool,i.default.shape({checked:i.default.node,unchecked:i.default.node})])}},250:function(e,t,n){var a;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t0){var n=t[0];return{x:n.clientX,y:n.clientY}}var a=e.pageX;if(void 0!==a)return{x:a,y:e.pageY}}return{x:0,y:0}}},254:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return l}));var a=n(3),r=n(0),o=n.n(r),c=n(209),s=n(201),i=n(195);function l({label:e,to:t,docsPluginId:n,...r}){var l;const u=Object(s.useActiveVersion)(n),{preferredVersion:d}=Object(i.useDocsPreferredVersion)(n),f=Object(s.useLatestVersion)(n),m=null!==(l=null!=u?u:d)&&void 0!==l?l:f,h=null!=e?e:m.label,b=null!=t?t:(e=>e.docs.find(t=>t.id===e.mainDocId))(m).path;return o.a.createElement(c.a,Object(a.a)({},r,{label:h,to:b}))}},255:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var a=n(3),r=n(0),o=n.n(r),c=n(209),s=n(201),i=n(195);const l=e=>e.docs.find(t=>t.id===e.mainDocId);function u({mobile:e,docsPluginId:t,dropdownActiveClassDisabled:n,dropdownItemsBefore:r,dropdownItemsAfter:u,...d}){var f,m;const h=Object(s.useActiveDocContext)(t),b=Object(s.useVersions)(t),v=Object(s.useLatestVersion)(t),{preferredVersion:g,savePreferredVersionName:p}=Object(i.useDocsPreferredVersion)(t);const O=null!==(f=null!==(m=h.activeVersion)&&void 0!==m?m:g)&&void 0!==f?f:v,E=e?"Versions":O.label,y=e?void 0:l(O).path;return o.a.createElement(c.a,Object(a.a)({},d,{mobile:e,label:E,to:y,items:function(){const e=b.map(e=>{const t=(null==h?void 0:h.alternateDocVersions[e.name])||l(e);return{isNavLink:!0,label:e.label,to:t.path,isActive:()=>e===(null==h?void 0:h.activeVersion),onClick:()=>{p(e.name)}}}),t=[...r,...e,...u];if(!(t.length<=1))return t}(),isActive:n?()=>!1:void 0}))}},256:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var a=n(3),r=n(0),o=n.n(r),c=n(209),s=n(201),i=n(194),l=n(195);function u({docId:e,activeSidebarClassName:t,label:n,docsPluginId:r,...u}){var d;const{activeVersion:f,activeDoc:m}=Object(s.useActiveDocContext)(r),{preferredVersion:h}=Object(l.useDocsPreferredVersion)(r),b=Object(s.useLatestVersion)(r),v=null!==(d=null!=f?f:h)&&void 0!==d?d:b,g=v.docs.find(t=>t.id===e);if(!g)throw new Error(`DocNavbarItem: couldn't find any doc with id=${e} in version ${v.name}.\nAvailable docIds=\n- ${v.docs.join("\n- ")}`);return o.a.createElement(c.a,Object(a.a)({exact:!0},u,{className:Object(i.a)(u.className,{[t]:m&&m.sidebar===g.sidebar}),label:null!=n?n:g.id,to:g.path}))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[1],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return c}));var a=n(21),r=n(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+c:c}(t,e,n,a)}}function c(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},198:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{}});var l=n(194),u=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);re.startsWith("/"))(_)?p(_):_):void 0;var _;const C=Object(a.useRef)(!1),w=n?o.e:o.c,D=s.a.canUseIntersectionObserver;let P;Object(a.useEffect)(()=>(!D&&y&&window.docusaurus.prefetch(k),()=>{D&&P&&P.disconnect()}),[k,D,y]);const S=null!==(t=null==k?void 0:k.startsWith("#"))&&void 0!==t&&t,N=!k||!y||S;return k&&y&&!S&&!b&&O.collectLink(k),N?r.a.createElement("a",Object.assign({href:k},E&&!y&&{target:"_blank",rel:"noopener noreferrer"},g)):r.a.createElement(w,Object.assign({},g,{onMouseEnter:()=>{C.current||(window.docusaurus.preload(k),C.current=!0)},innerRef:e=>{var t,n;D&&e&&y&&(t=e,n=()=>{window.docusaurus.prefetch(k)},P=new window.IntersectionObserver(e=>{e.forEach(e=>{t===e.target&&(e.isIntersecting||e.intersectionRatio>0)&&(P.unobserve(t),P.disconnect(),n())})}),P.observe(t))},to:k||""},n&&{isActive:h,activeClassName:m}))}},205:function(e,t,n){try{e.exports=n(222)}catch(a){e.exports={}}},206:function(e,t,n){"use strict";n.r(t);var a=n(10);n.d(t,"MemoryRouter",(function(){return a.d})),n.d(t,"Prompt",(function(){return a.f})),n.d(t,"Redirect",(function(){return a.g})),n.d(t,"Route",(function(){return a.h})),n.d(t,"Router",(function(){return a.i})),n.d(t,"StaticRouter",(function(){return a.j})),n.d(t,"Switch",(function(){return a.k})),n.d(t,"generatePath",(function(){return a.l})),n.d(t,"matchPath",(function(){return a.m})),n.d(t,"useHistory",(function(){return a.n})),n.d(t,"useLocation",(function(){return a.o})),n.d(t,"useParams",(function(){return a.p})),n.d(t,"useRouteMatch",(function(){return a.q})),n.d(t,"withRouter",(function(){return a.r})),n.d(t,"BrowserRouter",(function(){return a.a})),n.d(t,"HashRouter",(function(){return a.b})),n.d(t,"Link",(function(){return a.c})),n.d(t,"NavLink",(function(){return a.e}))},207:function(e,t,n){"use strict";var a=n(0),r=n.n(a),o=n(198),c=n(65),s=n.n(c);var i=function(){return r.a.createElement("nav",{"aria-label":"Skip navigation links"},r.a.createElement("button",{type:"button",tabIndex:0,className:s.a.skipToContent,onKeyDown:e=>{if(13!==e.keyCode)return;document.activeElement.blur();const t=document.querySelector("main:first-of-type");t&&t.scrollIntoView()}},"Skip to main content"))},l=n(199),u=n(200),d=n(66),f=n.n(d);var m=function(){const{isAnnouncementBarClosed:e,closeAnnouncementBar:t}=Object(u.a)(),{announcementBar:n}=Object(l.useThemeConfig)();if(!n)return null;const{content:a,backgroundColor:c,textColor:s,isCloseable:i}=n;return!a||i&&e?null:r.a.createElement("div",{className:f.a.announcementBar,style:{backgroundColor:c,color:s},role:"banner"},r.a.createElement("div",{className:Object(o.a)(f.a.announcementBarContent,{[f.a.announcementBarCloseable]:i}),dangerouslySetInnerHTML:{__html:a}}),i?r.a.createElement("button",{type:"button",className:f.a.announcementBarClose,onClick:t,"aria-label":"Close"},r.a.createElement("span",{"aria-hidden":"true"},"\xd7")):null)},h=n(3),b=n(24),v=n(21),g=n(206),p=n(194),O=n(202),E=n(23),y=n(237);function j(){return r.a.createElement("svg",{width:"15",height:"15",className:"DocSearch-Control-Key-Icon"},r.a.createElement("path",{d:"M4.505 4.496h2M5.505 5.496v5M8.216 4.496l.055 5.993M10 7.5c.333.333.5.667.5 1v2M12.326 4.5v5.996M8.384 4.496c1.674 0 2.116 0 2.116 1.5s-.442 1.5-2.116 1.5M3.205 9.303c-.09.448-.277 1.21-1.241 1.203C1 10.5.5 9.513.5 8V7c0-1.57.5-2.5 1.464-2.494.964.006 1.134.598 1.24 1.342M12.553 10.5h1.953",strokeWidth:"1.2",stroke:"currentColor",fill:"none",strokeLinecap:"square"}))}var k=n(238);function _(){return(_=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.isLast),u=null!==(o=null!=c?c:s)&&void 0!==o?o:i;return Object(l.docVersionSearchTag)(e,u.name)}))];return{locale:e.currentLocale,tags:r}}();return["language:"+e,t.map(e=>"docusaurus_tag:"+e)]}let A=null;function L({hit:e,children:t}){return r.a.createElement(O.a,{to:e.url},t)}function V({state:e,onClose:t}){const{generateSearchPageLink:n}=Object(y.a)();return r.a.createElement(O.a,{to:n(e.query),onClick:t},"See all ",e.context.nbHits," results")}function T({contextualSearch:e,...t}){var o,c;const{siteMetadata:s}=Object(v.default)(),i=N(),l=null!==(o=null===(c=t.searchParameters)||void 0===c?void 0:c.facetFilters)&&void 0!==o?o:[],u=e?[...i,...l]:l,d={...t.searchParameters,facetFilters:u},{withBaseUrl:f}=Object(p.b)(),m=Object(g.useHistory)(),O=Object(a.useRef)(null),[y,j]=Object(a.useState)(!1),[k,_]=Object(a.useState)(null),C=Object(a.useCallback)(()=>A?Promise.resolve():Promise.all([n.e(118).then(n.bind(null,277)),Promise.all([n.e(0),n.e(119)]).then(n.bind(null,276)),n.e(0).then(n.t.bind(null,193,7))]).then(([{DocSearchModal:e}])=>{A=e}),[]),w=Object(a.useCallback)(()=>{C().then(()=>{j(!0)})},[C,j]),D=Object(a.useCallback)(()=>{j(!1)},[j]),S=Object(a.useCallback)(e=>{C().then(()=>{j(!0),_(e.key)})},[C,j,_]),T=Object(a.useRef)({navigate({itemUrl:e}){m.push(e)}}).current,I=Object(a.useRef)(e=>e.map(e=>{const t=document.createElement("a");return t.href=e.url,{...e,url:f(`${t.pathname}${t.hash}`)}})).current,x=Object(a.useMemo)(()=>e=>r.a.createElement(V,Object(h.a)({},e,{onClose:D})),[D]),M=Object(a.useCallback)(e=>(e.addAlgoliaAgent("docusaurus",s.docusaurusVersion),e),[s.docusaurusVersion]);return function(e){var t=e.isOpen,n=e.onOpen,a=e.onClose,o=e.onInput,c=e.searchButtonRef;r.a.useEffect((function(){function e(e){(27===e.keyCode&&t||"k"===e.key&&(e.metaKey||e.ctrlKey)||!function(e){var t=e.target,n=t.tagName;return t.isContentEditable||"INPUT"===n||"SELECT"===n||"TEXTAREA"===n}(e)&&"/"===e.key&&!t)&&(e.preventDefault(),t?a():document.body.classList.contains("DocSearch--active")||document.body.classList.contains("DocSearch--active")||n()),c&&c.current===document.activeElement&&o&&/[a-zA-Z0-9]/.test(String.fromCharCode(e.keyCode))&&o(e)}return window.addEventListener("keydown",e),function(){window.removeEventListener("keydown",e)}}),[t,n,a,o,c])}({isOpen:y,onOpen:w,onClose:D,onInput:S,searchButtonRef:O}),r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,null,r.a.createElement("link",{rel:"preconnect",href:`https://${t.appId}-dsn.algolia.net`,crossOrigin:"anonymous"})),r.a.createElement(P,{onTouchStart:C,onFocus:C,onMouseOver:C,onClick:w,ref:O}),y&&Object(b.createPortal)(r.a.createElement(A,Object(h.a)({onClose:D,initialScrollY:window.scrollY,initialQuery:k,navigator:T,transformItems:I,hitComponent:L,resultsFooterComponent:x,transformSearchClient:M},t,{searchParameters:d})),document.body))}var I=function(){const{siteConfig:e}=Object(v.default)();return r.a.createElement(T,e.themeConfig.algolia)},x=n(253),M=n.n(x),B=n(67),R=n.n(B);const U=({icon:e,style:t})=>r.a.createElement("span",{className:Object(o.a)(R.a.toggle,R.a.dark),style:t},e),F=({icon:e,style:t})=>r.a.createElement("span",{className:Object(o.a)(R.a.toggle,R.a.light),style:t},e);var $=function(e){const{colorMode:{switchConfig:{darkIcon:t,darkIconStyle:n,lightIcon:a,lightIconStyle:o}}}=Object(l.useThemeConfig)(),{isClient:c}=Object(v.default)();return r.a.createElement(M.a,Object(h.a)({disabled:!c,icons:{checked:r.a.createElement(U,{icon:t,style:n}),unchecked:r.a.createElement(F,{icon:a,style:o})}},e))},H=n(209),X=n(240);var G=e=>{const t=Object(g.useLocation)(),[n,r]=Object(a.useState)(!e),o=Object(a.useRef)(!1),[c,s]=Object(a.useState)(0),[i,l]=Object(a.useState)(0),u=Object(a.useCallback)(e=>{null!==e&&l(e.getBoundingClientRect().height)},[]);return Object(X.a)(({scrollY:t})=>{if(!e)return;if(t=c?r(!1):t+a{e&&c&&r(!0)},[t.pathname]),Object(a.useEffect)(()=>{e&&(o.current=!0)},[t.hash]),{navbarRef:u,isNavbarVisible:n}},K=n(241),W=n(242),q=n(213);function Y({mobile:e,...t}){const{siteConfig:{baseUrl:n},i18n:{defaultLocale:a,currentLocale:o,locales:c,localeConfigs:s}}=Object(v.default)(),{pathname:i}=Object(g.useLocation)();function l(e){return s[e].label}const u=o===a?n:n.replace(`/${o}/`,"/"),d=i.replace(n,"");const f=c.map(e=>{const t=`${function(e){return e===a?""+u:`${u}${e}/`}(e)}${d}`;return{isNavLink:!0,label:l(e),to:"pathname://"+t,target:"_self",autoAddBaseUrl:!1,className:e===o?"dropdown__link--active":""}}),m=e?"Languages":l(o);return r.a.createElement(q.a,Object(h.a)({},t,{mobile:e,label:m,items:f}))}const z={default:()=>q.a,localeDropdown:()=>Y,docsVersion:()=>n(258).default,docsVersionDropdown:()=>n(259).default,doc:()=>n(260).default};function J({type:e,...t}){const n=((e="default")=>{const t=z[e];if(!t)throw new Error(`No NavbarItem component found for type=${e}.`);return t()})(e);return r.a.createElement(n,t)}var Q=n(252),Z=n(243),ee=n(69),te=n.n(ee);const ne="right";var ae=function(){const{navbar:{items:e,hideOnScroll:t,style:n},colorMode:{disableSwitch:c}}=Object(l.useThemeConfig)(),[s,i]=Object(a.useState)(!1),[u,d]=Object(a.useState)(!1),{isDarkTheme:f,setLightTheme:m,setDarkTheme:b}=Object(H.a)(),{navbarRef:v,isNavbarVisible:g}=G(t);Object(K.a)(s);const p=Object(a.useCallback)(()=>{i(!0)},[i]),O=Object(a.useCallback)(()=>{i(!1)},[i]),E=Object(a.useCallback)(e=>e.target.checked?b():m(),[m,b]),y=Object(W.a)();Object(a.useEffect)(()=>{y===W.b.desktop&&i(!1)},[y]);const{leftItems:j,rightItems:k}=function(e){return{leftItems:e.filter(e=>{var t;return"left"===(null!==(t=e.position)&&void 0!==t?t:ne)}),rightItems:e.filter(e=>{var t;return"right"===(null!==(t=e.position)&&void 0!==t?t:ne)})}}(e);return r.a.createElement("nav",{ref:v,className:Object(o.a)("navbar","navbar--fixed-top",{"navbar--dark":"dark"===n,"navbar--primary":"primary"===n,"navbar-sidebar--show":s,[te.a.navbarHideable]:t,[te.a.navbarHidden]:!g})},r.a.createElement("div",{className:"navbar__inner"},r.a.createElement("div",{className:"navbar__items"},null!=e&&0!==e.length&&r.a.createElement("div",{"aria-label":"Navigation bar toggle",className:"navbar__toggle",role:"button",tabIndex:0,onClick:p,onKeyDown:p},r.a.createElement(Z.a,null)),r.a.createElement(Q.a,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:Object(o.a)("navbar__title",{[te.a.hideLogoText]:u})}),j.map((e,t)=>r.a.createElement(J,Object(h.a)({},e,{key:t})))),r.a.createElement("div",{className:"navbar__items navbar__items--right"},k.map((e,t)=>r.a.createElement(J,Object(h.a)({},e,{key:t}))),!c&&r.a.createElement($,{className:te.a.displayOnlyInLargeViewport,"aria-label":"Dark mode toggle",checked:f,onChange:E}),r.a.createElement(I,{handleSearchBarToggle:d,isSearchBarExpanded:u}))),r.a.createElement("div",{role:"presentation",className:"navbar-sidebar__backdrop",onClick:O}),r.a.createElement("div",{className:"navbar-sidebar"},r.a.createElement("div",{className:"navbar-sidebar__brand"},r.a.createElement(Q.a,{className:"navbar__brand",imageClassName:"navbar__logo",titleClassName:"navbar__title",onClick:O}),!c&&s&&r.a.createElement($,{"aria-label":"Dark mode toggle in sidebar",checked:f,onChange:E})),r.a.createElement("div",{className:"navbar-sidebar__items"},r.a.createElement("div",{className:"menu"},r.a.createElement("ul",{className:"menu__list"},e.map((e,t)=>r.a.createElement(J,Object(h.a)({mobile:!0},e,{onClick:O,key:t}))))))))},re=n(70),oe=n.n(re);function ce({to:e,href:t,label:n,prependBaseUrlToHref:a,...o}){const c=Object(p.a)(e),s=Object(p.a)(t,{forcePrependBaseUrl:!0});return r.a.createElement(O.a,Object(h.a)({className:"footer__link-item"},t?{target:"_blank",rel:"noopener noreferrer",href:a?s:t}:{to:c},o),n)}const se=({url:e,alt:t})=>r.a.createElement("img",{className:"footer__logo",alt:t,src:e});var ie=function(){const{footer:e}=Object(l.useThemeConfig)(),{copyright:t,links:n=[],logo:a={}}=e||{},c=Object(p.a)(a.src);return e?r.a.createElement("footer",{className:Object(o.a)("footer",{"footer--dark":"dark"===e.style})},r.a.createElement("div",{className:"container"},n&&n.length>0&&r.a.createElement("div",{className:"row footer__links"},n.map((e,t)=>r.a.createElement("div",{key:t,className:"col footer__col"},null!=e.title?r.a.createElement("h4",{className:"footer__title"},e.title):null,null!=e.items&&Array.isArray(e.items)&&e.items.length>0?r.a.createElement("ul",{className:"footer__items"},e.items.map((e,t)=>e.html?r.a.createElement("li",{key:t,className:"footer__item",dangerouslySetInnerHTML:{__html:e.html}}):r.a.createElement("li",{key:e.href||e.to,className:"footer__item"},r.a.createElement(ce,e)))):null))),(a||t)&&r.a.createElement("div",{className:"footer__bottom text--center"},a&&a.src&&r.a.createElement("div",{className:"margin-bottom--sm"},a.href?r.a.createElement("a",{href:a.href,target:"_blank",rel:"noopener noreferrer",className:oe.a.footerLogoLink},r.a.createElement(se,{alt:a.alt,url:c})):r.a.createElement(se,{alt:a.alt,url:c})),t?r.a.createElement("div",{className:"footer__copyright",dangerouslySetInnerHTML:{__html:t}}):null))):null},le=n(11);const ue="light",de="dark",fe=e=>e===de?de:ue,me=()=>le.a.canUseDOM?fe(document.documentElement.getAttribute("data-theme")):ue,he=e=>{try{localStorage.setItem("theme",fe(e))}catch(t){console.error(t)}};var be=()=>{const{colorMode:{disableSwitch:e,respectPrefersColorScheme:t}}=Object(l.useThemeConfig)(),[n,r]=Object(a.useState)(me),o=Object(a.useCallback)(()=>{r(ue),he(ue)},[]),c=Object(a.useCallback)(()=>{r(de),he(de)},[]);return Object(a.useEffect)(()=>{document.documentElement.setAttribute("data-theme",fe(n))},[n]),Object(a.useEffect)(()=>{if(!e)try{const e=localStorage.getItem("theme");null!==e&&r(fe(e))}catch(t){console.error(t)}},[r]),Object(a.useEffect)(()=>{e&&!t||window.matchMedia("(prefers-color-scheme: dark)").addListener(({matches:e})=>{r(e?de:ue)})},[]),{isDarkTheme:n===de,setLightTheme:o,setDarkTheme:c}},ve=n(239);var ge=function(e){const{isDarkTheme:t,setLightTheme:n,setDarkTheme:a}=be();return r.a.createElement(ve.a.Provider,{value:{isDarkTheme:t,setLightTheme:n,setDarkTheme:a}},e.children)};const pe="docusaurus.tab.";var Oe=()=>{const[e,t]=Object(a.useState)({}),n=Object(a.useCallback)((e,t)=>{try{localStorage.setItem("docusaurus.tab."+e,t)}catch(n){console.error(n)}},[]);return Object(a.useEffect)(()=>{try{const e={};for(let t=0;t{t(t=>({...t,[e]:a})),n(e,a)}}};const Ee="docusaurus.announcement.dismiss",ye="docusaurus.announcement.id";var je=()=>{const{announcementBar:e}=Object(l.useThemeConfig)(),[t,n]=Object(a.useState)(!0),r=Object(a.useCallback)(()=>{localStorage.setItem(Ee,"true"),n(!0)},[]);return Object(a.useEffect)(()=>{if(!e)return;const{id:t}=e;let a=localStorage.getItem(ye);"annoucement-bar"===a&&(a="announcement-bar");const r=t!==a;localStorage.setItem(ye,t),r&&localStorage.setItem(Ee,"false"),(r||"false"===localStorage.getItem(Ee))&&n(!1)},[]),{isAnnouncementBarClosed:t,closeAnnouncementBar:r}},ke=n(201);var _e=function(e){const{tabGroupChoices:t,setTabGroupChoices:n}=Oe(),{isAnnouncementBarClosed:a,closeAnnouncementBar:o}=je();return r.a.createElement(ke.a.Provider,{value:{tabGroupChoices:t,setTabGroupChoices:n,isAnnouncementBarClosed:a,closeAnnouncementBar:o}},e.children)};function Ce({children:e}){return r.a.createElement(ge,null,r.a.createElement(_e,null,r.a.createElement(l.DocsPreferredVersionContextProvider,null,e)))}function we({locale:e,version:t,tag:n}){const a=e;return r.a.createElement(E.a,null,a&&r.a.createElement("meta",{name:"docsearch:language",content:a}),t&&r.a.createElement("meta",{name:"docsearch:version",content:t}),n&&r.a.createElement("meta",{name:"docsearch:docusaurus_tag",content:n}))}function De(e){const{siteConfig:t,i18n:{currentLocale:n}}=Object(v.default)(),{favicon:a,themeConfig:{image:o,metadatas:c},url:s}=t,{title:i,description:u,image:d,keywords:f,permalink:m,searchMetadatas:b}=e,g=Object(l.useTitleFormatter)(i),O=d||o,y=Object(p.a)(O,{absolute:!0}),j=Object(p.a)(a),k=n.split("-")[0];return r.a.createElement(r.a.Fragment,null,r.a.createElement(E.a,null,r.a.createElement("html",{lang:k}),g&&r.a.createElement("title",null,g),g&&r.a.createElement("meta",{property:"og:title",content:g}),a&&r.a.createElement("link",{rel:"shortcut icon",href:j}),u&&r.a.createElement("meta",{name:"description",content:u}),u&&r.a.createElement("meta",{property:"og:description",content:u}),f&&f.length&&r.a.createElement("meta",{name:"keywords",content:f.join(",")}),O&&r.a.createElement("meta",{property:"og:image",content:y}),O&&r.a.createElement("meta",{name:"twitter:image",content:y}),O&&r.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+g}),m&&r.a.createElement("meta",{property:"og:url",content:s+m}),m&&r.a.createElement("link",{rel:"canonical",href:s+m}),r.a.createElement("meta",{name:"twitter:card",content:"summary_large_image"})),r.a.createElement(we,Object(h.a)({tag:l.DEFAULT_SEARCH_TAG,locale:n},b)),r.a.createElement(E.a,null,c.map((e,t)=>r.a.createElement("meta",Object(h.a)({key:"metadata_"+t},e)))))}n(71);var Pe=function(){Object(a.useEffect)(()=>{const e="navigation-with-keyboard";function t(t){"keydown"===t.type&&"Tab"===t.key&&document.body.classList.add(e),"mousedown"===t.type&&document.body.classList.remove(e)}return document.addEventListener("keydown",t),document.addEventListener("mousedown",t),()=>{document.body.classList.remove(e),document.removeEventListener("keydown",t),document.removeEventListener("mousedown",t)}},[])};n(72);t.a=function(e){const{children:t,noFooter:n,wrapperClassName:a}=e;return Pe(),r.a.createElement(Ce,null,r.a.createElement(De,e),r.a.createElement(i,null),r.a.createElement(m,null),r.a.createElement(ae,null),r.a.createElement("div",{className:Object(o.a)("main-wrapper",a)},t),!n&&r.a.createElement(ie,null))}},209:function(e,t,n){"use strict";var a=n(0),r=n(239);t.a=function(){const e=Object(a.useContext)(r.a);if(null==e)throw new Error("`useThemeContext` is used outside of `Layout` Component. See https://v2.docusaurus.io/docs/theme-classic#usethemecontext.");return e}},210:function(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useThemeConfig=void 0;const r=a(n(21));t.useThemeConfig=function(){return r.default().siteConfig.themeConfig}},211:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDocsPluginEnabled=void 0;const a=n(205);t.isDocsPluginEnabled=!!a.useAllDocsData},212:function(e,t,n){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n),Object.defineProperty(e,a,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&a(t,e,n);return r(t,e),t},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionContext=t.DocsPreferredVersionContextProvider=void 0;const s=o(n(0)),i=n(210),l=n(211),u=n(205),d=c(n(228));function f({pluginIds:e,versionPersistence:t,allDocsData:n}){const a={};return e.forEach(e=>{a[e]=function(e){const a=d.default.read(e,t);return n[e].versions.some(e=>e.name===a)?{preferredVersionName:a}:(d.default.clear(e,t),{preferredVersionName:null})}(e)}),a}function m(){const e=u.useAllDocsData(),t=i.useThemeConfig().docs.versionPersistence,n=s.useMemo(()=>Object.keys(e),[e]),[a,r]=s.useState(()=>function(e){const t={};return e.forEach(e=>{t[e]={preferredVersionName:null}}),t}(n));s.useEffect(()=>{r(f({allDocsData:e,versionPersistence:t,pluginIds:n}))},[e,t,n]);return[a,s.useMemo(()=>({savePreferredVersion:function(e,n){d.default.save(e,t,n),r(t=>Object.assign(Object.assign({},t),{[e]:{preferredVersionName:n}}))}}),[r])]}const h=s.createContext(null);function b({children:e}){const t=m();return s.default.createElement(h.Provider,{value:t},e)}t.DocsPreferredVersionContextProvider=function({children:e}){return l.isDocsPluginEnabled?s.default.createElement(b,null,e):s.default.createElement(s.default.Fragment,null,e)},t.useDocsPreferredVersionContext=function(){const e=s.useContext(h);if(!e)throw new Error("Can't find docs preferred context, maybe you forgot to use the DocsPreferredVersionContextProvider ?");return e}},213:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r),c=n(198),s=n(202),i=n(194),l=n(206),u=n(199);function d({activeBasePath:e,activeBaseRegex:t,to:n,href:r,label:c,activeClassName:l="navbar__link--active",prependBaseUrlToHref:u,...d}){const f=Object(i.a)(n),m=Object(i.a)(e),h=Object(i.a)(r,{forcePrependBaseUrl:!0});return o.a.createElement(s.a,Object(a.a)({},r?{target:"_blank",rel:"noopener noreferrer",href:u?h:r}:{isNavLink:!0,activeClassName:l,to:f,...e||t?{isActive:(e,n)=>t?new RegExp(t).test(n.pathname):n.pathname.startsWith(m)}:null},d),c)}function f({items:e,position:t,className:n,...s}){const i=Object(r.useRef)(null),l=Object(r.useRef)(null),[u,f]=Object(r.useState)(!1);Object(r.useEffect)(()=>{const e=e=>{i.current&&!i.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[i]);const m=(e,t=!1)=>Object(c.a)({"navbar__item navbar__link":!t,dropdown__link:t},e);return e?o.a.createElement("div",{ref:i,className:Object(c.a)("navbar__item","dropdown","dropdown--hoverable",{"dropdown--left":"left"===t,"dropdown--right":"right"===t,"dropdown--show":u})},o.a.createElement(d,Object(a.a)({className:m(n)},s,{onClick:s.to?void 0:e=>e.preventDefault(),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),f(!u))}}),s.label),o.a.createElement("ul",{ref:l,className:"dropdown__menu"},e.map(({className:t,...n},r)=>o.a.createElement("li",{key:r},o.a.createElement(d,Object(a.a)({onKeyDown:t=>{if(r===e.length-1&&"Tab"===t.key){t.preventDefault(),f(!1);const e=i.current.nextElementSibling;e&&e.focus()}},activeClassName:"dropdown__link--active",className:m(t,!0)},n)))))):o.a.createElement(d,Object(a.a)({className:m(n)},s))}function m({items:e,className:t,position:n,...s}){var i,f;const m=Object(r.useRef)(null),{pathname:h}=Object(l.useLocation)(),[b,v]=Object(r.useState)(()=>{var t;return null===(t=!(null!=e&&e.some(e=>Object(u.isSamePath)(e.to,h))))||void 0===t||t}),g=(e,t=!1)=>Object(c.a)("menu__link",{"menu__link--sublist":t},e);if(!e)return o.a.createElement("li",{className:"menu__list-item"},o.a.createElement(d,Object(a.a)({className:g(t)},s)));const p=null!==(i=m.current)&&void 0!==i&&i.scrollHeight?(null===(f=m.current)||void 0===f?void 0:f.scrollHeight)+"px":void 0;return o.a.createElement("li",{className:Object(c.a)("menu__list-item",{"menu__list-item--collapsed":b})},o.a.createElement(d,Object(a.a)({role:"button",className:g(t,!0)},s,{onClick:()=>{v(e=>!e)}}),s.label),o.a.createElement("ul",{className:"menu__list",ref:m,style:{height:b?void 0:p}},e.map(({className:e,...t},n)=>o.a.createElement("li",{className:"menu__list-item",key:n},o.a.createElement(d,Object(a.a)({activeClassName:"menu__link--active",className:g(e)},t,{onClick:s.onClick}))))))}t.a=function({mobile:e=!1,...t}){const n=e?m:f;return o.a.createElement(n,t)}},221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.docVersionSearchTag=t.DEFAULT_SEARCH_TAG=void 0,t.DEFAULT_SEARCH_TAG="default",t.docVersionSearchTag=function(e,t){return`docs-${e}-${t}`}},222:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocVersionSuggestions=t.useActiveDocContext=t.useActiveVersion=t.useLatestVersion=t.useVersions=t.useActivePluginAndVersion=t.useActivePlugin=t.useDocsData=t.useAllDocsData=void 0;const a=n(206),r=n(223),o=n(224);t.useAllDocsData=()=>r.useAllPluginInstancesData("docusaurus-plugin-content-docs"),t.useDocsData=e=>r.usePluginData("docusaurus-plugin-content-docs",e),t.useActivePlugin=(e={})=>{const n=t.useAllDocsData(),{pathname:r}=a.useLocation();return o.getActivePlugin(n,r,e)},t.useActivePluginAndVersion=(e={})=>{const n=t.useActivePlugin(e),{pathname:r}=a.useLocation();if(n){return{activePlugin:n,activeVersion:o.getActiveVersion(n.pluginData,r)}}},t.useVersions=e=>t.useDocsData(e).versions,t.useLatestVersion=e=>{const n=t.useDocsData(e);return o.getLatestVersion(n)},t.useActiveVersion=e=>{const n=t.useDocsData(e),{pathname:r}=a.useLocation();return o.getActiveVersion(n,r)},t.useActiveDocContext=e=>{const n=t.useDocsData(e),{pathname:r}=a.useLocation();return o.getActiveDocContext(n,r)},t.useDocVersionSuggestions=e=>{const n=t.useDocsData(e),{pathname:r}=a.useLocation();return o.getDocVersionSuggestions(n,r)}},223:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return r})),n.d(t,"useAllPluginInstancesData",(function(){return o})),n.d(t,"usePluginData",(function(){return c}));var a=n(21);function r(){const{globalData:e}=Object(a.default)();if(!e)throw new Error("Docusaurus global data not found");return e}function o(e){const t=r()[e];if(!t)throw new Error("Docusaurus plugin global data not found for pluginName="+e);return t}function c(e,t="default"){const n=o(e)[t];if(!n)throw new Error(`Docusaurus plugin global data not found for pluginName=${e} and pluginId=${t}`);return n}},224:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDocVersionSuggestions=t.getActiveDocContext=t.getActiveVersion=t.getLatestVersion=t.getActivePlugin=void 0;const a=n(206);t.getActivePlugin=function(e,t,n={}){const r=Object.entries(e).find(([e,n])=>!!a.matchPath(t,{path:n.path,exact:!1,strict:!1})),o=r?{pluginId:r[0],pluginData:r[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for pathname=${t}, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map(e=>e.path).join(", ")}`);return o},t.getLatestVersion=e=>e.versions.find(e=>e.isLast),t.getActiveVersion=(e,n)=>{const r=t.getLatestVersion(e);return[...e.versions.filter(e=>e!==r),r].find(e=>!!a.matchPath(n,{path:e.path,exact:!1,strict:!1}))},t.getActiveDocContext=(e,n)=>{const r=t.getActiveVersion(e,n),o=null==r?void 0:r.docs.find(e=>!!a.matchPath(n,{path:e.path,exact:!0,strict:!1}));return{activeVersion:r,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach(e=>{e.docs.forEach(a=>{a.id===t&&(n[e.name]=a)})}),n}(o.id):{}}},t.getDocVersionSuggestions=(e,n)=>{const a=t.getLatestVersion(e),r=t.getActiveDocContext(e,n),o=r.activeVersion!==a;return{latestDocSuggestion:o?null==r?void 0:r.alternateDocVersions[a.name]:void 0,latestVersionSuggestion:o?a:void 0}}},225:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSamePath=void 0,t.isSamePath=(e,t)=>{const n=e=>!e||(null==e?void 0:e.endsWith("/"))?e:e+"/";return n(e)===n(t)}},226:function(e,t,n){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTitleFormatter=void 0;const r=a(n(21));t.useTitleFormatter=e=>{const{siteConfig:t={}}=r.default(),{title:n,titleDelimiter:a="|"}=t;return e&&e.trim().length?`${e.trim()} ${a} ${n}`:n}},227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionByPluginId=t.useDocsPreferredVersion=void 0;const a=n(0),r=n(212),o=n(205),c=n(229);t.useDocsPreferredVersion=function(e=c.DEFAULT_PLUGIN_ID){const t=o.useDocsData(e),[n,s]=r.useDocsPreferredVersionContext(),{preferredVersionName:i}=n[e];return{preferredVersion:i?t.versions.find(e=>e.name===i):null,savePreferredVersionName:a.useCallback(t=>{s.savePreferredVersion(e,t)},[s])}},t.useDocsPreferredVersionByPluginId=function(){const e=o.useAllDocsData(),[t]=r.useDocsPreferredVersionContext(),n=Object.keys(e),a={};return n.forEach(n=>{a[n]=function(n){const a=e[n],{preferredVersionName:r}=t[n];return r?a.versions.find(e=>e.name===r):null}(n)}),a}},228:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=e=>"docs-preferred-version-"+e,r={save:(e,t,n)=>{"none"===t||window.localStorage.setItem(a(e),n)},read:(e,t)=>"none"===t?null:window.localStorage.getItem(a(e)),clear:(e,t)=>{"none"===t||window.localStorage.removeItem(a(e))}};t.default=r},229:function(e,t,n){"use strict";n.r(t),n.d(t,"DEFAULT_PLUGIN_ID",(function(){return a}));const a="default"},237:function(e,t,n){"use strict";var a=n(206),r=n(11),o=n(21);t.a=function(){const e=Object(a.useHistory)(),t=Object(a.useLocation)(),{siteConfig:{baseUrl:n}={}}=Object(o.default)();return{searchValue:r.a.canUseDOM&&new URLSearchParams(t.search).get("q")||"",updateSearchPath:n=>{const a=new URLSearchParams(t.search);n?a.set("q",n):a.delete("q"),e.replace({search:a.toString()})},generateSearchPageLink:e=>`${n}search?q=${encodeURIComponent(e)}`}}},238:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(0),r=n.n(a);function o(){return r.a.createElement("svg",{width:"20",height:"20",className:"DocSearch-Search-Icon",viewBox:"0 0 20 20"},r.a.createElement("path",{d:"M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}},239:function(e,t,n){"use strict";var a=n(0);const r=n.n(a).a.createContext(void 0);t.a=r},240:function(e,t,n){"use strict";var a=n(0),r=n(11);const o=()=>({scrollX:r.a.canUseDOM?window.pageXOffset:0,scrollY:r.a.canUseDOM?window.pageYOffset:0});t.a=(e,t=[])=>{const[n,r]=Object(a.useState)(o()),c=()=>{const t=o();r(t),e&&e(t)};return Object(a.useEffect)(()=>{const e={passive:!0};return window.addEventListener("scroll",c,e),()=>window.removeEventListener("scroll",c,e)},t),n}},241:function(e,t,n){"use strict";var a=n(0);t.a=function(e=!0){Object(a.useEffect)(()=>(document.body.style.overflow=e?"hidden":"visible",()=>{document.body.style.overflow="visible"}),[e])}},242:function(e,t,n){"use strict";n.d(t,"b",(function(){return r}));var a=n(0);const r={desktop:"desktop",mobile:"mobile"};t.a=function(){const e="undefined"!=typeof window;function t(){if(e)return window.innerWidth>996?r.desktop:r.mobile}const[n,o]=Object(a.useState)(t);return Object(a.useEffect)(()=>{if(e)return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n);function n(){o(t())}},[]),n}},243:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r);t.a=({width:e=30,height:t=30,className:n,...r})=>o.a.createElement("svg",Object(a.a)({"aria-label":"Menu",className:n,width:e,height:t,viewBox:"0 0 30 30",role:"img",focusable:"false"},r),o.a.createElement("title",null,"Menu"),o.a.createElement("path",{stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M4 7h22M4 15h22M4 23h22"}))},252:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r),c=n(202),s=n(198),i=n(21),l=n(209),u=n(68),d=n.n(u);var f=e=>{const{isClient:t}=Object(i.default)(),{isDarkTheme:n}=Object(l.a)(),{sources:r,className:c,alt:u="",...f}=e,m=t?n?["dark"]:["light"]:["light","dark"];return o.a.createElement(o.a.Fragment,null,m.map(e=>o.a.createElement("img",Object(a.a)({key:e,src:r[e],alt:u,className:Object(s.a)(d.a.themedImage,d.a["themedImage--"+e],c)},f))))},m=n(194),h=n(199),b=n(195);t.a=e=>{const{isClient:t}=Object(i.default)(),{navbar:{title:n,logo:r={src:""}}}=Object(h.useThemeConfig)(),{imageClassName:s,titleClassName:l,...u}=e,d=Object(m.a)(r.href||"/"),v=r.target?{target:r.target}:Object(b.a)(d)?{}:{rel:"noopener noreferrer",target:"_blank"},g={light:Object(m.a)(r.src),dark:Object(m.a)(r.srcDark||r.src)};return o.a.createElement(c.a,Object(a.a)({to:d},u,v),r.src&&o.a.createElement(f,{key:t,className:s,sources:g,alt:r.alt||n||"Logo"}),null!=n&&o.a.createElement("strong",{className:l},n))}},253:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=Object.assign||function(e){for(var t=1;tthis.startX&&(this.setState({checked:!0}),this.startX=t,this.activated=tn?this.previouslyChecked!==this.state.checked&&(this.setState({checked:!1}),this.previouslyChecked=this.state.checked,t.click()):this.startX-4=0||Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a]);return n}(t,["className","icons"])),o=(0,s.default)("react-toggle",{"react-toggle--checked":this.state.checked,"react-toggle--focus":this.state.hasFocus,"react-toggle--disabled":this.props.disabled},n);return c.default.createElement("div",{className:o,onClick:this.handleClick,onTouchStart:this.handleTouchStart,onTouchMove:this.handleTouchMove,onTouchEnd:this.handleTouchEnd},c.default.createElement("div",{className:"react-toggle-track"},c.default.createElement("div",{className:"react-toggle-track-check"},this.getIcon("checked")),c.default.createElement("div",{className:"react-toggle-track-x"},this.getIcon("unchecked"))),c.default.createElement("div",{className:"react-toggle-thumb"}),c.default.createElement("input",a({},r,{ref:function(t){e.input=t},onFocus:this.handleFocus,onBlur:this.handleBlur,className:"react-toggle-screenreader-only",type:"checkbox"})))}}]),t}(o.PureComponent);t.default=m,m.displayName="Toggle",m.defaultProps={icons:{checked:c.default.createElement(l.default,null),unchecked:c.default.createElement(u.default,null)}},m.propTypes={checked:i.default.bool,disabled:i.default.bool,defaultChecked:i.default.bool,onChange:i.default.func,onFocus:i.default.func,onBlur:i.default.func,className:i.default.string,name:i.default.string,value:i.default.string,id:i.default.string,"aria-labelledby":i.default.string,"aria-label":i.default.string,icons:i.default.oneOfType([i.default.bool,i.default.shape({checked:i.default.node,unchecked:i.default.node})])}},254:function(e,t,n){var a;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t0){var n=t[0];return{x:n.clientX,y:n.clientY}}var a=e.pageX;if(void 0!==a)return{x:a,y:e.pageY}}return{x:0,y:0}}},258:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return l}));var a=n(3),r=n(0),o=n.n(r),c=n(213),s=n(205),i=n(199);function l({label:e,to:t,docsPluginId:n,...r}){var l;const u=Object(s.useActiveVersion)(n),{preferredVersion:d}=Object(i.useDocsPreferredVersion)(n),f=Object(s.useLatestVersion)(n),m=null!==(l=null!=u?u:d)&&void 0!==l?l:f,h=null!=e?e:m.label,b=null!=t?t:(e=>e.docs.find(t=>t.id===e.mainDocId))(m).path;return o.a.createElement(c.a,Object(a.a)({},r,{label:h,to:b}))}},259:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var a=n(3),r=n(0),o=n.n(r),c=n(213),s=n(205),i=n(199);const l=e=>e.docs.find(t=>t.id===e.mainDocId);function u({mobile:e,docsPluginId:t,dropdownActiveClassDisabled:n,dropdownItemsBefore:r,dropdownItemsAfter:u,...d}){var f,m;const h=Object(s.useActiveDocContext)(t),b=Object(s.useVersions)(t),v=Object(s.useLatestVersion)(t),{preferredVersion:g,savePreferredVersionName:p}=Object(i.useDocsPreferredVersion)(t);const O=null!==(f=null!==(m=h.activeVersion)&&void 0!==m?m:g)&&void 0!==f?f:v,E=e?"Versions":O.label,y=e?void 0:l(O).path;return o.a.createElement(c.a,Object(a.a)({},d,{mobile:e,label:E,to:y,items:function(){const e=b.map(e=>{const t=(null==h?void 0:h.alternateDocVersions[e.name])||l(e);return{isNavLink:!0,label:e.label,to:t.path,isActive:()=>e===(null==h?void 0:h.activeVersion),onClick:()=>{p(e.name)}}}),t=[...r,...e,...u];if(!(t.length<=1))return t}(),isActive:n?()=>!1:void 0}))}},260:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return u}));var a=n(3),r=n(0),o=n.n(r),c=n(213),s=n(205),i=n(198),l=n(199);function u({docId:e,activeSidebarClassName:t,label:n,docsPluginId:r,...u}){var d;const{activeVersion:f,activeDoc:m}=Object(s.useActiveDocContext)(r),{preferredVersion:h}=Object(l.useDocsPreferredVersion)(r),b=Object(s.useLatestVersion)(r),v=null!==(d=null!=f?f:h)&&void 0!==d?d:b,g=v.docs.find(t=>t.id===e);if(!g)throw new Error(`DocNavbarItem: couldn't find any doc with id=${e} in version ${v.name}.\nAvailable docIds=\n- ${v.docs.join("\n- ")}`);return o.a.createElement(c.a,Object(a.a)({exact:!0},u,{className:Object(i.a)(u.className,{[t]:m&&m.sidebar===g.sidebar}),label:null!=n?n:g.id,to:g.path}))}}}]); \ No newline at end of file diff --git a/docs/1.f7cb6107.js.LICENSE.txt b/docs/1.9f7a0c86.js.LICENSE.txt similarity index 100% rename from docs/1.f7cb6107.js.LICENSE.txt rename to docs/1.9f7a0c86.js.LICENSE.txt diff --git a/docs/114c846a.bb9c7dbb.js b/docs/114c846a.1fe85a1f.js similarity index 92% rename from docs/114c846a.bb9c7dbb.js rename to docs/114c846a.1fe85a1f.js index c09c4a58ba4..49b500eb7e8 100644 --- a/docs/114c846a.bb9c7dbb.js +++ b/docs/114c846a.1fe85a1f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return o}));var r=n(21),a=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),s=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},b=function(e){var t=s(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,o=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),b=s(n),d=r,f=b["".concat(o,".").concat(d)]||b[d]||p[d]||c;return n?a.a.createElement(f,i(i({ref:t},u),{},{components:n})):a.a.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,o=new Array(c);o[0]=d;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,o[1]=i;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},77:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(192)),o=n(193),i={id:"l",title:"8. L \u9759\u6001\u7c7b",sidebar_label:"8. L \u9759\u6001\u7c7b"},l={unversionedId:"global/l",id:"global/l",isDocsHomePage:!1,title:"8. L \u9759\u6001\u7c7b",description:"8.1 \u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00",source:"@site/docs\\global\\l.mdx",slug:"/global/l",permalink:"/docs/global/l",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/l.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"8. L \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",permalink:"/docs/global/jsonserializer"},next:{title:"9. MessageCenter \u9759\u6001\u7c7b",permalink:"/docs/global/messagecenter"}},u=[{value:"8.1 \u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00",id:"81-\u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00",children:[]},{value:"8.2 \u8f6c\u6362Html\u591a\u8bed\u8a00",id:"82-\u8f6c\u6362html\u591a\u8bed\u8a00",children:[]},{value:"8.3 \u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00",id:"83-\u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00",children:[]},{value:"8.4 \u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868",id:"84-\u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868",children:[]}],s={toc:u};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(o.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"81-\u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00"},"8.1 \u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var apiInterface = L.Text["API \u63a5\u53e3"];\n')),Object(c.b)("h2",{id:"82-\u8f6c\u6362html\u591a\u8bed\u8a00"},"8.2 \u8f6c\u6362Html\u591a\u8bed\u8a00"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var name = L.Html["Hello {0}", name];\n')),Object(c.b)("h2",{id:"83-\u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00"},"8.3 \u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'L.SetCulture("en-US");\n')),Object(c.b)("h2",{id:"84-\u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868"},"8.4 \u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var list = L.GetCultures();\n")))}b.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return o}));var r=n(21),a=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),s=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},b=function(e){var t=s(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,o=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),b=s(n),d=r,f=b["".concat(o,".").concat(d)]||b[d]||p[d]||c;return n?a.a.createElement(f,i(i({ref:t},u),{},{components:n})):a.a.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,o=new Array(c);o[0]=d;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,o[1]=i;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},77:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(196)),o=n(197),i={id:"l",title:"8. L \u9759\u6001\u7c7b",sidebar_label:"8. L \u9759\u6001\u7c7b"},l={unversionedId:"global/l",id:"global/l",isDocsHomePage:!1,title:"8. L \u9759\u6001\u7c7b",description:"8.1 \u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00",source:"@site/docs\\global\\l.mdx",slug:"/global/l",permalink:"/docs/global/l",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/l.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"8. L \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",permalink:"/docs/global/jsonserializer"},next:{title:"9. MessageCenter \u9759\u6001\u7c7b",permalink:"/docs/global/messagecenter"}},u=[{value:"8.1 \u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00",id:"81-\u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00",children:[]},{value:"8.2 \u8f6c\u6362Html\u591a\u8bed\u8a00",id:"82-\u8f6c\u6362html\u591a\u8bed\u8a00",children:[]},{value:"8.3 \u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00",id:"83-\u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00",children:[]},{value:"8.4 \u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868",id:"84-\u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868",children:[]}],s={toc:u};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(o.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"81-\u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00"},"8.1 \u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var apiInterface = L.Text["API \u63a5\u53e3"];\n')),Object(c.b)("h2",{id:"82-\u8f6c\u6362html\u591a\u8bed\u8a00"},"8.2 \u8f6c\u6362Html\u591a\u8bed\u8a00"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var name = L.Html["Hello {0}", name];\n')),Object(c.b)("h2",{id:"83-\u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00"},"8.3 \u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'L.SetCulture("en-US");\n')),Object(c.b)("h2",{id:"84-\u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868"},"8.4 \u83b7\u53d6\u7cfb\u7edf\u8bed\u8a00\u5217\u8868"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var list = L.GetCultures();\n")))}b.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/111.2bc7dbb2.js b/docs/115.9ad5e9dc.js similarity index 96% rename from docs/111.2bc7dbb2.js rename to docs/115.9ad5e9dc.js index 9c6931c63e8..5c1d2990109 100644 --- a/docs/111.2bc7dbb2.js +++ b/docs/115.9ad5e9dc.js @@ -1,2 +1,2 @@ -/*! For license information please see 111.2bc7dbb2.js.LICENSE.txt */ -(window.webpackJsonp=window.webpackJsonp||[]).push([[111],{111:function(e,t,r){"use strict";r.r(t);var n=r(0),i=r.n(n),a=r(267),s=r.n(a),c=r(257),u=r.n(c),o=r(194),f=r(23),h=r(198),l=r(11),m=r(195),d=r(21),v=r(201),p=r(233),g=r(203),y=r(112),R=r.n(y);const F=({docsSearchVersionsHelpers:e})=>{const t=Object.entries(e.allDocsData).filter(([,e])=>e.versions.length>1);return i.a.createElement("div",{className:Object(o.a)("col","col--3","padding-left--none",R.a.searchVersionColumn)},t.map(([r,n])=>{const a=t.length>1?r+": ":"";return i.a.createElement("select",{key:r,onChange:t=>e.setSearchVersion(r,t.target.value),defaultValue:e.searchVersions[r],className:R.a.searchVersionInput},n.versions.map((e,t)=>i.a.createElement("option",{key:t,label:`${a}${e.label}`,value:e.name})))}))};t.default=function(){const{siteConfig:{themeConfig:{algolia:{appId:e="BH4D9OD16A",apiKey:t,indexName:r}={}}}={}}=Object(d.default)(),a=function(){const e=Object(v.useAllDocsData)(),[t,r]=Object(n.useState)(()=>Object.entries(e).reduce((e,[t,r])=>({...e,[t]:r.versions[0].name}),{})),i=Object.values(e).some(e=>e.versions.length>1);return{allDocsData:e,versioningEnabled:i,searchVersions:t,setSearchVersion:(e,t)=>r(r=>({...r,[e]:t}))}}(),{searchValue:c,updateSearchPath:y}=Object(p.a)(),[b,j]=Object(n.useState)(c),P={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},[E,O]=Object(n.useReducer)((e,{type:t,value:r})=>{switch(t){case"reset":return P;case"loading":return{...e,loading:!0};case"update":return b!==r.query?e:{...r,items:0===r.lastPage?r.items:e.items.concat(r.items)};case"advance":{const t=e.totalPages>e.lastPage+1;return{...e,lastPage:t?e.lastPage+1:e.lastPage,hasMore:t}}default:return e}},P),x=s()(e,t),_=u()(x,r,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["docusaurus_tag"]});_.on("result",({results:{query:e,hits:t,page:r,nbHits:n,nbPages:i}})=>{if(""===e||!(t instanceof Array))return void O({type:"reset"});const a=e=>e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match"),s=t.map(({url:e,_highlightResult:{hierarchy:t},_snippetResult:r={}})=>{const{pathname:n,hash:i}=new URL(e),s=Object.keys(t).map(e=>a(t[e].value));return{title:s.pop(),url:n+i,summary:r.content?a(r.content.value)+"...":"",breadcrumbs:s}});O({type:"update",value:{items:s,query:e,totalResults:n,totalPages:i,lastPage:r,hasMore:i>r+1,loading:!1}})});const[w,N]=Object(n.useState)(null),H=Object(n.useRef)(0),S=Object(n.useRef)(l.a.canUseDOM&&new IntersectionObserver(e=>{const{isIntersecting:t,boundingClientRect:{y:r}}=e[0];t&&H.current>r&&O({type:"advance"}),H.current=r},{threshold:1})),A=()=>b?`Search results for "${b}"`:"Search the documentation",Q=(e=0)=>{_.addDisjunctiveFacetRefinement("docusaurus_tag","default"),Object.entries(a.searchVersions).forEach(([e,t])=>{_.addDisjunctiveFacetRefinement("docusaurus_tag",`docs-${e}-${t}`)}),_.setQuery(b).setPage(e).search()};return Object(n.useEffect)(()=>{if(w)return S.current.observe(w),()=>{S.current.unobserve(w)}},[w]),Object(n.useEffect)(()=>{y(b),O({type:"reset"}),b&&(O({type:"loading"}),setTimeout(()=>{Q()},300))},[b,a.searchVersions]),Object(n.useEffect)(()=>{E.lastPage&&0!==E.lastPage&&Q(E.lastPage)},[E.lastPage]),Object(n.useEffect)(()=>{c&&c!==b&&j(c)},[c]),i.a.createElement(g.a,{wrapperClassName:"search-page-wrapper"},i.a.createElement(f.a,null,i.a.createElement("title",null,Object(m.useTitleFormatter)(A())),i.a.createElement("meta",{property:"robots",content:"noindex, follow"})),i.a.createElement("div",{className:"container margin-vert--lg"},i.a.createElement("h1",null,A()),i.a.createElement("form",{className:"row",onSubmit:e=>e.preventDefault()},i.a.createElement("div",{className:Object(o.a)("col",R.a.searchQueryColumn,{"col--9":a.versioningEnabled,"col--12":!a.versioningEnabled})},i.a.createElement("input",{type:"search",name:"q",className:R.a.searchQueryInput,placeholder:"Type your search here","aria-label":"Search",onChange:e=>j(e.target.value),value:b,autoComplete:"off",autoFocus:!0})),a.versioningEnabled&&i.a.createElement(F,{docsSearchVersionsHelpers:a})),i.a.createElement("div",{className:Object(o.a)("row","margin-vert--sm")},i.a.createElement("div",{className:Object(o.a)("col","col--8",R.a.searchResultsColumn)},!!E.totalResults&&i.a.createElement("strong",null,E.totalResults," ",(C=E.totalResults,T="document",C>1?T+"s":T)," found")),i.a.createElement("div",{className:Object(o.a)("col","col--4",R.a.searchLogoColumn)},i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.algolia.com/","aria-label":"Search"},i.a.createElement("svg",{viewBox:"0 0 168 24",className:R.a.algoliaLogo,xmlns:"http://www.w3.org/2000/svg","aria-label":"Search by Algolia"},i.a.createElement("g",{fill:"none"},i.a.createElement("path",{className:R.a.algoliaLogoPathFill,d:"M120.925 18.804c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17zM6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z"}),i.a.createElement("path",{fill:"#5468FF",d:"M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938z"}),i.a.createElement("path",{fill:"white",d:"M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36"})))))),E.items.length>0?i.a.createElement("section",null,E.items.map(({title:e,url:t,summary:r,breadcrumbs:n},a)=>i.a.createElement("article",{key:a,className:R.a.searchResultItem},i.a.createElement(h.a,{to:t,className:R.a.searchResultItemHeading,dangerouslySetInnerHTML:{__html:e}}),n.length>0&&i.a.createElement("span",{className:R.a.searchResultItemPath},n.map((e,t)=>i.a.createElement(i.a.Fragment,null,0!==t&&i.a.createElement("span",{className:R.a.searchResultItemPathSeparator},"\u203a"),i.a.createElement("span",{dangerouslySetInnerHTML:{__html:e}})))),r&&i.a.createElement("p",{className:R.a.searchResultItemSummary,dangerouslySetInnerHTML:{__html:r}})))):[b&&!E.loading&&i.a.createElement("p",{key:"no-results"},"No results were found"),!!E.loading&&i.a.createElement("div",{key:"spinner",className:R.a.loadingSpinner})],E.hasMore&&i.a.createElement("div",{className:R.a.loader,ref:N},i.a.createElement("span",null,"Fetching new results..."))));var C,T}},214:function(e,t,r){"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var r=0;r0}},240:function(e,t,r){"use strict";var n=r(227),i=r(228),a=r(259),s=r(214),c=r(260),u=r(241),o=r(229),f=r(261);function h(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,r){return h(t[r],e)})):e===t}function l(e){var t=e?l._parseNumbers(e):{};this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach((function(e){var n=-1!==l.PARAMETERS.indexOf(e),i=void 0!==t[e];!n&&i&&(r[e]=t[e])}))}l.PARAMETERS=Object.keys(new l),l._parseNumbers=function(e){if(e instanceof l)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(r){var n=e[r];if("string"==typeof n){var i=parseFloat(n);t[r]=isNaN(i)?n:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var r={};Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t]||{};r[t]={},Object.keys(n).forEach((function(e){var i=n[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));r[t][e]=i}))})),t.numericRefinements=r}return n({},e,t)},l.make=function(e){var t=new l(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var r=t.getHierarchicalRefinement(e.name);r.length>0&&0!==r[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(r=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},l.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&o(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):o(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},l.prototype={constructor:l,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:f.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:f.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:f.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:f.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,r){var i=c(r);if(this.isNumericRefined(e,t,i))return this;var a=n({},this.numericRefinements);return a[e]=n({},a[e]),a[e][t]?(a[e][t]=a[e][t].slice(),a[e][t].push(i)):a[e][t]=[i],this.setQueryParameters({numericRefinements:a})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,r){return void 0!==r?this.isNumericRefined(e,t,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(n,i){return i===e&&n.op===t&&h(n.val,c(r))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,n){return n===e&&r.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,r){return r===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return o(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return o(this.numericRefinements[e])?u(this.numericRefinements,[e]):this.numericRefinements;if("function"==typeof e){var t=!1,r=this.numericRefinements,n=Object.keys(r).reduce((function(n,i){var a=r[i],s={};return a=a||{},Object.keys(a).forEach((function(r){var n=a[r]||[],c=[];n.forEach((function(t){e({val:t,op:r},i,"numeric")||c.push(t)})),c.length!==n.length&&(t=!0),s[r]=c})),n[i]=s,n}),{});return t?n:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:f.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:f.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:f.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:f.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:f.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:f.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:f.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:f.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:f.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),n={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+r))?-1===t.indexOf(r)?n[e]=[]:n[e]=[t.slice(0,t.lastIndexOf(r))]:n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:i({},n,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:i({},r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:i({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&f.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var r=this.getHierarchicalRefinement(e);return t?-1!==r.indexOf(t):r.length>0},isNumericRefined:function(e,t,r){if(void 0===r&&void 0===t)return!!this.numericRefinements[e];var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===r||!n)return n;var i,a,u=c(r),o=void 0!==(i=this.numericRefinements[e][t],a=u,s(i,(function(e){return h(e,a)})));return n&&o},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0})))},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},r=this;return Object.keys(this).forEach((function(n){var i=r[n];-1===e.indexOf(n)&&void 0!==i&&(t[n]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var r={};return r[e]=t,this.setQueryParameters(r)},setQueryParameters:function(e){if(!e)return this;var t=l.validate(this,e);if(t)throw t;var r=this,n=l._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=r[t],e}),{}),a=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?u(e,[t]):(i&&(e[t]=n[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return s(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(r).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=l},241:function(e,t,r){"use strict";e.exports=function(e,t){if(null===e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}},242:function(e,t,r){"use strict";var n=r(227),i=r(228),a=r(243),s=r(262),c=r(214),u=r(263),o=r(244),f=r(264);function h(e){var t={};return e.forEach((function(e,r){t[e]=r})),t}function l(e,t,r){t&&t[r]&&(e.stats=t[r])}function m(e,t){var r=t[0];this._rawResults=t;var a=this;Object.keys(r).forEach((function(e){a[e]=r[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var o=e.getRefinedDisjunctiveFacets(),m=h(e.facets),d=h(e.disjunctiveFacets),v=1,p=r.facets||{};Object.keys(p).forEach((function(t){var n,i,s=p[t],o=(n=e.hierarchicalFacets,i=t,c(n,(function(e){return(e.attributes||[]).indexOf(i)>-1})));if(o){var f=o.attributes.indexOf(t),h=u(e.hierarchicalFacets,(function(e){return e.name===o.name}));a.hierarchicalFacets[h][f]={attribute:t,data:s,exhaustive:r.exhaustiveFacetsCount}}else{var v,g=-1!==e.disjunctiveFacets.indexOf(t),y=-1!==e.facets.indexOf(t);g&&(v=d[t],a.disjunctiveFacets[v]={name:t,data:s,exhaustive:r.exhaustiveFacetsCount},l(a.disjunctiveFacets[v],r.facets_stats,t)),y&&(v=m[t],a.facets[v]={name:t,data:s,exhaustive:r.exhaustiveFacetsCount},l(a.facets[v],r.facets_stats,t))}})),this.hierarchicalFacets=s(this.hierarchicalFacets),o.forEach((function(s){var c=t[v],o=c&&c.facets?c.facets:{},f=e.getHierarchicalFacetByName(s);Object.keys(o).forEach((function(t){var s,h=o[t];if(f){s=u(e.hierarchicalFacets,(function(e){return e.name===f.name}));var m=u(a.hierarchicalFacets[s],(function(e){return e.attribute===t}));if(-1===m)return;a.hierarchicalFacets[s][m].data=n({},a.hierarchicalFacets[s][m].data,h)}else{s=d[t];var v=r.facets&&r.facets[t]||{};a.disjunctiveFacets[s]={name:t,data:i({},h,v),exhaustive:c.exhaustiveFacetsCount},l(a.disjunctiveFacets[s],c.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(r){!a.disjunctiveFacets[s].data[r]&&e.disjunctiveFacetsRefinements[t].indexOf(r)>-1&&(a.disjunctiveFacets[s].data[r]=0)}))}})),v++})),e.getRefinedHierarchicalFacets().forEach((function(r){var n=e.getHierarchicalFacetByName(r),s=e._getHierarchicalFacetSeparator(n),c=e.getHierarchicalRefinement(r);if(!(0===c.length||c[0].split(s).length<2)){var o=t[v],f=o&&o.facets?o.facets:{};Object.keys(f).forEach((function(t){var r=f[t],o=u(e.hierarchicalFacets,(function(e){return e.name===n.name})),h=u(a.hierarchicalFacets[o],(function(e){return e.attribute===t}));if(-1!==h){var l={};if(c.length>0){var m=c[0].split(s)[0];l[m]=a.hierarchicalFacets[o][h].data[m]}a.hierarchicalFacets[o][h].data=i(l,r,a.hierarchicalFacets[o][h].data)}})),v++}})),Object.keys(e.facetsExcludes).forEach((function(t){var n=e.facetsExcludes[t],i=m[t];a.facets[i]={name:t,data:r.facets[t],exhaustive:r.exhaustiveFacetsCount},n.forEach((function(e){a.facets[i]=a.facets[i]||{name:t},a.facets[i].data=a.facets[i].data||{},a.facets[i].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(f(e)),this.facets=s(this.facets),this.disjunctiveFacets=s(this.disjunctiveFacets),this._state=e}function d(e,t){if(!t.data||0===t.data.length)return t;var r=t.data.map((function(t){return d(e,t)})),i=e(r);return n({},t,{data:i})}function v(e,t){var r=c(e,(function(e){return e.name===t}));return r&&r.stats}function p(e,t,r,n,i){var a=c(i,(function(e){return e.name===r})),s=a&&a.data&&a.data[n]?a.data[n]:0,u=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:s,exhaustive:u}}m.prototype.getFacetByName=function(e){function t(t){return t.name===e}return c(this.facets,t)||c(this.disjunctiveFacets,t)||c(this.hierarchicalFacets,t)},m.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],m.prototype.getFacetValues=function(e,t){var r=function(e,t){function r(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=c(e.facets,r);return n?Object.keys(n.data).map((function(r){return{name:r,count:n.data[r],isRefined:e._state.isFacetRefined(t,r),isExcluded:e._state.isExcludeRefined(t,r)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=c(e.disjunctiveFacets,r);return i?Object.keys(i.data).map((function(r){return{name:r,count:i.data[r],isRefined:e._state.isDisjunctiveFacetRefined(t,r)}})):[]}if(e._state.isHierarchicalFacet(t))return c(e.hierarchicalFacets,r)}(this,e);if(r){var n=i({},t,{sortBy:m.DEFAULT_SORT});if(Array.isArray(n.sortBy)){var s=o(n.sortBy,m.DEFAULT_SORT);return Array.isArray(r)?a(r,s[0],s[1]):d((function(e){return a(e,s[0],s[1])}),r)}if("function"==typeof n.sortBy)return Array.isArray(r)?r.sort(n.sortBy):d((function(e){return function(e,t){return t.sort(e)}(n.sortBy,e)}),r);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}},m.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?v(this.facets,e):this._state.isDisjunctiveFacet(e)?v(this.disjunctiveFacets,e):void 0},m.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach((function(n){e.facetsRefinements[n].forEach((function(i){r.push(p(e,"facet",n,i,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(n){e.facetsExcludes[n].forEach((function(i){r.push(p(e,"exclude",n,i,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(n){e.disjunctiveFacetsRefinements[n].forEach((function(i){r.push(p(e,"disjunctive",n,i,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(n){e.hierarchicalFacetsRefinements[n].forEach((function(i){r.push(function(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),s=r.split(a),u=c(n,(function(e){return e.name===t})),o=s.reduce((function(e,t){var r=e&&c(e.data,(function(e){return e.name===t}));return void 0!==r?r:e}),u),f=o&&o.count||0,h=o&&o.exhaustive||!1,l=o&&o.path||"";return{type:"hierarchical",attributeName:t,name:l,count:f,exhaustive:h}}(e,n,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t];Object.keys(n).forEach((function(e){n[e].forEach((function(n){r.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})}))}))})),e.tagRefinements.forEach((function(e){r.push({type:"tag",attributeName:"_tags",name:e})})),r},e.exports=m},243:function(e,t,r){"use strict";function n(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e=r.length?a:"desc"===r[i]?-a:a}return e.index-t.index})),i.map((function(e){return e.value}))}},244:function(e,t,r){"use strict";var n=r(214);e.exports=function(e,t){var r=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=n(r,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},245:function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function c(){c.init.call(this)}e.exports=c,e.exports.once=function(e,t){return new Promise((function(r,n){function i(){void 0!==a&&e.removeListener("error",a),r([].slice.call(arguments))}var a;"error"!==t&&(a=function(r){e.removeListener(t,i),n(r)},e.once("error",a)),e.once(t,i)}))},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,a,s,c;if(o(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=f(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var c=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw c.context=s,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var o=u.length,f=p(u,o);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},c.prototype.listeners=function(e){return d(this,e,!0)},c.prototype.rawListeners=function(e){return d(this,e,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},c.prototype.listenerCount=v,c.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},246:function(e,t,r){"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},247:function(e,t,r){"use strict";e.exports="3.2.2"},257:function(e,t,r){"use strict";var n=r(258),i=r(240),a=r(242);function s(e,t,r){return new n(e,t,r)}s.version=r(247),s.AlgoliaSearchHelper=n,s.SearchParameters=i,s.SearchResults=a,e.exports=s},258:function(e,t,r){"use strict";var n=r(240),i=r(242),a=r(265),s=r(266),c=r(245),u=r(246),o=r(229),f=r(247);function h(e,t,r){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+f+")"),this.setClient(e);var i=r||{};i.index=t,this.state=n.make(i),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function l(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function m(){return this.state.page}u(h,c.EventEmitter),h.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},h.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},h.prototype.getQuery=function(){var e=this.state;return s._getHitsSearchParams(e)},h.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=s._getQueries(r.index,r),a=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),!t)return this.client.search(n).then((function(e){return a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),{content:new i(r,e.results),state:r,_originalResponse:e}}),(function(e){throw a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),e}));this.client.search(n).then((function(e){a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),t(null,new i(r,e.results),r)})).catch((function(e){a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),t(e,null,r)}))},h.prototype.searchForFacetValues=function(e,t,r,n){var i="function"==typeof this.client.searchForFacetValues;if(!i&&"function"!=typeof this.client.initIndex)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var a=this.state.setQueryParameters(n||{}),c=a.isDisjunctiveFacet(e),u=s.getSearchForFacetQuery(e,t,r,a);this._currentNbQueries++;var o=this;return this.emit("searchForFacetValues",{state:a,facet:e,query:t}),(i?this.client.searchForFacetValues([{indexName:a.index,params:u}]):this.client.initIndex(a.index).searchForFacetValues(u)).then((function(t){return o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.isRefined=c?a.isDisjunctiveFacetRefined(e,t.value):a.isFacetRefined(e,t.value)})),t}),(function(e){throw o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),e}))},h.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},h.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},h.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},h.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},h.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this},h.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},h.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},h.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},h.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},h.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this},h.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},h.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},h.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},h.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},h.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},h.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},h.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},h.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},h.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},h.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},h.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},h.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},h.prototype.setCurrentPage=l,h.prototype.setPage=l,h.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},h.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},h.prototype.setState=function(e){return this._change({state:n.make(e),isPageReset:!1}),this},h.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new n(e),this},h.prototype.hasRefinements=function(e){return!!o(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},h.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},h.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},h.prototype.hasTag=function(e){return this.state.isTagRefined(e)},h.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},h.prototype.getIndex=function(){return this.state.index},h.prototype.getCurrentPage=m,h.prototype.getPage=m,h.prototype.getTags=function(){return this.state.tagRefinements},h.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}));else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}))}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach((function(e){var n=r[e];t.push({value:n,operator:e,type:"numeric"})})),t},h.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},h.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},h.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=s._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var n=e.getModifiedState(t),i=s._getQueries(n.index,n);return r.push({state:n,queriesCount:i.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),i})),a=Array.prototype.concat.apply(n,i),c=this._queryId++;this._currentNbQueries++;try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,c)).catch(this._dispatchAlgoliaError.bind(this,c))}catch(u){this.emit("error",{error:u})}},h.prototype._dispatchAlgoliaResponse=function(e,t,r){if(!(t0},h.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))},h.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},h.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+f+")"),this.client=e),this},h.prototype.getClient=function(){return this.client},h.prototype.derive=function(e){var t=new a(this,e);return this.derivedHelpers.push(t),t},h.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},h.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=h},259:function(e,t,r){"use strict";e.exports=function(e,t){return e.filter((function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n}))}},260:function(e,t,r){"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},261:function(e,t,r){"use strict";var n=r(228),i=r(241),a=r(229),s={addRefinement:function(e,t,r){if(s.isRefined(e,t,r))return e;var i=""+r,a=e[t]?e[t].concat(i):[i],c={};return c[t]=a,n({},c,e)},removeRefinement:function(e,t,r){if(void 0===r)return s.clearRefinement(e,(function(e,r){return t===r}));var n=""+r;return s.clearRefinement(e,(function(e,r){return t===r&&n===e}))},toggleRefinement:function(e,t,r){if(void 0===r)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,r)?s.removeRefinement(e,t,r):s.addRefinement(e,t,r)},clearRefinement:function(e,t,r){if(void 0===t)return a(e)?{}:e;if("string"==typeof t)return i(e,[t]);if("function"==typeof t){var n=!1,s=Object.keys(e).reduce((function(i,a){var s=e[a]||[],c=s.filter((function(e){return!t(e,a,r)}));return c.length!==s.length&&(n=!0),i[a]=c,i}),{});return n?s:e}},isRefined:function(e,t,r){var n=!!e[t]&&e[t].length>0;if(void 0===r||!n)return n;var i=""+r;return-1!==e[t].indexOf(i)}};e.exports=s},262:function(e,t,r){"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},263:function(e,t,r){"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var r=0;r0){var h=0;for(f=c;h0&&s[0].split(c).length>1&&r.push({indexName:e,params:i._getDisjunctiveFacetSearchParams(t,n,!0)})})),r},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(i._getHitsHierarchicalFacetsAttributes(e)),r=i._getFacetFilters(e),a=i._getNumericFilters(e),s={facets:t,tagFilters:i._getTagFilters(e)};return r.length>0&&(s.facetFilters=r),a.length>0&&(s.numericFilters=a),n({},e.getQueryParams(),s)},_getDisjunctiveFacetSearchParams:function(e,t,r){var a=i._getFacetFilters(e,t,r),s=i._getNumericFilters(e,t),c={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:i._getTagFilters(e),analytics:!1,clickAnalytics:!1},u=e.getHierarchicalFacetByName(t);return c.facets=u?i._getDisjunctiveHierarchicalFacetAttribute(e,u,r):t,s.length>0&&(c.numericFilters=s),a.length>0&&(c.facetFilters=a),n({},e.getQueryParams(),c)},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach((function(n){var i=e.numericRefinements[n]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==n&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return n+e+t}));r.push(i)}else r.push(n+e+t)}))}))})),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).forEach((function(e){(i[e]||[]).forEach((function(t){n.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).forEach((function(e){(a[e]||[]).forEach((function(t){n.push(e+":-"+t)}))}));var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).forEach((function(e){var r=s[e]||[];if(e!==t&&r&&0!==r.length){var i=[];r.forEach((function(t){i.push(e+":"+t)})),n.push(i)}}));var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).forEach((function(i){var a=(c[i]||[])[0];if(void 0!==a){var s,u,o=e.getHierarchicalFacetByName(i),f=e._getHierarchicalFacetSeparator(o),h=e._getHierarchicalRootPath(o);if(t===i){if(-1===a.indexOf(f)||!h&&!0===r||h&&h.split(f).length===a.split(f).length)return;h?(u=h.split(f).length-1,a=h):(u=a.split(f).length-2,a=a.slice(0,a.lastIndexOf(f))),s=o.attributes[u]}else u=a.split(f).length-1,s=o.attributes[u];s&&n.push([s+":"+a])}})),n},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,r){var n=e.getHierarchicalRefinement(r.name)[0];if(!n)return t.push(r.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(r),a=n.split(i).length,s=r.attributes.slice(0,a+1);return t.concat(s)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(!0===r){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,a){var s=a.isDisjunctiveFacet(e)?a.clearRefinements(e):a,c={facetQuery:t,facetName:e};return"number"==typeof r&&(c.maxFacetHits=r),n({},i._getHitsSearchParams(s),c)}};e.exports=i},267:function(e,t,r){e.exports=function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(n=(s=c.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=i(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=a();return i[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function c(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,i).catch((function(){return c({caches:t}).get(e,n,i)}))},set:function(e,n){return r.set(e,n).catch((function(){return c({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return c({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return c({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var s=n(),c=i&&i.miss||function(){return Promise.resolve()};return s.then((function(e){return c(e)})).then((function(){return s}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function o(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function f(e,t){return Object.keys(void 0!==t?t:{}).forEach((function(r){e[r]=t[r](e)})),e}function h(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},v=1,p=2,g=3;function y(e){return r({},e,{status:arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,lastUpdate:Date.now()})}function R(e){return{protocol:e.protocol||"https",url:e.url,accept:e.accept||d.Any}}var F="GET",b="POST";function j(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===v||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return R(e)})):t}}))}function P(e,t,n,i){var s=[],c=function(e,t){if(e.method!==F&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r({},e.data,{},t.data);return JSON.stringify(n)}}(n,i),u=function(e,t){var n=r({},e.headers,{},t.headers),i={};return Object.keys(n).forEach((function(e){var t=n[e];i[e.toLowerCase()]=t})),i}(e,i),o=n.method,f=n.method!==F?{}:r({},n.data,{},i.data),h=r({"x-algolia-agent":e.userAgent.value},e.queryParameters,{},f,{},i.queryParameters),l=0,m=function t(r,a){var f=r.pop();if(void 0===f)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:_(s)};var m={data:c,headers:u,method:o,url:O(f,n.path,h),connectTimeout:a(l,e.timeouts.connect),responseTimeout:a(l,i.timeout)},d=function(e){var t={request:m,response:e,host:f,triesLeft:r.length};return s.push(t),t},v={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var i=d(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",w(i)),e.hostsCache.set(f,y(f,n.isTimedOut?g:p))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,i=r;try{i=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(i,n,t)}(e,_(s))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,v)}))};return j(e.hostsCache,t).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function E(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function O(e,t,r){var n=x(r),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(i+="?".concat(n)),i}function x(e){return Object.keys(e).map((function(t){return h("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function _(e){return e.map((function(e){return w(e)}))}function w(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r({},e,{request:r({},e.request,{headers:r({},e.request.headers,{},t)})})}var N=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===l.WithinHeaders?n:{}},queryParameters:function(){return e===l.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:l.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,s=e.responsesCache,c=e.timeouts,u=e.userAgent,o=e.hosts,f=e.queryParameters,h={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:s,timeouts:c,userAgent:u,headers:e.headers,queryParameters:f,hosts:o.map((function(e){return R(e)})),read:function(e,t){var r=m(t,h.timeouts.read),n=function(){return P(h,h.hosts.filter((function(e){return 0!=(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:h.queryParameters,headers:h.headers}};return h.responsesCache.get(a,(function(){return h.requestsCache.get(a,(function(){return h.requestsCache.set(a,n()).then((function(e){return Promise.all([h.requestsCache.delete(a),e])}),(function(e){return Promise.all([h.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return h.responsesCache.set(a,e)}})},write:function(e,t){return P(h,h.hosts.filter((function(e){return 0!=(e.accept&d.Write)})),e,m(t,h.timeouts.write))}};return h}(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:d.Read},{url:"".concat(t,".algolia.net"),accept:d.Write}].concat(o([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e,{headers:r({},n.headers(),{},{"content-type":"application/x-www-form-urlencoded"},{},e.headers),queryParameters:r({},n.queryParameters(),{},e.queryParameters)}));return f({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},H=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},S=function(e){return function(t,n){var i=t.map((function(e){return r({},e,{params:x(e.params||{})})}));return e.transporter.read({method:b,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},n)}},A=function(e){return function(t,i){return Promise.all(t.map((function(t){var a=t.params,s=a.facetName,c=a.facetQuery,u=n(a,["facetName","facetQuery"]);return H(e)(t.indexName,{methods:{searchForFacetValues:C}}).searchForFacetValues(s,c,r({},i,{},u))})))}},Q=function(e){return function(t,r){return e.transporter.read({method:b,path:h("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},C=function(e){return function(t,r,n){return e.transporter.read({method:b,path:h("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},T=1,D=2,k=3;function I(e,t,n){var i,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,i=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=i(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=i(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(i=k,{debug:function(e,t){return T>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return D>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:c({caches:[s({key:"".concat("4.4.0","-").concat(e)}),u()]}),userAgent:E("4.4.0").add({segment:"Browser",version:"lite"}),authMode:l.WithinQueryParameters};return N(r({},a,{},n,{methods:{search:S,searchForFacetValues:A,multipleQueries:S,multipleSearchForFacetValues:A,initIndex:function(e){return function(t){return H(e)(t,{methods:{search:Q,searchForFacetValues:C}})}}}}))}return I.version="4.4.0",I}()}}]); \ No newline at end of file +/*! For license information please see 115.9ad5e9dc.js.LICENSE.txt */ +(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{112:function(e,t,r){"use strict";r.r(t);var n=r(0),i=r.n(n),a=r(271),s=r.n(a),c=r(261),u=r.n(c),o=r(198),f=r(23),h=r(202),l=r(11),m=r(199),d=r(21),v=r(205),p=r(237),g=r(207),y=r(113),R=r.n(y);const F=({docsSearchVersionsHelpers:e})=>{const t=Object.entries(e.allDocsData).filter(([,e])=>e.versions.length>1);return i.a.createElement("div",{className:Object(o.a)("col","col--3","padding-left--none",R.a.searchVersionColumn)},t.map(([r,n])=>{const a=t.length>1?r+": ":"";return i.a.createElement("select",{key:r,onChange:t=>e.setSearchVersion(r,t.target.value),defaultValue:e.searchVersions[r],className:R.a.searchVersionInput},n.versions.map((e,t)=>i.a.createElement("option",{key:t,label:`${a}${e.label}`,value:e.name})))}))};t.default=function(){const{siteConfig:{themeConfig:{algolia:{appId:e="BH4D9OD16A",apiKey:t,indexName:r}={}}}={}}=Object(d.default)(),a=function(){const e=Object(v.useAllDocsData)(),[t,r]=Object(n.useState)(()=>Object.entries(e).reduce((e,[t,r])=>({...e,[t]:r.versions[0].name}),{})),i=Object.values(e).some(e=>e.versions.length>1);return{allDocsData:e,versioningEnabled:i,searchVersions:t,setSearchVersion:(e,t)=>r(r=>({...r,[e]:t}))}}(),{searchValue:c,updateSearchPath:y}=Object(p.a)(),[b,j]=Object(n.useState)(c),P={items:[],query:null,totalResults:null,totalPages:null,lastPage:null,hasMore:null,loading:null},[E,O]=Object(n.useReducer)((e,{type:t,value:r})=>{switch(t){case"reset":return P;case"loading":return{...e,loading:!0};case"update":return b!==r.query?e:{...r,items:0===r.lastPage?r.items:e.items.concat(r.items)};case"advance":{const t=e.totalPages>e.lastPage+1;return{...e,lastPage:t?e.lastPage+1:e.lastPage,hasMore:t}}default:return e}},P),x=s()(e,t),_=u()(x,r,{hitsPerPage:15,advancedSyntax:!0,disjunctiveFacets:["docusaurus_tag"]});_.on("result",({results:{query:e,hits:t,page:r,nbHits:n,nbPages:i}})=>{if(""===e||!(t instanceof Array))return void O({type:"reset"});const a=e=>e.replace(/algolia-docsearch-suggestion--highlight/g,"search-result-match"),s=t.map(({url:e,_highlightResult:{hierarchy:t},_snippetResult:r={}})=>{const{pathname:n,hash:i}=new URL(e),s=Object.keys(t).map(e=>a(t[e].value));return{title:s.pop(),url:n+i,summary:r.content?a(r.content.value)+"...":"",breadcrumbs:s}});O({type:"update",value:{items:s,query:e,totalResults:n,totalPages:i,lastPage:r,hasMore:i>r+1,loading:!1}})});const[w,N]=Object(n.useState)(null),H=Object(n.useRef)(0),S=Object(n.useRef)(l.a.canUseDOM&&new IntersectionObserver(e=>{const{isIntersecting:t,boundingClientRect:{y:r}}=e[0];t&&H.current>r&&O({type:"advance"}),H.current=r},{threshold:1})),A=()=>b?`Search results for "${b}"`:"Search the documentation",Q=(e=0)=>{_.addDisjunctiveFacetRefinement("docusaurus_tag","default"),Object.entries(a.searchVersions).forEach(([e,t])=>{_.addDisjunctiveFacetRefinement("docusaurus_tag",`docs-${e}-${t}`)}),_.setQuery(b).setPage(e).search()};return Object(n.useEffect)(()=>{if(w)return S.current.observe(w),()=>{S.current.unobserve(w)}},[w]),Object(n.useEffect)(()=>{y(b),O({type:"reset"}),b&&(O({type:"loading"}),setTimeout(()=>{Q()},300))},[b,a.searchVersions]),Object(n.useEffect)(()=>{E.lastPage&&0!==E.lastPage&&Q(E.lastPage)},[E.lastPage]),Object(n.useEffect)(()=>{c&&c!==b&&j(c)},[c]),i.a.createElement(g.a,{wrapperClassName:"search-page-wrapper"},i.a.createElement(f.a,null,i.a.createElement("title",null,Object(m.useTitleFormatter)(A())),i.a.createElement("meta",{property:"robots",content:"noindex, follow"})),i.a.createElement("div",{className:"container margin-vert--lg"},i.a.createElement("h1",null,A()),i.a.createElement("form",{className:"row",onSubmit:e=>e.preventDefault()},i.a.createElement("div",{className:Object(o.a)("col",R.a.searchQueryColumn,{"col--9":a.versioningEnabled,"col--12":!a.versioningEnabled})},i.a.createElement("input",{type:"search",name:"q",className:R.a.searchQueryInput,placeholder:"Type your search here","aria-label":"Search",onChange:e=>j(e.target.value),value:b,autoComplete:"off",autoFocus:!0})),a.versioningEnabled&&i.a.createElement(F,{docsSearchVersionsHelpers:a})),i.a.createElement("div",{className:Object(o.a)("row","margin-vert--sm")},i.a.createElement("div",{className:Object(o.a)("col","col--8",R.a.searchResultsColumn)},!!E.totalResults&&i.a.createElement("strong",null,E.totalResults," ",(C=E.totalResults,T="document",C>1?T+"s":T)," found")),i.a.createElement("div",{className:Object(o.a)("col","col--4",R.a.searchLogoColumn)},i.a.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.algolia.com/","aria-label":"Search"},i.a.createElement("svg",{viewBox:"0 0 168 24",className:R.a.algoliaLogo,xmlns:"http://www.w3.org/2000/svg","aria-label":"Search by Algolia"},i.a.createElement("g",{fill:"none"},i.a.createElement("path",{className:R.a.algoliaLogoPathFill,d:"M120.925 18.804c-4.386.02-4.386-3.54-4.386-4.106l-.007-13.336 2.675-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-10.846-2.18c.821 0 1.43-.047 1.855-.129v-2.719a6.334 6.334 0 0 0-1.574-.199 5.7 5.7 0 0 0-.897.069 2.699 2.699 0 0 0-.814.24c-.24.116-.439.28-.582.491-.15.212-.219.335-.219.656 0 .628.219.991.616 1.23s.938.362 1.615.362zm-.233-9.7c.883 0 1.629.109 2.231.328.602.218 1.088.525 1.444.915.363.396.609.922.76 1.483.157.56.232 1.175.232 1.85v6.874a32.5 32.5 0 0 1-1.868.314c-.834.123-1.772.185-2.813.185-.69 0-1.327-.069-1.895-.198a4.001 4.001 0 0 1-1.471-.636 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.803 0-.656.13-1.073.384-1.525a3.24 3.24 0 0 1 1.047-1.106c.445-.287.95-.492 1.532-.615a8.8 8.8 0 0 1 1.82-.185 8.404 8.404 0 0 1 1.972.24v-.438c0-.307-.035-.6-.11-.874a1.88 1.88 0 0 0-.384-.73 1.784 1.784 0 0 0-.724-.493 3.164 3.164 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.735 7.735 0 0 0-1.26.307l-.321-2.192c.335-.117.834-.233 1.478-.349a10.98 10.98 0 0 1 2.073-.178zm52.842 9.626c.822 0 1.43-.048 1.854-.13V13.7a6.347 6.347 0 0 0-1.574-.199c-.294 0-.595.021-.896.069a2.7 2.7 0 0 0-.814.24 1.46 1.46 0 0 0-.582.491c-.15.212-.218.335-.218.656 0 .628.218.991.615 1.23.404.245.938.362 1.615.362zm-.226-9.694c.883 0 1.629.108 2.231.327.602.219 1.088.526 1.444.915.355.39.609.923.759 1.483a6.8 6.8 0 0 1 .233 1.852v6.873c-.41.088-1.034.19-1.868.314-.834.123-1.772.184-2.813.184-.69 0-1.327-.068-1.895-.198a4.001 4.001 0 0 1-1.471-.635 3.085 3.085 0 0 1-.951-1.134c-.226-.465-.343-1.12-.343-1.804 0-.656.13-1.073.384-1.524.26-.45.608-.82 1.047-1.107.445-.286.95-.491 1.532-.614a8.803 8.803 0 0 1 2.751-.13c.329.034.671.096 1.04.185v-.437a3.3 3.3 0 0 0-.109-.875 1.873 1.873 0 0 0-.384-.731 1.784 1.784 0 0 0-.724-.492 3.165 3.165 0 0 0-1.143-.205c-.616 0-1.177.075-1.69.164a7.75 7.75 0 0 0-1.26.307l-.321-2.193c.335-.116.834-.232 1.478-.348a11.633 11.633 0 0 1 2.073-.177zm-8.034-1.271a1.626 1.626 0 0 1-1.628-1.62c0-.895.725-1.62 1.628-1.62.904 0 1.63.725 1.63 1.62 0 .895-.733 1.62-1.63 1.62zm1.348 13.22h-2.689V7.27l2.69-.423v11.956zm-4.714 0c-4.386.02-4.386-3.54-4.386-4.107l-.008-13.336 2.676-.424v13.254c0 .322 0 2.358 1.718 2.364v2.248zm-8.698-5.903c0-1.156-.253-2.119-.746-2.788-.493-.677-1.183-1.01-2.067-1.01-.882 0-1.574.333-2.065 1.01-.493.676-.733 1.632-.733 2.788 0 1.168.246 1.953.74 2.63.492.683 1.183 1.018 2.066 1.018.882 0 1.574-.342 2.067-1.019.492-.683.738-1.46.738-2.63zm2.737-.007c0 .902-.13 1.584-.397 2.33a5.52 5.52 0 0 1-1.128 1.906 4.986 4.986 0 0 1-1.752 1.223c-.685.286-1.739.45-2.265.45-.528-.006-1.574-.157-2.252-.45a5.096 5.096 0 0 1-1.744-1.223c-.487-.527-.863-1.162-1.137-1.906a6.345 6.345 0 0 1-.41-2.33c0-.902.123-1.77.397-2.508a5.554 5.554 0 0 1 1.15-1.892 5.133 5.133 0 0 1 1.75-1.216c.679-.287 1.425-.423 2.232-.423.808 0 1.553.142 2.237.423a4.88 4.88 0 0 1 1.753 1.216 5.644 5.644 0 0 1 1.135 1.892c.287.738.431 1.606.431 2.508zm-20.138 0c0 1.12.246 2.363.738 2.882.493.52 1.13.78 1.91.78.424 0 .828-.062 1.204-.178.377-.116.677-.253.917-.417V9.33a10.476 10.476 0 0 0-1.766-.226c-.971-.028-1.71.37-2.23 1.004-.513.636-.773 1.75-.773 2.788zm7.438 5.274c0 1.824-.466 3.156-1.404 4.004-.936.846-2.367 1.27-4.296 1.27-.705 0-2.17-.137-3.34-.396l.431-2.118c.98.205 2.272.26 2.95.26 1.074 0 1.84-.219 2.299-.656.459-.437.684-1.086.684-1.948v-.437a8.07 8.07 0 0 1-1.047.397c-.43.13-.93.198-1.492.198-.739 0-1.41-.116-2.018-.349a4.206 4.206 0 0 1-1.567-1.025c-.431-.45-.774-1.017-1.013-1.694-.24-.677-.363-1.885-.363-2.773 0-.834.13-1.88.384-2.577.26-.696.629-1.298 1.129-1.796.493-.498 1.095-.881 1.8-1.162a6.605 6.605 0 0 1 2.428-.457c.87 0 1.67.109 2.45.24.78.129 1.444.265 1.985.415V18.17zM6.972 6.677v1.627c-.712-.446-1.52-.67-2.425-.67-.585 0-1.045.13-1.38.391a1.24 1.24 0 0 0-.502 1.03c0 .425.164.765.494 1.02.33.256.835.532 1.516.83.447.192.795.356 1.045.495.25.138.537.332.862.582.324.25.563.548.718.894.154.345.23.741.23 1.188 0 .947-.334 1.691-1.004 2.234-.67.542-1.537.814-2.601.814-1.18 0-2.16-.229-2.936-.686v-1.708c.84.628 1.814.942 2.92.942.585 0 1.048-.136 1.388-.407.34-.271.51-.646.51-1.125 0-.287-.1-.55-.302-.79-.203-.24-.42-.42-.655-.542-.234-.123-.585-.29-1.053-.503a61.27 61.27 0 0 1-.582-.271 13.67 13.67 0 0 1-.55-.287 4.275 4.275 0 0 1-.567-.351 6.92 6.92 0 0 1-.455-.4c-.18-.17-.31-.34-.39-.51-.08-.17-.155-.37-.224-.598a2.553 2.553 0 0 1-.104-.742c0-.915.333-1.638.998-2.17.664-.532 1.523-.798 2.576-.798.968 0 1.793.17 2.473.51zm7.468 5.696v-.287c-.022-.607-.187-1.088-.495-1.444-.309-.357-.75-.535-1.324-.535-.532 0-.99.194-1.373.583-.382.388-.622.949-.717 1.683h3.909zm1.005 2.792v1.404c-.596.34-1.383.51-2.362.51-1.255 0-2.255-.377-3-1.132-.744-.755-1.116-1.744-1.116-2.968 0-1.297.34-2.316 1.021-3.055.68-.74 1.548-1.11 2.6-1.11 1.033 0 1.852.323 2.458.966.606.644.91 1.572.91 2.784 0 .33-.033.676-.096 1.038h-5.314c.107.702.405 1.239.894 1.611.49.372 1.106.558 1.85.558.862 0 1.58-.202 2.155-.606zm6.605-1.77h-1.212c-.596 0-1.045.116-1.349.35-.303.234-.454.532-.454.894 0 .372.117.664.35.877.235.213.575.32 1.022.32.51 0 .912-.142 1.204-.424.293-.281.44-.651.44-1.108v-.91zm-4.068-2.554V9.325c.627-.361 1.457-.542 2.489-.542 2.116 0 3.175 1.026 3.175 3.08V17h-1.548v-.957c-.415.68-1.143 1.02-2.186 1.02-.766 0-1.38-.22-1.843-.661-.462-.442-.694-1.003-.694-1.684 0-.776.293-1.38.878-1.81.585-.431 1.404-.647 2.457-.647h1.34V11.8c0-.554-.133-.971-.399-1.253-.266-.282-.707-.423-1.324-.423a4.07 4.07 0 0 0-2.345.718zm9.333-1.93v1.42c.394-1 1.101-1.5 2.123-1.5.148 0 .313.016.494.048v1.531a1.885 1.885 0 0 0-.75-.143c-.542 0-.989.24-1.34.718-.351.479-.527 1.048-.527 1.707V17h-1.563V8.91h1.563zm5.01 4.084c.022.82.272 1.492.75 2.019.479.526 1.15.79 2.01.79.639 0 1.235-.176 1.788-.527v1.404c-.521.319-1.186.479-1.995.479-1.265 0-2.276-.4-3.031-1.197-.755-.798-1.133-1.792-1.133-2.984 0-1.16.38-2.151 1.14-2.975.761-.825 1.79-1.237 3.088-1.237.702 0 1.346.149 1.93.447v1.436a3.242 3.242 0 0 0-1.77-.495c-.84 0-1.513.266-2.019.798-.505.532-.758 1.213-.758 2.042zM40.24 5.72v4.579c.458-1 1.293-1.5 2.505-1.5.787 0 1.42.245 1.899.734.479.49.718 1.17.718 2.042V17h-1.564v-5.106c0-.553-.14-.98-.422-1.284-.282-.303-.652-.455-1.11-.455-.531 0-1.002.202-1.411.606-.41.405-.615 1.022-.615 1.851V17h-1.563V5.72h1.563zm14.966 10.02c.596 0 1.096-.253 1.5-.758.404-.506.606-1.157.606-1.955 0-.915-.202-1.62-.606-2.114-.404-.495-.92-.742-1.548-.742-.553 0-1.05.224-1.491.67-.442.447-.662 1.133-.662 2.058 0 .958.212 1.67.638 2.138.425.469.946.703 1.563.703zM53.004 5.72v4.42c.574-.894 1.388-1.341 2.44-1.341 1.022 0 1.857.383 2.506 1.149.649.766.973 1.781.973 3.047 0 1.138-.309 2.109-.925 2.912-.617.803-1.463 1.205-2.537 1.205-1.075 0-1.894-.447-2.457-1.34V17h-1.58V5.72h1.58zm9.908 11.104l-3.223-7.913h1.739l1.005 2.632 1.26 3.415c.096-.32.48-1.458 1.15-3.415l.909-2.632h1.66l-2.92 7.866c-.777 2.074-1.963 3.11-3.559 3.11a2.92 2.92 0 0 1-.734-.079v-1.34c.17.042.351.064.543.064 1.032 0 1.755-.57 2.17-1.708z"}),i.a.createElement("path",{fill:"#5468FF",d:"M78.988.938h16.594a2.968 2.968 0 0 1 2.966 2.966V20.5a2.967 2.967 0 0 1-2.966 2.964H78.988a2.967 2.967 0 0 1-2.966-2.964V3.897A2.961 2.961 0 0 1 78.988.938z"}),i.a.createElement("path",{fill:"white",d:"M89.632 5.967v-.772a.978.978 0 0 0-.978-.977h-2.28a.978.978 0 0 0-.978.977v.793c0 .088.082.15.171.13a7.127 7.127 0 0 1 1.984-.28c.65 0 1.295.088 1.917.259.082.02.164-.04.164-.13m-6.248 1.01l-.39-.389a.977.977 0 0 0-1.382 0l-.465.465a.973.973 0 0 0 0 1.38l.383.383c.062.061.15.047.205-.014.226-.307.472-.601.746-.874.281-.28.568-.526.883-.751.068-.042.075-.137.02-.2m4.16 2.453v3.341c0 .096.104.165.192.117l2.97-1.537c.068-.034.089-.117.055-.184a3.695 3.695 0 0 0-3.08-1.866c-.068 0-.136.054-.136.13m0 8.048a4.489 4.489 0 0 1-4.49-4.482 4.488 4.488 0 0 1 4.49-4.482 4.488 4.488 0 0 1 4.489 4.482 4.484 4.484 0 0 1-4.49 4.482m0-10.85a6.363 6.363 0 1 0 0 12.729 6.37 6.37 0 0 0 6.372-6.368 6.358 6.358 0 0 0-6.371-6.36"})))))),E.items.length>0?i.a.createElement("section",null,E.items.map(({title:e,url:t,summary:r,breadcrumbs:n},a)=>i.a.createElement("article",{key:a,className:R.a.searchResultItem},i.a.createElement(h.a,{to:t,className:R.a.searchResultItemHeading,dangerouslySetInnerHTML:{__html:e}}),n.length>0&&i.a.createElement("span",{className:R.a.searchResultItemPath},n.map((e,t)=>i.a.createElement(i.a.Fragment,null,0!==t&&i.a.createElement("span",{className:R.a.searchResultItemPathSeparator},"\u203a"),i.a.createElement("span",{dangerouslySetInnerHTML:{__html:e}})))),r&&i.a.createElement("p",{className:R.a.searchResultItemSummary,dangerouslySetInnerHTML:{__html:r}})))):[b&&!E.loading&&i.a.createElement("p",{key:"no-results"},"No results were found"),!!E.loading&&i.a.createElement("div",{key:"spinner",className:R.a.loadingSpinner})],E.hasMore&&i.a.createElement("div",{className:R.a.loader,ref:N},i.a.createElement("span",null,"Fetching new results..."))));var C,T}},218:function(e,t,r){"use strict";e.exports=function(e,t){if(Array.isArray(e))for(var r=0;r0}},244:function(e,t,r){"use strict";var n=r(231),i=r(232),a=r(263),s=r(218),c=r(264),u=r(245),o=r(233),f=r(265);function h(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((function(e,r){return h(t[r],e)})):e===t}function l(e){var t=e?l._parseNumbers(e):{};this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach((function(e){var n=-1!==l.PARAMETERS.indexOf(e),i=void 0!==t[e];!n&&i&&(r[e]=t[e])}))}l.PARAMETERS=Object.keys(new l),l._parseNumbers=function(e){if(e instanceof l)return e;var t={};if(["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"].forEach((function(r){var n=e[r];if("string"==typeof n){var i=parseFloat(n);t[r]=isNaN(i)?n:i}})),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map((function(e){return Array.isArray(e)?e.map((function(e){return parseFloat(e)})):e}))),e.numericRefinements){var r={};Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t]||{};r[t]={},Object.keys(n).forEach((function(e){var i=n[e].map((function(e){return Array.isArray(e)?e.map((function(e){return"string"==typeof e?parseFloat(e):e})):"string"==typeof e?parseFloat(e):e}));r[t][e]=i}))})),t.numericRefinements=r}return n({},e,t)},l.make=function(e){var t=new l(e);return(e.hierarchicalFacets||[]).forEach((function(e){if(e.rootPath){var r=t.getHierarchicalRefinement(e.name);r.length>0&&0!==r[0].indexOf(e.rootPath)&&(t=t.clearRefinements(e.name)),0===(r=t.getHierarchicalRefinement(e.name)).length&&(t=t.toggleHierarchicalFacetRefinement(e.name,e.rootPath))}})),t},l.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&o(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):o(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null},l.prototype={constructor:l,clearRefinements:function(e){var t={numericRefinements:this._clearNumericRefinements(e),facetsRefinements:f.clearRefinement(this.facetsRefinements,e,"conjunctiveFacet"),facetsExcludes:f.clearRefinement(this.facetsExcludes,e,"exclude"),disjunctiveFacetsRefinements:f.clearRefinement(this.disjunctiveFacetsRefinements,e,"disjunctiveFacet"),hierarchicalFacetsRefinements:f.clearRefinement(this.hierarchicalFacetsRefinements,e,"hierarchicalFacet")};return t.numericRefinements===this.numericRefinements&&t.facetsRefinements===this.facetsRefinements&&t.facetsExcludes===this.facetsExcludes&&t.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&t.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(t)},clearTags:function(){return void 0===this.tagFilters&&0===this.tagRefinements.length?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(e){return e===this.index?this:this.setQueryParameters({index:e})},setQuery:function(e){return e===this.query?this:this.setQueryParameters({query:e})},setPage:function(e){return e===this.page?this:this.setQueryParameters({page:e})},setFacets:function(e){return this.setQueryParameters({facets:e})},setDisjunctiveFacets:function(e){return this.setQueryParameters({disjunctiveFacets:e})},setHitsPerPage:function(e){return this.hitsPerPage===e?this:this.setQueryParameters({hitsPerPage:e})},setTypoTolerance:function(e){return this.typoTolerance===e?this:this.setQueryParameters({typoTolerance:e})},addNumericRefinement:function(e,t,r){var i=c(r);if(this.isNumericRefined(e,t,i))return this;var a=n({},this.numericRefinements);return a[e]=n({},a[e]),a[e][t]?(a[e][t]=a[e][t].slice(),a[e][t].push(i)):a[e][t]=[i],this.setQueryParameters({numericRefinements:a})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsRefinements[e]||[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)&&this.disjunctiveFacetsRefinements[e]||[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)&&this.facetsExcludes[e]||[]},removeNumericRefinement:function(e,t,r){return void 0!==r?this.isNumericRefined(e,t,r)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(n,i){return i===e&&n.op===t&&h(n.val,c(r))}))}):this:void 0!==t?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(r,n){return n===e&&r.op===t}))}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements((function(t,r){return r===e}))}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(e){if(void 0===e)return o(this.numericRefinements)?{}:this.numericRefinements;if("string"==typeof e)return o(this.numericRefinements[e])?u(this.numericRefinements,[e]):this.numericRefinements;if("function"==typeof e){var t=!1,r=this.numericRefinements,n=Object.keys(r).reduce((function(n,i){var a=r[i],s={};return a=a||{},Object.keys(a).forEach((function(r){var n=a[r]||[],c=[];n.forEach((function(t){e({val:t,op:r},i,"numeric")||c.push(t)})),c.length!==n.length&&(t=!0),s[r]=c})),n[i]=s,n}),{});return t?n:this.numericRefinements}},addFacet:function(e){return this.isConjunctiveFacet(e)?this:this.setQueryParameters({facets:this.facets.concat([e])})},addDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([e])})},addHierarchicalFacet:function(e){if(this.isHierarchicalFacet(e.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+e.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([e])})},addFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this:this.setQueryParameters({facetsRefinements:f.addRefinement(this.facetsRefinements,e,t)})},addExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this:this.setQueryParameters({facetsExcludes:f.addRefinement(this.facetsExcludes,e,t)})},addDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this:this.setQueryParameters({disjunctiveFacetsRefinements:f.addRefinement(this.disjunctiveFacetsRefinements,e,t)})},addTagRefinement:function(e){if(this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.concat(e)};return this.setQueryParameters(t)},removeFacet:function(e){return this.isConjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({facets:this.facets.filter((function(t){return t!==e}))}):this},removeDisjunctiveFacet:function(e){return this.isDisjunctiveFacet(e)?this.clearRefinements(e).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter((function(t){return t!==e}))}):this},removeHierarchicalFacet:function(e){return this.isHierarchicalFacet(e)?this.clearRefinements(e).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter((function(t){return t.name!==e}))}):this},removeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsRefinements,e,t)?this.setQueryParameters({facetsRefinements:f.removeRefinement(this.facetsRefinements,e,t)}):this},removeExcludeRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return f.isRefined(this.facetsExcludes,e,t)?this.setQueryParameters({facetsExcludes:f.removeRefinement(this.facetsExcludes,e,t)}):this},removeDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return f.isRefined(this.disjunctiveFacetsRefinements,e,t)?this.setQueryParameters({disjunctiveFacetsRefinements:f.removeRefinement(this.disjunctiveFacetsRefinements,e,t)}):this},removeTagRefinement:function(e){if(!this.isTagRefined(e))return this;var t={tagRefinements:this.tagRefinements.filter((function(t){return t!==e}))};return this.setQueryParameters(t)},toggleRefinement:function(e,t){return this.toggleFacetRefinement(e,t)},toggleFacetRefinement:function(e,t){if(this.isHierarchicalFacet(e))return this.toggleHierarchicalFacetRefinement(e,t);if(this.isConjunctiveFacet(e))return this.toggleConjunctiveFacetRefinement(e,t);if(this.isDisjunctiveFacet(e))return this.toggleDisjunctiveFacetRefinement(e,t);throw new Error("Cannot refine the undeclared facet "+e+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:f.toggleRefinement(this.facetsRefinements,e,t)})},toggleExcludeFacetRefinement:function(e,t){if(!this.isConjunctiveFacet(e))throw new Error(e+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:f.toggleRefinement(this.facetsExcludes,e,t)})},toggleDisjunctiveFacetRefinement:function(e,t){if(!this.isDisjunctiveFacet(e))throw new Error(e+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:f.toggleRefinement(this.disjunctiveFacetsRefinements,e,t)})},toggleHierarchicalFacetRefinement:function(e,t){if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration");var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),n={};return void 0!==this.hierarchicalFacetsRefinements[e]&&this.hierarchicalFacetsRefinements[e].length>0&&(this.hierarchicalFacetsRefinements[e][0]===t||0===this.hierarchicalFacetsRefinements[e][0].indexOf(t+r))?-1===t.indexOf(r)?n[e]=[]:n[e]=[t.slice(0,t.lastIndexOf(r))]:n[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:i({},n,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:i({},r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:i({},t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(e){return this.isTagRefined(e)?this.removeTagRefinement(e):this.addTagRefinement(e)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return void 0!==this.getHierarchicalFacetByName(e)},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsRefinements,e,t)},isExcludeRefined:function(e,t){return!!this.isConjunctiveFacet(e)&&f.isRefined(this.facetsExcludes,e,t)},isDisjunctiveFacetRefined:function(e,t){return!!this.isDisjunctiveFacet(e)&&f.isRefined(this.disjunctiveFacetsRefinements,e,t)},isHierarchicalFacetRefined:function(e,t){if(!this.isHierarchicalFacet(e))return!1;var r=this.getHierarchicalRefinement(e);return t?-1!==r.indexOf(t):r.length>0},isNumericRefined:function(e,t,r){if(void 0===r&&void 0===t)return!!this.numericRefinements[e];var n=this.numericRefinements[e]&&void 0!==this.numericRefinements[e][t];if(void 0===r||!n)return n;var i,a,u=c(r),o=void 0!==(i=this.numericRefinements[e][t],a=u,s(i,(function(e){return h(e,a)})));return n&&o},isTagRefined:function(e){return-1!==this.tagRefinements.indexOf(e)},getRefinedDisjunctiveFacets:function(){var e=this,t=a(Object.keys(this.numericRefinements).filter((function(t){return Object.keys(e.numericRefinements[t]).length>0})),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter((function(t){return e.disjunctiveFacetsRefinements[t].length>0})).concat(t).concat(this.getRefinedHierarchicalFacets())},getRefinedHierarchicalFacets:function(){var e=this;return a(this.hierarchicalFacets.map((function(e){return e.name})),Object.keys(this.hierarchicalFacetsRefinements).filter((function(t){return e.hierarchicalFacetsRefinements[t].length>0})))},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter((function(t){return-1===e.indexOf(t)}))},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements"],getQueryParams:function(){var e=this.managedParameters,t={},r=this;return Object.keys(this).forEach((function(n){var i=r[n];-1===e.indexOf(n)&&void 0!==i&&(t[n]=i)})),t},setQueryParameter:function(e,t){if(this[e]===t)return this;var r={};return r[e]=t,this.setQueryParameters(r)},setQueryParameters:function(e){if(!e)return this;var t=l.validate(this,e);if(t)throw t;var r=this,n=l._parseNumbers(e),i=Object.keys(this).reduce((function(e,t){return e[t]=r[t],e}),{}),a=Object.keys(n).reduce((function(e,t){var r=void 0!==e[t],i=void 0!==n[t];return r&&!i?u(e,[t]):(i&&(e[t]=n[t]),e)}),i);return new this.constructor(a)},resetPage:function(){return void 0===this.page?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return"boolean"!=typeof e.showParentLevel||e.showParentLevel},getHierarchicalFacetByName:function(e){return s(this.hierarchicalFacets,(function(t){return t.name===e}))},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e));return t.split(r).map((function(e){return e.trim()}))},toString:function(){return JSON.stringify(this,null,2)}},e.exports=l},245:function(e,t,r){"use strict";e.exports=function(e,t){if(null===e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}},246:function(e,t,r){"use strict";var n=r(231),i=r(232),a=r(247),s=r(266),c=r(218),u=r(267),o=r(248),f=r(268);function h(e){var t={};return e.forEach((function(e,r){t[e]=r})),t}function l(e,t,r){t&&t[r]&&(e.stats=t[r])}function m(e,t){var r=t[0];this._rawResults=t;var a=this;Object.keys(r).forEach((function(e){a[e]=r[e]})),this.processingTimeMS=t.reduce((function(e,t){return void 0===t.processingTimeMS?e:e+t.processingTimeMS}),0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map((function(){return[]})),this.facets=[];var o=e.getRefinedDisjunctiveFacets(),m=h(e.facets),d=h(e.disjunctiveFacets),v=1,p=r.facets||{};Object.keys(p).forEach((function(t){var n,i,s=p[t],o=(n=e.hierarchicalFacets,i=t,c(n,(function(e){return(e.attributes||[]).indexOf(i)>-1})));if(o){var f=o.attributes.indexOf(t),h=u(e.hierarchicalFacets,(function(e){return e.name===o.name}));a.hierarchicalFacets[h][f]={attribute:t,data:s,exhaustive:r.exhaustiveFacetsCount}}else{var v,g=-1!==e.disjunctiveFacets.indexOf(t),y=-1!==e.facets.indexOf(t);g&&(v=d[t],a.disjunctiveFacets[v]={name:t,data:s,exhaustive:r.exhaustiveFacetsCount},l(a.disjunctiveFacets[v],r.facets_stats,t)),y&&(v=m[t],a.facets[v]={name:t,data:s,exhaustive:r.exhaustiveFacetsCount},l(a.facets[v],r.facets_stats,t))}})),this.hierarchicalFacets=s(this.hierarchicalFacets),o.forEach((function(s){var c=t[v],o=c&&c.facets?c.facets:{},f=e.getHierarchicalFacetByName(s);Object.keys(o).forEach((function(t){var s,h=o[t];if(f){s=u(e.hierarchicalFacets,(function(e){return e.name===f.name}));var m=u(a.hierarchicalFacets[s],(function(e){return e.attribute===t}));if(-1===m)return;a.hierarchicalFacets[s][m].data=n({},a.hierarchicalFacets[s][m].data,h)}else{s=d[t];var v=r.facets&&r.facets[t]||{};a.disjunctiveFacets[s]={name:t,data:i({},h,v),exhaustive:c.exhaustiveFacetsCount},l(a.disjunctiveFacets[s],c.facets_stats,t),e.disjunctiveFacetsRefinements[t]&&e.disjunctiveFacetsRefinements[t].forEach((function(r){!a.disjunctiveFacets[s].data[r]&&e.disjunctiveFacetsRefinements[t].indexOf(r)>-1&&(a.disjunctiveFacets[s].data[r]=0)}))}})),v++})),e.getRefinedHierarchicalFacets().forEach((function(r){var n=e.getHierarchicalFacetByName(r),s=e._getHierarchicalFacetSeparator(n),c=e.getHierarchicalRefinement(r);if(!(0===c.length||c[0].split(s).length<2)){var o=t[v],f=o&&o.facets?o.facets:{};Object.keys(f).forEach((function(t){var r=f[t],o=u(e.hierarchicalFacets,(function(e){return e.name===n.name})),h=u(a.hierarchicalFacets[o],(function(e){return e.attribute===t}));if(-1!==h){var l={};if(c.length>0){var m=c[0].split(s)[0];l[m]=a.hierarchicalFacets[o][h].data[m]}a.hierarchicalFacets[o][h].data=i(l,r,a.hierarchicalFacets[o][h].data)}})),v++}})),Object.keys(e.facetsExcludes).forEach((function(t){var n=e.facetsExcludes[t],i=m[t];a.facets[i]={name:t,data:r.facets[t],exhaustive:r.exhaustiveFacetsCount},n.forEach((function(e){a.facets[i]=a.facets[i]||{name:t},a.facets[i].data=a.facets[i].data||{},a.facets[i].data[e]=0}))})),this.hierarchicalFacets=this.hierarchicalFacets.map(f(e)),this.facets=s(this.facets),this.disjunctiveFacets=s(this.disjunctiveFacets),this._state=e}function d(e,t){if(!t.data||0===t.data.length)return t;var r=t.data.map((function(t){return d(e,t)})),i=e(r);return n({},t,{data:i})}function v(e,t){var r=c(e,(function(e){return e.name===t}));return r&&r.stats}function p(e,t,r,n,i){var a=c(i,(function(e){return e.name===r})),s=a&&a.data&&a.data[n]?a.data[n]:0,u=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:s,exhaustive:u}}m.prototype.getFacetByName=function(e){function t(t){return t.name===e}return c(this.facets,t)||c(this.disjunctiveFacets,t)||c(this.hierarchicalFacets,t)},m.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"],m.prototype.getFacetValues=function(e,t){var r=function(e,t){function r(e){return e.name===t}if(e._state.isConjunctiveFacet(t)){var n=c(e.facets,r);return n?Object.keys(n.data).map((function(r){return{name:r,count:n.data[r],isRefined:e._state.isFacetRefined(t,r),isExcluded:e._state.isExcludeRefined(t,r)}})):[]}if(e._state.isDisjunctiveFacet(t)){var i=c(e.disjunctiveFacets,r);return i?Object.keys(i.data).map((function(r){return{name:r,count:i.data[r],isRefined:e._state.isDisjunctiveFacetRefined(t,r)}})):[]}if(e._state.isHierarchicalFacet(t))return c(e.hierarchicalFacets,r)}(this,e);if(r){var n=i({},t,{sortBy:m.DEFAULT_SORT});if(Array.isArray(n.sortBy)){var s=o(n.sortBy,m.DEFAULT_SORT);return Array.isArray(r)?a(r,s[0],s[1]):d((function(e){return a(e,s[0],s[1])}),r)}if("function"==typeof n.sortBy)return Array.isArray(r)?r.sort(n.sortBy):d((function(e){return function(e,t){return t.sort(e)}(n.sortBy,e)}),r);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")}},m.prototype.getFacetStats=function(e){return this._state.isConjunctiveFacet(e)?v(this.facets,e):this._state.isDisjunctiveFacet(e)?v(this.disjunctiveFacets,e):void 0},m.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach((function(n){e.facetsRefinements[n].forEach((function(i){r.push(p(e,"facet",n,i,t.facets))}))})),Object.keys(e.facetsExcludes).forEach((function(n){e.facetsExcludes[n].forEach((function(i){r.push(p(e,"exclude",n,i,t.facets))}))})),Object.keys(e.disjunctiveFacetsRefinements).forEach((function(n){e.disjunctiveFacetsRefinements[n].forEach((function(i){r.push(p(e,"disjunctive",n,i,t.disjunctiveFacets))}))})),Object.keys(e.hierarchicalFacetsRefinements).forEach((function(n){e.hierarchicalFacetsRefinements[n].forEach((function(i){r.push(function(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),s=r.split(a),u=c(n,(function(e){return e.name===t})),o=s.reduce((function(e,t){var r=e&&c(e.data,(function(e){return e.name===t}));return void 0!==r?r:e}),u),f=o&&o.count||0,h=o&&o.exhaustive||!1,l=o&&o.path||"";return{type:"hierarchical",attributeName:t,name:l,count:f,exhaustive:h}}(e,n,i,t.hierarchicalFacets))}))})),Object.keys(e.numericRefinements).forEach((function(t){var n=e.numericRefinements[t];Object.keys(n).forEach((function(e){n[e].forEach((function(n){r.push({type:"numeric",attributeName:t,name:n,numericValue:n,operator:e})}))}))})),e.tagRefinements.forEach((function(e){r.push({type:"tag",attributeName:"_tags",name:e})})),r},e.exports=m},247:function(e,t,r){"use strict";function n(e,t){if(e!==t){var r=void 0!==e,n=null===e,i=void 0!==t,a=null===t;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e=r.length?a:"desc"===r[i]?-a:a}return e.index-t.index})),i.map((function(e){return e.value}))}},248:function(e,t,r){"use strict";var n=r(218);e.exports=function(e,t){var r=(t||[]).map((function(e){return e.split(":")}));return e.reduce((function(e,t){var i=t.split(":"),a=n(r,(function(e){return e[0]===i[0]}));return i.length>1||!a?(e[0].push(i[0]),e[1].push(i[1]),e):(e[0].push(a[0]),e[1].push(a[1]),e)}),[[],[]])}},249:function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function c(){c.init.call(this)}e.exports=c,e.exports.once=function(e,t){return new Promise((function(r,n){function i(){void 0!==a&&e.removeListener("error",a),r([].slice.call(arguments))}var a;"error"!==t&&(a=function(r){e.removeListener(t,i),n(r)},e.once("error",a)),e.once(t,i)}))},c.EventEmitter=c,c.prototype._events=void 0,c.prototype._eventsCount=0,c.prototype._maxListeners=void 0;var u=10;function o(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?c.defaultMaxListeners:e._maxListeners}function h(e,t,r,n){var i,a,s,c;if(o(r),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),a=e._events),s=a[t]),void 0===s)s=a[t]=r,++e._eventsCount;else if("function"==typeof s?s=a[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=f(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function m(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var c=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw c.context=s,c}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var o=u.length,f=p(u,o);for(r=0;r=0;a--)if(r[a]===t||r[a].listener===t){s=r[a].listener,i=a;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},c.prototype.listeners=function(e){return d(this,e,!0)},c.prototype.rawListeners=function(e){return d(this,e,!1)},c.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},c.prototype.listenerCount=v,c.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},250:function(e,t,r){"use strict";e.exports=function(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}},251:function(e,t,r){"use strict";e.exports="3.2.2"},261:function(e,t,r){"use strict";var n=r(262),i=r(244),a=r(246);function s(e,t,r){return new n(e,t,r)}s.version=r(251),s.AlgoliaSearchHelper=n,s.SearchParameters=i,s.SearchResults=a,e.exports=s},262:function(e,t,r){"use strict";var n=r(244),i=r(246),a=r(269),s=r(270),c=r(249),u=r(250),o=r(233),f=r(251);function h(e,t,r){"function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+f+")"),this.setClient(e);var i=r||{};i.index=t,this.state=n.make(i),this.lastResults=null,this._queryId=0,this._lastQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0}function l(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}function m(){return this.state.page}u(h,c.EventEmitter),h.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this},h.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this},h.prototype.getQuery=function(){var e=this.state;return s._getHitsSearchParams(e)},h.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=s._getQueries(r.index,r),a=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),!t)return this.client.search(n).then((function(e){return a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),{content:new i(r,e.results),state:r,_originalResponse:e}}),(function(e){throw a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),e}));this.client.search(n).then((function(e){a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),t(null,new i(r,e.results),r)})).catch((function(e){a._currentNbQueries--,0===a._currentNbQueries&&a.emit("searchQueueEmpty"),t(e,null,r)}))},h.prototype.searchForFacetValues=function(e,t,r,n){var i="function"==typeof this.client.searchForFacetValues;if(!i&&"function"!=typeof this.client.initIndex)throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var a=this.state.setQueryParameters(n||{}),c=a.isDisjunctiveFacet(e),u=s.getSearchForFacetQuery(e,t,r,a);this._currentNbQueries++;var o=this;return this.emit("searchForFacetValues",{state:a,facet:e,query:t}),(i?this.client.searchForFacetValues([{indexName:a.index,params:u}]):this.client.initIndex(a.index).searchForFacetValues(u)).then((function(t){return o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),(t=Array.isArray(t)?t[0]:t).facetHits.forEach((function(t){t.isRefined=c?a.isDisjunctiveFacetRefined(e,t.value):a.isFacetRefined(e,t.value)})),t}),(function(e){throw o._currentNbQueries--,0===o._currentNbQueries&&o.emit("searchQueueEmpty"),e}))},h.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this},h.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this},h.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this},h.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)},h.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this},h.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)},h.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this},h.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)},h.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this},h.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this},h.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)},h.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this},h.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)},h.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this},h.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)},h.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this},h.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)},h.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)},h.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this},h.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)},h.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this},h.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)},h.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)},h.prototype.setCurrentPage=l,h.prototype.setPage=l,h.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this},h.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this},h.prototype.setState=function(e){return this._change({state:n.make(e),isPageReset:!1}),this},h.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new n(e),this},h.prototype.hasRefinements=function(e){return!!o(this.state.getNumericRefinements(e))||(this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):!!this.state.isHierarchicalFacet(e)&&this.state.isHierarchicalFacetRefined(e))},h.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)},h.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)},h.prototype.hasTag=function(e){return this.state.isTagRefined(e)},h.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)},h.prototype.getIndex=function(){return this.state.index},h.prototype.getCurrentPage=m,h.prototype.getPage=m,h.prototype.getTags=function(){return this.state.tagRefinements},h.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e))this.state.getConjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"conjunctive"})})),this.state.getExcludeRefinements(e).forEach((function(e){t.push({value:e,type:"exclude"})}));else if(this.state.isDisjunctiveFacet(e)){this.state.getDisjunctiveRefinements(e).forEach((function(e){t.push({value:e,type:"disjunctive"})}))}var r=this.state.getNumericRefinements(e);return Object.keys(r).forEach((function(e){var n=r[e];t.push({value:n,operator:e,type:"numeric"})})),t},h.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)},h.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)},h.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=s._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map((function(e){var n=e.getModifiedState(t),i=s._getQueries(n.index,n);return r.push({state:n,queriesCount:i.length,helper:e}),e.emit("search",{state:n,results:e.lastResults}),i})),a=Array.prototype.concat.apply(n,i),c=this._queryId++;this._currentNbQueries++;try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,c)).catch(this._dispatchAlgoliaError.bind(this,c))}catch(u){this.emit("error",{error:u})}},h.prototype._dispatchAlgoliaResponse=function(e,t,r){if(!(t0},h.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))},h.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this},h.prototype.setClient=function(e){return this.client===e||("function"==typeof e.addAlgoliaAgent&&e.addAlgoliaAgent("JS Helper ("+f+")"),this.client=e),this},h.prototype.getClient=function(){return this.client},h.prototype.derive=function(e){var t=new a(this,e);return this.derivedHelpers.push(t),t},h.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(-1===t)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)},h.prototype.hasPendingRequests=function(){return this._currentNbQueries>0},e.exports=h},263:function(e,t,r){"use strict";e.exports=function(e,t){return e.filter((function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n}))}},264:function(e,t,r){"use strict";e.exports=function e(t){if("number"==typeof t)return t;if("string"==typeof t)return parseFloat(t);if(Array.isArray(t))return t.map(e);throw new Error("The value should be a number, a parsable string or an array of those.")}},265:function(e,t,r){"use strict";var n=r(232),i=r(245),a=r(233),s={addRefinement:function(e,t,r){if(s.isRefined(e,t,r))return e;var i=""+r,a=e[t]?e[t].concat(i):[i],c={};return c[t]=a,n({},c,e)},removeRefinement:function(e,t,r){if(void 0===r)return s.clearRefinement(e,(function(e,r){return t===r}));var n=""+r;return s.clearRefinement(e,(function(e,r){return t===r&&n===e}))},toggleRefinement:function(e,t,r){if(void 0===r)throw new Error("toggleRefinement should be used with a value");return s.isRefined(e,t,r)?s.removeRefinement(e,t,r):s.addRefinement(e,t,r)},clearRefinement:function(e,t,r){if(void 0===t)return a(e)?{}:e;if("string"==typeof t)return i(e,[t]);if("function"==typeof t){var n=!1,s=Object.keys(e).reduce((function(i,a){var s=e[a]||[],c=s.filter((function(e){return!t(e,a,r)}));return c.length!==s.length&&(n=!0),i[a]=c,i}),{});return n?s:e}},isRefined:function(e,t,r){var n=!!e[t]&&e[t].length>0;if(void 0===r||!n)return n;var i=""+r;return-1!==e[t].indexOf(i)}};e.exports=s},266:function(e,t,r){"use strict";e.exports=function(e){return Array.isArray(e)?e.filter(Boolean):[]}},267:function(e,t,r){"use strict";e.exports=function(e,t){if(!Array.isArray(e))return-1;for(var r=0;r0){var h=0;for(f=c;h0&&s[0].split(c).length>1&&r.push({indexName:e,params:i._getDisjunctiveFacetSearchParams(t,n,!0)})})),r},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(i._getHitsHierarchicalFacetsAttributes(e)),r=i._getFacetFilters(e),a=i._getNumericFilters(e),s={facets:t,tagFilters:i._getTagFilters(e)};return r.length>0&&(s.facetFilters=r),a.length>0&&(s.numericFilters=a),n({},e.getQueryParams(),s)},_getDisjunctiveFacetSearchParams:function(e,t,r){var a=i._getFacetFilters(e,t,r),s=i._getNumericFilters(e,t),c={hitsPerPage:1,page:0,attributesToRetrieve:[],attributesToHighlight:[],attributesToSnippet:[],tagFilters:i._getTagFilters(e),analytics:!1,clickAnalytics:!1},u=e.getHierarchicalFacetByName(t);return c.facets=u?i._getDisjunctiveHierarchicalFacetAttribute(e,u,r):t,s.length>0&&(c.numericFilters=s),a.length>0&&(c.facetFilters=a),n({},e.getQueryParams(),c)},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach((function(n){var i=e.numericRefinements[n]||{};Object.keys(i).forEach((function(e){var a=i[e]||[];t!==n&&a.forEach((function(t){if(Array.isArray(t)){var i=t.map((function(t){return n+e+t}));r.push(i)}else r.push(n+e+t)}))}))})),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).forEach((function(e){(i[e]||[]).forEach((function(t){n.push(e+":"+t)}))}));var a=e.facetsExcludes||{};Object.keys(a).forEach((function(e){(a[e]||[]).forEach((function(t){n.push(e+":-"+t)}))}));var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).forEach((function(e){var r=s[e]||[];if(e!==t&&r&&0!==r.length){var i=[];r.forEach((function(t){i.push(e+":"+t)})),n.push(i)}}));var c=e.hierarchicalFacetsRefinements||{};return Object.keys(c).forEach((function(i){var a=(c[i]||[])[0];if(void 0!==a){var s,u,o=e.getHierarchicalFacetByName(i),f=e._getHierarchicalFacetSeparator(o),h=e._getHierarchicalRootPath(o);if(t===i){if(-1===a.indexOf(f)||!h&&!0===r||h&&h.split(f).length===a.split(f).length)return;h?(u=h.split(f).length-1,a=h):(u=a.split(f).length-2,a=a.slice(0,a.lastIndexOf(f))),s=o.attributes[u]}else u=a.split(f).length-1,s=o.attributes[u];s&&n.push([s+":"+a])}})),n},_getHitsHierarchicalFacetsAttributes:function(e){return e.hierarchicalFacets.reduce((function(t,r){var n=e.getHierarchicalRefinement(r.name)[0];if(!n)return t.push(r.attributes[0]),t;var i=e._getHierarchicalFacetSeparator(r),a=n.split(i).length,s=r.attributes.slice(0,a+1);return t.concat(s)}),[])},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(!0===r){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=(e.getHierarchicalRefinement(t.name)[0]||"").split(n).length-1;return t.attributes.slice(0,s+1)},getSearchForFacetQuery:function(e,t,r,a){var s=a.isDisjunctiveFacet(e)?a.clearRefinements(e):a,c={facetQuery:t,facetName:e};return"number"==typeof r&&(c.maxFacetHits=r),n({},i._getHitsSearchParams(s),c)}};e.exports=i},271:function(e,t,r){e.exports=function(){"use strict";function e(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function r(r){for(var n=1;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)){var r=[],n=!0,i=!1,a=void 0;try{for(var s,c=e[Symbol.iterator]();!(n=(s=c.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw a}}return r}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function a(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return Promise.resolve().then((function(){var r=JSON.stringify(e),n=a()[r];return Promise.all([n||t(),void 0!==n])})).then((function(e){var t=i(e,2),n=t[0],a=t[1];return Promise.all([n,a||r.miss(n)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve().then((function(){var i=a();return i[JSON.stringify(e)]=t,n().setItem(r,JSON.stringify(i)),t}))},delete:function(e){return Promise.resolve().then((function(){var t=a();delete t[JSON.stringify(e)],n().setItem(r,JSON.stringify(t))}))},clear:function(){return Promise.resolve().then((function(){n().removeItem(r)}))}}}function c(e){var t=a(e.caches),r=t.shift();return void 0===r?{get:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return t().then((function(e){return Promise.all([e,r.miss(e)])})).then((function(e){return i(e,1)[0]}))},set:function(e,t){return Promise.resolve(t)},delete:function(e){return Promise.resolve()},clear:function(){return Promise.resolve()}}:{get:function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}};return r.get(e,n,i).catch((function(){return c({caches:t}).get(e,n,i)}))},set:function(e,n){return r.set(e,n).catch((function(){return c({caches:t}).set(e,n)}))},delete:function(e){return r.delete(e).catch((function(){return c({caches:t}).delete(e)}))},clear:function(){return r.clear().catch((function(){return c({caches:t}).clear()}))}}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{serializable:!0},t={};return{get:function(r,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{miss:function(){return Promise.resolve()}},a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);var s=n(),c=i&&i.miss||function(){return Promise.resolve()};return s.then((function(e){return c(e)})).then((function(){return s}))},set:function(r,n){return t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)},delete:function(e){return delete t[JSON.stringify(e)],Promise.resolve()},clear:function(){return t={},Promise.resolve()}}}function o(e){for(var t=e.length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function f(e,t){return Object.keys(void 0!==t?t:{}).forEach((function(r){e[r]=t[r](e)})),e}function h(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}var d={Read:1,Write:2,Any:3},v=1,p=2,g=3;function y(e){return r({},e,{status:arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,lastUpdate:Date.now()})}function R(e){return{protocol:e.protocol||"https",url:e.url,accept:e.accept||d.Any}}var F="GET",b="POST";function j(e,t){return Promise.all(t.map((function(t){return e.get(t,(function(){return Promise.resolve(y(t))}))}))).then((function(e){var r=e.filter((function(e){return function(e){return e.status===v||Date.now()-e.lastUpdate>12e4}(e)})),n=e.filter((function(e){return function(e){return e.status===g&&Date.now()-e.lastUpdate<=12e4}(e)})),i=[].concat(a(r),a(n));return{getTimeout:function(e,t){return(0===n.length&&0===e?1:n.length+3+e)*t},statelessHosts:i.length>0?i.map((function(e){return R(e)})):t}}))}function P(e,t,n,i){var s=[],c=function(e,t){if(e.method!==F&&(void 0!==e.data||void 0!==t.data)){var n=Array.isArray(e.data)?e.data:r({},e.data,{},t.data);return JSON.stringify(n)}}(n,i),u=function(e,t){var n=r({},e.headers,{},t.headers),i={};return Object.keys(n).forEach((function(e){var t=n[e];i[e.toLowerCase()]=t})),i}(e,i),o=n.method,f=n.method!==F?{}:r({},n.data,{},i.data),h=r({"x-algolia-agent":e.userAgent.value},e.queryParameters,{},f,{},i.queryParameters),l=0,m=function t(r,a){var f=r.pop();if(void 0===f)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:_(s)};var m={data:c,headers:u,method:o,url:O(f,n.path,h),connectTimeout:a(l,e.timeouts.connect),responseTimeout:a(l,i.timeout)},d=function(e){var t={request:m,response:e,host:f,triesLeft:r.length};return s.push(t),t},v={onSucess:function(e){return function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e)},onRetry:function(n){var i=d(n);return n.isTimedOut&&l++,Promise.all([e.logger.info("Retryable failure",w(i)),e.hostsCache.set(f,y(f,n.isTimedOut?g:p))]).then((function(){return t(r,a)}))},onFail:function(e){throw d(e),function(e,t){var r=e.content,n=e.status,i=r;try{i=JSON.parse(r).message}catch(e){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(i,n,t)}(e,_(s))}};return e.requester.send(m).then((function(e){return function(e,t){return function(e){var t=e.status;return e.isTimedOut||function(e){var t=e.isTimedOut,r=e.status;return!t&&0==~~r}(e)||2!=~~(t/100)&&4!=~~(t/100)}(e)?t.onRetry(e):2==~~(e.status/100)?t.onSucess(e):t.onFail(e)}(e,v)}))};return j(e.hostsCache,t).then((function(e){return m(a(e.statelessHosts).reverse(),e.getTimeout)}))}function E(e){var t={value:"Algolia for JavaScript (".concat(e,")"),add:function(e){var r="; ".concat(e.segment).concat(void 0!==e.version?" (".concat(e.version,")"):"");return-1===t.value.indexOf(r)&&(t.value="".concat(t.value).concat(r)),t}};return t}function O(e,t,r){var n=x(r),i="".concat(e.protocol,"://").concat(e.url,"/").concat("/"===t.charAt(0)?t.substr(1):t);return n.length&&(i+="?".concat(n)),i}function x(e){return Object.keys(e).map((function(t){return h("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r})).join("&")}function _(e){return e.map((function(e){return w(e)}))}function w(e){var t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return r({},e,{request:r({},e.request,{headers:r({},e.request.headers,{},t)})})}var N=function(e){var t=e.appId,n=function(e,t,r){var n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:function(){return e===l.WithinHeaders?n:{}},queryParameters:function(){return e===l.WithinQueryParameters?n:{}}}}(void 0!==e.authMode?e.authMode:l.WithinHeaders,t,e.apiKey),a=function(e){var t=e.hostsCache,r=e.logger,n=e.requester,a=e.requestsCache,s=e.responsesCache,c=e.timeouts,u=e.userAgent,o=e.hosts,f=e.queryParameters,h={hostsCache:t,logger:r,requester:n,requestsCache:a,responsesCache:s,timeouts:c,userAgent:u,headers:e.headers,queryParameters:f,hosts:o.map((function(e){return R(e)})),read:function(e,t){var r=m(t,h.timeouts.read),n=function(){return P(h,h.hosts.filter((function(e){return 0!=(e.accept&d.Read)})),e,r)};if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();var a={request:e,mappedRequestOptions:r,transporter:{queryParameters:h.queryParameters,headers:h.headers}};return h.responsesCache.get(a,(function(){return h.requestsCache.get(a,(function(){return h.requestsCache.set(a,n()).then((function(e){return Promise.all([h.requestsCache.delete(a),e])}),(function(e){return Promise.all([h.requestsCache.delete(a),Promise.reject(e)])})).then((function(e){var t=i(e,2);return t[0],t[1]}))}))}),{miss:function(e){return h.responsesCache.set(a,e)}})},write:function(e,t){return P(h,h.hosts.filter((function(e){return 0!=(e.accept&d.Write)})),e,m(t,h.timeouts.write))}};return h}(r({hosts:[{url:"".concat(t,"-dsn.algolia.net"),accept:d.Read},{url:"".concat(t,".algolia.net"),accept:d.Write}].concat(o([{url:"".concat(t,"-1.algolianet.com")},{url:"".concat(t,"-2.algolianet.com")},{url:"".concat(t,"-3.algolianet.com")}]))},e,{headers:r({},n.headers(),{},{"content-type":"application/x-www-form-urlencoded"},{},e.headers),queryParameters:r({},n.queryParameters(),{},e.queryParameters)}));return f({transporter:a,appId:t,addAlgoliaAgent:function(e,t){a.userAgent.add({segment:e,version:t})},clearCache:function(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then((function(){}))}},e.methods)},H=function(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f({transporter:e.transporter,appId:e.appId,indexName:t},r.methods)}},S=function(e){return function(t,n){var i=t.map((function(e){return r({},e,{params:x(e.params||{})})}));return e.transporter.read({method:b,path:"1/indexes/*/queries",data:{requests:i},cacheable:!0},n)}},A=function(e){return function(t,i){return Promise.all(t.map((function(t){var a=t.params,s=a.facetName,c=a.facetQuery,u=n(a,["facetName","facetQuery"]);return H(e)(t.indexName,{methods:{searchForFacetValues:C}}).searchForFacetValues(s,c,r({},i,{},u))})))}},Q=function(e){return function(t,r){return e.transporter.read({method:b,path:h("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r)}},C=function(e){return function(t,r,n){return e.transporter.read({method:b,path:h("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n)}},T=1,D=2,k=3;function I(e,t,n){var i,a={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:function(e){return new Promise((function(t){var r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach((function(t){return r.setRequestHeader(t,e.headers[t])}));var n,i=function(e,n){return setTimeout((function(){r.abort(),t({status:0,content:n,isTimedOut:!0})}),1e3*e)},a=i(e.connectTimeout,"Connection timeout");r.onreadystatechange=function(){r.readyState>r.OPENED&&void 0===n&&(clearTimeout(a),n=i(e.responseTimeout,"Socket timeout"))},r.onerror=function(){0===r.status&&(clearTimeout(a),clearTimeout(n),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=function(){clearTimeout(a),clearTimeout(n),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)}))}},logger:(i=k,{debug:function(e,t){return T>=i&&console.debug(e,t),Promise.resolve()},info:function(e,t){return D>=i&&console.info(e,t),Promise.resolve()},error:function(e,t){return console.error(e,t),Promise.resolve()}}),responsesCache:u(),requestsCache:u({serializable:!1}),hostsCache:c({caches:[s({key:"".concat("4.4.0","-").concat(e)}),u()]}),userAgent:E("4.4.0").add({segment:"Browser",version:"lite"}),authMode:l.WithinQueryParameters};return N(r({},a,{},n,{methods:{search:S,searchForFacetValues:A,multipleQueries:S,multipleSearchForFacetValues:A,initIndex:function(e){return function(t){return H(e)(t,{methods:{search:Q,searchForFacetValues:C}})}}}}))}return I.version="4.4.0",I}()}}]); \ No newline at end of file diff --git a/docs/111.2bc7dbb2.js.LICENSE.txt b/docs/115.9ad5e9dc.js.LICENSE.txt similarity index 100% rename from docs/111.2bc7dbb2.js.LICENSE.txt rename to docs/115.9ad5e9dc.js.LICENSE.txt diff --git a/docs/112.f2cbb49d.js b/docs/116.65c524d9.js similarity index 85% rename from docs/112.f2cbb49d.js rename to docs/116.65c524d9.js index 38840587f67..37e101c3e5b 100644 --- a/docs/112.f2cbb49d.js +++ b/docs/116.65c524d9.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[112],{185:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o=n(23),i=n(195),s=n(21),c=n(190),u=n(198);var l=function(e){const{metadata:t}=e;return a.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog list page navigation"},a.a.createElement("div",{className:"pagination-nav__item"},t.previous&&a.a.createElement(u.a,{className:"pagination-nav__link",to:t.previous.permalink},a.a.createElement("div",{className:"pagination-nav__sublabel"},"Previous"),a.a.createElement("div",{className:"pagination-nav__label"},"\xab ",t.previous.title))),a.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},t.next&&a.a.createElement(u.a,{className:"pagination-nav__link",to:t.next.permalink},a.a.createElement("div",{className:"pagination-nav__sublabel"},"Next"),a.a.createElement("div",{className:"pagination-nav__label"},t.next.title," \xbb"))))},d=n(201);var f=function(){const{siteConfig:{title:e}}=Object(s.default)(),{pluginId:t}=Object(d.useActivePlugin)({failfast:!0}),{savePreferredVersionName:n}=Object(i.useDocsPreferredVersion)(t),r=Object(d.useActiveVersion)(t),{latestDocSuggestion:o,latestVersionSuggestion:c}=Object(d.useDocVersionSuggestions)(t);if(!c)return a.a.createElement(a.a.Fragment,null);const l=null!=o?o:(f=c).docs.find(e=>e.id===f.mainDocId);var f;return a.a.createElement("div",{className:"alert alert--warning margin-bottom--md",role:"alert"},"current"===r.name?a.a.createElement("div",null,"This is unreleased documentation for ",e," ",a.a.createElement("strong",null,r.label)," version."):a.a.createElement("div",null,"This is documentation for ",e," ",a.a.createElement("strong",null,r.label),", which is no longer actively maintained."),a.a.createElement("div",{className:"margin-top--md"},"For up-to-date documentation, see the"," ",a.a.createElement("strong",null,a.a.createElement(u.a,{to:l.path,onClick:()=>n(c.name)},"latest version"))," ","(",c.label,")."))},m=n(231),g=n(226),v=n(194),p=n(81),b=n.n(p);t.default=function(e){const{siteConfig:t}=Object(s.default)(),{url:n}=t,{content:r}=e,{metadata:u,frontMatter:{image:p,keywords:h,hide_title:E,hide_table_of_contents:D}}=r,{description:P,title:_,permalink:O,editUrl:V,lastUpdatedAt:j,lastUpdatedBy:y}=u,{pluginId:A}=Object(d.useActivePlugin)({failfast:!0}),w=Object(d.useVersions)(A),C=Object(d.useActiveVersion)(A),N=w.length>1,x=Object(i.useTitleFormatter)(_),L=Object(c.a)(p,{absolute:!0});return a.a.createElement(a.a.Fragment,null,a.a.createElement(o.a,null,a.a.createElement("title",null,x),a.a.createElement("meta",{property:"og:title",content:x}),P&&a.a.createElement("meta",{name:"description",content:P}),P&&a.a.createElement("meta",{property:"og:description",content:P}),h&&h.length&&a.a.createElement("meta",{name:"keywords",content:h.join(",")}),p&&a.a.createElement("meta",{property:"og:image",content:L}),p&&a.a.createElement("meta",{name:"twitter:image",content:L}),p&&a.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+_}),O&&a.a.createElement("meta",{property:"og:url",content:n+O}),O&&a.a.createElement("link",{rel:"canonical",href:n+O})),a.a.createElement("div",{className:"row"},a.a.createElement("div",{className:Object(v.a)("col",{[b.a.docItemCol]:!D})},a.a.createElement(f,null),a.a.createElement("div",{className:b.a.docItemContainer},a.a.createElement("article",null,N&&a.a.createElement("div",null,a.a.createElement("span",{className:"badge badge--secondary"},"Version: ",C.label)),!E&&a.a.createElement("header",null,a.a.createElement("h1",{className:b.a.docTitle},_)),a.a.createElement("div",{className:"markdown"},a.a.createElement(r,null))),(V||j||y)&&a.a.createElement("div",{className:"margin-vert--xl"},a.a.createElement("div",{className:"row"},a.a.createElement("div",{className:"col"},V&&a.a.createElement("a",{href:V,target:"_blank",rel:"noreferrer noopener"},a.a.createElement(g.a,null),"Edit this page")),(j||y)&&a.a.createElement("div",{className:"col text--right"},a.a.createElement("em",null,a.a.createElement("small",null,"Last updated"," ",j&&a.a.createElement(a.a.Fragment,null,"on"," ",a.a.createElement("time",{dateTime:new Date(1e3*j).toISOString(),className:b.a.docLastUpdatedAt},new Date(1e3*j).toLocaleDateString()),y&&" "),y&&a.a.createElement(a.a.Fragment,null,"by ",a.a.createElement("strong",null,y)),!1))))),a.a.createElement("div",{className:"margin-vert--lg"},a.a.createElement(l,{metadata:u})))),!D&&r.toc&&a.a.createElement("div",{className:"col col--3"},a.a.createElement(m.a,{toc:r.toc}))))}},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(191);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},194:function(e,t,n){"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{}});var u=n(190),l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);ae.startsWith("/"))(V)?h(V):V):void 0;var V;const j=Object(r.useRef)(!1),y=n?o.e:o.c,A=s.a.canUseIntersectionObserver;let w;Object(r.useEffect)(()=>(!A&&P&&window.docusaurus.prefetch(O),()=>{A&&w&&w.disconnect()}),[O,A,P]);const C=null!==(t=null==O?void 0:O.startsWith("#"))&&void 0!==t&&t,N=!O||!P||C;return O&&P&&!C&&!v&&E.collectLink(O),N?a.a.createElement("a",Object.assign({href:O},D&&!P&&{target:"_blank",rel:"noopener noreferrer"},b)):a.a.createElement(y,Object.assign({},b,{onMouseEnter:()=>{j.current||(window.docusaurus.preload(O),j.current=!0)},innerRef:e=>{var t,n;A&&e&&P&&(t=e,n=()=>{window.docusaurus.prefetch(O)},w=new window.IntersectionObserver(e=>{e.forEach(e=>{t===e.target&&(e.isIntersecting||e.intersectionRatio>0)&&(w.unobserve(t),w.disconnect(),n())})}),w.observe(t))},to:O||""},n&&{isActive:g,activeClassName:m}))}},201:function(e,t,n){try{e.exports=n(218)}catch(r){e.exports={}}},202:function(e,t,n){"use strict";n.r(t);var r=n(10);n.d(t,"MemoryRouter",(function(){return r.d})),n.d(t,"Prompt",(function(){return r.f})),n.d(t,"Redirect",(function(){return r.g})),n.d(t,"Route",(function(){return r.h})),n.d(t,"Router",(function(){return r.i})),n.d(t,"StaticRouter",(function(){return r.j})),n.d(t,"Switch",(function(){return r.k})),n.d(t,"generatePath",(function(){return r.l})),n.d(t,"matchPath",(function(){return r.m})),n.d(t,"useHistory",(function(){return r.n})),n.d(t,"useLocation",(function(){return r.o})),n.d(t,"useParams",(function(){return r.p})),n.d(t,"useRouteMatch",(function(){return r.q})),n.d(t,"withRouter",(function(){return r.r})),n.d(t,"BrowserRouter",(function(){return r.a})),n.d(t,"HashRouter",(function(){return r.b})),n.d(t,"Link",(function(){return r.c})),n.d(t,"NavLink",(function(){return r.e}))},206:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useThemeConfig=void 0;const a=r(n(21));t.useThemeConfig=function(){return a.default().siteConfig.themeConfig}},207:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDocsPluginEnabled=void 0;const r=n(201);t.isDocsPluginEnabled=!!r.useAllDocsData},208:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionContext=t.DocsPreferredVersionContextProvider=void 0;const s=o(n(0)),c=n(206),u=n(207),l=n(201),d=i(n(224));function f({pluginIds:e,versionPersistence:t,allDocsData:n}){const r={};return e.forEach(e=>{r[e]=function(e){const r=d.default.read(e,t);return n[e].versions.some(e=>e.name===r)?{preferredVersionName:r}:(d.default.clear(e,t),{preferredVersionName:null})}(e)}),r}function m(){const e=l.useAllDocsData(),t=c.useThemeConfig().docs.versionPersistence,n=s.useMemo(()=>Object.keys(e),[e]),[r,a]=s.useState(()=>function(e){const t={};return e.forEach(e=>{t[e]={preferredVersionName:null}}),t}(n));s.useEffect(()=>{a(f({allDocsData:e,versionPersistence:t,pluginIds:n}))},[e,t,n]);return[r,s.useMemo(()=>({savePreferredVersion:function(e,n){d.default.save(e,t,n),a(t=>Object.assign(Object.assign({},t),{[e]:{preferredVersionName:n}}))}}),[a])]}const g=s.createContext(null);function v({children:e}){const t=m();return s.default.createElement(g.Provider,{value:t},e)}t.DocsPreferredVersionContextProvider=function({children:e}){return u.isDocsPluginEnabled?s.default.createElement(v,null,e):s.default.createElement(s.default.Fragment,null,e)},t.useDocsPreferredVersionContext=function(){const e=s.useContext(g);if(!e)throw new Error("Can't find docs preferred context, maybe you forgot to use the DocsPreferredVersionContextProvider ?");return e}},217:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.docVersionSearchTag=t.DEFAULT_SEARCH_TAG=void 0,t.DEFAULT_SEARCH_TAG="default",t.docVersionSearchTag=function(e,t){return`docs-${e}-${t}`}},218:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocVersionSuggestions=t.useActiveDocContext=t.useActiveVersion=t.useLatestVersion=t.useVersions=t.useActivePluginAndVersion=t.useActivePlugin=t.useDocsData=t.useAllDocsData=void 0;const r=n(202),a=n(219),o=n(220);t.useAllDocsData=()=>a.useAllPluginInstancesData("docusaurus-plugin-content-docs"),t.useDocsData=e=>a.usePluginData("docusaurus-plugin-content-docs",e),t.useActivePlugin=(e={})=>{const n=t.useAllDocsData(),{pathname:a}=r.useLocation();return o.getActivePlugin(n,a,e)},t.useActivePluginAndVersion=(e={})=>{const n=t.useActivePlugin(e),{pathname:a}=r.useLocation();if(n){return{activePlugin:n,activeVersion:o.getActiveVersion(n.pluginData,a)}}},t.useVersions=e=>t.useDocsData(e).versions,t.useLatestVersion=e=>{const n=t.useDocsData(e);return o.getLatestVersion(n)},t.useActiveVersion=e=>{const n=t.useDocsData(e),{pathname:a}=r.useLocation();return o.getActiveVersion(n,a)},t.useActiveDocContext=e=>{const n=t.useDocsData(e),{pathname:a}=r.useLocation();return o.getActiveDocContext(n,a)},t.useDocVersionSuggestions=e=>{const n=t.useDocsData(e),{pathname:a}=r.useLocation();return o.getDocVersionSuggestions(n,a)}},219:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return a})),n.d(t,"useAllPluginInstancesData",(function(){return o})),n.d(t,"usePluginData",(function(){return i}));var r=n(21);function a(){const{globalData:e}=Object(r.default)();if(!e)throw new Error("Docusaurus global data not found");return e}function o(e){const t=a()[e];if(!t)throw new Error("Docusaurus plugin global data not found for pluginName="+e);return t}function i(e,t="default"){const n=o(e)[t];if(!n)throw new Error(`Docusaurus plugin global data not found for pluginName=${e} and pluginId=${t}`);return n}},220:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDocVersionSuggestions=t.getActiveDocContext=t.getActiveVersion=t.getLatestVersion=t.getActivePlugin=void 0;const r=n(202);t.getActivePlugin=function(e,t,n={}){const a=Object.entries(e).find(([e,n])=>!!r.matchPath(t,{path:n.path,exact:!1,strict:!1})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for pathname=${t}, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map(e=>e.path).join(", ")}`);return o},t.getLatestVersion=e=>e.versions.find(e=>e.isLast),t.getActiveVersion=(e,n)=>{const a=t.getLatestVersion(e);return[...e.versions.filter(e=>e!==a),a].find(e=>!!r.matchPath(n,{path:e.path,exact:!1,strict:!1}))},t.getActiveDocContext=(e,n)=>{const a=t.getActiveVersion(e,n),o=null==a?void 0:a.docs.find(e=>!!r.matchPath(n,{path:e.path,exact:!0,strict:!1}));return{activeVersion:a,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach(e=>{e.docs.forEach(r=>{r.id===t&&(n[e.name]=r)})}),n}(o.id):{}}},t.getDocVersionSuggestions=(e,n)=>{const r=t.getLatestVersion(e),a=t.getActiveDocContext(e,n),o=a.activeVersion!==r;return{latestDocSuggestion:o?null==a?void 0:a.alternateDocVersions[r.name]:void 0,latestVersionSuggestion:o?r:void 0}}},221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSamePath=void 0,t.isSamePath=(e,t)=>{const n=e=>!e||(null==e?void 0:e.endsWith("/"))?e:e+"/";return n(e)===n(t)}},222:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTitleFormatter=void 0;const a=r(n(21));t.useTitleFormatter=e=>{const{siteConfig:t={}}=a.default(),{title:n,titleDelimiter:r="|"}=t;return e&&e.trim().length?`${e.trim()} ${r} ${n}`:n}},223:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionByPluginId=t.useDocsPreferredVersion=void 0;const r=n(0),a=n(208),o=n(201),i=n(225);t.useDocsPreferredVersion=function(e=i.DEFAULT_PLUGIN_ID){const t=o.useDocsData(e),[n,s]=a.useDocsPreferredVersionContext(),{preferredVersionName:c}=n[e];return{preferredVersion:c?t.versions.find(e=>e.name===c):null,savePreferredVersionName:r.useCallback(t=>{s.savePreferredVersion(e,t)},[s])}},t.useDocsPreferredVersionByPluginId=function(){const e=o.useAllDocsData(),[t]=a.useDocsPreferredVersionContext(),n=Object.keys(e),r={};return n.forEach(n=>{r[n]=function(n){const r=e[n],{preferredVersionName:a}=t[n];return a?r.versions.find(e=>e.name===a):null}(n)}),r}},224:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=e=>"docs-preferred-version-"+e,a={save:(e,t,n)=>{"none"===t||window.localStorage.setItem(r(e),n)},read:(e,t)=>"none"===t?null:window.localStorage.getItem(r(e)),clear:(e,t)=>{"none"===t||window.localStorage.removeItem(r(e))}};t.default=a},225:function(e,t,n){"use strict";n.r(t),n.d(t,"DEFAULT_PLUGIN_ID",(function(){return r}));const r="default"},226:function(e,t,n){"use strict";var r=n(3),a=n(0),o=n.n(a),i=n(194),s=n(63),c=n.n(s);t.a=({className:e,...t})=>o.a.createElement("svg",Object(r.a)({fill:"currentColor",height:"1.2em",width:"1.2em",preserveAspectRatio:"xMidYMid meet",role:"img",viewBox:"0 0 40 40",className:Object(i.a)(c.a.iconEdit,e)},t),o.a.createElement("g",null,o.a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))},231:function(e,t,n){"use strict";var r=n(0),a=n.n(r),o=n(194);var i=function(e,t,n){const[a,o]=Object(r.useState)(void 0);Object(r.useEffect)(()=>{function r(){const r=function(){const e=Array.from(document.getElementsByClassName("anchor")),t=e.find(e=>{const{top:t}=e.getBoundingClientRect();return t>=n});if(t){if(t.getBoundingClientRect().top>=n){const n=e[e.indexOf(t)-1];return null!=n?n:t}return t}return e[e.length-1]}();if(r){let n=0,i=!1;const s=document.getElementsByClassName(e);for(;n{document.removeEventListener("scroll",r),document.removeEventListener("resize",r)}})},s=n(62),c=n.n(s);const u="table-of-contents__link";function l({toc:e,isChild:t}){return e.length?a.a.createElement("ul",{className:t?"":"table-of-contents table-of-contents__left-border"},e.map(e=>a.a.createElement("li",{key:e.id},a.a.createElement("a",{href:"#"+e.id,className:u,dangerouslySetInnerHTML:{__html:e.value}}),a.a.createElement(l,{isChild:!0,toc:e.children})))):null}t.a=function({toc:e}){return i(u,"table-of-contents__link--active",100),a.a.createElement("div",{className:Object(o.a)(c.a.tableOfContents,"thin-scrollbar")},a.a.createElement(l,{toc:e}))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[116],{189:function(e,t,n){"use strict";n.r(t);var r=n(0),a=n.n(r),o=n(23),i=n(199),s=n(21),c=n(194),u=n(202);var l=function(e){const{metadata:t}=e;return a.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog list page navigation"},a.a.createElement("div",{className:"pagination-nav__item"},t.previous&&a.a.createElement(u.a,{className:"pagination-nav__link",to:t.previous.permalink},a.a.createElement("div",{className:"pagination-nav__sublabel"},"Previous"),a.a.createElement("div",{className:"pagination-nav__label"},"\xab ",t.previous.title))),a.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},t.next&&a.a.createElement(u.a,{className:"pagination-nav__link",to:t.next.permalink},a.a.createElement("div",{className:"pagination-nav__sublabel"},"Next"),a.a.createElement("div",{className:"pagination-nav__label"},t.next.title," \xbb"))))},d=n(205);var f=function(){const{siteConfig:{title:e}}=Object(s.default)(),{pluginId:t}=Object(d.useActivePlugin)({failfast:!0}),{savePreferredVersionName:n}=Object(i.useDocsPreferredVersion)(t),r=Object(d.useActiveVersion)(t),{latestDocSuggestion:o,latestVersionSuggestion:c}=Object(d.useDocVersionSuggestions)(t);if(!c)return a.a.createElement(a.a.Fragment,null);const l=null!=o?o:(f=c).docs.find(e=>e.id===f.mainDocId);var f;return a.a.createElement("div",{className:"alert alert--warning margin-bottom--md",role:"alert"},"current"===r.name?a.a.createElement("div",null,"This is unreleased documentation for ",e," ",a.a.createElement("strong",null,r.label)," version."):a.a.createElement("div",null,"This is documentation for ",e," ",a.a.createElement("strong",null,r.label),", which is no longer actively maintained."),a.a.createElement("div",{className:"margin-top--md"},"For up-to-date documentation, see the"," ",a.a.createElement("strong",null,a.a.createElement(u.a,{to:l.path,onClick:()=>n(c.name)},"latest version"))," ","(",c.label,")."))},m=n(235),g=n(230),v=n(198),p=n(81),b=n.n(p);t.default=function(e){const{siteConfig:t}=Object(s.default)(),{url:n}=t,{content:r}=e,{metadata:u,frontMatter:{image:p,keywords:h,hide_title:E,hide_table_of_contents:D}}=r,{description:P,title:_,permalink:O,editUrl:V,lastUpdatedAt:j,lastUpdatedBy:y}=u,{pluginId:A}=Object(d.useActivePlugin)({failfast:!0}),w=Object(d.useVersions)(A),C=Object(d.useActiveVersion)(A),N=w.length>1,x=Object(i.useTitleFormatter)(_),L=Object(c.a)(p,{absolute:!0});return a.a.createElement(a.a.Fragment,null,a.a.createElement(o.a,null,a.a.createElement("title",null,x),a.a.createElement("meta",{property:"og:title",content:x}),P&&a.a.createElement("meta",{name:"description",content:P}),P&&a.a.createElement("meta",{property:"og:description",content:P}),h&&h.length&&a.a.createElement("meta",{name:"keywords",content:h.join(",")}),p&&a.a.createElement("meta",{property:"og:image",content:L}),p&&a.a.createElement("meta",{name:"twitter:image",content:L}),p&&a.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+_}),O&&a.a.createElement("meta",{property:"og:url",content:n+O}),O&&a.a.createElement("link",{rel:"canonical",href:n+O})),a.a.createElement("div",{className:"row"},a.a.createElement("div",{className:Object(v.a)("col",{[b.a.docItemCol]:!D})},a.a.createElement(f,null),a.a.createElement("div",{className:b.a.docItemContainer},a.a.createElement("article",null,N&&a.a.createElement("div",null,a.a.createElement("span",{className:"badge badge--secondary"},"Version: ",C.label)),!E&&a.a.createElement("header",null,a.a.createElement("h1",{className:b.a.docTitle},_)),a.a.createElement("div",{className:"markdown"},a.a.createElement(r,null))),(V||j||y)&&a.a.createElement("div",{className:"margin-vert--xl"},a.a.createElement("div",{className:"row"},a.a.createElement("div",{className:"col"},V&&a.a.createElement("a",{href:V,target:"_blank",rel:"noreferrer noopener"},a.a.createElement(g.a,null),"Edit this page")),(j||y)&&a.a.createElement("div",{className:"col text--right"},a.a.createElement("em",null,a.a.createElement("small",null,"Last updated"," ",j&&a.a.createElement(a.a.Fragment,null,"on"," ",a.a.createElement("time",{dateTime:new Date(1e3*j).toISOString(),className:b.a.docLastUpdatedAt},new Date(1e3*j).toLocaleDateString()),y&&" "),y&&a.a.createElement(a.a.Fragment,null,"by ",a.a.createElement("strong",null,y)),!1))))),a.a.createElement("div",{className:"margin-vert--lg"},a.a.createElement(l,{metadata:u})))),!D&&r.toc&&a.a.createElement("div",{className:"col col--3"},a.a.createElement(m.a,{toc:r.toc}))))}},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},198:function(e,t,n){"use strict";function r(e){var t,n,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{}});var u=n(194),l=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);ae.startsWith("/"))(V)?h(V):V):void 0;var V;const j=Object(r.useRef)(!1),y=n?o.e:o.c,A=s.a.canUseIntersectionObserver;let w;Object(r.useEffect)(()=>(!A&&P&&window.docusaurus.prefetch(O),()=>{A&&w&&w.disconnect()}),[O,A,P]);const C=null!==(t=null==O?void 0:O.startsWith("#"))&&void 0!==t&&t,N=!O||!P||C;return O&&P&&!C&&!v&&E.collectLink(O),N?a.a.createElement("a",Object.assign({href:O},D&&!P&&{target:"_blank",rel:"noopener noreferrer"},b)):a.a.createElement(y,Object.assign({},b,{onMouseEnter:()=>{j.current||(window.docusaurus.preload(O),j.current=!0)},innerRef:e=>{var t,n;A&&e&&P&&(t=e,n=()=>{window.docusaurus.prefetch(O)},w=new window.IntersectionObserver(e=>{e.forEach(e=>{t===e.target&&(e.isIntersecting||e.intersectionRatio>0)&&(w.unobserve(t),w.disconnect(),n())})}),w.observe(t))},to:O||""},n&&{isActive:g,activeClassName:m}))}},205:function(e,t,n){try{e.exports=n(222)}catch(r){e.exports={}}},206:function(e,t,n){"use strict";n.r(t);var r=n(10);n.d(t,"MemoryRouter",(function(){return r.d})),n.d(t,"Prompt",(function(){return r.f})),n.d(t,"Redirect",(function(){return r.g})),n.d(t,"Route",(function(){return r.h})),n.d(t,"Router",(function(){return r.i})),n.d(t,"StaticRouter",(function(){return r.j})),n.d(t,"Switch",(function(){return r.k})),n.d(t,"generatePath",(function(){return r.l})),n.d(t,"matchPath",(function(){return r.m})),n.d(t,"useHistory",(function(){return r.n})),n.d(t,"useLocation",(function(){return r.o})),n.d(t,"useParams",(function(){return r.p})),n.d(t,"useRouteMatch",(function(){return r.q})),n.d(t,"withRouter",(function(){return r.r})),n.d(t,"BrowserRouter",(function(){return r.a})),n.d(t,"HashRouter",(function(){return r.b})),n.d(t,"Link",(function(){return r.c})),n.d(t,"NavLink",(function(){return r.e}))},210:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useThemeConfig=void 0;const a=r(n(21));t.useThemeConfig=function(){return a.default().siteConfig.themeConfig}},211:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDocsPluginEnabled=void 0;const r=n(205);t.isDocsPluginEnabled=!!r.useAllDocsData},212:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.hasOwnProperty.call(e,n)&&r(t,e,n);return a(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionContext=t.DocsPreferredVersionContextProvider=void 0;const s=o(n(0)),c=n(210),u=n(211),l=n(205),d=i(n(228));function f({pluginIds:e,versionPersistence:t,allDocsData:n}){const r={};return e.forEach(e=>{r[e]=function(e){const r=d.default.read(e,t);return n[e].versions.some(e=>e.name===r)?{preferredVersionName:r}:(d.default.clear(e,t),{preferredVersionName:null})}(e)}),r}function m(){const e=l.useAllDocsData(),t=c.useThemeConfig().docs.versionPersistence,n=s.useMemo(()=>Object.keys(e),[e]),[r,a]=s.useState(()=>function(e){const t={};return e.forEach(e=>{t[e]={preferredVersionName:null}}),t}(n));s.useEffect(()=>{a(f({allDocsData:e,versionPersistence:t,pluginIds:n}))},[e,t,n]);return[r,s.useMemo(()=>({savePreferredVersion:function(e,n){d.default.save(e,t,n),a(t=>Object.assign(Object.assign({},t),{[e]:{preferredVersionName:n}}))}}),[a])]}const g=s.createContext(null);function v({children:e}){const t=m();return s.default.createElement(g.Provider,{value:t},e)}t.DocsPreferredVersionContextProvider=function({children:e}){return u.isDocsPluginEnabled?s.default.createElement(v,null,e):s.default.createElement(s.default.Fragment,null,e)},t.useDocsPreferredVersionContext=function(){const e=s.useContext(g);if(!e)throw new Error("Can't find docs preferred context, maybe you forgot to use the DocsPreferredVersionContextProvider ?");return e}},221:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.docVersionSearchTag=t.DEFAULT_SEARCH_TAG=void 0,t.DEFAULT_SEARCH_TAG="default",t.docVersionSearchTag=function(e,t){return`docs-${e}-${t}`}},222:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocVersionSuggestions=t.useActiveDocContext=t.useActiveVersion=t.useLatestVersion=t.useVersions=t.useActivePluginAndVersion=t.useActivePlugin=t.useDocsData=t.useAllDocsData=void 0;const r=n(206),a=n(223),o=n(224);t.useAllDocsData=()=>a.useAllPluginInstancesData("docusaurus-plugin-content-docs"),t.useDocsData=e=>a.usePluginData("docusaurus-plugin-content-docs",e),t.useActivePlugin=(e={})=>{const n=t.useAllDocsData(),{pathname:a}=r.useLocation();return o.getActivePlugin(n,a,e)},t.useActivePluginAndVersion=(e={})=>{const n=t.useActivePlugin(e),{pathname:a}=r.useLocation();if(n){return{activePlugin:n,activeVersion:o.getActiveVersion(n.pluginData,a)}}},t.useVersions=e=>t.useDocsData(e).versions,t.useLatestVersion=e=>{const n=t.useDocsData(e);return o.getLatestVersion(n)},t.useActiveVersion=e=>{const n=t.useDocsData(e),{pathname:a}=r.useLocation();return o.getActiveVersion(n,a)},t.useActiveDocContext=e=>{const n=t.useDocsData(e),{pathname:a}=r.useLocation();return o.getActiveDocContext(n,a)},t.useDocVersionSuggestions=e=>{const n=t.useDocsData(e),{pathname:a}=r.useLocation();return o.getDocVersionSuggestions(n,a)}},223:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return a})),n.d(t,"useAllPluginInstancesData",(function(){return o})),n.d(t,"usePluginData",(function(){return i}));var r=n(21);function a(){const{globalData:e}=Object(r.default)();if(!e)throw new Error("Docusaurus global data not found");return e}function o(e){const t=a()[e];if(!t)throw new Error("Docusaurus plugin global data not found for pluginName="+e);return t}function i(e,t="default"){const n=o(e)[t];if(!n)throw new Error(`Docusaurus plugin global data not found for pluginName=${e} and pluginId=${t}`);return n}},224:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDocVersionSuggestions=t.getActiveDocContext=t.getActiveVersion=t.getLatestVersion=t.getActivePlugin=void 0;const r=n(206);t.getActivePlugin=function(e,t,n={}){const a=Object.entries(e).find(([e,n])=>!!r.matchPath(t,{path:n.path,exact:!1,strict:!1})),o=a?{pluginId:a[0],pluginData:a[1]}:void 0;if(!o&&n.failfast)throw new Error(`Can't find active docs plugin for pathname=${t}, while it was expected to be found. Maybe you tried to use a docs feature that can only be used on a docs-related page? Existing docs plugin paths are: ${Object.values(e).map(e=>e.path).join(", ")}`);return o},t.getLatestVersion=e=>e.versions.find(e=>e.isLast),t.getActiveVersion=(e,n)=>{const a=t.getLatestVersion(e);return[...e.versions.filter(e=>e!==a),a].find(e=>!!r.matchPath(n,{path:e.path,exact:!1,strict:!1}))},t.getActiveDocContext=(e,n)=>{const a=t.getActiveVersion(e,n),o=null==a?void 0:a.docs.find(e=>!!r.matchPath(n,{path:e.path,exact:!0,strict:!1}));return{activeVersion:a,activeDoc:o,alternateDocVersions:o?function(t){const n={};return e.versions.forEach(e=>{e.docs.forEach(r=>{r.id===t&&(n[e.name]=r)})}),n}(o.id):{}}},t.getDocVersionSuggestions=(e,n)=>{const r=t.getLatestVersion(e),a=t.getActiveDocContext(e,n),o=a.activeVersion!==r;return{latestDocSuggestion:o?null==a?void 0:a.alternateDocVersions[r.name]:void 0,latestVersionSuggestion:o?r:void 0}}},225:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSamePath=void 0,t.isSamePath=(e,t)=>{const n=e=>!e||(null==e?void 0:e.endsWith("/"))?e:e+"/";return n(e)===n(t)}},226:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.useTitleFormatter=void 0;const a=r(n(21));t.useTitleFormatter=e=>{const{siteConfig:t={}}=a.default(),{title:n,titleDelimiter:r="|"}=t;return e&&e.trim().length?`${e.trim()} ${r} ${n}`:n}},227:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useDocsPreferredVersionByPluginId=t.useDocsPreferredVersion=void 0;const r=n(0),a=n(212),o=n(205),i=n(229);t.useDocsPreferredVersion=function(e=i.DEFAULT_PLUGIN_ID){const t=o.useDocsData(e),[n,s]=a.useDocsPreferredVersionContext(),{preferredVersionName:c}=n[e];return{preferredVersion:c?t.versions.find(e=>e.name===c):null,savePreferredVersionName:r.useCallback(t=>{s.savePreferredVersion(e,t)},[s])}},t.useDocsPreferredVersionByPluginId=function(){const e=o.useAllDocsData(),[t]=a.useDocsPreferredVersionContext(),n=Object.keys(e),r={};return n.forEach(n=>{r[n]=function(n){const r=e[n],{preferredVersionName:a}=t[n];return a?r.versions.find(e=>e.name===a):null}(n)}),r}},228:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=e=>"docs-preferred-version-"+e,a={save:(e,t,n)=>{"none"===t||window.localStorage.setItem(r(e),n)},read:(e,t)=>"none"===t?null:window.localStorage.getItem(r(e)),clear:(e,t)=>{"none"===t||window.localStorage.removeItem(r(e))}};t.default=a},229:function(e,t,n){"use strict";n.r(t),n.d(t,"DEFAULT_PLUGIN_ID",(function(){return r}));const r="default"},230:function(e,t,n){"use strict";var r=n(3),a=n(0),o=n.n(a),i=n(198),s=n(63),c=n.n(s);t.a=({className:e,...t})=>o.a.createElement("svg",Object(r.a)({fill:"currentColor",height:"1.2em",width:"1.2em",preserveAspectRatio:"xMidYMid meet",role:"img",viewBox:"0 0 40 40",className:Object(i.a)(c.a.iconEdit,e)},t),o.a.createElement("g",null,o.a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))},235:function(e,t,n){"use strict";var r=n(0),a=n.n(r),o=n(198);var i=function(e,t,n){const[a,o]=Object(r.useState)(void 0);Object(r.useEffect)(()=>{function r(){const r=function(){const e=Array.from(document.getElementsByClassName("anchor")),t=e.find(e=>{const{top:t}=e.getBoundingClientRect();return t>=n});if(t){if(t.getBoundingClientRect().top>=n){const n=e[e.indexOf(t)-1];return null!=n?n:t}return t}return e[e.length-1]}();if(r){let n=0,i=!1;const s=document.getElementsByClassName(e);for(;n{document.removeEventListener("scroll",r),document.removeEventListener("resize",r)}})},s=n(62),c=n.n(s);const u="table-of-contents__link";function l({toc:e,isChild:t}){return e.length?a.a.createElement("ul",{className:t?"":"table-of-contents table-of-contents__left-border"},e.map(e=>a.a.createElement("li",{key:e.id},a.a.createElement("a",{href:"#"+e.id,className:u,dangerouslySetInnerHTML:{__html:e.value}}),a.a.createElement(l,{isChild:!0,toc:e.children})))):null}t.a=function({toc:e}){return i(u,"table-of-contents__link--active",100),a.a.createElement("div",{className:Object(o.a)(c.a.tableOfContents,"thin-scrollbar")},a.a.createElement(l,{toc:e}))}}}]); \ No newline at end of file diff --git a/docs/113.7a6febac.js b/docs/117.e46a35a0.js similarity index 94% rename from docs/113.7a6febac.js rename to docs/117.e46a35a0.js index 1c4d56319cc..81620125845 100644 --- a/docs/113.7a6febac.js +++ b/docs/117.e46a35a0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[113,116],{186:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(192),o=a(21),c=a(25),s=a(203),i=a(3),u=a(194),p=a(195),m=a(196),d=a(237),y=a(238),b=a(236),h=a(198),f=a(191),g=a(248);var v=e=>r.a.createElement("svg",Object(i.a)({width:"20",height:"20",role:"img"},e),r.a.createElement("g",{fill:"#7a7a7a"},r.a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),r.a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"}))),j=a(239),O=a(82),k=a.n(O);const E=(e,t)=>"link"===e.type?Object(p.isSamePath)(e.href,t):"category"===e.type&&e.items.some(e=>E(e,t));function N({item:e,onItemClick:t,collapsible:a,activePath:l,...o}){const{items:c,label:s}=e,p=E(e,l),m=function(e){const t=Object(n.useRef)(e);return Object(n.useEffect)(()=>{t.current=e},[e]),t.current}(p),[d,y]=Object(n.useState)(()=>!!a&&(!p&&e.collapsed)),b=Object(n.useRef)(null),[h,f]=Object(n.useState)(void 0),g=(e=!0)=>{var t;f(e?(null===(t=b.current)||void 0===t?void 0:t.scrollHeight)+"px":void 0)};Object(n.useEffect)(()=>{p&&!m&&d&&y(!1)},[p,m,d]);const v=Object(n.useCallback)(e=>{e.preventDefault(),h||g(),setTimeout(()=>y(e=>!e),100)},[h]);return 0===c.length?null:r.a.createElement("li",{className:Object(u.a)("menu__list-item",{"menu__list-item--collapsed":d}),key:s},r.a.createElement("a",Object(i.a)({className:Object(u.a)("menu__link",{"menu__link--sublist":a,"menu__link--active":a&&p,[k.a.menuLinkText]:!a}),onClick:a?v:void 0,href:a?"#!":void 0},o),s),r.a.createElement("ul",{className:"menu__list",ref:b,style:{height:h},onTransitionEnd:()=>{d||g(!1)}},c.map(e=>r.a.createElement(x,{tabIndex:d?"-1":"0",key:e.label,item:e,onItemClick:t,collapsible:a,activePath:l}))))}function C({item:e,onItemClick:t,activePath:a,collapsible:n,...l}){const{href:o,label:c}=e,s=E(e,a);return r.a.createElement("li",{className:"menu__list-item",key:c},r.a.createElement(h.a,Object(i.a)({className:Object(u.a)("menu__link",{"menu__link--active":s}),to:o},Object(f.a)(o)?{isNavLink:!0,exact:!0,onClick:t}:{target:"_blank",rel:"noreferrer noopener"},l),c))}function x(e){switch(e.item.type){case"category":return r.a.createElement(N,e);case"link":default:return r.a.createElement(C,e)}}var w=function({path:e,sidebar:t,sidebarCollapsible:a=!0,onCollapse:l,isHidden:o}){const[c,s]=Object(n.useState)(!1),{navbar:{hideOnScroll:i},hideableSidebar:h}=Object(p.useThemeConfig)(),{isAnnouncementBarClosed:f}=Object(m.a)(),{scrollY:O}=Object(b.a)();Object(d.a)(c);const E=Object(y.a)();return Object(n.useEffect)(()=>{E===y.b.desktop&&s(!1)},[E]),r.a.createElement("div",{className:Object(u.a)(k.a.sidebar,{[k.a.sidebarWithHideableNavbar]:i,[k.a.sidebarHidden]:o})},i&&r.a.createElement(g.a,{tabIndex:-1,className:k.a.sidebarLogo}),r.a.createElement("div",{className:Object(u.a)("menu","menu--responsive","thin-scrollbar",k.a.menu,{"menu--show":c,[k.a.menuWithAnnouncementBar]:!f&&0===O})},r.a.createElement("button",{"aria-label":c?"Close Menu":"Open Menu","aria-haspopup":"true",className:"button button--secondary button--sm menu__button",type:"button",onClick:()=>{s(!c)}},c?r.a.createElement("span",{className:Object(u.a)(k.a.sidebarMenuIcon,k.a.sidebarMenuCloseIcon)},"\xd7"):r.a.createElement(j.a,{className:k.a.sidebarMenuIcon,height:24,width:24})),r.a.createElement("ul",{className:"menu__list"},t.map(t=>r.a.createElement(x,{key:t.label,item:t,onItemClick:e=>{e.target.blur(),s(!1)},collapsible:a,activePath:e})))),h&&r.a.createElement("button",{type:"button",title:"Collapse sidebar","aria-label":"Collapse sidebar",className:Object(u.a)("button button--secondary button--outline",k.a.collapseSidebarButton),onClick:l},r.a.createElement(v,{className:k.a.collapseSidebarButtonIcon})))},P=a(213),T=a(232),S=a(202),_=a(83),D=a.n(_);function I({currentDocRoute:e,versionMetadata:t,children:a}){var c,i;const{siteConfig:m,isClient:d}=Object(o.default)(),{pluginId:y,permalinkToSidebar:b,docsSidebars:h,version:f}=t,g=b[e.path],j=h[g],[O,k]=Object(n.useState)(!1),[E,N]=Object(n.useState)(!1),C=Object(n.useCallback)(()=>{E&&N(!1),k(!O)},[E]);return r.a.createElement(s.a,{key:d,searchMetadatas:{version:f,tag:Object(p.docVersionSearchTag)(y,f)}},r.a.createElement("div",{className:D.a.docPage},j&&r.a.createElement("div",{className:Object(u.a)(D.a.docSidebarContainer,{[D.a.docSidebarContainerHidden]:O}),onTransitionEnd:e=>{e.currentTarget.classList.contains(D.a.docSidebarContainer)&&O&&N(!0)},role:"complementary"},r.a.createElement(w,{key:g,sidebar:j,path:e.path,sidebarCollapsible:null===(c=null===(i=m.themeConfig)||void 0===i?void 0:i.sidebarCollapsible)||void 0===c||c,onCollapse:C,isHidden:E}),E&&r.a.createElement("div",{className:D.a.collapsedDocSidebar,title:"Expand sidebar","aria-label":"Expand sidebar",tabIndex:0,role:"button",onKeyDown:C,onClick:C},r.a.createElement(v,null))),r.a.createElement("main",{className:D.a.docMainContainer},r.a.createElement("div",{className:Object(u.a)("container padding-vert--lg",D.a.docItemWrapper,{[D.a.docItemWrapperEnhanced]:O})},r.a.createElement(l.a,{components:P.a},a)))))}t.default=function(e){const{route:{routes:t},versionMetadata:a,location:n}=e,l=t.find(e=>Object(S.matchPath)(n.pathname,e));return l?r.a.createElement(I,{currentDocRoute:l,versionMetadata:a},Object(c.a)(t)):r.a.createElement(T.default,e)}},192:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return y}));var n=a(0),r=a.n(n);function l(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function c(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=r.a.createContext({}),u=function(e){var t=r.a.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):c(c({},t),e)),a},p=function(e){var t=u(e.components);return r.a.createElement(i.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,o=e.parentName,i=s(e,["components","mdxType","originalType","parentName"]),p=u(a),d=n,y=p["".concat(o,".").concat(d)]||p[d]||m[d]||l;return a?r.a.createElement(y,c(c({ref:t},i),{},{components:a})):r.a.createElement(y,c({ref:t},i))}));function y(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,o=new Array(l);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var i=2;i{const a=document.createElement("textarea"),n=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection();let l=!1;r.rangeCount>0&&(l=r.getRangeAt(0)),t.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch(c){}return a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),n&&n.focus(),o};e.exports=n,e.exports.default=n},212:function(e,t){function a(e){let t,a=[];for(let n of e.split(",").map(e=>e.trim()))if(/^-?\d+$/.test(n))a.push(parseInt(n,10));else if(t=n.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,n,r,l]=t;if(n&&l){n=parseInt(n),l=parseInt(l);const e=n0&&e[a-1]===t?e:e.concat(t)},b=function(e,t){var a=e.plain,n=Object.create(null),r=e.styles.reduce((function(e,a){var n=a.languages,r=a.style;return n&&!n.includes(t)||a.types.forEach((function(t){var a=p({},e[t],r);e[t]=a})),e}),n);return r.root=a,r.plain=p({},a,{backgroundColor:null}),r};function h(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(a[n]=e[n]);return a}var f=function(e){function t(){for(var t=this,a=[],n=arguments.length;n--;)a[n]=arguments[n];e.apply(this,a),u(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var a=e.theme?b(e.theme,e.language):void 0;return t.themeDict=a})),u(this,"getLineProps",(function(e){var a=e.key,n=e.className,r=e.style,l=p({},h(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),o=t.getThemeDict(t.props);return void 0!==o&&(l.style=o.plain),void 0!==r&&(l.style=void 0!==l.style?p({},l.style,r):r),void 0!==a&&(l.key=a),n&&(l.className+=" "+n),l})),u(this,"getStyleForToken",(function(e){var a=e.types,n=e.empty,r=a.length,l=t.getThemeDict(t.props);if(void 0!==l){if(1===r&&"plain"===a[0])return n?{display:"inline-block"}:void 0;if(1===r&&!n)return l[a[0]];var o=n?{display:"inline-block"}:{},c=a.map((function(e){return l[e]}));return Object.assign.apply(Object,[o].concat(c))}})),u(this,"getTokenProps",(function(e){var a=e.key,n=e.className,r=e.style,l=e.token,o=p({},h(e,["key","className","style","token"]),{className:"token "+l.types.join(" "),children:l.content,style:t.getStyleForToken(l),key:void 0});return void 0!==r&&(o.style=void 0!==o.style?p({},o.style,r):r),void 0!==a&&(o.key=a),n&&(o.className+=" "+n),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,a=e.language,n=e.code,r=e.children,l=this.getThemeDict(this.props),o=t.languages[a];return r({tokens:function(e){for(var t=[[]],a=[e],n=[0],r=[e.length],l=0,o=0,c=[],s=[c];o>-1;){for(;(l=n[o]++)0?u:["plain"],i=p):(u=y(u,p.type),p.alias&&(u=y(u,p.alias)),i=p.content),"string"==typeof i){var b=i.split(m),h=b.length;c.push({types:u,content:b[0]});for(var f=1;f{const{prism:e}=Object(N.useThemeConfig)(),{isDarkTheme:t}=Object(E.a)(),a=e.theme||k,n=e.darkTheme||a;return t?n:a},x=a(57),w=a.n(x);const P=/{([\d,-]+)}/,T=(e=["js","jsBlock","jsx","python","html"])=>{const t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},a=["highlight-next-line","highlight-start","highlight-end"].join("|"),n=e.map(e=>`(?:${t[e].start}\\s*(${a})\\s*${t[e].end})`).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)},S=/(?:title=")(.*)(?:")/;var _=({children:e,className:t,metastring:a})=>{const{prism:o}=Object(N.useThemeConfig)(),[s,u]=Object(r.useState)(!1),[p,m]=Object(r.useState)(!1);Object(r.useEffect)(()=>{m(!0)},[]);const d=Object(r.useRef)(null);let y=[],b="";const h=C(),g=Array.isArray(e)?e.join(""):e;if(a&&P.test(a)){const e=a.match(P)[1];y=O()(e).filter(e=>e>0)}a&&S.test(a)&&(b=a.match(S)[1]);let j=t&&t.replace(/language-/,"");!j&&o.defaultLanguage&&(j=o.defaultLanguage);let k=g.replace(/\n$/,"");if(0===y.length&&void 0!==j){let e="";const t=(e=>{switch(e){case"js":case"javascript":case"ts":case"typescript":return T(["js","jsBlock"]);case"jsx":case"tsx":return T(["js","jsBlock","jsx"]);case"html":return T(["js","jsBlock","html"]);case"python":case"py":return T(["python"]);default:return T()}})(j),a=g.replace(/\n$/,"").split("\n");let n;for(let r=0;re||t,void 0)){case"highlight-next-line":e+=l+",";break;case"highlight-start":n=l;break;case"highlight-end":e+=`${n}-${l-1},`}a.splice(r,1)}else r+=1}y=O()(e),k=a.join("\n")}const E=()=>{v()(k),u(!0),setTimeout(()=>u(!1),2e3)};return l.a.createElement(f,Object(n.a)({},i,{key:String(p),theme:h,code:k,language:j}),({className:e,style:t,tokens:a,getLineProps:r,getTokenProps:o})=>l.a.createElement(l.a.Fragment,null,b&&l.a.createElement("div",{style:t,className:w.a.codeBlockTitle},b),l.a.createElement("div",{className:w.a.codeBlockContent},l.a.createElement("div",{tabIndex:0,className:Object(c.a)(e,w.a.codeBlock,"thin-scrollbar",{[w.a.codeBlockWithTitle]:b})},l.a.createElement("div",{className:w.a.codeBlockLines,style:t},a.map((e,t)=>{1===e.length&&""===e[0].content&&(e[0].content="\n");const a=r({line:e,key:t});return y.includes(t+1)&&(a.className=a.className+" docusaurus-highlight-code-line"),l.a.createElement("div",Object(n.a)({key:t},a),e.map((e,t)=>l.a.createElement("span",Object(n.a)({key:t},o({token:e,key:t})))))}))),l.a.createElement("button",{ref:d,type:"button","aria-label":"Copy code to clipboard",className:Object(c.a)(w.a.copyButton),onClick:E},s?"Copied":"Copy"))))},D=(a(58),a(59)),I=a.n(D);var L=e=>function({id:t,...a}){const{navbar:{hideOnScroll:n}}=Object(N.useThemeConfig)();return t?l.a.createElement(e,a,l.a.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:Object(c.a)("anchor",{[I.a.enhancedAnchor]:!n}),id:t}),a.children,l.a.createElement("a",{className:"hash-link",href:"#"+t,title:"Direct link to heading"},"#")):l.a.createElement(e,a)},B=a(60),M=a.n(B);const R={code:e=>{const{children:t}=e;return"string"==typeof t?t.includes("\n")?l.a.createElement(_,e):l.a.createElement("code",e):t},a:e=>l.a.createElement(o.a,e),pre:e=>l.a.createElement("div",Object(n.a)({className:M.a.mdxCodeBlock},e)),h1:L("h1"),h2:L("h2"),h3:L("h3"),h4:L("h4"),h5:L("h5"),h6:L("h6")};t.a=R},232:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(203);t.default=function(){return r.a.createElement(l.a,{title:"Page Not Found"},r.a.createElement("main",{className:"container margin-vert--xl"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col col--6 col--offset-3"},r.a.createElement("h1",{className:"hero__title"},"Page Not Found"),r.a.createElement("p",null,"We could not find what you were looking for."),r.a.createElement("p",null,"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[117,120],{190:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(196),o=a(21),c=a(25),s=a(207),i=a(3),u=a(198),p=a(199),m=a(200),d=a(241),y=a(242),b=a(240),h=a(202),f=a(195),g=a(252);var v=e=>r.a.createElement("svg",Object(i.a)({width:"20",height:"20",role:"img"},e),r.a.createElement("g",{fill:"#7a7a7a"},r.a.createElement("path",{d:"M9.992 10.023c0 .2-.062.399-.172.547l-4.996 7.492a.982.982 0 01-.828.454H1c-.55 0-1-.453-1-1 0-.2.059-.403.168-.551l4.629-6.942L.168 3.078A.939.939 0 010 2.528c0-.548.45-.997 1-.997h2.996c.352 0 .649.18.828.45L9.82 9.472c.11.148.172.347.172.55zm0 0"}),r.a.createElement("path",{d:"M19.98 10.023c0 .2-.058.399-.168.547l-4.996 7.492a.987.987 0 01-.828.454h-3c-.547 0-.996-.453-.996-1 0-.2.059-.403.168-.551l4.625-6.942-4.625-6.945a.939.939 0 01-.168-.55 1 1 0 01.996-.997h3c.348 0 .649.18.828.45l4.996 7.492c.11.148.168.347.168.55zm0 0"}))),j=a(243),O=a(82),k=a.n(O);const E=(e,t)=>"link"===e.type?Object(p.isSamePath)(e.href,t):"category"===e.type&&e.items.some(e=>E(e,t));function N({item:e,onItemClick:t,collapsible:a,activePath:l,...o}){const{items:c,label:s}=e,p=E(e,l),m=function(e){const t=Object(n.useRef)(e);return Object(n.useEffect)(()=>{t.current=e},[e]),t.current}(p),[d,y]=Object(n.useState)(()=>!!a&&(!p&&e.collapsed)),b=Object(n.useRef)(null),[h,f]=Object(n.useState)(void 0),g=(e=!0)=>{var t;f(e?(null===(t=b.current)||void 0===t?void 0:t.scrollHeight)+"px":void 0)};Object(n.useEffect)(()=>{p&&!m&&d&&y(!1)},[p,m,d]);const v=Object(n.useCallback)(e=>{e.preventDefault(),h||g(),setTimeout(()=>y(e=>!e),100)},[h]);return 0===c.length?null:r.a.createElement("li",{className:Object(u.a)("menu__list-item",{"menu__list-item--collapsed":d}),key:s},r.a.createElement("a",Object(i.a)({className:Object(u.a)("menu__link",{"menu__link--sublist":a,"menu__link--active":a&&p,[k.a.menuLinkText]:!a}),onClick:a?v:void 0,href:a?"#!":void 0},o),s),r.a.createElement("ul",{className:"menu__list",ref:b,style:{height:h},onTransitionEnd:()=>{d||g(!1)}},c.map(e=>r.a.createElement(x,{tabIndex:d?"-1":"0",key:e.label,item:e,onItemClick:t,collapsible:a,activePath:l}))))}function C({item:e,onItemClick:t,activePath:a,collapsible:n,...l}){const{href:o,label:c}=e,s=E(e,a);return r.a.createElement("li",{className:"menu__list-item",key:c},r.a.createElement(h.a,Object(i.a)({className:Object(u.a)("menu__link",{"menu__link--active":s}),to:o},Object(f.a)(o)?{isNavLink:!0,exact:!0,onClick:t}:{target:"_blank",rel:"noreferrer noopener"},l),c))}function x(e){switch(e.item.type){case"category":return r.a.createElement(N,e);case"link":default:return r.a.createElement(C,e)}}var w=function({path:e,sidebar:t,sidebarCollapsible:a=!0,onCollapse:l,isHidden:o}){const[c,s]=Object(n.useState)(!1),{navbar:{hideOnScroll:i},hideableSidebar:h}=Object(p.useThemeConfig)(),{isAnnouncementBarClosed:f}=Object(m.a)(),{scrollY:O}=Object(b.a)();Object(d.a)(c);const E=Object(y.a)();return Object(n.useEffect)(()=>{E===y.b.desktop&&s(!1)},[E]),r.a.createElement("div",{className:Object(u.a)(k.a.sidebar,{[k.a.sidebarWithHideableNavbar]:i,[k.a.sidebarHidden]:o})},i&&r.a.createElement(g.a,{tabIndex:-1,className:k.a.sidebarLogo}),r.a.createElement("div",{className:Object(u.a)("menu","menu--responsive","thin-scrollbar",k.a.menu,{"menu--show":c,[k.a.menuWithAnnouncementBar]:!f&&0===O})},r.a.createElement("button",{"aria-label":c?"Close Menu":"Open Menu","aria-haspopup":"true",className:"button button--secondary button--sm menu__button",type:"button",onClick:()=>{s(!c)}},c?r.a.createElement("span",{className:Object(u.a)(k.a.sidebarMenuIcon,k.a.sidebarMenuCloseIcon)},"\xd7"):r.a.createElement(j.a,{className:k.a.sidebarMenuIcon,height:24,width:24})),r.a.createElement("ul",{className:"menu__list"},t.map(t=>r.a.createElement(x,{key:t.label,item:t,onItemClick:e=>{e.target.blur(),s(!1)},collapsible:a,activePath:e})))),h&&r.a.createElement("button",{type:"button",title:"Collapse sidebar","aria-label":"Collapse sidebar",className:Object(u.a)("button button--secondary button--outline",k.a.collapseSidebarButton),onClick:l},r.a.createElement(v,{className:k.a.collapseSidebarButtonIcon})))},P=a(217),T=a(236),S=a(206),_=a(83),D=a.n(_);function I({currentDocRoute:e,versionMetadata:t,children:a}){var c,i;const{siteConfig:m,isClient:d}=Object(o.default)(),{pluginId:y,permalinkToSidebar:b,docsSidebars:h,version:f}=t,g=b[e.path],j=h[g],[O,k]=Object(n.useState)(!1),[E,N]=Object(n.useState)(!1),C=Object(n.useCallback)(()=>{E&&N(!1),k(!O)},[E]);return r.a.createElement(s.a,{key:d,searchMetadatas:{version:f,tag:Object(p.docVersionSearchTag)(y,f)}},r.a.createElement("div",{className:D.a.docPage},j&&r.a.createElement("div",{className:Object(u.a)(D.a.docSidebarContainer,{[D.a.docSidebarContainerHidden]:O}),onTransitionEnd:e=>{e.currentTarget.classList.contains(D.a.docSidebarContainer)&&O&&N(!0)},role:"complementary"},r.a.createElement(w,{key:g,sidebar:j,path:e.path,sidebarCollapsible:null===(c=null===(i=m.themeConfig)||void 0===i?void 0:i.sidebarCollapsible)||void 0===c||c,onCollapse:C,isHidden:E}),E&&r.a.createElement("div",{className:D.a.collapsedDocSidebar,title:"Expand sidebar","aria-label":"Expand sidebar",tabIndex:0,role:"button",onKeyDown:C,onClick:C},r.a.createElement(v,null))),r.a.createElement("main",{className:D.a.docMainContainer},r.a.createElement("div",{className:Object(u.a)("container padding-vert--lg",D.a.docItemWrapper,{[D.a.docItemWrapperEnhanced]:O})},r.a.createElement(l.a,{components:P.a},a)))))}t.default=function(e){const{route:{routes:t},versionMetadata:a,location:n}=e,l=t.find(e=>Object(S.matchPath)(n.pathname,e));return l?r.a.createElement(I,{currentDocRoute:l,versionMetadata:a},Object(c.a)(t)):r.a.createElement(T.default,e)}},196:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return y}));var n=a(0),r=a.n(n);function l(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function c(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=r.a.createContext({}),u=function(e){var t=r.a.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):c(c({},t),e)),a},p=function(e){var t=u(e.components);return r.a.createElement(i.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,o=e.parentName,i=s(e,["components","mdxType","originalType","parentName"]),p=u(a),d=n,y=p["".concat(o,".").concat(d)]||p[d]||m[d]||l;return a?r.a.createElement(y,c(c({ref:t},i),{},{components:a})):r.a.createElement(y,c({ref:t},i))}));function y(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,o=new Array(l);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var i=2;i{const a=document.createElement("textarea"),n=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection();let l=!1;r.rangeCount>0&&(l=r.getRangeAt(0)),t.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch(c){}return a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),n&&n.focus(),o};e.exports=n,e.exports.default=n},216:function(e,t){function a(e){let t,a=[];for(let n of e.split(",").map(e=>e.trim()))if(/^-?\d+$/.test(n))a.push(parseInt(n,10));else if(t=n.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,n,r,l]=t;if(n&&l){n=parseInt(n),l=parseInt(l);const e=n0&&e[a-1]===t?e:e.concat(t)},b=function(e,t){var a=e.plain,n=Object.create(null),r=e.styles.reduce((function(e,a){var n=a.languages,r=a.style;return n&&!n.includes(t)||a.types.forEach((function(t){var a=p({},e[t],r);e[t]=a})),e}),n);return r.root=a,r.plain=p({},a,{backgroundColor:null}),r};function h(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(a[n]=e[n]);return a}var f=function(e){function t(){for(var t=this,a=[],n=arguments.length;n--;)a[n]=arguments[n];e.apply(this,a),u(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var a=e.theme?b(e.theme,e.language):void 0;return t.themeDict=a})),u(this,"getLineProps",(function(e){var a=e.key,n=e.className,r=e.style,l=p({},h(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),o=t.getThemeDict(t.props);return void 0!==o&&(l.style=o.plain),void 0!==r&&(l.style=void 0!==l.style?p({},l.style,r):r),void 0!==a&&(l.key=a),n&&(l.className+=" "+n),l})),u(this,"getStyleForToken",(function(e){var a=e.types,n=e.empty,r=a.length,l=t.getThemeDict(t.props);if(void 0!==l){if(1===r&&"plain"===a[0])return n?{display:"inline-block"}:void 0;if(1===r&&!n)return l[a[0]];var o=n?{display:"inline-block"}:{},c=a.map((function(e){return l[e]}));return Object.assign.apply(Object,[o].concat(c))}})),u(this,"getTokenProps",(function(e){var a=e.key,n=e.className,r=e.style,l=e.token,o=p({},h(e,["key","className","style","token"]),{className:"token "+l.types.join(" "),children:l.content,style:t.getStyleForToken(l),key:void 0});return void 0!==r&&(o.style=void 0!==o.style?p({},o.style,r):r),void 0!==a&&(o.key=a),n&&(o.className+=" "+n),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,a=e.language,n=e.code,r=e.children,l=this.getThemeDict(this.props),o=t.languages[a];return r({tokens:function(e){for(var t=[[]],a=[e],n=[0],r=[e.length],l=0,o=0,c=[],s=[c];o>-1;){for(;(l=n[o]++)0?u:["plain"],i=p):(u=y(u,p.type),p.alias&&(u=y(u,p.alias)),i=p.content),"string"==typeof i){var b=i.split(m),h=b.length;c.push({types:u,content:b[0]});for(var f=1;f{const{prism:e}=Object(N.useThemeConfig)(),{isDarkTheme:t}=Object(E.a)(),a=e.theme||k,n=e.darkTheme||a;return t?n:a},x=a(57),w=a.n(x);const P=/{([\d,-]+)}/,T=(e=["js","jsBlock","jsx","python","html"])=>{const t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},a=["highlight-next-line","highlight-start","highlight-end"].join("|"),n=e.map(e=>`(?:${t[e].start}\\s*(${a})\\s*${t[e].end})`).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)},S=/(?:title=")(.*)(?:")/;var _=({children:e,className:t,metastring:a})=>{const{prism:o}=Object(N.useThemeConfig)(),[s,u]=Object(r.useState)(!1),[p,m]=Object(r.useState)(!1);Object(r.useEffect)(()=>{m(!0)},[]);const d=Object(r.useRef)(null);let y=[],b="";const h=C(),g=Array.isArray(e)?e.join(""):e;if(a&&P.test(a)){const e=a.match(P)[1];y=O()(e).filter(e=>e>0)}a&&S.test(a)&&(b=a.match(S)[1]);let j=t&&t.replace(/language-/,"");!j&&o.defaultLanguage&&(j=o.defaultLanguage);let k=g.replace(/\n$/,"");if(0===y.length&&void 0!==j){let e="";const t=(e=>{switch(e){case"js":case"javascript":case"ts":case"typescript":return T(["js","jsBlock"]);case"jsx":case"tsx":return T(["js","jsBlock","jsx"]);case"html":return T(["js","jsBlock","html"]);case"python":case"py":return T(["python"]);default:return T()}})(j),a=g.replace(/\n$/,"").split("\n");let n;for(let r=0;re||t,void 0)){case"highlight-next-line":e+=l+",";break;case"highlight-start":n=l;break;case"highlight-end":e+=`${n}-${l-1},`}a.splice(r,1)}else r+=1}y=O()(e),k=a.join("\n")}const E=()=>{v()(k),u(!0),setTimeout(()=>u(!1),2e3)};return l.a.createElement(f,Object(n.a)({},i,{key:String(p),theme:h,code:k,language:j}),({className:e,style:t,tokens:a,getLineProps:r,getTokenProps:o})=>l.a.createElement(l.a.Fragment,null,b&&l.a.createElement("div",{style:t,className:w.a.codeBlockTitle},b),l.a.createElement("div",{className:w.a.codeBlockContent},l.a.createElement("div",{tabIndex:0,className:Object(c.a)(e,w.a.codeBlock,"thin-scrollbar",{[w.a.codeBlockWithTitle]:b})},l.a.createElement("div",{className:w.a.codeBlockLines,style:t},a.map((e,t)=>{1===e.length&&""===e[0].content&&(e[0].content="\n");const a=r({line:e,key:t});return y.includes(t+1)&&(a.className=a.className+" docusaurus-highlight-code-line"),l.a.createElement("div",Object(n.a)({key:t},a),e.map((e,t)=>l.a.createElement("span",Object(n.a)({key:t},o({token:e,key:t})))))}))),l.a.createElement("button",{ref:d,type:"button","aria-label":"Copy code to clipboard",className:Object(c.a)(w.a.copyButton),onClick:E},s?"Copied":"Copy"))))},D=(a(58),a(59)),I=a.n(D);var L=e=>function({id:t,...a}){const{navbar:{hideOnScroll:n}}=Object(N.useThemeConfig)();return t?l.a.createElement(e,a,l.a.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:Object(c.a)("anchor",{[I.a.enhancedAnchor]:!n}),id:t}),a.children,l.a.createElement("a",{className:"hash-link",href:"#"+t,title:"Direct link to heading"},"#")):l.a.createElement(e,a)},B=a(60),M=a.n(B);const R={code:e=>{const{children:t}=e;return"string"==typeof t?t.includes("\n")?l.a.createElement(_,e):l.a.createElement("code",e):t},a:e=>l.a.createElement(o.a,e),pre:e=>l.a.createElement("div",Object(n.a)({className:M.a.mdxCodeBlock},e)),h1:L("h1"),h2:L("h2"),h3:L("h3"),h4:L("h4"),h5:L("h5"),h6:L("h6")};t.a=R},236:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),l=a(207);t.default=function(){return r.a.createElement(l.a,{title:"Page Not Found"},r.a.createElement("main",{className:"container margin-vert--xl"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col col--6 col--offset-3"},r.a.createElement("h1",{className:"hero__title"},"Page Not Found"),r.a.createElement("p",null,"We could not find what you were looking for."),r.a.createElement("p",null,"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))}}}]); \ No newline at end of file diff --git a/handbook/build/114.4f4e4a67.js b/docs/118.4c40d7f8.js similarity index 99% rename from handbook/build/114.4f4e4a67.js rename to docs/118.4c40d7f8.js index 0a716edea8b..e910a253901 100644 --- a/handbook/build/114.4f4e4a67.js +++ b/docs/118.4c40d7f8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[114],{273:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=t.initialState;return{getState:function(){return r},dispatch:function(a,c){var i=function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var C=null;function N(e){var t=e.event,r=e.nextState,n=void 0===r?{}:r,o=e.props,a=e.query,c=e.refresh,i=e.store,l=D(e,["event","nextState","props","query","refresh","store"]);if(o.onInput)return Promise.resolve(o.onInput(P({query:a,refresh:c,state:i.getState()},l)));C&&o.environment.clearTimeout(C);var s,u=l.setCollections,f=l.setIsOpen,m=l.setQuery,p=l.setSelectedItemId,h=l.setStatus;return m(a),p(o.defaultSelectedItemId),0===a.length&&!1===o.openOnFocus?(h("idle"),u(i.getState().collections.map((function(e){return P(P({},e),{},{items:[]})}))),f(null!==(s=n.isOpen)&&void 0!==s?s:o.shouldPanelShow({state:i.getState()})),Promise.resolve()):(h("loading"),C=o.environment.setTimeout((function(){h("stalled")}),o.stallThreshold),o.getSources(P({query:a,refresh:c,state:i.getState()},l)).then((function(e){return h("loading"),Promise.all(e.map((function(e){return Promise.resolve(e.getItems(P({query:a,refresh:c,state:i.getState()},l))).then((function(t){return Array.isArray(t),"The `getItems` function must return an array of items but returned type ".concat(JSON.stringify(w(t)),":\n\n").concat(JSON.stringify(t,null,2)),{source:e,items:t}}))}))).then((function(e){var r;h("idle"),u(e),f(null!==(r=n.isOpen)&&void 0!==r?r:0===a.length&&o.openOnFocus||o.shouldPanelShow({state:i.getState()}));var s=E(i.getState());if(null!==i.getState().selectedItemId&&s){var m=s.item,p=s.itemInputValue,d=s.itemUrl,v=s.source;v.onHighlight(P({event:t,item:m,itemInputValue:p,itemUrl:d,refresh:c,source:v,state:i.getState()},l))}})).catch((function(e){throw h("error"),e})).finally((function(){C&&o.environment.clearTimeout(C)}))})))}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function H(e,t){return e===t||e.contains(t)}function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function L(e){var t=e.props,r=e.refresh,n=e.store,o=M(e,["props","refresh","store"]);return{getEnvironmentProps:function(e){return{onTouchStart:function(r){!1!==n.getState().isOpen&&r.target!==e.inputElement&&(!1===[e.formElement,e.panelElement].some((function(e){return H(e,r.target)||H(e,t.environment.document.activeElement)}))&&n.dispatch("blur",null))},onTouchMove:function(r){!1!==n.getState().isOpen&&e.inputElement===t.environment.document.activeElement&&r.target!==e.inputElement&&e.inputElement.blur()}}},getRootProps:function(e){return T({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return T({action:"",noValidate:!0,role:"search",onSubmit:function(a){var c;a.preventDefault(),t.onSubmit(T({event:a,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),null===(c=e.inputElement)||void 0===c||c.blur()},onReset:function(a){var c;a.preventDefault(),t.onReset(T({event:a,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),null===(c=e.inputElement)||void 0===c||c.focus()}},M(e,["inputElement"]))},getLabelProps:function(e){return T({htmlFor:"".concat(t.id,"-input"),id:"".concat(t.id,"-label")},e)},getInputProps:function(e){function a(e){(t.openOnFocus||n.getState().query.length>0)&&N(T({event:e,props:t,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var c="ontouchstart"in t.environment,i=e||{},l=(i.inputElement,i.maxLength),s=void 0===l?512:l,u=M(i,["inputElement","maxLength"]),f=E(n.getState());return T({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&null!==n.getState().selectedItemId?"".concat(t.id,"-item-").concat(n.getState().selectedItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:null!=f&&f.itemUrl?"go":"search",spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:s,type:"search",onChange:function(e){N(T({event:e,props:t,query:e.currentTarget.value.slice(0,s),refresh:r,store:n},o))},onKeyDown:function(e){!function(e){var t=e.event,r=e.props,n=e.refresh,o=e.store,a=q(e,["event","props","refresh","store"]);if("ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault(),o.dispatch(t.key,null);var c=r.environment.document.getElementById("".concat(r.id,"-item-").concat(o.getState().selectedItemId));c&&(c.scrollIntoViewIfNeeded?c.scrollIntoViewIfNeeded(!1):c.scrollIntoView(!1));var i=E(o.getState());if(null!==o.getState().selectedItemId&&i){var l=i.item,s=i.itemInputValue,u=i.itemUrl,f=i.source;f.onHighlight(x({event:t,item:l,itemInputValue:s,itemUrl:u,refresh:n,source:f,state:o.getState()},a))}}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null);else if("Enter"===t.key){if(null===o.getState().selectedItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return;t.preventDefault();var m=E(o.getState()),p=m.item,h=m.itemInputValue,d=m.itemUrl,v=m.source;if(t.metaKey||t.ctrlKey)void 0!==d&&(v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a)),r.navigator.navigateNewTab({itemUrl:d,item:p,state:o.getState()}));else if(t.shiftKey)void 0!==d&&(v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a)),r.navigator.navigateNewWindow({itemUrl:d,item:p,state:o.getState()}));else if(t.altKey);else{if(void 0!==d)return v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a)),void r.navigator.navigate({itemUrl:d,item:p,state:o.getState()});N(x({event:t,nextState:{isOpen:!1},props:r,query:h,refresh:n,store:o},a)).then((function(){v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a))}))}}}(T({event:e,props:t,refresh:r,store:n},o))},onFocus:a,onBlur:function(){c||n.dispatch("blur",null)},onClick:function(r){e.inputElement!==t.environment.document.activeElement||n.getState().isOpen||a(r)}},u)},getPanelProps:function(e){return T({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},e)},getListProps:function(e){return T({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},e)},getItemProps:function(e){var a=e.item,c=e.source,i=M(e,["item","source"]);return T({id:"".concat(t.id,"-item-").concat(a.__autocomplete_id),role:"option","aria-selected":n.getState().selectedItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==n.getState().selectedItemId){n.dispatch("mousemove",a.__autocomplete_id);var t=E(n.getState());if(null!==n.getState().selectedItemId&&t){var c=t.item,i=t.itemInputValue,l=t.itemUrl,s=t.source;s.onHighlight(T({event:e,item:c,itemInputValue:i,itemUrl:l,refresh:r,source:s,state:n.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var i=c.getItemInputValue({item:a,state:n.getState()}),l=c.getItemUrl({item:a,state:n.getState()});(l?Promise.resolve():N(T({event:e,nextState:{isOpen:!1},props:t,query:i,refresh:r,store:n},o))).then((function(){c.onSelect(T({event:e,item:a,itemInputValue:i,itemUrl:l,refresh:r,source:c,state:n.getState()},o))}))}},i)}}}function F(e){var t=e.state;return!1===t.isOpen||null===t.selectedItemId?null:E(t).itemInputValue||null}function U(e,t,r,n){if(e<0&&(null===t||null!==n&&0===t))return r+e;var o=(null===t?-1:t)+e;return o<=-1||o>=r?null===n?null:0:o}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t0});case"blur":return t.props.debug?e:z(z({},e),{},{isOpen:!1,selectedItemId:null});case"mousemove":return z(z({},e),{},{selectedItemId:t.payload});case"mouseleave":return z(z({},e),{},{selectedItemId:t.props.defaultSelectedItemId});default:return"The reducer action ".concat(JSON.stringify(t.type)," is not supported."),e}};function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t0}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(f++),plugins:o,initialState:O({selectedItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var r;null===(r=e.onStateChange)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onStateChange)||void 0===r?void 0:r.call(e,t)}))},onSubmit:function(t){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onSubmit)||void 0===r?void 0:r.call(e,t)}))},onReset:function(t){var r;null===(r=e.onReset)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onReset)||void 0===r?void 0:r.call(e,t)}))},getSources:function(r){return Promise.all([].concat(y(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return v(e,r)}))).then((function(e){return c(e)})).then((function(e){return e.map((function(e){return O(O({},e),{},{onSelect:function(r){e.onSelect(r),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,r)}))},onHighlight:function(r){e.onHighlight(r),t.forEach((function(e){var t;return null===(t=e.onHighlight)||void 0===t?void 0:t.call(e,r)}))}})}))}))},navigator:O({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,r=n.open(t,"_blank","noopener");null==r||r.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,"_blank","noopener")}},e.navigator)})}(e,t),n=a(J,r),o=function(e){var t=e.store;return{setSelectedItemId:function(e){t.dispatch("setSelectedItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var r=0,n=e.map((function(e){return l(l({},e),{},{items:c(e.items).map((function(e){return l(l({},e),{},{__autocomplete_id:r++})}))})}));t.dispatch("setCollections",n)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:n}),i=L(W({props:r,refresh:s,store:n},o));function s(){return N(W({event:new Event("input"),nextState:{isOpen:n.getState().isOpen},props:r,query:n.getState().query,refresh:s,store:n},o))}return r.plugins.forEach((function(e){var r;return null===(r=e.subscribe)||void 0===r?void 0:r.call(e,W(W({},o),{},{onSelect:function(e){t.push({onSelect:e})},onHighlight:function(e){t.push({onHighlight:e})}}))})),W(W({refresh:s},i),o)}function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&te.a.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},te.a.createElement("p",{className:"DocSearch-Help"},"Try searching for:"),te.a.createElement("ul",null,t.slice(0,3).reduce((function(t,r){return[].concat(se(t),[te.a.createElement("li",{key:r},te.a.createElement("button",{className:"DocSearch-Prefill",key:r,onClick:function(){e.setQuery(r.toLowerCase()+" "),e.refresh(),e.inputRef.current.focus()}},r))])}),[]))),te.a.createElement("p",{className:"DocSearch-Help"},"Believe this query should return results?"," ",te.a.createElement("a",{href:"https://github.com/algolia/docsearch-configs/issues/new?template=Missing_results.md&title=[".concat(e.indexName,']+Missing+results+for+query+"').concat(e.state.query,'"'),target:"_blank",rel:"noopener noreferrer"},"Let us know"),"."))}function me(e){switch(e.type){case"lvl1":return te.a.createElement(pe,null);case"content":return te.a.createElement(de,null);default:return te.a.createElement(he,null)}}function pe(){return te.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function he(){return te.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function de(){return te.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function ve(){return te.a.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},te.a.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),te.a.createElement("path",{d:"M8 17l-6-6 6-6"})))}function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Se(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function Ee(e){var t=e.hit,r=e.attribute,n=e.tagName,o=void 0===n?"span":n,a=Oe(e,["hit","attribute","tagName"]);return Object(ee.createElement)(o,ge(ge({},a),{},{dangerouslySetInnerHTML:{__html:Se(t,"_snippetResult.".concat(r,".value"))||Se(t,r)}}))}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var c,i=e[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(l){o=!0,a=l}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return je(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return je(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0}));return e.state.query?!1===t?te.a.createElement(fe,e):te.a.createElement(Ne,e):te.a.createElement(He,Re({},e,{hasCollections:t}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function _e(){return te.a.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},te.a.createElement("g",{fill:"none",fillRule:"evenodd"},te.a.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},te.a.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),te.a.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},te.a.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}var Me=r(234);function Le(){return(Le=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ve(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(t){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function ze(e){var t=e.key,r=e.limit,n=void 0===r?5:r,o=Ve(t),a=o.getItem().slice(0,n);return{add:function(e){var t=e,r=(t._highlightResult,t._snippetResult,Ue(t,["_highlightResult","_snippetResult"])),c=a.findIndex((function(e){return e.objectID===r.objectID}));c>-1&&a.splice(c,1),a.unshift(r),a=a.slice(0,n),o.setItem(a)},remove:function(e){a=a.filter((function(t){return t.objectID!==e.objectID})),o.setItem(a)},getAll:function(){return a}}}function Be(e){const t="algoliasearch-client-js-"+e.key;let r;const n=()=>(void 0===r&&(r=e.localStorage||window.localStorage),r),o=()=>JSON.parse(n().getItem(t)||"{}");return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then(()=>{const r=JSON.stringify(e),n=o()[r];return Promise.all([n||t(),void 0!==n])}).then(([e,t])=>Promise.all([e,t||r.miss(e)])).then(([e])=>e),set:(e,r)=>Promise.resolve().then(()=>{const a=o();return a[JSON.stringify(e)]=r,n().setItem(t,JSON.stringify(a)),r}),delete:e=>Promise.resolve().then(()=>{const r=o();delete r[JSON.stringify(e)],n().setItem(t,JSON.stringify(r))}),clear:()=>Promise.resolve().then(()=>{n().removeItem(t)})}}function Je(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then(e=>Promise.all([e,r.miss(e)])).then(([e])=>e),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>r.get(e,n,o).catch(()=>Je({caches:t}).get(e,n,o)),set:(e,n)=>r.set(e,n).catch(()=>Je({caches:t}).set(e,n)),delete:e=>r.delete(e).catch(()=>Je({caches:t}).delete(e)),clear:()=>r.clear().catch(()=>Je({caches:t}).clear())}}function Ke(e={serializable:!0}){let t={};return{get(r,n,o={miss:()=>Promise.resolve()}){const a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);const c=n(),i=o&&o.miss||(()=>Promise.resolve());return c.then(e=>i(e)).then(()=>c)},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function We(e){let t=e.length-1;for(;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function $e(e,t){return Object.keys(void 0!==t?t:{}).forEach(r=>{e[r]=t[r](e)}),e}function Qe(e,...t){let r=0;return e.replace(/%s/g,()=>encodeURIComponent(t[r++]))}const Ye="4.4.0",Ge={WithinQueryParameters:0,WithinHeaders:1};function Xe(e,t){const r=e||{},n=r.data||{};return Object.keys(r).forEach(e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])}),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}const Ze={Read:1,Write:2,Any:3},et=1,tt=2,rt=3,nt=12e4;function ot(e,t=et){return{...e,status:t,lastUpdate:Date.now()}}function at(e){return{protocol:e.protocol||"https",url:e.url,accept:e.accept||Ze.Any}}const ct="GET",it="POST";function lt(e,t){return Promise.all(t.map(t=>e.get(t,()=>Promise.resolve(ot(t))))).then(e=>{const r=e.filter(e=>function(e){return e.status===et||Date.now()-e.lastUpdate>nt}(e)),n=e.filter(e=>function(e){return e.status===rt&&Date.now()-e.lastUpdate<=nt}(e)),o=[...r,...n];return{getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t,statelessHosts:o.length>0?o.map(e=>at(e)):t}})}function st(e,t,r,n){const o=[],a=function(e,t){if(e.method===ct||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(r,n),c=function(e,t){const r={...e.headers,...t.headers},n={};return Object.keys(r).forEach(e=>{const t=r[e];n[e.toLowerCase()]=t}),n}(e,n),i=r.method,l=r.method!==ct?{}:{...r.data,...n.data},s={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...l,...n.queryParameters};let u=0;const f=(t,l)=>{const m=t.pop();if(void 0===m)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:pt(o)};const p={data:a,headers:c,method:i,url:ft(m,r.path,s),connectTimeout:l(u,e.timeouts.connect),responseTimeout:l(u,n.timeout)},h=e=>{const r={request:p,response:e,host:m,triesLeft:t.length};return o.push(r),r},d={onSucess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(r){const n=h(r);return r.isTimedOut&&u++,Promise.all([e.logger.info("Retryable failure",ht(n)),e.hostsCache.set(m,ot(m,r.isTimedOut?rt:tt))]).then(()=>f(t,l))},onFail(e){throw h(e),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(o){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(n,t,r)}(e,pt(o))}};return e.requester.send(p).then(e=>((e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSucess(e):t.onFail(e))(e,d))};return lt(e.hostsCache,t).then(e=>f([...e.statelessHosts].reverse(),e.getTimeout))}function ut(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}function ft(e,t,r){const n=mt(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(o+="?"+n),o}function mt(e){return Object.keys(e).map(t=>{return Qe("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r}).join("&")}function pt(e){return e.map(e=>ht(e))}function ht(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const dt=e=>{const t=e.appId,r=function(e,t,r){const n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:()=>e===Ge.WithinHeaders?n:{},queryParameters:()=>e===Ge.WithinQueryParameters?n:{}}}(void 0!==e.authMode?e.authMode:Ge.WithinHeaders,t,e.apiKey),n=function(e){const{hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,hosts:l,queryParameters:s,headers:u}=e,f={hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,headers:u,queryParameters:s,hosts:l.map(e=>at(e)),read(e,t){const r=Xe(t,f.timeouts.read),n=()=>st(f,f.hosts.filter(e=>0!=(e.accept&Ze.Read)),e,r);if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();const o={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,()=>f.requestsCache.get(o,()=>f.requestsCache.set(o,n()).then(e=>Promise.all([f.requestsCache.delete(o),e]),e=>Promise.all([f.requestsCache.delete(o),Promise.reject(e)])).then(([e,t])=>t)),{miss:e=>f.responsesCache.set(o,e)})},write:(e,t)=>st(f,f.hosts.filter(e=>0!=(e.accept&Ze.Write)),e,Xe(t,f.timeouts.write))};return f}({hosts:[{url:t+"-dsn.algolia.net",accept:Ze.Read},{url:t+".algolia.net",accept:Ze.Write}].concat(We([{url:t+"-1.algolianet.com"},{url:t+"-2.algolianet.com"},{url:t+"-3.algolianet.com"}])),...e,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...r.queryParameters(),...e.queryParameters}});return $e({transporter:n,appId:t,addAlgoliaAgent(e,t){n.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then(()=>{})},e.methods)},vt=e=>(t,r={})=>$e({transporter:e.transporter,appId:e.appId,indexName:t},r.methods),yt=e=>(t,r)=>{const n=t.map(e=>({...e,params:mt(e.params||{})}));return e.transporter.read({method:it,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)},gt=e=>(t,r)=>Promise.all(t.map(t=>{const{facetName:n,facetQuery:o,...a}=t.params;return vt(e)(t.indexName,{methods:{searchForFacetValues:Ot}}).searchForFacetValues(n,o,{...r,...a})})),bt=e=>(t,r)=>e.transporter.read({method:it,path:Qe("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r),Ot=e=>(t,r,n)=>e.transporter.read({method:it,path:Qe("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n),St=1,Et=2,wt=3;function jt(e,t,r){const n={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise(t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(t=>r.setRequestHeader(t,e.headers[t]));const n=(e,n)=>setTimeout(()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})},1e3*e),o=n(e.connectTimeout,"Connection timeout");let a;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===a&&(clearTimeout(o),a=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(a),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(a),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)})},logger:(o=wt,{debug:(e,t)=>(St>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(Et>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:Ke(),requestsCache:Ke({serializable:!1}),hostsCache:Je({caches:[Be({key:"4.4.0-"+e}),Ke()]}),userAgent:ut(Ye).add({segment:"Browser",version:"lite"}),authMode:Ge.WithinQueryParameters};var o;return dt({...n,...r,methods:{search:yt,searchForFacetValues:gt,multipleQueries:yt,multipleSearchForFacetValues:gt,initIndex:e=>t=>vt(e)(t,{methods:{search:bt,searchForFacetValues:Ot}})}})}jt.version=Ye;var Pt=jt,It="3.0.0-alpha.32";function Dt(){}function Ct(e){return e}function Nt(e,t){return e.reduce((function(e,r){var n=t(r);return e.hasOwnProperty(n)||(e[n]=[]),e[n].length<5&&e[n].push(r),e}),{})}function kt(){return(kt=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r",highlightPostTag:"",hitsPerPage:20},i)}]}).catch((function(e){throw"RetryError"===e.name&&a("error"),e})).then((function(e){var t=e[0].hits,o=e[0].nbHits,a=Nt(t,(function(e){return e.hierarchy.lvl0}));return r.context.searchSuggestions.length0&&(z(),A.current&&A.current.focus())}),[R,z]),te.a.useEffect((function(){function e(){if(N.current){var e=.01*window.innerHeight;N.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),te.a.createElement("div",kt({ref:C},V({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===I.status&&"DocSearch-Container--Stalled","error"===I.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),onMouseDown:function(e){e.target===e.currentTarget&&s()}}),te.a.createElement("div",{className:"DocSearch-Modal",ref:N},te.a.createElement("header",{className:"DocSearch-SearchBar",ref:k},te.a.createElement(Fe,kt({},F,{state:I,autoFocus:0===R.length,onClose:s,inputRef:A,isFromSelection:Boolean(R)&&R===H}))),te.a.createElement("div",{className:"DocSearch-Dropdown",ref:x},te.a.createElement(Te,kt({},F,{indexName:o,state:I,hitComponent:p,resultsFooterComponent:d,disableUserPersonalization:E,recentSearches:M,favoriteSearches:_,onItemClick:function(e){L(e),s()},inputRef:A}))),te.a.createElement("footer",{className:"DocSearch-Footer"},te.a.createElement(ne,null))))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[118],{277:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=t.initialState;return{getState:function(){return r},dispatch:function(a,c){var i=function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var C=null;function N(e){var t=e.event,r=e.nextState,n=void 0===r?{}:r,o=e.props,a=e.query,c=e.refresh,i=e.store,l=D(e,["event","nextState","props","query","refresh","store"]);if(o.onInput)return Promise.resolve(o.onInput(P({query:a,refresh:c,state:i.getState()},l)));C&&o.environment.clearTimeout(C);var s,u=l.setCollections,f=l.setIsOpen,m=l.setQuery,p=l.setSelectedItemId,h=l.setStatus;return m(a),p(o.defaultSelectedItemId),0===a.length&&!1===o.openOnFocus?(h("idle"),u(i.getState().collections.map((function(e){return P(P({},e),{},{items:[]})}))),f(null!==(s=n.isOpen)&&void 0!==s?s:o.shouldPanelShow({state:i.getState()})),Promise.resolve()):(h("loading"),C=o.environment.setTimeout((function(){h("stalled")}),o.stallThreshold),o.getSources(P({query:a,refresh:c,state:i.getState()},l)).then((function(e){return h("loading"),Promise.all(e.map((function(e){return Promise.resolve(e.getItems(P({query:a,refresh:c,state:i.getState()},l))).then((function(t){return Array.isArray(t),"The `getItems` function must return an array of items but returned type ".concat(JSON.stringify(w(t)),":\n\n").concat(JSON.stringify(t,null,2)),{source:e,items:t}}))}))).then((function(e){var r;h("idle"),u(e),f(null!==(r=n.isOpen)&&void 0!==r?r:0===a.length&&o.openOnFocus||o.shouldPanelShow({state:i.getState()}));var s=E(i.getState());if(null!==i.getState().selectedItemId&&s){var m=s.item,p=s.itemInputValue,d=s.itemUrl,v=s.source;v.onHighlight(P({event:t,item:m,itemInputValue:p,itemUrl:d,refresh:c,source:v,state:i.getState()},l))}})).catch((function(e){throw h("error"),e})).finally((function(){C&&o.environment.clearTimeout(C)}))})))}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function x(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function H(e,t){return e===t||e.contains(t)}function R(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function T(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function L(e){var t=e.props,r=e.refresh,n=e.store,o=M(e,["props","refresh","store"]);return{getEnvironmentProps:function(e){return{onTouchStart:function(r){!1!==n.getState().isOpen&&r.target!==e.inputElement&&(!1===[e.formElement,e.panelElement].some((function(e){return H(e,r.target)||H(e,t.environment.document.activeElement)}))&&n.dispatch("blur",null))},onTouchMove:function(r){!1!==n.getState().isOpen&&e.inputElement===t.environment.document.activeElement&&r.target!==e.inputElement&&e.inputElement.blur()}}},getRootProps:function(e){return T({role:"combobox","aria-expanded":n.getState().isOpen,"aria-haspopup":"listbox","aria-owns":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label")},e)},getFormProps:function(e){e.inputElement;return T({action:"",noValidate:!0,role:"search",onSubmit:function(a){var c;a.preventDefault(),t.onSubmit(T({event:a,refresh:r,state:n.getState()},o)),n.dispatch("submit",null),null===(c=e.inputElement)||void 0===c||c.blur()},onReset:function(a){var c;a.preventDefault(),t.onReset(T({event:a,refresh:r,state:n.getState()},o)),n.dispatch("reset",null),null===(c=e.inputElement)||void 0===c||c.focus()}},M(e,["inputElement"]))},getLabelProps:function(e){return T({htmlFor:"".concat(t.id,"-input"),id:"".concat(t.id,"-label")},e)},getInputProps:function(e){function a(e){(t.openOnFocus||n.getState().query.length>0)&&N(T({event:e,props:t,query:n.getState().completion||n.getState().query,refresh:r,store:n},o)),n.dispatch("focus",null)}var c="ontouchstart"in t.environment,i=e||{},l=(i.inputElement,i.maxLength),s=void 0===l?512:l,u=M(i,["inputElement","maxLength"]),f=E(n.getState());return T({"aria-autocomplete":"both","aria-activedescendant":n.getState().isOpen&&null!==n.getState().selectedItemId?"".concat(t.id,"-item-").concat(n.getState().selectedItemId):void 0,"aria-controls":n.getState().isOpen?"".concat(t.id,"-list"):void 0,"aria-labelledby":"".concat(t.id,"-label"),value:n.getState().completion||n.getState().query,id:"".concat(t.id,"-input"),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",enterKeyHint:null!=f&&f.itemUrl?"go":"search",spellCheck:"false",autoFocus:t.autoFocus,placeholder:t.placeholder,maxLength:s,type:"search",onChange:function(e){N(T({event:e,props:t,query:e.currentTarget.value.slice(0,s),refresh:r,store:n},o))},onKeyDown:function(e){!function(e){var t=e.event,r=e.props,n=e.refresh,o=e.store,a=q(e,["event","props","refresh","store"]);if("ArrowUp"===t.key||"ArrowDown"===t.key){t.preventDefault(),o.dispatch(t.key,null);var c=r.environment.document.getElementById("".concat(r.id,"-item-").concat(o.getState().selectedItemId));c&&(c.scrollIntoViewIfNeeded?c.scrollIntoViewIfNeeded(!1):c.scrollIntoView(!1));var i=E(o.getState());if(null!==o.getState().selectedItemId&&i){var l=i.item,s=i.itemInputValue,u=i.itemUrl,f=i.source;f.onHighlight(x({event:t,item:l,itemInputValue:s,itemUrl:u,refresh:n,source:f,state:o.getState()},a))}}else if("Escape"===t.key)t.preventDefault(),o.dispatch(t.key,null);else if("Enter"===t.key){if(null===o.getState().selectedItemId||o.getState().collections.every((function(e){return 0===e.items.length})))return;t.preventDefault();var m=E(o.getState()),p=m.item,h=m.itemInputValue,d=m.itemUrl,v=m.source;if(t.metaKey||t.ctrlKey)void 0!==d&&(v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a)),r.navigator.navigateNewTab({itemUrl:d,item:p,state:o.getState()}));else if(t.shiftKey)void 0!==d&&(v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a)),r.navigator.navigateNewWindow({itemUrl:d,item:p,state:o.getState()}));else if(t.altKey);else{if(void 0!==d)return v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a)),void r.navigator.navigate({itemUrl:d,item:p,state:o.getState()});N(x({event:t,nextState:{isOpen:!1},props:r,query:h,refresh:n,store:o},a)).then((function(){v.onSelect(x({event:t,item:p,itemInputValue:h,itemUrl:d,refresh:n,source:v,state:o.getState()},a))}))}}}(T({event:e,props:t,refresh:r,store:n},o))},onFocus:a,onBlur:function(){c||n.dispatch("blur",null)},onClick:function(r){e.inputElement!==t.environment.document.activeElement||n.getState().isOpen||a(r)}},u)},getPanelProps:function(e){return T({onMouseDown:function(e){e.preventDefault()},onMouseLeave:function(){n.dispatch("mouseleave",null)}},e)},getListProps:function(e){return T({role:"listbox","aria-labelledby":"".concat(t.id,"-label"),id:"".concat(t.id,"-list")},e)},getItemProps:function(e){var a=e.item,c=e.source,i=M(e,["item","source"]);return T({id:"".concat(t.id,"-item-").concat(a.__autocomplete_id),role:"option","aria-selected":n.getState().selectedItemId===a.__autocomplete_id,onMouseMove:function(e){if(a.__autocomplete_id!==n.getState().selectedItemId){n.dispatch("mousemove",a.__autocomplete_id);var t=E(n.getState());if(null!==n.getState().selectedItemId&&t){var c=t.item,i=t.itemInputValue,l=t.itemUrl,s=t.source;s.onHighlight(T({event:e,item:c,itemInputValue:i,itemUrl:l,refresh:r,source:s,state:n.getState()},o))}}},onMouseDown:function(e){e.preventDefault()},onClick:function(e){var i=c.getItemInputValue({item:a,state:n.getState()}),l=c.getItemUrl({item:a,state:n.getState()});(l?Promise.resolve():N(T({event:e,nextState:{isOpen:!1},props:t,query:i,refresh:r,store:n},o))).then((function(){c.onSelect(T({event:e,item:a,itemInputValue:i,itemUrl:l,refresh:r,source:c,state:n.getState()},o))}))}},i)}}}function F(e){var t=e.state;return!1===t.isOpen||null===t.selectedItemId?null:E(t).itemInputValue||null}function U(e,t,r,n){if(e<0&&(null===t||null!==n&&0===t))return r+e;var o=(null===t?-1:t)+e;return o<=-1||o>=r?null===n?null:0:o}function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function z(e){for(var t=1;t0});case"blur":return t.props.debug?e:z(z({},e),{},{isOpen:!1,selectedItemId:null});case"mousemove":return z(z({},e),{},{selectedItemId:t.payload});case"mouseleave":return z(z({},e),{},{selectedItemId:t.props.defaultSelectedItemId});default:return"The reducer action ".concat(JSON.stringify(t.type)," is not supported."),e}};function K(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function W(e){for(var t=1;t0}},e),{},{id:null!==(r=e.id)&&void 0!==r?r:"autocomplete-".concat(f++),plugins:o,initialState:O({selectedItemId:null,query:"",completion:null,collections:[],isOpen:!1,status:"idle",context:{}},e.initialState),onStateChange:function(t){var r;null===(r=e.onStateChange)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onStateChange)||void 0===r?void 0:r.call(e,t)}))},onSubmit:function(t){var r;null===(r=e.onSubmit)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onSubmit)||void 0===r?void 0:r.call(e,t)}))},onReset:function(t){var r;null===(r=e.onReset)||void 0===r||r.call(e,t),o.forEach((function(e){var r;return null===(r=e.onReset)||void 0===r?void 0:r.call(e,t)}))},getSources:function(r){return Promise.all([].concat(y(o.map((function(e){return e.getSources}))),[e.getSources]).filter(Boolean).map((function(e){return v(e,r)}))).then((function(e){return c(e)})).then((function(e){return e.map((function(e){return O(O({},e),{},{onSelect:function(r){e.onSelect(r),t.forEach((function(e){var t;return null===(t=e.onSelect)||void 0===t?void 0:t.call(e,r)}))},onHighlight:function(r){e.onHighlight(r),t.forEach((function(e){var t;return null===(t=e.onHighlight)||void 0===t?void 0:t.call(e,r)}))}})}))}))},navigator:O({navigate:function(e){var t=e.itemUrl;n.location.assign(t)},navigateNewTab:function(e){var t=e.itemUrl,r=n.open(t,"_blank","noopener");null==r||r.focus()},navigateNewWindow:function(e){var t=e.itemUrl;n.open(t,"_blank","noopener")}},e.navigator)})}(e,t),n=a(J,r),o=function(e){var t=e.store;return{setSelectedItemId:function(e){t.dispatch("setSelectedItemId",e)},setQuery:function(e){t.dispatch("setQuery",e)},setCollections:function(e){var r=0,n=e.map((function(e){return l(l({},e),{},{items:c(e.items).map((function(e){return l(l({},e),{},{__autocomplete_id:r++})}))})}));t.dispatch("setCollections",n)},setIsOpen:function(e){t.dispatch("setIsOpen",e)},setStatus:function(e){t.dispatch("setStatus",e)},setContext:function(e){t.dispatch("setContext",e)}}}({store:n}),i=L(W({props:r,refresh:s,store:n},o));function s(){return N(W({event:new Event("input"),nextState:{isOpen:n.getState().isOpen},props:r,query:n.getState().query,refresh:s,store:n},o))}return r.plugins.forEach((function(e){var r;return null===(r=e.subscribe)||void 0===r?void 0:r.call(e,W(W({},o),{},{onSelect:function(e){t.push({onSelect:e})},onHighlight:function(e){t.push({onHighlight:e})}}))})),W(W({refresh:s},i),o)}function Y(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&te.a.createElement("div",{className:"DocSearch-NoResults-Prefill-List"},te.a.createElement("p",{className:"DocSearch-Help"},"Try searching for:"),te.a.createElement("ul",null,t.slice(0,3).reduce((function(t,r){return[].concat(se(t),[te.a.createElement("li",{key:r},te.a.createElement("button",{className:"DocSearch-Prefill",key:r,onClick:function(){e.setQuery(r.toLowerCase()+" "),e.refresh(),e.inputRef.current.focus()}},r))])}),[]))),te.a.createElement("p",{className:"DocSearch-Help"},"Believe this query should return results?"," ",te.a.createElement("a",{href:"https://github.com/algolia/docsearch-configs/issues/new?template=Missing_results.md&title=[".concat(e.indexName,']+Missing+results+for+query+"').concat(e.state.query,'"'),target:"_blank",rel:"noopener noreferrer"},"Let us know"),"."))}function me(e){switch(e.type){case"lvl1":return te.a.createElement(pe,null);case"content":return te.a.createElement(de,null);default:return te.a.createElement(he,null)}}function pe(){return te.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("path",{d:"M17 6v12c0 .52-.2 1-1 1H4c-.7 0-1-.33-1-1V2c0-.55.42-1 1-1h8l5 5zM14 8h-3.13c-.51 0-.87-.34-.87-.87V4",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function he(){return te.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("path",{d:"M13 13h4-4V8H7v5h6v4-4H7V8H3h4V3v5h6V3v5h4-4v5zm-6 0v4-4H3h4z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"}))}function de(){return te.a.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("path",{d:"M17 5H3h14zm0 5H3h14zm0 5H3h14z",stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinejoin:"round"}))}function ve(){return te.a.createElement("svg",{className:"DocSearch-Hit-Select-Icon",width:"20",height:"20",viewBox:"0 0 20 20"},te.a.createElement("g",{stroke:"currentColor",fill:"none",fillRule:"evenodd",strokeLinecap:"round",strokeLinejoin:"round"},te.a.createElement("path",{d:"M18 3v4c0 2-2 4-4 4H2"}),te.a.createElement("path",{d:"M8 17l-6-6 6-6"})))}function ye(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ge(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Se(e,t){return t.split(".").reduce((function(e,t){return e&&e[t]}),e)}function Ee(e){var t=e.hit,r=e.attribute,n=e.tagName,o=void 0===n?"span":n,a=Oe(e,["hit","attribute","tagName"]);return Object(ee.createElement)(o,ge(ge({},a),{},{dangerouslySetInnerHTML:{__html:Se(t,"_snippetResult.".concat(r,".value"))||Se(t,r)}}))}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,o=!1,a=void 0;try{for(var c,i=e[Symbol.iterator]();!(n=(c=i.next()).done)&&(r.push(c.value),!t||r.length!==t);n=!0);}catch(l){o=!0,a=l}finally{try{n||null==i.return||i.return()}finally{if(o)throw a}}return r}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return je(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return je(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0}));return e.state.query?!1===t?te.a.createElement(fe,e):te.a.createElement(Ne,e):te.a.createElement(He,Re({},e,{hasCollections:t}))}),(function(e,t){return"loading"===t.state.status||"stalled"===t.state.status}));function _e(){return te.a.createElement("svg",{viewBox:"0 0 38 38",stroke:"currentColor",strokeOpacity:".5"},te.a.createElement("g",{fill:"none",fillRule:"evenodd"},te.a.createElement("g",{transform:"translate(1 1)",strokeWidth:"2"},te.a.createElement("circle",{strokeOpacity:".3",cx:"18",cy:"18",r:"18"}),te.a.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18"},te.a.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"1s",repeatCount:"indefinite"})))))}var Me=r(238);function Le(){return(Le=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ve(e){return!1===function(){var e="__TEST_KEY__";try{return localStorage.setItem(e,""),localStorage.removeItem(e),!0}catch(t){return!1}}()?{setItem:function(){},getItem:function(){return[]}}:{setItem:function(t){return window.localStorage.setItem(e,JSON.stringify(t))},getItem:function(){var t=window.localStorage.getItem(e);return t?JSON.parse(t):[]}}}function ze(e){var t=e.key,r=e.limit,n=void 0===r?5:r,o=Ve(t),a=o.getItem().slice(0,n);return{add:function(e){var t=e,r=(t._highlightResult,t._snippetResult,Ue(t,["_highlightResult","_snippetResult"])),c=a.findIndex((function(e){return e.objectID===r.objectID}));c>-1&&a.splice(c,1),a.unshift(r),a=a.slice(0,n),o.setItem(a)},remove:function(e){a=a.filter((function(t){return t.objectID!==e.objectID})),o.setItem(a)},getAll:function(){return a}}}function Be(e){const t="algoliasearch-client-js-"+e.key;let r;const n=()=>(void 0===r&&(r=e.localStorage||window.localStorage),r),o=()=>JSON.parse(n().getItem(t)||"{}");return{get:(e,t,r={miss:()=>Promise.resolve()})=>Promise.resolve().then(()=>{const r=JSON.stringify(e),n=o()[r];return Promise.all([n||t(),void 0!==n])}).then(([e,t])=>Promise.all([e,t||r.miss(e)])).then(([e])=>e),set:(e,r)=>Promise.resolve().then(()=>{const a=o();return a[JSON.stringify(e)]=r,n().setItem(t,JSON.stringify(a)),r}),delete:e=>Promise.resolve().then(()=>{const r=o();delete r[JSON.stringify(e)],n().setItem(t,JSON.stringify(r))}),clear:()=>Promise.resolve().then(()=>{n().removeItem(t)})}}function Je(e){const t=[...e.caches],r=t.shift();return void 0===r?{get:(e,t,r={miss:()=>Promise.resolve()})=>t().then(e=>Promise.all([e,r.miss(e)])).then(([e])=>e),set:(e,t)=>Promise.resolve(t),delete:e=>Promise.resolve(),clear:()=>Promise.resolve()}:{get:(e,n,o={miss:()=>Promise.resolve()})=>r.get(e,n,o).catch(()=>Je({caches:t}).get(e,n,o)),set:(e,n)=>r.set(e,n).catch(()=>Je({caches:t}).set(e,n)),delete:e=>r.delete(e).catch(()=>Je({caches:t}).delete(e)),clear:()=>r.clear().catch(()=>Je({caches:t}).clear())}}function Ke(e={serializable:!0}){let t={};return{get(r,n,o={miss:()=>Promise.resolve()}){const a=JSON.stringify(r);if(a in t)return Promise.resolve(e.serializable?JSON.parse(t[a]):t[a]);const c=n(),i=o&&o.miss||(()=>Promise.resolve());return c.then(e=>i(e)).then(()=>c)},set:(r,n)=>(t[JSON.stringify(r)]=e.serializable?JSON.stringify(n):n,Promise.resolve(n)),delete:e=>(delete t[JSON.stringify(e)],Promise.resolve()),clear:()=>(t={},Promise.resolve())}}function We(e){let t=e.length-1;for(;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function $e(e,t){return Object.keys(void 0!==t?t:{}).forEach(r=>{e[r]=t[r](e)}),e}function Qe(e,...t){let r=0;return e.replace(/%s/g,()=>encodeURIComponent(t[r++]))}const Ye="4.4.0",Ge={WithinQueryParameters:0,WithinHeaders:1};function Xe(e,t){const r=e||{},n=r.data||{};return Object.keys(r).forEach(e=>{-1===["timeout","headers","queryParameters","data","cacheable"].indexOf(e)&&(n[e]=r[e])}),{data:Object.entries(n).length>0?n:void 0,timeout:r.timeout||t,headers:r.headers||{},queryParameters:r.queryParameters||{},cacheable:r.cacheable}}const Ze={Read:1,Write:2,Any:3},et=1,tt=2,rt=3,nt=12e4;function ot(e,t=et){return{...e,status:t,lastUpdate:Date.now()}}function at(e){return{protocol:e.protocol||"https",url:e.url,accept:e.accept||Ze.Any}}const ct="GET",it="POST";function lt(e,t){return Promise.all(t.map(t=>e.get(t,()=>Promise.resolve(ot(t))))).then(e=>{const r=e.filter(e=>function(e){return e.status===et||Date.now()-e.lastUpdate>nt}(e)),n=e.filter(e=>function(e){return e.status===rt&&Date.now()-e.lastUpdate<=nt}(e)),o=[...r,...n];return{getTimeout:(e,t)=>(0===n.length&&0===e?1:n.length+3+e)*t,statelessHosts:o.length>0?o.map(e=>at(e)):t}})}function st(e,t,r,n){const o=[],a=function(e,t){if(e.method===ct||void 0===e.data&&void 0===t.data)return;const r=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(r)}(r,n),c=function(e,t){const r={...e.headers,...t.headers},n={};return Object.keys(r).forEach(e=>{const t=r[e];n[e.toLowerCase()]=t}),n}(e,n),i=r.method,l=r.method!==ct?{}:{...r.data,...n.data},s={"x-algolia-agent":e.userAgent.value,...e.queryParameters,...l,...n.queryParameters};let u=0;const f=(t,l)=>{const m=t.pop();if(void 0===m)throw{name:"RetryError",message:"Unreachable hosts - your application id may be incorrect. If the error persists, contact support@algolia.com.",transporterStackTrace:pt(o)};const p={data:a,headers:c,method:i,url:ft(m,r.path,s),connectTimeout:l(u,e.timeouts.connect),responseTimeout:l(u,n.timeout)},h=e=>{const r={request:p,response:e,host:m,triesLeft:t.length};return o.push(r),r},d={onSucess:e=>function(e){try{return JSON.parse(e.content)}catch(t){throw function(e,t){return{name:"DeserializationError",message:e,response:t}}(t.message,e)}}(e),onRetry(r){const n=h(r);return r.isTimedOut&&u++,Promise.all([e.logger.info("Retryable failure",ht(n)),e.hostsCache.set(m,ot(m,r.isTimedOut?rt:tt))]).then(()=>f(t,l))},onFail(e){throw h(e),function({content:e,status:t},r){let n=e;try{n=JSON.parse(e).message}catch(o){}return function(e,t,r){return{name:"ApiError",message:e,status:t,transporterStackTrace:r}}(n,t,r)}(e,pt(o))}};return e.requester.send(p).then(e=>((e,t)=>(e=>{const t=e.status;return e.isTimedOut||(({isTimedOut:e,status:t})=>!e&&0==~~t)(e)||2!=~~(t/100)&&4!=~~(t/100)})(e)?t.onRetry(e):(({status:e})=>2==~~(e/100))(e)?t.onSucess(e):t.onFail(e))(e,d))};return lt(e.hostsCache,t).then(e=>f([...e.statelessHosts].reverse(),e.getTimeout))}function ut(e){const t={value:`Algolia for JavaScript (${e})`,add(e){const r=`; ${e.segment}${void 0!==e.version?` (${e.version})`:""}`;return-1===t.value.indexOf(r)&&(t.value=`${t.value}${r}`),t}};return t}function ft(e,t,r){const n=mt(r);let o=`${e.protocol}://${e.url}/${"/"===t.charAt(0)?t.substr(1):t}`;return n.length&&(o+="?"+n),o}function mt(e){return Object.keys(e).map(t=>{return Qe("%s=%s",t,(r=e[t],"[object Object]"===Object.prototype.toString.call(r)||"[object Array]"===Object.prototype.toString.call(r)?JSON.stringify(e[t]):e[t]));var r}).join("&")}function pt(e){return e.map(e=>ht(e))}function ht(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}const dt=e=>{const t=e.appId,r=function(e,t,r){const n={"x-algolia-api-key":r,"x-algolia-application-id":t};return{headers:()=>e===Ge.WithinHeaders?n:{},queryParameters:()=>e===Ge.WithinQueryParameters?n:{}}}(void 0!==e.authMode?e.authMode:Ge.WithinHeaders,t,e.apiKey),n=function(e){const{hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,hosts:l,queryParameters:s,headers:u}=e,f={hostsCache:t,logger:r,requester:n,requestsCache:o,responsesCache:a,timeouts:c,userAgent:i,headers:u,queryParameters:s,hosts:l.map(e=>at(e)),read(e,t){const r=Xe(t,f.timeouts.read),n=()=>st(f,f.hosts.filter(e=>0!=(e.accept&Ze.Read)),e,r);if(!0!==(void 0!==r.cacheable?r.cacheable:e.cacheable))return n();const o={request:e,mappedRequestOptions:r,transporter:{queryParameters:f.queryParameters,headers:f.headers}};return f.responsesCache.get(o,()=>f.requestsCache.get(o,()=>f.requestsCache.set(o,n()).then(e=>Promise.all([f.requestsCache.delete(o),e]),e=>Promise.all([f.requestsCache.delete(o),Promise.reject(e)])).then(([e,t])=>t)),{miss:e=>f.responsesCache.set(o,e)})},write:(e,t)=>st(f,f.hosts.filter(e=>0!=(e.accept&Ze.Write)),e,Xe(t,f.timeouts.write))};return f}({hosts:[{url:t+"-dsn.algolia.net",accept:Ze.Read},{url:t+".algolia.net",accept:Ze.Write}].concat(We([{url:t+"-1.algolianet.com"},{url:t+"-2.algolianet.com"},{url:t+"-3.algolianet.com"}])),...e,headers:{...r.headers(),"content-type":"application/x-www-form-urlencoded",...e.headers},queryParameters:{...r.queryParameters(),...e.queryParameters}});return $e({transporter:n,appId:t,addAlgoliaAgent(e,t){n.userAgent.add({segment:e,version:t})},clearCache:()=>Promise.all([n.requestsCache.clear(),n.responsesCache.clear()]).then(()=>{})},e.methods)},vt=e=>(t,r={})=>$e({transporter:e.transporter,appId:e.appId,indexName:t},r.methods),yt=e=>(t,r)=>{const n=t.map(e=>({...e,params:mt(e.params||{})}));return e.transporter.read({method:it,path:"1/indexes/*/queries",data:{requests:n},cacheable:!0},r)},gt=e=>(t,r)=>Promise.all(t.map(t=>{const{facetName:n,facetQuery:o,...a}=t.params;return vt(e)(t.indexName,{methods:{searchForFacetValues:Ot}}).searchForFacetValues(n,o,{...r,...a})})),bt=e=>(t,r)=>e.transporter.read({method:it,path:Qe("1/indexes/%s/query",e.indexName),data:{query:t},cacheable:!0},r),Ot=e=>(t,r,n)=>e.transporter.read({method:it,path:Qe("1/indexes/%s/facets/%s/query",e.indexName,t),data:{facetQuery:r},cacheable:!0},n),St=1,Et=2,wt=3;function jt(e,t,r){const n={appId:e,apiKey:t,timeouts:{connect:1,read:2,write:30},requester:{send:e=>new Promise(t=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),Object.keys(e.headers).forEach(t=>r.setRequestHeader(t,e.headers[t]));const n=(e,n)=>setTimeout(()=>{r.abort(),t({status:0,content:n,isTimedOut:!0})},1e3*e),o=n(e.connectTimeout,"Connection timeout");let a;r.onreadystatechange=()=>{r.readyState>r.OPENED&&void 0===a&&(clearTimeout(o),a=n(e.responseTimeout,"Socket timeout"))},r.onerror=()=>{0===r.status&&(clearTimeout(o),clearTimeout(a),t({content:r.responseText||"Network request failed",status:r.status,isTimedOut:!1}))},r.onload=()=>{clearTimeout(o),clearTimeout(a),t({content:r.responseText,status:r.status,isTimedOut:!1})},r.send(e.data)})},logger:(o=wt,{debug:(e,t)=>(St>=o&&console.debug(e,t),Promise.resolve()),info:(e,t)=>(Et>=o&&console.info(e,t),Promise.resolve()),error:(e,t)=>(console.error(e,t),Promise.resolve())}),responsesCache:Ke(),requestsCache:Ke({serializable:!1}),hostsCache:Je({caches:[Be({key:"4.4.0-"+e}),Ke()]}),userAgent:ut(Ye).add({segment:"Browser",version:"lite"}),authMode:Ge.WithinQueryParameters};var o;return dt({...n,...r,methods:{search:yt,searchForFacetValues:gt,multipleQueries:yt,multipleSearchForFacetValues:gt,initIndex:e=>t=>vt(e)(t,{methods:{search:bt,searchForFacetValues:Ot}})}})}jt.version=Ye;var Pt=jt,It="3.0.0-alpha.32";function Dt(){}function Ct(e){return e}function Nt(e,t){return e.reduce((function(e,r){var n=t(r);return e.hasOwnProperty(n)||(e[n]=[]),e[n].length<5&&e[n].push(r),e}),{})}function kt(){return(kt=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r",highlightPostTag:"",hitsPerPage:20},i)}]}).catch((function(e){throw"RetryError"===e.name&&a("error"),e})).then((function(e){var t=e[0].hits,o=e[0].nbHits,a=Nt(t,(function(e){return e.hierarchy.lvl0}));return r.context.searchSuggestions.length0&&(z(),A.current&&A.current.focus())}),[R,z]),te.a.useEffect((function(){function e(){if(N.current){var e=.01*window.innerHeight;N.current.style.setProperty("--docsearch-vh","".concat(e,"px"))}}return e(),window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[]),te.a.createElement("div",kt({ref:C},V({"aria-expanded":!0}),{className:["DocSearch","DocSearch-Container","stalled"===I.status&&"DocSearch-Container--Stalled","error"===I.status&&"DocSearch-Container--Errored"].filter(Boolean).join(" "),onMouseDown:function(e){e.target===e.currentTarget&&s()}}),te.a.createElement("div",{className:"DocSearch-Modal",ref:N},te.a.createElement("header",{className:"DocSearch-SearchBar",ref:k},te.a.createElement(Fe,kt({},F,{state:I,autoFocus:0===R.length,onClose:s,inputRef:A,isFromSelection:Boolean(R)&&R===H}))),te.a.createElement("div",{className:"DocSearch-Dropdown",ref:x},te.a.createElement(Te,kt({},F,{indexName:o,state:I,hitComponent:p,resultsFooterComponent:d,disableUserPersonalization:E,recentSearches:M,favoriteSearches:_,onItemClick:function(e){L(e),s()},inputRef:A}))),te.a.createElement("footer",{className:"DocSearch-Footer"},te.a.createElement(ne,null))))}}}]); \ No newline at end of file diff --git a/docs/115.cb089b0d.js b/docs/119.dbe01748.js similarity index 69% rename from docs/115.cb089b0d.js rename to docs/119.dbe01748.js index 0f6657423e8..c0294425fdc 100644 --- a/docs/115.cb089b0d.js +++ b/docs/119.dbe01748.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[115],{272:function(n,i,o){"use strict";o.r(i);var r=o(64);for(var t in r)["default"].indexOf(t)<0&&function(n){o.d(i,n,(function(){return r[n]}))}(t)}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[119],{276:function(n,i,o){"use strict";o.r(i);var r=o(64);for(var t in r)["default"].indexOf(t)<0&&function(n){o.d(i,n,(function(){return r[n]}))}(t)}}]); \ No newline at end of file diff --git a/docs/116.e1ed1ad3.js b/docs/120.6991c191.js similarity index 80% rename from docs/116.e1ed1ad3.js rename to docs/120.6991c191.js index 5efe3e77e9d..2a6cc45bdcf 100644 --- a/docs/116.e1ed1ad3.js +++ b/docs/120.6991c191.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[116],{232:function(e,t,a){"use strict";a.r(t);var n=a(0),o=a.n(n),l=a(203);t.default=function(){return o.a.createElement(l.a,{title:"Page Not Found"},o.a.createElement("main",{className:"container margin-vert--xl"},o.a.createElement("div",{className:"row"},o.a.createElement("div",{className:"col col--6 col--offset-3"},o.a.createElement("h1",{className:"hero__title"},"Page Not Found"),o.a.createElement("p",null,"We could not find what you were looking for."),o.a.createElement("p",null,"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[120],{236:function(e,t,a){"use strict";a.r(t);var n=a(0),o=a.n(n),l=a(207);t.default=function(){return o.a.createElement(l.a,{title:"Page Not Found"},o.a.createElement("main",{className:"container margin-vert--xl"},o.a.createElement("div",{className:"row"},o.a.createElement("div",{className:"col col--6 col--offset-3"},o.a.createElement("h1",{className:"hero__title"},"Page Not Found"),o.a.createElement("p",null,"We could not find what you were looking for."),o.a.createElement("p",null,"Please contact the owner of the site that linked you to the original URL and let them know their link is broken.")))))}}}]); \ No newline at end of file diff --git a/docs/17256d0f.d2b9d03d.js b/docs/17256d0f.a4787a0b.js similarity index 98% rename from docs/17256d0f.d2b9d03d.js rename to docs/17256d0f.a4787a0b.js index fd1173c72a2..627119a6239 100644 --- a/docs/17256d0f.d2b9d03d.js +++ b/docs/17256d0f.a4787a0b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return r}));var a=n(21),i=n(191);function l(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:l=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const r=n.startsWith(t)?n:t+n.replace(/^\//,"");return l?e+r:r}(t,e,n,a)}}function r(e,t={}){const{withBaseUrl:n}=l();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var a=n(0),i=n.n(a);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var o=i.a.createContext({}),p=function(e){var t=i.a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=p(e.components);return i.a.createElement(o.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,r=e.parentName,o=c(e,["components","mdxType","originalType","parentName"]),s=p(n),m=a,u=s["".concat(r,".").concat(m)]||s[m]||d[m]||l;return n?i.a.createElement(u,b(b({ref:t},o),{},{components:n})):i.a.createElement(u,b({ref:t},o))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,r=new Array(l);r[0]=m;var b={};for(var c in t)hasOwnProperty.call(t,c)&&(b[c]=t[c]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var o=2;ot(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,t,n){"use strict";function a(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tt.value===e)&&N(e)}const v=e=>{N(e),null!=d&&O(d,e)},h=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(r.a)("tabs",{"tabs--block":n},m)},s.map(({value:e,label:t})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(r.a)("tabs__item",c.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,t,n)=>{switch(n.keyCode){case p:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case o:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(h,e.target,e)},onFocus:()=>v(e),onClick:()=>{v(e)}},t))),t?Object(a.cloneElement)(g.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,t)=>Object(a.cloneElement)(e,{key:t,hidden:e.props.value!==j}))))}},200:function(e,t,n){"use strict";var a=n(3),i=n(0),l=n.n(i);t.a=function({children:e,hidden:t,className:n}){return l.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:t,className:n}),e)}},78:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return p})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return d})),n.d(t,"default",(function(){return u}));var a=n(3),i=n(7),l=(n(0),n(192)),r=n(190),b=n(199),c=n(200),o=n(193),p={id:"data-validation",title:"8. \u6570\u636e\u6821\u9a8c",sidebar_label:"8. \u6570\u636e\u6821\u9a8c"},s={unversionedId:"data-validation",id:"data-validation",isDocsHomePage:!1,title:"8. \u6570\u636e\u6821\u9a8c",description:"8.1 \u5173\u4e8e\u6570\u636e\u6821\u9a8c",source:"@site/docs\\data-validation.mdx",slug:"/data-validation",permalink:"/docs/data-validation",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/data-validation.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"8. \u6570\u636e\u6821\u9a8c",sidebar:"docs",previous:{title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",permalink:"/docs/friendly-exception"},next:{title:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",permalink:"/docs/dbcontext"}},d=[{value:"8.1 \u5173\u4e8e\u6570\u636e\u6821\u9a8c",id:"81-\u5173\u4e8e\u6570\u636e\u6821\u9a8c",children:[]},{value:"8.2 \u6570\u636e\u6821\u9a8c\u7684\u597d\u5904",id:"82-\u6570\u636e\u6821\u9a8c\u7684\u597d\u5904",children:[]},{value:"8.3 \u6570\u636e\u6821\u9a8c\u65b9\u5f0f",id:"83-\u6570\u636e\u6821\u9a8c\u65b9\u5f0f",children:[{value:"8.3.1 \u4f20\u7edf\u65b9\u5f0f",id:"831-\u4f20\u7edf\u65b9\u5f0f",children:[]},{value:"8.3.2 Mvc \u7279\u6027\u65b9\u5f0f",id:"832-mvc-\u7279\u6027\u65b9\u5f0f",children:[]}]},{value:"8.4 DataValidation \u9a8c\u8bc1 \ud83e\udd17",id:"84-datavalidation-\u9a8c\u8bc1-",children:[{value:"8.4.1 DataValidation \u4f18\u70b9",id:"841-datavalidation-\u4f18\u70b9",children:[]}]},{value:"8.5 DataValidation \u4f7f\u7528",id:"85-datavalidation-\u4f7f\u7528",children:[{value:"8.5.1 \u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1",id:"851-\u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1",children:[]},{value:"8.5.2 \u517c\u5bb9 Mvc \u7279\u6027\u9a8c\u8bc1",id:"852-\u517c\u5bb9-mvc-\u7279\u6027\u9a8c\u8bc1",children:[]},{value:"8.5.3 \u517c\u5bb9 Mvc \u590d\u6742\u9a8c\u8bc1",id:"853-\u517c\u5bb9-mvc-\u590d\u6742\u9a8c\u8bc1",children:[]}]},{value:"8.6 \u624b\u52a8\u9a8c\u8bc1",id:"86-\u624b\u52a8\u9a8c\u8bc1",children:[{value:"8.6.1 \u9a8c\u8bc1\u6a21\u578b",id:"861-\u9a8c\u8bc1\u6a21\u578b",children:[]},{value:"8.6.2 TryValidate \u548c Validate",id:"862-tryvalidate-\u548c-validate",children:[]},{value:"8.6.3 ValidationTypes \u5e38\u89c1\u9a8c\u8bc1",id:"863-validationtypes-\u5e38\u89c1\u9a8c\u8bc1",children:[]},{value:"8.6.4 [DataValidation] \u7279\u6027",id:"864-datavalidation-\u7279\u6027",children:[]}]},{value:"8.7 [NonValidation] \u8df3\u8fc7\u9a8c\u8bc1",id:"87-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1",children:[]},{value:"8.8 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c",id:"88-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c",children:[{value:"8.8.1 \u81ea\u5b9a\u4e49 ValidationTypes \u7c7b\u578b",id:"881-\u81ea\u5b9a\u4e49-validationtypes-\u7c7b\u578b",children:[]},{value:"8.8.2 \u81ea\u5b9a\u4e49 ValidationTypes \u5931\u8d25\u6d88\u606f",id:"882-\u81ea\u5b9a\u4e49-validationtypes-\u5931\u8d25\u6d88\u606f",children:[]}]},{value:"8.9 \u6a21\u578b\u9a8c\u8bc1\u8303\u56f4",id:"89-\u6a21\u578b\u9a8c\u8bc1\u8303\u56f4",children:[{value:"8.9.1 \u5168\u5c40\u9a8c\u8bc1",id:"891-\u5168\u5c40\u9a8c\u8bc1",children:[]},{value:"8.9.2 [NonValidation] \u8df3\u8fc7\u9a8c\u8bc1",id:"892-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1",children:[]},{value:"8.9.3 [TypeFilter(typeof(DataValidationFilter))] \u5c40\u90e8\u9a8c\u8bc1",id:"893-typefiltertypeofdatavalidationfilter-\u5c40\u90e8\u9a8c\u8bc1",children:[]},{value:"8.9.4 [ApiController] \u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1",id:"894-apicontroller-\u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1",children:[]}]},{value:"8.10 MiniProfiler \u67e5\u770b",id:"810-miniprofiler-\u67e5\u770b",children:[]},{value:"8.11 \u591a\u8bed\u8a00\u652f\u6301",id:"811-\u591a\u8bed\u8a00\u652f\u6301",children:[]},{value:"8.12 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"812-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:d};function u(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(l.b)("wrapper",Object(a.a)({},m,n,{components:t,mdxType:"MDXLayout"}),Object(l.b)(o.a,{mdxType:"JoinGroup"}),Object(l.b)("h2",{id:"81-\u5173\u4e8e\u6570\u636e\u6821\u9a8c"},"8.1 \u5173\u4e8e\u6570\u636e\u6821\u9a8c"),Object(l.b)("p",null,"\u6570\u636e\u6821\u9a8c\u5b57\u9762\u4e0a\u7684\u610f\u601d\u5c31\u662f\u5bf9\u4f7f\u7528\u8005\u63d0\u4ea4\u8fc7\u6765\u7684\u6570\u636e\u8fdb\u884c\u5408\u6cd5\u6027\u9a8c\u8bc1\u3002\u5728\u4e00\u5957\u5b8c\u5584\u7684\u5e94\u7528\u7cfb\u7edf\u4e2d\uff0c\u6570\u636e\u6709\u6548\u6027\u6821\u9a8c\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e1a\u52a1\u5904\u7406\u7b2c\u4e00\u9053\u5173\u5361\u3002"),Object(l.b)("h2",{id:"82-\u6570\u636e\u6821\u9a8c\u7684\u597d\u5904"},"8.2 \u6570\u636e\u6821\u9a8c\u7684\u597d\u5904"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u8fc7\u6ee4\u4e0d\u5b89\u5168\u6570\u636e\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u5b89\u5168\u6027"),Object(l.b)("li",{parentName:"ul"},"\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u4e1a\u52a1\u5f02\u5e38\u5904\u7406\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u54cd\u5e94\u901f\u5ea6"),Object(l.b)("li",{parentName:"ul"},"\u5927\u5927\u63d0\u9ad8\u7cfb\u7edf\u7a33\u5b9a\u6027"),Object(l.b)("li",{parentName:"ul"},"\u5927\u6570\u636e\u5e76\u53d1\u65f6\u8d77\u7740\u4e00\u5b9a\u7684\u7f13\u51b2\u4f5c\u7528")),Object(l.b)("h2",{id:"83-\u6570\u636e\u6821\u9a8c\u65b9\u5f0f"},"8.3 \u6570\u636e\u6821\u9a8c\u65b9\u5f0f"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u4f20\u7edf\u65b9\u5f0f\uff0c\u5728\u4e1a\u52a1\u4ee3\u7801\u4e4b\u524d\u624b\u52a8\u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Mvc")," \u7279\u6027\u65b9\u5f0f\uff0c",Object(l.b)("inlineCode",{parentName:"li"},"Mvc")," \u5185\u7f6e\u7684 ",Object(l.b)("inlineCode",{parentName:"li"},"DataAnnotations")," \u65b9\u5f0f"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u63a8\u8350\u65b9\u5f0f"),"\uff0c",Object(l.b)("inlineCode",{parentName:"li"},"Furion")," \u6846\u67b6\u5185\u7f6e\u7684 ",Object(l.b)("inlineCode",{parentName:"li"},"DataValidation")," \u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},"\u5176\u4ed6\u65b9\u5f0f\uff0c\u4f7f\u7528\u7b2c\u4e09\u65b9\u9a8c\u8bc1\u5e93\uff0c\u5982 ",Object(l.b)("inlineCode",{parentName:"li"},"FluentValidation"))),Object(l.b)("h3",{id:"831-\u4f20\u7edf\u65b9\u5f0f"},"8.3.1 \u4f20\u7edf\u65b9\u5f0f"),Object(l.b)("p",null,"\u5728\u5f88\u591a\u8001\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u770b\u5230\u8fd9\u6837\u7684\u4ee3\u7801\uff1a"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,9,14}","{4,9,14}":!0}),'public bool Insert(Person person)\n{\n // \u9a8c\u8bc1\u53c2\u6570\n if(string.IsNullOrEmty(person.Name))\n {\n throw new System.Exception("\u540d\u5b57\u4e0d\u80fd\u4e3a\u7a7a");\n }\n\n if(person.Age < 18)\n {\n throw new System.Exception("\u5e74\u9f84\u4e0d\u80fd\u5c0f\u4e8e 18 \u5c81");\n }\n\n if(!person.Password.Equals(person.ConfirmPassword)\n {\n throw new System.Exception("\u4e24\u6b21\u5bc6\u7801\u4e0d\u4e00\u81f4");\n }\n\n // \u4e1a\u52a1\u4ee3\u7801\n _repository.Insert(person.Adapt());\n\n // ...\n}\n')),Object(l.b)("p",null,"\u4ece\u4e0a\u9762\u7684\u4ee3\u7801\u770b\u8d77\u6765\uff0c\u4f3c\u4e4e\u6ca1\u6709\u4ec0\u4e48\u4e0d\u59a5\uff0c\u4f46\u662f\u4ece\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u7ef4\u62a4\u6027\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u4e2a\u7cdf\u7cd5\u7684\u4ee3\u7801\uff0c\u56e0\u4e3a\u8be5\u4e1a\u52a1\u4ee3\u7801\u4e2d",Object(l.b)("strong",{parentName:"p"},"\u5305\u542b\u4e86\u592a\u591a\u4e0e\u4e1a\u52a1\u65e0\u5173\u7684\u6570\u636e\u9a8c\u8bc1"),"\u3002"),Object(l.b)("p",null,"\u8bd5\u60f3\u4e00\u4e0b\uff0c\u5982\u679c\u8fd9\u4e2a ",Object(l.b)("inlineCode",{parentName:"p"},"Person")," \u6709 \u51e0\u5341\u4e2a\u53c2\u6570\u90fd\u9700\u8981\u9a8c\u8bc1\u5462\uff1f\u53ef\u60f3\u800c\u77e5\uff0c\u8fd9\u662f\u4e00\u4e2a\u5e9e\u5927\u7684\u4e1a\u52a1\u4ee3\u7801\u3002"),Object(l.b)("p",null,"\u518d\u8005\uff0c\u5982\u679c\u5176\u4ed6\u5730\u65b9\u4e5f\u9700\u8981\u7528\u5230\u8fd9\u4e2a ",Object(l.b)("inlineCode",{parentName:"p"},"Person")," \u7c7b\u9a8c\u8bc1\u5462\uff1f\u90a3\u4ee3\u7801\u597d\u6bd4\u8001\u9f20\u5543\u8fc7\u7684\u9762\u5305\u5c51\u4e00\u6837\uff0c\u5230\u5904\u90fd\u662f\u3002"),Object(l.b)("p",null,"\u5982\u6b64\u5f97\u77e5\uff0c\u8fd9\u6837\u7684\u65b9\u5f0f\u662f\u6781\u5176\u4e0d\u63a8\u8350\u7684\uff0c",Object(l.b)("strong",{parentName:"p"},"\u4e0d\u4f46\u6c61\u67d3\u4e86\u4e1a\u52a1\u4ee3\u7801\uff0c\u4e5f\u7834\u574f\u4e86\u4e1a\u52a1\u804c\u8d23\u5355\u4e00\u6027\u539f\u7406\uff0c\u4e5f\u8ba9\u9a8c\u8bc1\u903b\u8f91\u65e0\u6cd5\u5b9e\u73b0\u901a\u7528\uff0c\u540e\u7eed\u7ef4\u62a4\u96be\u5ea6\u5927\u5927\u5347\u7ea7"),"\u3002"),Object(l.b)("h3",{id:"832-mvc-\u7279\u6027\u65b9\u5f0f"},"8.3.2 ",Object(l.b)("inlineCode",{parentName:"h3"},"Mvc")," \u7279\u6027\u65b9\u5f0f"),Object(l.b)("p",null,"\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u5fae\u8f6f\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u5168\u65b0\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"\u7279\u6027")," \u9a8c\u8bc1\u65b9\u5f0f\uff0c\u53ef\u901a\u8fc7\u5bf9\u5bf9\u8c61\u8d34\u7279\u6027\u5b9e\u73b0\u6570\u636e\u9a8c\u8bc1\u3002\u8fd9\u79cd\u65b9\u5f0f\u6709\u6548\u7684\u5c06\u6570\u636e\u6821\u9a8c\u548c\u4e1a\u52a1\u4ee3\u7801\u5265\u79bb\u5f00\u6765\uff0c\u800c\u4e14\u5bb9\u6613\u4f7f\u7528\u548c\u62d3\u5c55\u3002"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5728\u6a21\u578b\u4e2d\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,7-8,11-12}","{1,7-8,11-12}":!0}),"using System.ComponentModel.DataAnnotations;\n\nnamespace Hoa.Application.Authorization.Dtos\n{\n public class SignInInput\n {\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MinLength(4)] // \u6700\u5c0f\u957f\u5ea6\u9a8c\u8bc1\n public string Account { get; set; }\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MaxLength(32)] // \u6700\u5927\u957f\u5ea6\u9a8c\u8bc1\n public string Password { get; set; }\n }\n}\n")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5728\u53c2\u6570\u4e2d\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2-3,8-9,12-13}","{2-3,8-9,12-13}":!0}),'public void CheckMethodParameterValid(\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MinLength(4)] // \u6700\u5c0f\u957f\u5ea6\u9a8c\u8bc1\n string name,\n\n int age,\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [RegularExpression("[a-zA-Z0-9_]{8,30}") // \u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\n string password,\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [RegularExpression("[a-zA-Z0-9_]{8,30}") // \u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\n string confirmPassword\n)\n{\n // TODO\n}\n')),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u9192")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u5982\u679c\u51fd\u6570\u7684\u53c2\u6570\u5927\u4e8e\u6216\u7b49\u4e8e 3 \u4e2a\uff0c\u5efa\u8bae\u62bd\u79bb\u51fa\u6a21\u578b\u7c7b\uff0c\u4e5f\u5c31\u662f\u4e0d\u5efa\u8bae\u4e0a\u9762\u7684\u65b9\u5f0f\u3002"))),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u81ea\u5b9a\u4e49\u7279\u6027\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,13-24}","{1,13-24}":!0}),'public class ClassicMovieAttribute : ValidationAttribute\n{\n public ClassicMovieAttribute(int year)\n {\n Year = year;\n }\n\n public int Year { get; }\n\n public string GetErrorMessage() =>\n $"Classic movies must have a release year no later than {Year}.";\n\n protected override ValidationResult IsValid(object value, ValidationContext validationContext)\n {\n var movie = (Movie)validationContext.ObjectInstance;\n var releaseYear = ((DateTime)value).Year;\n\n if (movie.Genre == Genre.Classic && releaseYear > Year)\n {\n return new ValidationResult(GetErrorMessage());\n }\n\n return ValidationResult.Success;\n }\n}\n')),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},Object(l.b)("inlineCode",{parentName:"strong"},"IValidatableObject")," \u590d\u6742\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3,10-19}","{1,3,10-19}":!0}),'using System.Collections.Generic;\n\npublic class DtoModel : IValidatableObject\n{\n [Required]\n [StringLength(100)]\n public string Title { get; set; }\n\n // \u4f60\u7684\u9a8c\u8bc1\u903b\u8f91\n public IEnumerable Validate(ValidationContext validationContext)\n {\n if (\u4f60\u7684\u903b\u8f91\u4ee3\u7801)\n {\n yield return new ValidationResult(\n "\u9519\u8bef\u6d88\u606f"\n ,new[] { nameof(Title) } // \u9a8c\u8bc1\u5931\u8d25\u7684\u5c5e\u6027\n );\n }\n }\n}\n')),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u7279\u6027\u65b9\u5f0f\u6781\u5927\u7684\u5c06\u4e1a\u52a1\u903b\u8f91\u548c\u9a8c\u8bc1\u8fdb\u884c\u4e86\u5265\u79bb\u548c\u89e3\u8026\uff0c\u800c\u4e14\u8fd8\u80fd\u5b9e\u73b0\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1\u3002"),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u4f46\u662f ",Object(l.b)("inlineCode",{parentName:"strong"},"Mvc")," \u7279\u6027\u9a8c\u8bc1\u65b9\u5f0f\u6709\u51e0\u4e2a\u660e\u663e\u7684\u7f3a\u70b9"),"\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u53ea\u80fd\u5728 ",Object(l.b)("inlineCode",{parentName:"li"},"\u63a7\u5236\u5668")," \u4e2d\u7684 ",Object(l.b)("inlineCode",{parentName:"li"},"Action"),"\uff08\u52a8\u4f5c\u65b9\u6cd5\uff09\u4e2d\u4f7f\u7528"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u65e0\u6cd5\u5728\u4efb\u610f\u7c7b\u3001\u4efb\u610f\u65b9\u6cd5\u4e2d\u4f7f\u7528")),Object(l.b)("li",{parentName:"ul"},"\u5185\u7f6e\u7684\u9a8c\u8bc1\u7c7b\u578b\u975e\u5e38\u6709\u9650\uff0c\u4e14\u4e0d\u6613\u62d3\u5c55"),Object(l.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u9a8c\u8bc1\u6d88\u606f\u540e\u671f\u914d\u7f6e")),Object(l.b)("p",null,"\u6240\u4ee5\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u65b0\u7684\u9a8c\u8bc1\u5f15\u64ce ",Object(l.b)("inlineCode",{parentName:"p"},"DataValidation"),"\uff0c\u5728\u5b8c\u5168\u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u5185\u7f6e\u9a8c\u8bc1\u7684\u540c\u65f6\u63d0\u4f9b\u4e86\u5927\u91cf\u5e38\u89c1\u9a8c\u8bc1\u3001\u590d\u6742\u9a8c\u8bc1\u3001\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7b49\u80fd\u529b\u3002"),Object(l.b)("h2",{id:"84-datavalidation-\u9a8c\u8bc1-"},"8.4 ",Object(l.b)("inlineCode",{parentName:"h2"},"DataValidation")," \u9a8c\u8bc1 \ud83e\udd17"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"DataValidation")," \u662f ",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5168\u65b0\u7684\u9a8c\u8bc1\u65b9\u5f0f\uff0c\u5b8c\u5168\u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u5185\u7f6e\u9a8c\u8bc1\uff0c\u5e76\u4e14\u8d4b\u4e88\u4e86\u8d85\u80fd\u3002"),Object(l.b)("h3",{id:"841-datavalidation-\u4f18\u70b9"},"8.4.1 ",Object(l.b)("inlineCode",{parentName:"h3"},"DataValidation")," \u4f18\u70b9"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5b8c\u5168\u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"strong"},"Mvc")," \u5185\u7f6e\u9a8c\u8bc1\u5f15\u64ce")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5185\u7f6e\u5e38\u89c1\u9a8c\u8bc1\u7c7b\u578b\u53ca\u53ef\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\u578b\u529f\u80fd")),Object(l.b)("li",{parentName:"ul"},"\u63d0\u4f9b\u5168\u5c40\u5bf9\u8c61\u62d3\u5c55\u9a8c\u8bc1\u65b9\u5f0f"),Object(l.b)("li",{parentName:"ul"},"\u652f\u6301\u9a8c\u8bc1\u6d88\u606f\u540e\u671f\u914d\u7f6e\uff0c\u652f\u6301\u5b9e\u65f6\u66f4\u65b0"),Object(l.b)("li",{parentName:"ul"},"\u652f\u6301\u5728\u4efb\u4f55\u7c7b\uff0c\u4efb\u4f55\u65b9\u6cd5\u3001\u4efb\u4f55\u4f4d\u7f6e\u5b9e\u73b0\u624b\u52a8\u9a8c\u8bc1\u3001\u7279\u6027\u65b9\u5f0f\u9a8c\u8bc1\u7b49"),Object(l.b)("li",{parentName:"ul"},"\u652f\u6301\u8bbe\u7f6e\u9a8c\u8bc1\u7ed3\u679c\u6a21\u578b")),Object(l.b)("h2",{id:"85-datavalidation-\u4f7f\u7528"},"8.5 ",Object(l.b)("inlineCode",{parentName:"h2"},"DataValidation")," \u4f7f\u7528"),Object(l.b)("div",{className:"admonition admonition-important alert alert--info"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u9ed8\u8ba4\u5df2\u7ecf\u7ee7\u627f\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002\u4e5f\u5c31\u662f ",Object(l.b)("inlineCode",{parentName:"p"},"8.5.1")," \u7ae0\u8282\u53ef\u4e0d\u914d\u7f6e\u3002"))),Object(l.b)("h3",{id:"851-\u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1"},"8.5.1 \u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddDataValidation();\n }\n }\n}\n")),Object(l.b)("div",{className:"admonition admonition-important alert alert--info"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u9700\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u540e\u6ce8\u518c\u3002"))),Object(l.b)("h3",{id:"852-\u517c\u5bb9-mvc-\u7279\u6027\u9a8c\u8bc1"},"8.5.2 \u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"h3"},"Mvc")," \u7279\u6027\u9a8c\u8bc1"),Object(l.b)(b.a,{defaultValue:"testdto",values:[{label:"TestDto",value:"testdto"},{label:"FurAppService",value:"furAppService"}],mdxType:"Tabs"},Object(l.b)(c.a,{value:"testdto",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,7,10}","{1,7,10}":!0}),'using System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class TestDto\n {\n [Range(10, 20, ErrorMessage = "Id \u53ea\u80fd\u5728 10-20 \u533a\u95f4\u53d6\u503c")]\n public int Id { get; set; }\n\n [Required(ErrorMessage = "\u5fc5\u586b"), MinLength(3, ErrorMessage = "\u5b57\u7b26\u4e32\u957f\u5ea6\u4e0d\u80fd\u5c11\u4e8e3\u4f4d")]\n public string Name { get; set; }\n }\n}\n'))),Object(l.b)(c.a,{value:"furAppService",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12,22}","{12,22}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n /// \n /// \u503c\u7c7b\u578b\u9a8c\u8bc1\n /// \n /// \n /// \n public int Get(int id)\n {\n return id;\n }\n\n /// \n /// \u5bf9\u8c61\u7c7b\u578b\u9a8c\u8bc1\n /// \n /// \n /// \n public TestDto Post(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n')))),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz1.gif")}),Object(l.b)("h3",{id:"853-\u517c\u5bb9-mvc-\u590d\u6742\u9a8c\u8bc1"},"8.5.3 \u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"h3"},"Mvc")," \u590d\u6742\u9a8c\u8bc1"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6,14-22}","{2,6,14-22}":!0}),'using System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class TestDto : IValidatableObject\n {\n [Range(10, 20, ErrorMessage = "Id \u53ea\u80fd\u5728 10-20 \u533a\u95f4\u53d6\u503c")]\n public int Id { get; set; }\n\n [Required(ErrorMessage = "\u5fc5\u586b"), MinLength(3, ErrorMessage = "\u5b57\u7b26\u4e32\u957f\u5ea6\u4e0d\u80fd\u5c11\u4e8e3\u4f4d")]\n public string Name { get; set; }\n\n public IEnumerable Validate(ValidationContext validationContext)\n {\n if (Name.StartsWith("Furion"))\n {\n yield return new ValidationResult(\n "\u4e0d\u80fd\u4ee5 Furion \u5f00\u5934"\n , new[] { nameof(Name) }\n );\n }\n }\n }\n}\n')),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz2.gif")}),Object(l.b)("h2",{id:"86-\u624b\u52a8\u9a8c\u8bc1"},"8.6 \u624b\u52a8\u9a8c\u8bc1"),Object(l.b)("h3",{id:"861-\u9a8c\u8bc1\u6a21\u578b"},"8.6.1 \u9a8c\u8bc1\u6a21\u578b"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,11}","{1,11}":!0}),"using Furion.DataValidation;\nusing Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [NonValidation] // \u8df3\u8fc7\u5168\u5c40\u9a8c\u8bc1\n public DataValidationResult Post(TestDto testDto)\n {\n return testDto.TryValidate();\n }\n }\n}\n")),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz3.gif")}),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u652f\u6301 ",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"Mvc"))," \u5185\u7f6e\u7684\u7279\u6027\u9a8c\u8bc1\u3001\u5c5e\u6027\u9a8c\u8bc1\u53ca\u590d\u6742\u7684 ",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"IValidatableObject"))," \u9a8c\u8bc1\u3002"))),Object(l.b)("h3",{id:"862-tryvalidate-\u548c-validate"},"8.6.2 ",Object(l.b)("inlineCode",{parentName:"h3"},"TryValidate")," \u548c ",Object(l.b)("inlineCode",{parentName:"h3"},"Validate")),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"TryValidate()")," \u548c ",Object(l.b)("inlineCode",{parentName:"p"},"Validate()")," \u4e24\u4e2a\u9a8c\u8bc1\u62d3\u5c55\u65b9\u6cd5\uff0c\u552f\u4e00\u7684\u533a\u522b\u5c31\u662f\u540e\u8005\u9a8c\u8bc1\u5931\u8d25\u5c06\u81ea\u52a8\u629b\u51fa\u5f02\u5e38\u6d88\u606f\u3002"),Object(l.b)("h3",{id:"863-validationtypes-\u5e38\u89c1\u9a8c\u8bc1"},"8.6.3 ",Object(l.b)("inlineCode",{parentName:"h3"},"ValidationTypes")," \u5e38\u89c1\u9a8c\u8bc1"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u5185\u7f6e\u4e86\u5f88\u591a\u5e38\u7528\u7c7b\u578b\u7684\u6570\u636e\u9a8c\u8bc1\uff0c\u5305\u62ec\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Required"),"\uff1a\u975e\u7a7a\u3001\u975e Null \u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Numeric"),"\uff1a\u6570\u503c\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PositiveNumber"),"\uff1a\u6b63\u6570\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"NegativeNumber"),"\uff1a\u8d1f\u6570\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Integer"),"\uff1a\u6574\u6570\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Money"),"\uff1a\u91d1\u94b1\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Date"),"\uff1a\u65e5\u671f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Time"),"\uff1a\u65f6\u95f4\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IDCard"),"\uff1a\u8eab\u4efd\u8bc1\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PostCode"),"\uff1a\u90ae\u7f16\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneNumber"),"\uff1a\u624b\u673a\u53f7\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Telephone"),"\uff1a\u56fa\u8bdd\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneOrTelNumber"),"\uff1a\u624b\u673a\u6216\u56fa\u8bdd\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EmailAddress"),"\uff1a\u90ae\u4ef6\u5730\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Url"),"\uff1a\u7f51\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Color"),"\uff1a\u989c\u8272\u503c\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Chinese"),"\uff1a\u4e2d\u6587\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv4"),"\uff1aIPv4 \u5730\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv6"),"\uff1aIPv6 \u5730\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Age"),"\uff1a\u5e74\u9f84\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"ChineseName"),"\uff1a\u4e2d\u6587\u540d\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EnglishName"),"\uff1a\u82f1\u6587\u540d\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Capital"),"\uff1a\u7eaf\u5927\u5199\u82f1\u6587\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Lowercase"),"\uff1a\u7eaf\u5c0f\u5199\u82f1\u6587\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Ascii"),"\uff1aAscii \u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Md5"),"\uff1aMd5 \u5b57\u7b26\u4e32\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Zip"),"\uff1a\u538b\u7f29\u5305\u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Image"),"\uff1a\u56fe\u7247\u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Document"),"\uff1a\u6587\u6863\u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"MP3"),"\uff1aMp3 \u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Flash"),"\uff1aFlash \u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Video"),"\uff1a\u89c6\u9891\u6587\u4ef6\u683c\u5f0f\u7c7b\u578b")),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u4f7f\u7528\u793a\u4f8b")),Object(l.b)(b.a,{defaultValue:"dglx",values:[{label:"\u5355\u4e2a\u7c7b\u578b\u9a8c\u8bc1",value:"dglx"},{label:"\u591a\u4e2a\u7ec4\u5408\u7c7b\u578b\u9a8c\u8bc1",value:"zhlx"}],mdxType:"Tabs"},Object(l.b)(c.a,{value:"dglx",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u9a8c\u8bc1\u5fc5\u586b\n"".TryValidate(ValidationTypes.Required); // => false\n\n// \u9a8c\u8bc1\u4e2d\u6587\n"\u6211\u53eb MonK".TryValidate(ValidationTypes.Chinese); // => false\n\n// \u9a8c\u8bc1\u6570\u503c\n2.TryValidate(ValidationTypes.Numeric); // => true\n\n// \u9a8c\u8bc1\u6574\u6570\ntrue.TryValidate(ValidationTypes.Integer); // => false\n\n// \u9a8c\u8bc1\u90ae\u7bb1\n"monksoul@outlook.com".TryValidate(ValidationTypes.EmailAddress); // => true\n\n// \u9a8c\u8bc1\u8d1f\u6570\n2.0m.TryValidate(ValidationTypes.NegativeNumber); // => false\n\n// \u81ea\u5b9a\u4e49\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\n"Furion".TryValidate("/^Furion$"); // => true\n'))),Object(l.b)(c.a,{value:"zhlx",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u9a8c\u8bc1\u6570\u503c\u7c7b\u578b\u4e14\u662f\u6574\u6570\n"20".TryValidate(ValidationTypes.Numeric, ValidationTypes.Integer); // => true\n\n// \u9a8c\u8bc1\u65f6\u65e5\u671f\u6216\u65f6\u95f4\u683c\u5f0f\n"2020-05-20".TryValidate(ValidationOptions.AtLeastOne, ValidationTypes.Date, ValidationTypes.Time); // => true\n"23:45:20".TryValidate(ValidationOptions.AtLeastOne, ValidationTypes.Date, ValidationTypes.Time); // => true\n\n')))),Object(l.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u53ef\u901a\u8fc7\u8bbe\u7f6e ",Object(l.b)("inlineCode",{parentName:"p"},"TryValidate([ValidationOptions], params object[] validationTypes)")," \u65b9\u6cd5\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"ValidationOptions")," \u53c2\u6570\u914d\u7f6e\u9a8c\u8bc1\u903b\u8f91\uff0c\u5982\uff1a",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"\u540c\u65f6\u6210\u7acb"))," \u6216 ",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"\u53ea\u8981\u4e00\u4e2a\u6210\u7acb"))," \u5373\u53ef\u9a8c\u8bc1\u901a\u8fc7"))),Object(l.b)("h3",{id:"864-datavalidation-\u7279\u6027"},"8.6.4 ",Object(l.b)("inlineCode",{parentName:"h3"},"[DataValidation]")," \u7279\u6027"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u8fd8\u63d0\u4f9b\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"[DataValidation]")," \u7279\u6027\u65b9\u4fbf\u5728\u6a21\u578b\u53c2\u6570\u4e2d\u4f7f\u7528 ",Object(l.b)("inlineCode",{parentName:"p"},"ValidationTypes")," \u5e38\u89c1\u9a8c\u8bc1\u6216\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u3002"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,7,10,14,17,20}","{1,7,10,14,17,20}":!0}),'using Furion.DataValidation;\n\nnamespace Furion.Application\n{\n public class TestDto\n {\n [DataValidation(ValidationTypes.Integer)]\n public int Id { get; set; }\n\n [DataValidation(ValidationTypes.Numeric, ValidationTypes.Integer)]\n public int Cost { get; set; }\n\n [DataValidation(ValidationOptions.AtLeastOne, ValidationTypes.Chinese, ValidationTypes.Date)]\n public string Name { get; set; }\n\n // \u53ef\u4ee5\u548cMvc\u7279\u6027\u5171\u5b58\n [Required, DataValidation(ValidationTypes.Age)]\n public int Age { get; set; }\n\n [DataValidation(ValidationTypes.IDCard, ErrorMessage = "\u81ea\u5b9a\u4e49\u8eab\u4efd\u8bc1\u63d0\u793a\u6d88\u606f")]\n public string IDCard { get; set; }\n }\n}\n')),Object(l.b)("h2",{id:"87-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1"},"8.7 ",Object(l.b)("inlineCode",{parentName:"h2"},"[NonValidation]")," \u8df3\u8fc7\u9a8c\u8bc1"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5bf9\u8c61\u6a21\u578b\u8df3\u8fc7\u9a8c\u8bc1\u7279\u6027 ",Object(l.b)("inlineCode",{parentName:"p"},"[NonValidation]"),"\uff0c\u652f\u6301\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u5668"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u52a8\u4f5c\u65b9\u6cd5"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u7c7b")," \u4e2d\u4f7f\u7528\u3002"),Object(l.b)("p",null,"\u4e00\u65e6\u8d34\u4e86\u6b64\u7279\u6027\uff0c\u90a3\u4e48\u5c06\u4e0d\u4f1a\u6267\u884c\u9a8c\u8bc1\u64cd\u4f5c\u3002"),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"[NonValidation]"))," \u53ea\u5bf9\u5bf9\u8c61\u7c7b\u578b\u6709\u6548\uff0c\u503c\u7c7b\u578b\u65e0\u6548\u3002"))),Object(l.b)("h2",{id:"88-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c"},"8.8 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c"),Object(l.b)("h3",{id:"881-\u81ea\u5b9a\u4e49-validationtypes-\u7c7b\u578b"},"8.8.1 \u81ea\u5b9a\u4e49 ",Object(l.b)("inlineCode",{parentName:"h3"},"ValidationTypes")," \u7c7b\u578b"),Object(l.b)("p",null,"\u9664\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u5185\u7f6e\u7684\u9a8c\u8bc1\u7c7b\u578b\u4ee5\u5916\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\u578b\u673a\u5236\u3002"),Object(l.b)("p",null,"\u5b9e\u73b0\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\u578b\u5fc5\u987b\u9075\u5faa\u4ee5\u4e0b\u914d\u7f6e\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u9a8c\u8bc1\u7c7b\u578b\u5fc5\u987b\u65f6\u516c\u5f00\u4e14\u662f ",Object(l.b)("inlineCode",{parentName:"li"},"Enum")," \u679a\u4e3e\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},"\u679a\u4e3e\u7c7b\u578b\u5fc5\u987b\u8d34\u6709 ",Object(l.b)("inlineCode",{parentName:"li"},"[ValidationType]")," \u7279\u6027"),Object(l.b)("li",{parentName:"ul"},"\u679a\u4e3e\u4e2d\u6bcf\u4e00\u9879\u5fc5\u987b\u8d34\u6709 ",Object(l.b)("inlineCode",{parentName:"li"},"[ValidationItemMetadata]")," \u7279\u6027")),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u5982"),"\uff1a"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,12,18}","{1,6,12,18}":!0}),'using Furion.DataValidation;\nusing System.Text.RegularExpressions;\n\nnamespace Furion.Application\n{\n [ValidationType]\n public enum MyValidationTypes\n {\n /// \n /// \u5f3a\u5bc6\u7801\u7c7b\u578b\n /// \n [ValidationItemMetadata(@"^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$", "\u5fc5\u987b\u987b\u5305\u542b\u5927\u5c0f\u5199\u5b57\u6bcd\u548c\u6570\u5b57\u7684\u7ec4\u5408\uff0c\u4e0d\u80fd\u4f7f\u7528\u7279\u6b8a\u5b57\u7b26\uff0c\u957f\u5ea6\u57288-10\u4e4b\u95f4")]\n StrongPassword,\n\n /// \n /// \u4ee5 Furion \u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5ffd\u7565\u5927\u5c0f\u5199\n /// \n [ValidationItemMetadata(@"^(furion).*", "\u9ed8\u8ba4\u63d0\u793a\uff1a\u5fc5\u987b\u4ee5Fur\u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5ffd\u7565\u5927\u5c0f\u5199", RegexOptions.IgnoreCase)]\n StartWithFurString\n }\n}\n\n')),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u4f7f\u7528")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u624b\u52a8\u4f7f\u7528")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"q1w2e3".TryValidate(MyValidationTypes.StrongPassword); // => false\n\n"furos".TryValidate(MyValidationTypes.StartWithFurString); // => true\n')),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[DataValidation]")," \u4e2d\u4f7f\u7528")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"[DataValidation(MyValidationTypes.StrongPassword)]\npublic string Password { get; set; }\n")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u591a\u4e2a\u81ea\u5b9a\u4e49\u7c7b\u578b\u6df7\u7528")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"Q1w2e3r4t5!*".TryValidate(MyValidationTypes.StrongPassword, ValidationTypes.Required); // => true\n')),Object(l.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u81ea\u5b9a\u4e49\u7684\u9a8c\u8bc1\u7c7b\u578b\u4e5f\u8981\u4fdd\u8bc1\u540d\u79f0\u5168\u5c40\u552f\u4e00\uff0c\u4e5f\u5c31\u662f\u591a\u4e2a\u9a8c\u8bc1\u7c7b\u578b\u4e0d\u80fd\u51fa\u73b0\u4e00\u6837\u7684\u540d\u5b57\u3002"))),Object(l.b)("h3",{id:"882-\u81ea\u5b9a\u4e49-validationtypes-\u5931\u8d25\u6d88\u606f"},"8.8.2 \u81ea\u5b9a\u4e49 ",Object(l.b)("inlineCode",{parentName:"h3"},"ValidationTypes")," \u5931\u8d25\u6d88\u606f"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u5185\u7f6e\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"ValidationTypes")," \u5df2\u6709\u9ed8\u8ba4\u7684\u5931\u8d25\u6d88\u606f\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Required"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is required.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Numeric"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a numeric type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PositiveNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a positive number type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"NegativeNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a negative number type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Integer"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a integer type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Money"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a money type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Date"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a date type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Time"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a time type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IDCard"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a idcard type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PostCode"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a postcode type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a phone number type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Telephone"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a telephone type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneOrTelNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a phone number or telephone type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EmailAddress"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a email address type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Url"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a url address type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Color"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a color type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Chinese"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a chinese type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv4"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a IPv4 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv6"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a IPv6 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Age"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a age type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"ChineseName"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a chinese name type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EnglishName"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a english name type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Capital"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a capital type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Lowercase"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a lowercase type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Ascii"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a ascii type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Md5"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a md5 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Zip"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a zip type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Image"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a image type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Document"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a document type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"MP3"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a mp3 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Flash"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a flash type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Video"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a video type."))),Object(l.b)("p",null,"\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u7ee7\u627f ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," \u9a8c\u8bc1\u6d88\u606f\u63d0\u4f9b\u5668\u7c7b\u578b\uff0c\u6216\u901a\u8fc7 ",Object(l.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u3002"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},Object(l.b)("inlineCode",{parentName:"strong"},"[ValidationMessageType]"))," \u65b9\u5f0f")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,9,12,15,19,22}","{5,9,12,15,19,22}":!0}),'using Furion.DataValidation;\n\nnamespace Furion.Application\n{\n [ValidationMessageType]\n public enum MyValidationMessageType\n {\n // \u4fee\u6539\u5185\u7f6e\u9a8c\u8bc1\u7c7b\u578b\u9a8c\u8bc1\u5931\u8d25\u6d88\u606f\n [ValidationMessage("\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null")]\n Required,\n\n [ValidationMessage("\u5fc5\u987b\u662f\u6570\u503c\u7c7b\u578b")]\n Numeric,\n\n [ValidationMessage("\u5fc5\u987b\u662f\u6b63\u6570")]\n PositiveNumber,\n\n // \u4fee\u6539\u81ea\u5b9a\u4e49\u7c7b\u578b\u9a8c\u8bc1\u5931\u8d25\u6d88\u606f\n [ValidationMessage("\u5bc6\u7801\u592a\u7b80\u5355\u4e86")]\n StrongPassword,\n\n [ValidationMessage("\u5fc5\u987b\u4ee5 Furion \u5f00\u5934")]\n StartWithFurString\n }\n}\n')),Object(l.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u9664\u4e86\u8d34 ",Object(l.b)("inlineCode",{parentName:"p"},"[ValidationMessageType]")," \u7279\u6027\u5916\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," \u65b9\u5f0f\u67e5\u627e\u9a8c\u8bc1\u6d88\u606f\u7c7b\u578b\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("pre",{parentName:"div"},Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,8-12}","{1,6,8-12}":!0}),"using Furion.DataValidation;\nusing System;\n\nnamespace Furion.Application\n{\n public class MyValidationTypeMessageProvider : IValidationMessageTypeProvider\n {\n public Type[] Definitions => new[]\n {\n typeof(MyValidationMessageType),\n typeof(MyValidationMessageType2)\n };\n }\n}\n")),Object(l.b)("p",{parentName:"div"},"\u6ce8\u518c\u9a8c\u8bc1\u6d88\u606f\u63d0\u4f9b\u5668"),Object(l.b)("pre",{parentName:"div"},Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddDataValidation();\n }\n }\n}\n")))),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz4.png")}),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},Object(l.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u65b9\u5f0f"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-9} title="Furion.Web.Entry/appsettings.json"',"{2-9}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "ValidationTypeMessageSettings": {\n "Definitions": [\n ["Required", "\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null"],\n ["Numeric", "\u5fc5\u987b\u662f\u6570\u503c\u7c7b\u578b"],\n\n ["StrongPassword", "\u5bc6\u7801\u592a\u7b80\u5355\u4e86!!!"]\n ]\n }\n}\n')),Object(l.b)("div",{className:"admonition admonition-important alert alert--info"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"important")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u76f8\u540c\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"Key")," \u4f1a\u8986\u76d6 ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," \u63d0\u4f9b\u76f8\u540c ",Object(l.b)("inlineCode",{parentName:"p"},"Key")," \u7684\u503c\u3002"))),Object(l.b)("h4",{id:"\u9519\u8bef\u6d88\u606f\u67e5\u627e\u4f18\u5148\u7ea7"},"\u9519\u8bef\u6d88\u606f\u67e5\u627e\u4f18\u5148\u7ea7"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"DefaultErrorMessage")," -> ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," -> ",Object(l.b)("inlineCode",{parentName:"p"},"appsettings.json")," (",Object(l.b)("strong",{parentName:"p"},"\u4f4e -> \u9ad8"),")"),Object(l.b)("h2",{id:"89-\u6a21\u578b\u9a8c\u8bc1\u8303\u56f4"},"8.9 \u6a21\u578b\u9a8c\u8bc1\u8303\u56f4"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u591a\u79cd\u6a21\u578b\u9a8c\u8bc1\u8303\u56f4\u8bbe\u7f6e\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u5168\u5c40\u9a8c\u8bc1\uff08\u9ed8\u8ba4\uff09"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[NonValidation]")," \u8df3\u8fc7\u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[TypeFilter(typeof(DataValidationFilter))]")," \u5c40\u90e8\u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[ApiController]")," \u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1")),Object(l.b)("h3",{id:"891-\u5168\u5c40\u9a8c\u8bc1"},"8.9.1 \u5168\u5c40\u9a8c\u8bc1"),Object(l.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7 ",Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u6ce8\u518c\u6570\u636e\u9a8c\u8bc1\u670d\u52a1\u5df2\u7ecf\u542f\u7528\u4e86\u5168\u5c40\u9a8c\u8bc1\uff0c\u5982\u82e5\u4e0d\u60f3\u542f\u7528\u5168\u5c40\u9a8c\u8bc1\uff0c\u5219\u4f20\u5165 ",Object(l.b)("inlineCode",{parentName:"p"},"false")," \u5373\u53ef\uff0c\u5982\uff1a",Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation(false)"),"\u3002"),Object(l.b)("h3",{id:"892-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1"},"8.9.2 ",Object(l.b)("inlineCode",{parentName:"h3"},"[NonValidation]")," \u8df3\u8fc7\u9a8c\u8bc1"),Object(l.b)("p",null,"\u53ef\u901a\u8fc7 ",Object(l.b)("inlineCode",{parentName:"p"},"[NonValidation]")," \u8d34\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u5668"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u52a8\u4f5c\u65b9\u6cd5"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u7c7b")," \u4e2d\u8df3\u8fc7\u5168\u5c40\u9a8c\u8bc1\u6216\u4e0d\u9700\u8981\u9a8c\u8bc1"),Object(l.b)("h3",{id:"893-typefiltertypeofdatavalidationfilter-\u5c40\u90e8\u9a8c\u8bc1"},"8.9.3 ",Object(l.b)("inlineCode",{parentName:"h3"},"[TypeFilter(typeof(DataValidationFilter))]")," \u5c40\u90e8\u9a8c\u8bc1"),Object(l.b)("p",null,"\u6211\u4eec\u4e5f\u53ef\u4ee5\u65e0\u9700\u6ce8\u518c ",Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u670d\u52a1\uff0c\u76f4\u63a5\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"\u52a8\u4f5c\u65b9\u6cd5")," \u4e0a\u8d34 ",Object(l.b)("inlineCode",{parentName:"p"},"[TypeFilter(typeof(DataValidationFilter))]")," \u53ef\u542f\u7528\u5c40\u90e8\u9a8c\u8bc1\u3002\u5982\uff1a"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3,9}","{1,3,9}":!0}),"using Furion.DataValidation;\nusing Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [TypeFilter(typeof(DataValidationFilter))]\n public TestDto Post(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n")),Object(l.b)("h3",{id:"894-apicontroller-\u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1"},"8.9.4 ",Object(l.b)("inlineCode",{parentName:"h3"},"[ApiController]")," \u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u662f ",Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u63d0\u4f9b\u7684\u63a7\u5236\u5668\u8303\u56f4\uff08\u542b\u6240\u6709\u52a8\u4f5c\u65b9\u6cd5\uff09\u7684\u9a8c\u8bc1\u3002"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [ApiController]\n public class MvcController : Controller\n {\n public IActionResult Index()\n {\n return View();\n }\n }\n}\n")),Object(l.b)("h2",{id:"810-miniprofiler-\u67e5\u770b"},"8.10 ",Object(l.b)("inlineCode",{parentName:"h2"},"MiniProfiler")," \u67e5\u770b"),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz5.png")}),Object(l.b)("h2",{id:"811-\u591a\u8bed\u8a00\u652f\u6301"},"8.11 \u591a\u8bed\u8a00\u652f\u6301"),Object(l.b)("p",null,"\u53c2\u89c1 ",Object(l.b)("a",Object(a.a)({parentName:"p"},{href:"./local-language"}),"\u3010\u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09\u3011")," \u7ae0\u8282"),Object(l.b)("h2",{id:"812-\u53cd\u9988\u4e0e\u5efa\u8bae"},"8.12 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(l.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[8],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return l})),n.d(t,"a",(function(){return r}));var a=n(21),i=n(195);function l(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:l=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const r=n.startsWith(t)?n:t+n.replace(/^\//,"");return l?e+r:r}(t,e,n,a)}}function r(e,t={}){const{withBaseUrl:n}=l();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return u}));var a=n(0),i=n.n(a);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var o=i.a.createContext({}),p=function(e){var t=i.a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=p(e.components);return i.a.createElement(o.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,r=e.parentName,o=c(e,["components","mdxType","originalType","parentName"]),s=p(n),m=a,u=s["".concat(r,".").concat(m)]||s[m]||d[m]||l;return n?i.a.createElement(u,b(b({ref:t},o),{},{components:n})):i.a.createElement(u,b({ref:t},o))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,r=new Array(l);r[0]=m;var b={};for(var c in t)hasOwnProperty.call(t,c)&&(b[c]=t[c]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var o=2;ot(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,t,n){"use strict";function a(e){var t,n,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tt.value===e)&&N(e)}const v=e=>{N(e),null!=d&&O(d,e)},h=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(r.a)("tabs",{"tabs--block":n},m)},s.map(({value:e,label:t})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(r.a)("tabs__item",c.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,t,n)=>{switch(n.keyCode){case p:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case o:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(h,e.target,e)},onFocus:()=>v(e),onClick:()=>{v(e)}},t))),t?Object(a.cloneElement)(g.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,t)=>Object(a.cloneElement)(e,{key:t,hidden:e.props.value!==j}))))}},204:function(e,t,n){"use strict";var a=n(3),i=n(0),l=n.n(i);t.a=function({children:e,hidden:t,className:n}){return l.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:t,className:n}),e)}},78:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return p})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return d})),n.d(t,"default",(function(){return u}));var a=n(3),i=n(7),l=(n(0),n(196)),r=n(194),b=n(203),c=n(204),o=n(197),p={id:"data-validation",title:"8. \u6570\u636e\u6821\u9a8c",sidebar_label:"8. \u6570\u636e\u6821\u9a8c"},s={unversionedId:"data-validation",id:"data-validation",isDocsHomePage:!1,title:"8. \u6570\u636e\u6821\u9a8c",description:"8.1 \u5173\u4e8e\u6570\u636e\u6821\u9a8c",source:"@site/docs\\data-validation.mdx",slug:"/data-validation",permalink:"/docs/data-validation",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/data-validation.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"8. \u6570\u636e\u6821\u9a8c",sidebar:"docs",previous:{title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",permalink:"/docs/friendly-exception"},next:{title:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",permalink:"/docs/dbcontext"}},d=[{value:"8.1 \u5173\u4e8e\u6570\u636e\u6821\u9a8c",id:"81-\u5173\u4e8e\u6570\u636e\u6821\u9a8c",children:[]},{value:"8.2 \u6570\u636e\u6821\u9a8c\u7684\u597d\u5904",id:"82-\u6570\u636e\u6821\u9a8c\u7684\u597d\u5904",children:[]},{value:"8.3 \u6570\u636e\u6821\u9a8c\u65b9\u5f0f",id:"83-\u6570\u636e\u6821\u9a8c\u65b9\u5f0f",children:[{value:"8.3.1 \u4f20\u7edf\u65b9\u5f0f",id:"831-\u4f20\u7edf\u65b9\u5f0f",children:[]},{value:"8.3.2 Mvc \u7279\u6027\u65b9\u5f0f",id:"832-mvc-\u7279\u6027\u65b9\u5f0f",children:[]}]},{value:"8.4 DataValidation \u9a8c\u8bc1 \ud83e\udd17",id:"84-datavalidation-\u9a8c\u8bc1-",children:[{value:"8.4.1 DataValidation \u4f18\u70b9",id:"841-datavalidation-\u4f18\u70b9",children:[]}]},{value:"8.5 DataValidation \u4f7f\u7528",id:"85-datavalidation-\u4f7f\u7528",children:[{value:"8.5.1 \u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1",id:"851-\u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1",children:[]},{value:"8.5.2 \u517c\u5bb9 Mvc \u7279\u6027\u9a8c\u8bc1",id:"852-\u517c\u5bb9-mvc-\u7279\u6027\u9a8c\u8bc1",children:[]},{value:"8.5.3 \u517c\u5bb9 Mvc \u590d\u6742\u9a8c\u8bc1",id:"853-\u517c\u5bb9-mvc-\u590d\u6742\u9a8c\u8bc1",children:[]}]},{value:"8.6 \u624b\u52a8\u9a8c\u8bc1",id:"86-\u624b\u52a8\u9a8c\u8bc1",children:[{value:"8.6.1 \u9a8c\u8bc1\u6a21\u578b",id:"861-\u9a8c\u8bc1\u6a21\u578b",children:[]},{value:"8.6.2 TryValidate \u548c Validate",id:"862-tryvalidate-\u548c-validate",children:[]},{value:"8.6.3 ValidationTypes \u5e38\u89c1\u9a8c\u8bc1",id:"863-validationtypes-\u5e38\u89c1\u9a8c\u8bc1",children:[]},{value:"8.6.4 [DataValidation] \u7279\u6027",id:"864-datavalidation-\u7279\u6027",children:[]}]},{value:"8.7 [NonValidation] \u8df3\u8fc7\u9a8c\u8bc1",id:"87-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1",children:[]},{value:"8.8 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c",id:"88-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c",children:[{value:"8.8.1 \u81ea\u5b9a\u4e49 ValidationTypes \u7c7b\u578b",id:"881-\u81ea\u5b9a\u4e49-validationtypes-\u7c7b\u578b",children:[]},{value:"8.8.2 \u81ea\u5b9a\u4e49 ValidationTypes \u5931\u8d25\u6d88\u606f",id:"882-\u81ea\u5b9a\u4e49-validationtypes-\u5931\u8d25\u6d88\u606f",children:[]}]},{value:"8.9 \u6a21\u578b\u9a8c\u8bc1\u8303\u56f4",id:"89-\u6a21\u578b\u9a8c\u8bc1\u8303\u56f4",children:[{value:"8.9.1 \u5168\u5c40\u9a8c\u8bc1",id:"891-\u5168\u5c40\u9a8c\u8bc1",children:[]},{value:"8.9.2 [NonValidation] \u8df3\u8fc7\u9a8c\u8bc1",id:"892-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1",children:[]},{value:"8.9.3 [TypeFilter(typeof(DataValidationFilter))] \u5c40\u90e8\u9a8c\u8bc1",id:"893-typefiltertypeofdatavalidationfilter-\u5c40\u90e8\u9a8c\u8bc1",children:[]},{value:"8.9.4 [ApiController] \u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1",id:"894-apicontroller-\u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1",children:[]}]},{value:"8.10 MiniProfiler \u67e5\u770b",id:"810-miniprofiler-\u67e5\u770b",children:[]},{value:"8.11 \u591a\u8bed\u8a00\u652f\u6301",id:"811-\u591a\u8bed\u8a00\u652f\u6301",children:[]},{value:"8.12 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"812-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:d};function u(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(l.b)("wrapper",Object(a.a)({},m,n,{components:t,mdxType:"MDXLayout"}),Object(l.b)(o.a,{mdxType:"JoinGroup"}),Object(l.b)("h2",{id:"81-\u5173\u4e8e\u6570\u636e\u6821\u9a8c"},"8.1 \u5173\u4e8e\u6570\u636e\u6821\u9a8c"),Object(l.b)("p",null,"\u6570\u636e\u6821\u9a8c\u5b57\u9762\u4e0a\u7684\u610f\u601d\u5c31\u662f\u5bf9\u4f7f\u7528\u8005\u63d0\u4ea4\u8fc7\u6765\u7684\u6570\u636e\u8fdb\u884c\u5408\u6cd5\u6027\u9a8c\u8bc1\u3002\u5728\u4e00\u5957\u5b8c\u5584\u7684\u5e94\u7528\u7cfb\u7edf\u4e2d\uff0c\u6570\u636e\u6709\u6548\u6027\u6821\u9a8c\u662f\u5fc5\u4e0d\u53ef\u5c11\u7684\u4e1a\u52a1\u5904\u7406\u7b2c\u4e00\u9053\u5173\u5361\u3002"),Object(l.b)("h2",{id:"82-\u6570\u636e\u6821\u9a8c\u7684\u597d\u5904"},"8.2 \u6570\u636e\u6821\u9a8c\u7684\u597d\u5904"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u8fc7\u6ee4\u4e0d\u5b89\u5168\u6570\u636e\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u5b89\u5168\u6027"),Object(l.b)("li",{parentName:"ul"},"\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u4e1a\u52a1\u5f02\u5e38\u5904\u7406\uff0c\u63d0\u9ad8\u7cfb\u7edf\u7684\u54cd\u5e94\u901f\u5ea6"),Object(l.b)("li",{parentName:"ul"},"\u5927\u5927\u63d0\u9ad8\u7cfb\u7edf\u7a33\u5b9a\u6027"),Object(l.b)("li",{parentName:"ul"},"\u5927\u6570\u636e\u5e76\u53d1\u65f6\u8d77\u7740\u4e00\u5b9a\u7684\u7f13\u51b2\u4f5c\u7528")),Object(l.b)("h2",{id:"83-\u6570\u636e\u6821\u9a8c\u65b9\u5f0f"},"8.3 \u6570\u636e\u6821\u9a8c\u65b9\u5f0f"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u4f20\u7edf\u65b9\u5f0f\uff0c\u5728\u4e1a\u52a1\u4ee3\u7801\u4e4b\u524d\u624b\u52a8\u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Mvc")," \u7279\u6027\u65b9\u5f0f\uff0c",Object(l.b)("inlineCode",{parentName:"li"},"Mvc")," \u5185\u7f6e\u7684 ",Object(l.b)("inlineCode",{parentName:"li"},"DataAnnotations")," \u65b9\u5f0f"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u63a8\u8350\u65b9\u5f0f"),"\uff0c",Object(l.b)("inlineCode",{parentName:"li"},"Furion")," \u6846\u67b6\u5185\u7f6e\u7684 ",Object(l.b)("inlineCode",{parentName:"li"},"DataValidation")," \u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},"\u5176\u4ed6\u65b9\u5f0f\uff0c\u4f7f\u7528\u7b2c\u4e09\u65b9\u9a8c\u8bc1\u5e93\uff0c\u5982 ",Object(l.b)("inlineCode",{parentName:"li"},"FluentValidation"))),Object(l.b)("h3",{id:"831-\u4f20\u7edf\u65b9\u5f0f"},"8.3.1 \u4f20\u7edf\u65b9\u5f0f"),Object(l.b)("p",null,"\u5728\u5f88\u591a\u8001\u9879\u76ee\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u770b\u5230\u8fd9\u6837\u7684\u4ee3\u7801\uff1a"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,9,14}","{4,9,14}":!0}),'public bool Insert(Person person)\n{\n // \u9a8c\u8bc1\u53c2\u6570\n if(string.IsNullOrEmty(person.Name))\n {\n throw new System.Exception("\u540d\u5b57\u4e0d\u80fd\u4e3a\u7a7a");\n }\n\n if(person.Age < 18)\n {\n throw new System.Exception("\u5e74\u9f84\u4e0d\u80fd\u5c0f\u4e8e 18 \u5c81");\n }\n\n if(!person.Password.Equals(person.ConfirmPassword)\n {\n throw new System.Exception("\u4e24\u6b21\u5bc6\u7801\u4e0d\u4e00\u81f4");\n }\n\n // \u4e1a\u52a1\u4ee3\u7801\n _repository.Insert(person.Adapt());\n\n // ...\n}\n')),Object(l.b)("p",null,"\u4ece\u4e0a\u9762\u7684\u4ee3\u7801\u770b\u8d77\u6765\uff0c\u4f3c\u4e4e\u6ca1\u6709\u4ec0\u4e48\u4e0d\u59a5\uff0c\u4f46\u662f\u4ece\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u7ef4\u62a4\u6027\u6765\u8bf4\uff0c\u8fd9\u662f\u4e00\u4e2a\u7cdf\u7cd5\u7684\u4ee3\u7801\uff0c\u56e0\u4e3a\u8be5\u4e1a\u52a1\u4ee3\u7801\u4e2d",Object(l.b)("strong",{parentName:"p"},"\u5305\u542b\u4e86\u592a\u591a\u4e0e\u4e1a\u52a1\u65e0\u5173\u7684\u6570\u636e\u9a8c\u8bc1"),"\u3002"),Object(l.b)("p",null,"\u8bd5\u60f3\u4e00\u4e0b\uff0c\u5982\u679c\u8fd9\u4e2a ",Object(l.b)("inlineCode",{parentName:"p"},"Person")," \u6709 \u51e0\u5341\u4e2a\u53c2\u6570\u90fd\u9700\u8981\u9a8c\u8bc1\u5462\uff1f\u53ef\u60f3\u800c\u77e5\uff0c\u8fd9\u662f\u4e00\u4e2a\u5e9e\u5927\u7684\u4e1a\u52a1\u4ee3\u7801\u3002"),Object(l.b)("p",null,"\u518d\u8005\uff0c\u5982\u679c\u5176\u4ed6\u5730\u65b9\u4e5f\u9700\u8981\u7528\u5230\u8fd9\u4e2a ",Object(l.b)("inlineCode",{parentName:"p"},"Person")," \u7c7b\u9a8c\u8bc1\u5462\uff1f\u90a3\u4ee3\u7801\u597d\u6bd4\u8001\u9f20\u5543\u8fc7\u7684\u9762\u5305\u5c51\u4e00\u6837\uff0c\u5230\u5904\u90fd\u662f\u3002"),Object(l.b)("p",null,"\u5982\u6b64\u5f97\u77e5\uff0c\u8fd9\u6837\u7684\u65b9\u5f0f\u662f\u6781\u5176\u4e0d\u63a8\u8350\u7684\uff0c",Object(l.b)("strong",{parentName:"p"},"\u4e0d\u4f46\u6c61\u67d3\u4e86\u4e1a\u52a1\u4ee3\u7801\uff0c\u4e5f\u7834\u574f\u4e86\u4e1a\u52a1\u804c\u8d23\u5355\u4e00\u6027\u539f\u7406\uff0c\u4e5f\u8ba9\u9a8c\u8bc1\u903b\u8f91\u65e0\u6cd5\u5b9e\u73b0\u901a\u7528\uff0c\u540e\u7eed\u7ef4\u62a4\u96be\u5ea6\u5927\u5927\u5347\u7ea7"),"\u3002"),Object(l.b)("h3",{id:"832-mvc-\u7279\u6027\u65b9\u5f0f"},"8.3.2 ",Object(l.b)("inlineCode",{parentName:"h3"},"Mvc")," \u7279\u6027\u65b9\u5f0f"),Object(l.b)("p",null,"\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u5fae\u8f6f\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u5168\u65b0\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"\u7279\u6027")," \u9a8c\u8bc1\u65b9\u5f0f\uff0c\u53ef\u901a\u8fc7\u5bf9\u5bf9\u8c61\u8d34\u7279\u6027\u5b9e\u73b0\u6570\u636e\u9a8c\u8bc1\u3002\u8fd9\u79cd\u65b9\u5f0f\u6709\u6548\u7684\u5c06\u6570\u636e\u6821\u9a8c\u548c\u4e1a\u52a1\u4ee3\u7801\u5265\u79bb\u5f00\u6765\uff0c\u800c\u4e14\u5bb9\u6613\u4f7f\u7528\u548c\u62d3\u5c55\u3002"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5728\u6a21\u578b\u4e2d\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,7-8,11-12}","{1,7-8,11-12}":!0}),"using System.ComponentModel.DataAnnotations;\n\nnamespace Hoa.Application.Authorization.Dtos\n{\n public class SignInInput\n {\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MinLength(4)] // \u6700\u5c0f\u957f\u5ea6\u9a8c\u8bc1\n public string Account { get; set; }\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MaxLength(32)] // \u6700\u5927\u957f\u5ea6\u9a8c\u8bc1\n public string Password { get; set; }\n }\n}\n")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5728\u53c2\u6570\u4e2d\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2-3,8-9,12-13}","{2-3,8-9,12-13}":!0}),'public void CheckMethodParameterValid(\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MinLength(4)] // \u6700\u5c0f\u957f\u5ea6\u9a8c\u8bc1\n string name,\n\n int age,\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [RegularExpression("[a-zA-Z0-9_]{8,30}") // \u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\n string password,\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [RegularExpression("[a-zA-Z0-9_]{8,30}") // \u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\n string confirmPassword\n)\n{\n // TODO\n}\n')),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u9192")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u5982\u679c\u51fd\u6570\u7684\u53c2\u6570\u5927\u4e8e\u6216\u7b49\u4e8e 3 \u4e2a\uff0c\u5efa\u8bae\u62bd\u79bb\u51fa\u6a21\u578b\u7c7b\uff0c\u4e5f\u5c31\u662f\u4e0d\u5efa\u8bae\u4e0a\u9762\u7684\u65b9\u5f0f\u3002"))),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u81ea\u5b9a\u4e49\u7279\u6027\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,13-24}","{1,13-24}":!0}),'public class ClassicMovieAttribute : ValidationAttribute\n{\n public ClassicMovieAttribute(int year)\n {\n Year = year;\n }\n\n public int Year { get; }\n\n public string GetErrorMessage() =>\n $"Classic movies must have a release year no later than {Year}.";\n\n protected override ValidationResult IsValid(object value, ValidationContext validationContext)\n {\n var movie = (Movie)validationContext.ObjectInstance;\n var releaseYear = ((DateTime)value).Year;\n\n if (movie.Genre == Genre.Classic && releaseYear > Year)\n {\n return new ValidationResult(GetErrorMessage());\n }\n\n return ValidationResult.Success;\n }\n}\n')),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},Object(l.b)("inlineCode",{parentName:"strong"},"IValidatableObject")," \u590d\u6742\u9a8c\u8bc1"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3,10-19}","{1,3,10-19}":!0}),'using System.Collections.Generic;\n\npublic class DtoModel : IValidatableObject\n{\n [Required]\n [StringLength(100)]\n public string Title { get; set; }\n\n // \u4f60\u7684\u9a8c\u8bc1\u903b\u8f91\n public IEnumerable Validate(ValidationContext validationContext)\n {\n if (\u4f60\u7684\u903b\u8f91\u4ee3\u7801)\n {\n yield return new ValidationResult(\n "\u9519\u8bef\u6d88\u606f"\n ,new[] { nameof(Title) } // \u9a8c\u8bc1\u5931\u8d25\u7684\u5c5e\u6027\n );\n }\n }\n}\n')),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u7279\u6027\u65b9\u5f0f\u6781\u5927\u7684\u5c06\u4e1a\u52a1\u903b\u8f91\u548c\u9a8c\u8bc1\u8fdb\u884c\u4e86\u5265\u79bb\u548c\u89e3\u8026\uff0c\u800c\u4e14\u8fd8\u80fd\u5b9e\u73b0\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1\u3002"),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u4f46\u662f ",Object(l.b)("inlineCode",{parentName:"strong"},"Mvc")," \u7279\u6027\u9a8c\u8bc1\u65b9\u5f0f\u6709\u51e0\u4e2a\u660e\u663e\u7684\u7f3a\u70b9"),"\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u53ea\u80fd\u5728 ",Object(l.b)("inlineCode",{parentName:"li"},"\u63a7\u5236\u5668")," \u4e2d\u7684 ",Object(l.b)("inlineCode",{parentName:"li"},"Action"),"\uff08\u52a8\u4f5c\u65b9\u6cd5\uff09\u4e2d\u4f7f\u7528"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u65e0\u6cd5\u5728\u4efb\u610f\u7c7b\u3001\u4efb\u610f\u65b9\u6cd5\u4e2d\u4f7f\u7528")),Object(l.b)("li",{parentName:"ul"},"\u5185\u7f6e\u7684\u9a8c\u8bc1\u7c7b\u578b\u975e\u5e38\u6709\u9650\uff0c\u4e14\u4e0d\u6613\u62d3\u5c55"),Object(l.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u9a8c\u8bc1\u6d88\u606f\u540e\u671f\u914d\u7f6e")),Object(l.b)("p",null,"\u6240\u4ee5\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u65b0\u7684\u9a8c\u8bc1\u5f15\u64ce ",Object(l.b)("inlineCode",{parentName:"p"},"DataValidation"),"\uff0c\u5728\u5b8c\u5168\u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u5185\u7f6e\u9a8c\u8bc1\u7684\u540c\u65f6\u63d0\u4f9b\u4e86\u5927\u91cf\u5e38\u89c1\u9a8c\u8bc1\u3001\u590d\u6742\u9a8c\u8bc1\u3001\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7b49\u80fd\u529b\u3002"),Object(l.b)("h2",{id:"84-datavalidation-\u9a8c\u8bc1-"},"8.4 ",Object(l.b)("inlineCode",{parentName:"h2"},"DataValidation")," \u9a8c\u8bc1 \ud83e\udd17"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"DataValidation")," \u662f ",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5168\u65b0\u7684\u9a8c\u8bc1\u65b9\u5f0f\uff0c\u5b8c\u5168\u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u5185\u7f6e\u9a8c\u8bc1\uff0c\u5e76\u4e14\u8d4b\u4e88\u4e86\u8d85\u80fd\u3002"),Object(l.b)("h3",{id:"841-datavalidation-\u4f18\u70b9"},"8.4.1 ",Object(l.b)("inlineCode",{parentName:"h3"},"DataValidation")," \u4f18\u70b9"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5b8c\u5168\u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"strong"},"Mvc")," \u5185\u7f6e\u9a8c\u8bc1\u5f15\u64ce")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},"\u5185\u7f6e\u5e38\u89c1\u9a8c\u8bc1\u7c7b\u578b\u53ca\u53ef\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\u578b\u529f\u80fd")),Object(l.b)("li",{parentName:"ul"},"\u63d0\u4f9b\u5168\u5c40\u5bf9\u8c61\u62d3\u5c55\u9a8c\u8bc1\u65b9\u5f0f"),Object(l.b)("li",{parentName:"ul"},"\u652f\u6301\u9a8c\u8bc1\u6d88\u606f\u540e\u671f\u914d\u7f6e\uff0c\u652f\u6301\u5b9e\u65f6\u66f4\u65b0"),Object(l.b)("li",{parentName:"ul"},"\u652f\u6301\u5728\u4efb\u4f55\u7c7b\uff0c\u4efb\u4f55\u65b9\u6cd5\u3001\u4efb\u4f55\u4f4d\u7f6e\u5b9e\u73b0\u624b\u52a8\u9a8c\u8bc1\u3001\u7279\u6027\u65b9\u5f0f\u9a8c\u8bc1\u7b49"),Object(l.b)("li",{parentName:"ul"},"\u652f\u6301\u8bbe\u7f6e\u9a8c\u8bc1\u7ed3\u679c\u6a21\u578b")),Object(l.b)("h2",{id:"85-datavalidation-\u4f7f\u7528"},"8.5 ",Object(l.b)("inlineCode",{parentName:"h2"},"DataValidation")," \u4f7f\u7528"),Object(l.b)("div",{className:"admonition admonition-important alert alert--info"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u9ed8\u8ba4\u5df2\u7ecf\u7ee7\u627f\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002\u4e5f\u5c31\u662f ",Object(l.b)("inlineCode",{parentName:"p"},"8.5.1")," \u7ae0\u8282\u53ef\u4e0d\u914d\u7f6e\u3002"))),Object(l.b)("h3",{id:"851-\u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1"},"8.5.1 \u6ce8\u518c\u9a8c\u8bc1\u670d\u52a1"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddDataValidation();\n }\n }\n}\n")),Object(l.b)("div",{className:"admonition admonition-important alert alert--info"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u9700\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u540e\u6ce8\u518c\u3002"))),Object(l.b)("h3",{id:"852-\u517c\u5bb9-mvc-\u7279\u6027\u9a8c\u8bc1"},"8.5.2 \u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"h3"},"Mvc")," \u7279\u6027\u9a8c\u8bc1"),Object(l.b)(b.a,{defaultValue:"testdto",values:[{label:"TestDto",value:"testdto"},{label:"FurAppService",value:"furAppService"}],mdxType:"Tabs"},Object(l.b)(c.a,{value:"testdto",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,7,10}","{1,7,10}":!0}),'using System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class TestDto\n {\n [Range(10, 20, ErrorMessage = "Id \u53ea\u80fd\u5728 10-20 \u533a\u95f4\u53d6\u503c")]\n public int Id { get; set; }\n\n [Required(ErrorMessage = "\u5fc5\u586b"), MinLength(3, ErrorMessage = "\u5b57\u7b26\u4e32\u957f\u5ea6\u4e0d\u80fd\u5c11\u4e8e3\u4f4d")]\n public string Name { get; set; }\n }\n}\n'))),Object(l.b)(c.a,{value:"furAppService",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12,22}","{12,22}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n /// \n /// \u503c\u7c7b\u578b\u9a8c\u8bc1\n /// \n /// \n /// \n public int Get(int id)\n {\n return id;\n }\n\n /// \n /// \u5bf9\u8c61\u7c7b\u578b\u9a8c\u8bc1\n /// \n /// \n /// \n public TestDto Post(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n')))),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz1.gif")}),Object(l.b)("h3",{id:"853-\u517c\u5bb9-mvc-\u590d\u6742\u9a8c\u8bc1"},"8.5.3 \u517c\u5bb9 ",Object(l.b)("inlineCode",{parentName:"h3"},"Mvc")," \u590d\u6742\u9a8c\u8bc1"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6,14-22}","{2,6,14-22}":!0}),'using System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class TestDto : IValidatableObject\n {\n [Range(10, 20, ErrorMessage = "Id \u53ea\u80fd\u5728 10-20 \u533a\u95f4\u53d6\u503c")]\n public int Id { get; set; }\n\n [Required(ErrorMessage = "\u5fc5\u586b"), MinLength(3, ErrorMessage = "\u5b57\u7b26\u4e32\u957f\u5ea6\u4e0d\u80fd\u5c11\u4e8e3\u4f4d")]\n public string Name { get; set; }\n\n public IEnumerable Validate(ValidationContext validationContext)\n {\n if (Name.StartsWith("Furion"))\n {\n yield return new ValidationResult(\n "\u4e0d\u80fd\u4ee5 Furion \u5f00\u5934"\n , new[] { nameof(Name) }\n );\n }\n }\n }\n}\n')),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz2.gif")}),Object(l.b)("h2",{id:"86-\u624b\u52a8\u9a8c\u8bc1"},"8.6 \u624b\u52a8\u9a8c\u8bc1"),Object(l.b)("h3",{id:"861-\u9a8c\u8bc1\u6a21\u578b"},"8.6.1 \u9a8c\u8bc1\u6a21\u578b"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,11}","{1,11}":!0}),"using Furion.DataValidation;\nusing Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [NonValidation] // \u8df3\u8fc7\u5168\u5c40\u9a8c\u8bc1\n public DataValidationResult Post(TestDto testDto)\n {\n return testDto.TryValidate();\n }\n }\n}\n")),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz3.gif")}),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u652f\u6301 ",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"Mvc"))," \u5185\u7f6e\u7684\u7279\u6027\u9a8c\u8bc1\u3001\u5c5e\u6027\u9a8c\u8bc1\u53ca\u590d\u6742\u7684 ",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"IValidatableObject"))," \u9a8c\u8bc1\u3002"))),Object(l.b)("h3",{id:"862-tryvalidate-\u548c-validate"},"8.6.2 ",Object(l.b)("inlineCode",{parentName:"h3"},"TryValidate")," \u548c ",Object(l.b)("inlineCode",{parentName:"h3"},"Validate")),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"TryValidate()")," \u548c ",Object(l.b)("inlineCode",{parentName:"p"},"Validate()")," \u4e24\u4e2a\u9a8c\u8bc1\u62d3\u5c55\u65b9\u6cd5\uff0c\u552f\u4e00\u7684\u533a\u522b\u5c31\u662f\u540e\u8005\u9a8c\u8bc1\u5931\u8d25\u5c06\u81ea\u52a8\u629b\u51fa\u5f02\u5e38\u6d88\u606f\u3002"),Object(l.b)("h3",{id:"863-validationtypes-\u5e38\u89c1\u9a8c\u8bc1"},"8.6.3 ",Object(l.b)("inlineCode",{parentName:"h3"},"ValidationTypes")," \u5e38\u89c1\u9a8c\u8bc1"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u5185\u7f6e\u4e86\u5f88\u591a\u5e38\u7528\u7c7b\u578b\u7684\u6570\u636e\u9a8c\u8bc1\uff0c\u5305\u62ec\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Required"),"\uff1a\u975e\u7a7a\u3001\u975e Null \u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Numeric"),"\uff1a\u6570\u503c\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PositiveNumber"),"\uff1a\u6b63\u6570\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"NegativeNumber"),"\uff1a\u8d1f\u6570\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Integer"),"\uff1a\u6574\u6570\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Money"),"\uff1a\u91d1\u94b1\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Date"),"\uff1a\u65e5\u671f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Time"),"\uff1a\u65f6\u95f4\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IDCard"),"\uff1a\u8eab\u4efd\u8bc1\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PostCode"),"\uff1a\u90ae\u7f16\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneNumber"),"\uff1a\u624b\u673a\u53f7\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Telephone"),"\uff1a\u56fa\u8bdd\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneOrTelNumber"),"\uff1a\u624b\u673a\u6216\u56fa\u8bdd\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EmailAddress"),"\uff1a\u90ae\u4ef6\u5730\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Url"),"\uff1a\u7f51\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Color"),"\uff1a\u989c\u8272\u503c\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Chinese"),"\uff1a\u4e2d\u6587\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv4"),"\uff1aIPv4 \u5730\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv6"),"\uff1aIPv6 \u5730\u5740\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Age"),"\uff1a\u5e74\u9f84\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"ChineseName"),"\uff1a\u4e2d\u6587\u540d\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EnglishName"),"\uff1a\u82f1\u6587\u540d\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Capital"),"\uff1a\u7eaf\u5927\u5199\u82f1\u6587\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Lowercase"),"\uff1a\u7eaf\u5c0f\u5199\u82f1\u6587\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Ascii"),"\uff1aAscii \u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Md5"),"\uff1aMd5 \u5b57\u7b26\u4e32\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Zip"),"\uff1a\u538b\u7f29\u5305\u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Image"),"\uff1a\u56fe\u7247\u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Document"),"\uff1a\u6587\u6863\u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"MP3"),"\uff1aMp3 \u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Flash"),"\uff1aFlash \u683c\u5f0f\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Video"),"\uff1a\u89c6\u9891\u6587\u4ef6\u683c\u5f0f\u7c7b\u578b")),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u4f7f\u7528\u793a\u4f8b")),Object(l.b)(b.a,{defaultValue:"dglx",values:[{label:"\u5355\u4e2a\u7c7b\u578b\u9a8c\u8bc1",value:"dglx"},{label:"\u591a\u4e2a\u7ec4\u5408\u7c7b\u578b\u9a8c\u8bc1",value:"zhlx"}],mdxType:"Tabs"},Object(l.b)(c.a,{value:"dglx",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u9a8c\u8bc1\u5fc5\u586b\n"".TryValidate(ValidationTypes.Required); // => false\n\n// \u9a8c\u8bc1\u4e2d\u6587\n"\u6211\u53eb MonK".TryValidate(ValidationTypes.Chinese); // => false\n\n// \u9a8c\u8bc1\u6570\u503c\n2.TryValidate(ValidationTypes.Numeric); // => true\n\n// \u9a8c\u8bc1\u6574\u6570\ntrue.TryValidate(ValidationTypes.Integer); // => false\n\n// \u9a8c\u8bc1\u90ae\u7bb1\n"monksoul@outlook.com".TryValidate(ValidationTypes.EmailAddress); // => true\n\n// \u9a8c\u8bc1\u8d1f\u6570\n2.0m.TryValidate(ValidationTypes.NegativeNumber); // => false\n\n// \u81ea\u5b9a\u4e49\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\n"Furion".TryValidate("/^Furion$"); // => true\n'))),Object(l.b)(c.a,{value:"zhlx",mdxType:"TabItem"},Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u9a8c\u8bc1\u6570\u503c\u7c7b\u578b\u4e14\u662f\u6574\u6570\n"20".TryValidate(ValidationTypes.Numeric, ValidationTypes.Integer); // => true\n\n// \u9a8c\u8bc1\u65f6\u65e5\u671f\u6216\u65f6\u95f4\u683c\u5f0f\n"2020-05-20".TryValidate(ValidationOptions.AtLeastOne, ValidationTypes.Date, ValidationTypes.Time); // => true\n"23:45:20".TryValidate(ValidationOptions.AtLeastOne, ValidationTypes.Date, ValidationTypes.Time); // => true\n\n')))),Object(l.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u53ef\u901a\u8fc7\u8bbe\u7f6e ",Object(l.b)("inlineCode",{parentName:"p"},"TryValidate([ValidationOptions], params object[] validationTypes)")," \u65b9\u6cd5\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"ValidationOptions")," \u53c2\u6570\u914d\u7f6e\u9a8c\u8bc1\u903b\u8f91\uff0c\u5982\uff1a",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"\u540c\u65f6\u6210\u7acb"))," \u6216 ",Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"\u53ea\u8981\u4e00\u4e2a\u6210\u7acb"))," \u5373\u53ef\u9a8c\u8bc1\u901a\u8fc7"))),Object(l.b)("h3",{id:"864-datavalidation-\u7279\u6027"},"8.6.4 ",Object(l.b)("inlineCode",{parentName:"h3"},"[DataValidation]")," \u7279\u6027"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u8fd8\u63d0\u4f9b\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"[DataValidation]")," \u7279\u6027\u65b9\u4fbf\u5728\u6a21\u578b\u53c2\u6570\u4e2d\u4f7f\u7528 ",Object(l.b)("inlineCode",{parentName:"p"},"ValidationTypes")," \u5e38\u89c1\u9a8c\u8bc1\u6216\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u3002"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,7,10,14,17,20}","{1,7,10,14,17,20}":!0}),'using Furion.DataValidation;\n\nnamespace Furion.Application\n{\n public class TestDto\n {\n [DataValidation(ValidationTypes.Integer)]\n public int Id { get; set; }\n\n [DataValidation(ValidationTypes.Numeric, ValidationTypes.Integer)]\n public int Cost { get; set; }\n\n [DataValidation(ValidationOptions.AtLeastOne, ValidationTypes.Chinese, ValidationTypes.Date)]\n public string Name { get; set; }\n\n // \u53ef\u4ee5\u548cMvc\u7279\u6027\u5171\u5b58\n [Required, DataValidation(ValidationTypes.Age)]\n public int Age { get; set; }\n\n [DataValidation(ValidationTypes.IDCard, ErrorMessage = "\u81ea\u5b9a\u4e49\u8eab\u4efd\u8bc1\u63d0\u793a\u6d88\u606f")]\n public string IDCard { get; set; }\n }\n}\n')),Object(l.b)("h2",{id:"87-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1"},"8.7 ",Object(l.b)("inlineCode",{parentName:"h2"},"[NonValidation]")," \u8df3\u8fc7\u9a8c\u8bc1"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5bf9\u8c61\u6a21\u578b\u8df3\u8fc7\u9a8c\u8bc1\u7279\u6027 ",Object(l.b)("inlineCode",{parentName:"p"},"[NonValidation]"),"\uff0c\u652f\u6301\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u5668"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u52a8\u4f5c\u65b9\u6cd5"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u7c7b")," \u4e2d\u4f7f\u7528\u3002"),Object(l.b)("p",null,"\u4e00\u65e6\u8d34\u4e86\u6b64\u7279\u6027\uff0c\u90a3\u4e48\u5c06\u4e0d\u4f1a\u6267\u884c\u9a8c\u8bc1\u64cd\u4f5c\u3002"),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"note")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("strong",{parentName:"p"},Object(l.b)("inlineCode",{parentName:"strong"},"[NonValidation]"))," \u53ea\u5bf9\u5bf9\u8c61\u7c7b\u578b\u6709\u6548\uff0c\u503c\u7c7b\u578b\u65e0\u6548\u3002"))),Object(l.b)("h2",{id:"88-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c"},"8.8 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u64cd\u4f5c"),Object(l.b)("h3",{id:"881-\u81ea\u5b9a\u4e49-validationtypes-\u7c7b\u578b"},"8.8.1 \u81ea\u5b9a\u4e49 ",Object(l.b)("inlineCode",{parentName:"h3"},"ValidationTypes")," \u7c7b\u578b"),Object(l.b)("p",null,"\u9664\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u5185\u7f6e\u7684\u9a8c\u8bc1\u7c7b\u578b\u4ee5\u5916\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\u578b\u673a\u5236\u3002"),Object(l.b)("p",null,"\u5b9e\u73b0\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\u578b\u5fc5\u987b\u9075\u5faa\u4ee5\u4e0b\u914d\u7f6e\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u9a8c\u8bc1\u7c7b\u578b\u5fc5\u987b\u65f6\u516c\u5f00\u4e14\u662f ",Object(l.b)("inlineCode",{parentName:"li"},"Enum")," \u679a\u4e3e\u7c7b\u578b"),Object(l.b)("li",{parentName:"ul"},"\u679a\u4e3e\u7c7b\u578b\u5fc5\u987b\u8d34\u6709 ",Object(l.b)("inlineCode",{parentName:"li"},"[ValidationType]")," \u7279\u6027"),Object(l.b)("li",{parentName:"ul"},"\u679a\u4e3e\u4e2d\u6bcf\u4e00\u9879\u5fc5\u987b\u8d34\u6709 ",Object(l.b)("inlineCode",{parentName:"li"},"[ValidationItemMetadata]")," \u7279\u6027")),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u5982"),"\uff1a"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,12,18}","{1,6,12,18}":!0}),'using Furion.DataValidation;\nusing System.Text.RegularExpressions;\n\nnamespace Furion.Application\n{\n [ValidationType]\n public enum MyValidationTypes\n {\n /// \n /// \u5f3a\u5bc6\u7801\u7c7b\u578b\n /// \n [ValidationItemMetadata(@"^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$", "\u5fc5\u987b\u987b\u5305\u542b\u5927\u5c0f\u5199\u5b57\u6bcd\u548c\u6570\u5b57\u7684\u7ec4\u5408\uff0c\u4e0d\u80fd\u4f7f\u7528\u7279\u6b8a\u5b57\u7b26\uff0c\u957f\u5ea6\u57288-10\u4e4b\u95f4")]\n StrongPassword,\n\n /// \n /// \u4ee5 Furion \u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5ffd\u7565\u5927\u5c0f\u5199\n /// \n [ValidationItemMetadata(@"^(furion).*", "\u9ed8\u8ba4\u63d0\u793a\uff1a\u5fc5\u987b\u4ee5Fur\u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5ffd\u7565\u5927\u5c0f\u5199", RegexOptions.IgnoreCase)]\n StartWithFurString\n }\n}\n\n')),Object(l.b)("p",null,Object(l.b)("strong",{parentName:"p"},"\u4f7f\u7528")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u624b\u52a8\u4f7f\u7528")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"q1w2e3".TryValidate(MyValidationTypes.StrongPassword); // => false\n\n"furos".TryValidate(MyValidationTypes.StartWithFurString); // => true\n')),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[DataValidation]")," \u4e2d\u4f7f\u7528")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"[DataValidation(MyValidationTypes.StrongPassword)]\npublic string Password { get; set; }\n")),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u591a\u4e2a\u81ea\u5b9a\u4e49\u7c7b\u578b\u6df7\u7528")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"Q1w2e3r4t5!*".TryValidate(MyValidationTypes.StrongPassword, ValidationTypes.Required); // => true\n')),Object(l.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u81ea\u5b9a\u4e49\u7684\u9a8c\u8bc1\u7c7b\u578b\u4e5f\u8981\u4fdd\u8bc1\u540d\u79f0\u5168\u5c40\u552f\u4e00\uff0c\u4e5f\u5c31\u662f\u591a\u4e2a\u9a8c\u8bc1\u7c7b\u578b\u4e0d\u80fd\u51fa\u73b0\u4e00\u6837\u7684\u540d\u5b57\u3002"))),Object(l.b)("h3",{id:"882-\u81ea\u5b9a\u4e49-validationtypes-\u5931\u8d25\u6d88\u606f"},"8.8.2 \u81ea\u5b9a\u4e49 ",Object(l.b)("inlineCode",{parentName:"h3"},"ValidationTypes")," \u5931\u8d25\u6d88\u606f"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u5185\u7f6e\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"ValidationTypes")," \u5df2\u6709\u9ed8\u8ba4\u7684\u5931\u8d25\u6d88\u606f\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Required"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is required.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Numeric"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a numeric type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PositiveNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a positive number type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"NegativeNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a negative number type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Integer"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a integer type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Money"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a money type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Date"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a date type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Time"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a time type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IDCard"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a idcard type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PostCode"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a postcode type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a phone number type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Telephone"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a telephone type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"PhoneOrTelNumber"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a phone number or telephone type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EmailAddress"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a email address type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Url"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a url address type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Color"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a color type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Chinese"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a chinese type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv4"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a IPv4 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"IPv6"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a IPv6 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Age"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a age type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"ChineseName"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a chinese name type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"EnglishName"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a english name type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Capital"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a capital type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Lowercase"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a lowercase type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Ascii"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a ascii type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Md5"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a md5 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Zip"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a zip type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Image"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a image type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Document"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a document type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"MP3"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a mp3 type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Flash"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a flash type.")),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"Video"),"\uff1a",Object(l.b)("strong",{parentName:"li"},"The Value is not a video type."))),Object(l.b)("p",null,"\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u7ee7\u627f ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," \u9a8c\u8bc1\u6d88\u606f\u63d0\u4f9b\u5668\u7c7b\u578b\uff0c\u6216\u901a\u8fc7 ",Object(l.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u3002"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},Object(l.b)("inlineCode",{parentName:"strong"},"[ValidationMessageType]"))," \u65b9\u5f0f")),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,9,12,15,19,22}","{5,9,12,15,19,22}":!0}),'using Furion.DataValidation;\n\nnamespace Furion.Application\n{\n [ValidationMessageType]\n public enum MyValidationMessageType\n {\n // \u4fee\u6539\u5185\u7f6e\u9a8c\u8bc1\u7c7b\u578b\u9a8c\u8bc1\u5931\u8d25\u6d88\u606f\n [ValidationMessage("\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null")]\n Required,\n\n [ValidationMessage("\u5fc5\u987b\u662f\u6570\u503c\u7c7b\u578b")]\n Numeric,\n\n [ValidationMessage("\u5fc5\u987b\u662f\u6b63\u6570")]\n PositiveNumber,\n\n // \u4fee\u6539\u81ea\u5b9a\u4e49\u7c7b\u578b\u9a8c\u8bc1\u5931\u8d25\u6d88\u606f\n [ValidationMessage("\u5bc6\u7801\u592a\u7b80\u5355\u4e86")]\n StrongPassword,\n\n [ValidationMessage("\u5fc5\u987b\u4ee5 Furion \u5f00\u5934")]\n StartWithFurString\n }\n}\n')),Object(l.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u9664\u4e86\u8d34 ",Object(l.b)("inlineCode",{parentName:"p"},"[ValidationMessageType]")," \u7279\u6027\u5916\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86 ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," \u65b9\u5f0f\u67e5\u627e\u9a8c\u8bc1\u6d88\u606f\u7c7b\u578b\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("pre",{parentName:"div"},Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,8-12}","{1,6,8-12}":!0}),"using Furion.DataValidation;\nusing System;\n\nnamespace Furion.Application\n{\n public class MyValidationTypeMessageProvider : IValidationMessageTypeProvider\n {\n public Type[] Definitions => new[]\n {\n typeof(MyValidationMessageType),\n typeof(MyValidationMessageType2)\n };\n }\n}\n")),Object(l.b)("p",{parentName:"div"},"\u6ce8\u518c\u9a8c\u8bc1\u6d88\u606f\u63d0\u4f9b\u5668"),Object(l.b)("pre",{parentName:"div"},Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddDataValidation();\n }\n }\n}\n")))),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz4.png")}),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},Object(l.b)("strong",{parentName:"li"},Object(l.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u65b9\u5f0f"))),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-9} title="Furion.Web.Entry/appsettings.json"',"{2-9}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "ValidationTypeMessageSettings": {\n "Definitions": [\n ["Required", "\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null"],\n ["Numeric", "\u5fc5\u987b\u662f\u6570\u503c\u7c7b\u578b"],\n\n ["StrongPassword", "\u5bc6\u7801\u592a\u7b80\u5355\u4e86!!!"]\n ]\n }\n}\n')),Object(l.b)("div",{className:"admonition admonition-important alert alert--info"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"important")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},Object(l.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u76f8\u540c\u7684 ",Object(l.b)("inlineCode",{parentName:"p"},"Key")," \u4f1a\u8986\u76d6 ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," \u63d0\u4f9b\u76f8\u540c ",Object(l.b)("inlineCode",{parentName:"p"},"Key")," \u7684\u503c\u3002"))),Object(l.b)("h4",{id:"\u9519\u8bef\u6d88\u606f\u67e5\u627e\u4f18\u5148\u7ea7"},"\u9519\u8bef\u6d88\u606f\u67e5\u627e\u4f18\u5148\u7ea7"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"DefaultErrorMessage")," -> ",Object(l.b)("inlineCode",{parentName:"p"},"IValidationMessageTypeProvider")," -> ",Object(l.b)("inlineCode",{parentName:"p"},"appsettings.json")," (",Object(l.b)("strong",{parentName:"p"},"\u4f4e -> \u9ad8"),")"),Object(l.b)("h2",{id:"89-\u6a21\u578b\u9a8c\u8bc1\u8303\u56f4"},"8.9 \u6a21\u578b\u9a8c\u8bc1\u8303\u56f4"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u591a\u79cd\u6a21\u578b\u9a8c\u8bc1\u8303\u56f4\u8bbe\u7f6e\uff1a"),Object(l.b)("ul",null,Object(l.b)("li",{parentName:"ul"},"\u5168\u5c40\u9a8c\u8bc1\uff08\u9ed8\u8ba4\uff09"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[NonValidation]")," \u8df3\u8fc7\u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[TypeFilter(typeof(DataValidationFilter))]")," \u5c40\u90e8\u9a8c\u8bc1"),Object(l.b)("li",{parentName:"ul"},Object(l.b)("inlineCode",{parentName:"li"},"[ApiController]")," \u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1")),Object(l.b)("h3",{id:"891-\u5168\u5c40\u9a8c\u8bc1"},"8.9.1 \u5168\u5c40\u9a8c\u8bc1"),Object(l.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u901a\u8fc7 ",Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u6ce8\u518c\u6570\u636e\u9a8c\u8bc1\u670d\u52a1\u5df2\u7ecf\u542f\u7528\u4e86\u5168\u5c40\u9a8c\u8bc1\uff0c\u5982\u82e5\u4e0d\u60f3\u542f\u7528\u5168\u5c40\u9a8c\u8bc1\uff0c\u5219\u4f20\u5165 ",Object(l.b)("inlineCode",{parentName:"p"},"false")," \u5373\u53ef\uff0c\u5982\uff1a",Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation(false)"),"\u3002"),Object(l.b)("h3",{id:"892-nonvalidation-\u8df3\u8fc7\u9a8c\u8bc1"},"8.9.2 ",Object(l.b)("inlineCode",{parentName:"h3"},"[NonValidation]")," \u8df3\u8fc7\u9a8c\u8bc1"),Object(l.b)("p",null,"\u53ef\u901a\u8fc7 ",Object(l.b)("inlineCode",{parentName:"p"},"[NonValidation]")," \u8d34\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u5668"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u52a8\u4f5c\u65b9\u6cd5"),"\uff0c",Object(l.b)("inlineCode",{parentName:"p"},"\u7c7b")," \u4e2d\u8df3\u8fc7\u5168\u5c40\u9a8c\u8bc1\u6216\u4e0d\u9700\u8981\u9a8c\u8bc1"),Object(l.b)("h3",{id:"893-typefiltertypeofdatavalidationfilter-\u5c40\u90e8\u9a8c\u8bc1"},"8.9.3 ",Object(l.b)("inlineCode",{parentName:"h3"},"[TypeFilter(typeof(DataValidationFilter))]")," \u5c40\u90e8\u9a8c\u8bc1"),Object(l.b)("p",null,"\u6211\u4eec\u4e5f\u53ef\u4ee5\u65e0\u9700\u6ce8\u518c ",Object(l.b)("inlineCode",{parentName:"p"},".AddDataValidation()")," \u670d\u52a1\uff0c\u76f4\u63a5\u5728 ",Object(l.b)("inlineCode",{parentName:"p"},"\u52a8\u4f5c\u65b9\u6cd5")," \u4e0a\u8d34 ",Object(l.b)("inlineCode",{parentName:"p"},"[TypeFilter(typeof(DataValidationFilter))]")," \u53ef\u542f\u7528\u5c40\u90e8\u9a8c\u8bc1\u3002\u5982\uff1a"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3,9}","{1,3,9}":!0}),"using Furion.DataValidation;\nusing Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [TypeFilter(typeof(DataValidationFilter))]\n public TestDto Post(TestDto testDto)\n {\n return testDto;\n }\n }\n}\n")),Object(l.b)("h3",{id:"894-apicontroller-\u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1"},"8.9.4 ",Object(l.b)("inlineCode",{parentName:"h3"},"[ApiController]")," \u63a7\u5236\u5668\u8303\u56f4\u9a8c\u8bc1"),Object(l.b)("p",null,Object(l.b)("inlineCode",{parentName:"p"},"[ApiController]")," \u662f ",Object(l.b)("inlineCode",{parentName:"p"},"Mvc")," \u63d0\u4f9b\u7684\u63a7\u5236\u5668\u8303\u56f4\uff08\u542b\u6240\u6709\u52a8\u4f5c\u65b9\u6cd5\uff09\u7684\u9a8c\u8bc1\u3002"),Object(l.b)("pre",null,Object(l.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [ApiController]\n public class MvcController : Controller\n {\n public IActionResult Index()\n {\n return View();\n }\n }\n}\n")),Object(l.b)("h2",{id:"810-miniprofiler-\u67e5\u770b"},"8.10 ",Object(l.b)("inlineCode",{parentName:"h2"},"MiniProfiler")," \u67e5\u770b"),Object(l.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(l.b)("img",{src:Object(r.a)("img/sjyz5.png")}),Object(l.b)("h2",{id:"811-\u591a\u8bed\u8a00\u652f\u6301"},"8.11 \u591a\u8bed\u8a00\u652f\u6301"),Object(l.b)("p",null,"\u53c2\u89c1 ",Object(l.b)("a",Object(a.a)({parentName:"p"},{href:"./local-language"}),"\u3010\u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09\u3011")," \u7ae0\u8282"),Object(l.b)("h2",{id:"812-\u53cd\u9988\u4e0e\u5efa\u8bae"},"8.12 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(l.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(l.b)("h5",{parentName:"div"},Object(l.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(l.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(l.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(l.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(l.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(l.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/1761adf3.585b914a.js b/docs/1761adf3.abfe825b.js similarity index 98% rename from docs/1761adf3.585b914a.js rename to docs/1761adf3.abfe825b.js index 9868f12814d..d3ca5421f45 100644 --- a/docs/1761adf3.585b914a.js +++ b/docs/1761adf3.abfe825b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return l}));var a=n(21),r=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,a)}}function l(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=r.a.createContext({}),b=function(e){var t=r.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=b(e.components);return r.a.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),p=b(n),d=a,m=p["".concat(l,".").concat(d)]||p[d]||u[d]||i;return n?r.a.createElement(m,c(c({ref:t},s),{},{components:n})):r.a.createElement(m,c({ref:t},s))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=d;var c={};for(var o in t)hasOwnProperty.call(t,o)&&(c[o]=t[o]);c.originalType=e,c.mdxType="string"==typeof e?e:a,l[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tt.value===e)&&v(e)}const T=e=>{v(e),null!=u&&O(u,e)},P=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(l.a)("tabs",{"tabs--block":n},d)},p.map(({value:e,label:t})=>r.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(l.a)("tabs__item",o.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>P.push(e),onKeyDown:e=>{((e,t,n)=>{switch(n.keyCode){case b:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case s:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(P,e.target,e)},onFocus:()=>T(e),onClick:()=>{T(e)}},t))),t?Object(a.cloneElement)(N.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):r.a.createElement("div",{className:"margin-vert--md"},N.map((e,t)=>Object(a.cloneElement)(e,{key:t,hidden:e.props.value!==j}))))}},200:function(e,t,n){"use strict";var a=n(3),r=n(0),i=n.n(r);t.a=function({children:e,hidden:t,className:n}){return i.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:t,className:n}),e)}},79:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return s})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),i=(n(0),n(192)),l=n(193),c=(n(190),n(199)),o=n(200),s={id:"dbcontext-proc",title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",sidebar_label:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c"},b={unversionedId:"dbcontext-proc",id:"dbcontext-proc",isDocsHomePage:!1,title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",description:"\u63a8\u8350\u4f7f\u7528 \u300a9.17 Sql \u9ad8\u7ea7\u4ee3\u7406\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002Sql \u9ad8\u7ea7\u4ee3\u7406 \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002",source:"@site/docs\\dbcontext-proc.mdx",slug:"/dbcontext-proc",permalink:"/docs/dbcontext-proc",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-proc.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.12 \u89c6\u56fe\u64cd\u4f5c",permalink:"/docs/dbcontext-view"},next:{title:"9.14 \u51fd\u6570\u64cd\u4f5c",permalink:"/docs/dbcontext-function"}},p=[{value:"9.13.1 \u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b",id:"9131-\u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b",children:[{value:"9.13.1.1 \u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93",id:"91311-\u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93",children:[]}]},{value:"9.13.2 \u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528",id:"9132-\u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528",children:[{value:"9.13.2.1 \u521d\u59cb\u5316\u65b9\u5f0f",id:"91321-\u521d\u59cb\u5316\u65b9\u5f0f",children:[]},{value:"9.13.2.2 \u8fd4\u56de DataTable",id:"91322-\u8fd4\u56de-datatable",children:[]},{value:"9.13.2.3 \u8fd4\u56de DataSet",id:"91323-\u8fd4\u56de-dataset",children:[]},{value:"9.13.2.4 \u8fd4\u56de List<T>",id:"91324-\u8fd4\u56de-listt",children:[]},{value:"9.13.2.5 \u8fd4\u56de Tuple<T1,...T8>",id:"91325-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.13.2.6 \u8fd4\u56de \u5355\u884c\u5355\u5217 object",id:"91326-\u8fd4\u56de-\u5355\u884c\u5355\u5217-object",children:[]},{value:"9.13.2.7 \u8fd4\u56de \u5355\u884c\u5355\u5217 <T>",id:"91327-\u8fd4\u56de-\u5355\u884c\u5355\u5217-t",children:[]},{value:"9.13.2.8 \u6267\u884c\u4f46\u65e0\u8fd4\u56de",id:"91328-\u6267\u884c\u4f46\u65e0\u8fd4\u56de",children:[]}]},{value:"9.13.3 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",id:"9133-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",children:[{value:"9.13.3.1 \u521b\u5efa\u53c2\u6570\u6a21\u578b",id:"91331-\u521b\u5efa\u53c2\u6570\u6a21\u578b",children:[]},{value:"9.13.3.2 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",id:"91332-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",children:[]}]},{value:"9.13.3 \u5173\u4e8e [DbParameter]",id:"9133-\u5173\u4e8e-dbparameter",children:[]},{value:"9.13.4 \u5173\u4e8e ProcedureOutputResult",id:"9134-\u5173\u4e8e-procedureoutputresult",children:[]},{value:"9.13.5 \u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570",id:"9135-\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570",children:[]},{value:"9.13.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9136-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:p};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(l.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/dbcontext-sql-proxy"}),"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002",Object(i.b)("inlineCode",{parentName:"p"},"Sql \u9ad8\u7ea7\u4ee3\u7406")," \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002"))),Object(i.b)("h2",{id:"9131-\u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b"},"9.13.1 \u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b"),Object(i.b)("p",null,"\u5f15\u7528\u767e\u5ea6\u767e\u79d1\uff1a"),Object(i.b)("blockquote",null,Object(i.b)("p",{parentName:"blockquote"},"\u5b58\u50a8\u8fc7\u7a0b\uff08Stored Procedure\uff09\u662f\u5728\u5927\u578b\u6570\u636e\u5e93\u7cfb\u7edf\u4e2d\uff0c\u4e00\u7ec4\u4e3a\u4e86\u5b8c\u6210\u7279\u5b9a\u529f\u80fd\u7684 SQL \u8bed\u53e5\u96c6\uff0c\u5b83\u5b58\u50a8\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u4e00\u6b21\u7f16\u8bd1\u540e\u6c38\u4e45\u6709\u6548\uff0c\u7528\u6237\u901a\u8fc7\u6307\u5b9a\u5b58\u50a8\u8fc7\u7a0b\u7684\u540d\u5b57\u5e76\u7ed9\u51fa\u53c2\u6570\uff08\u5982\u679c\u8be5\u5b58\u50a8\u8fc7\u7a0b\u5e26\u6709\u53c2\u6570\uff09\u6765\u6267\u884c\u5b83\u3002"),Object(i.b)("p",{parentName:"blockquote"},"\u5b58\u50a8\u8fc7\u7a0b\u662f\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u5bf9\u8c61\u3002\u5728\u6570\u636e\u91cf\u7279\u522b\u5e9e\u5927\u7684\u60c5\u51b5\u4e0b\u5229\u7528\u5b58\u50a8\u8fc7\u7a0b\u80fd\u8fbe\u5230\u500d\u901f\u7684\u6548\u7387\u63d0\u5347\u3002")),Object(i.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5b58\u50a8\u8fc7\u7a0b\u5c31\u662f\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\uff08",Object(i.b)("inlineCode",{parentName:"p"},"Sqlite")," \u9664\u5916\uff09\u4e2d\u7f16\u5199\u903b\u8f91\u7684\u51fd\u6570/\u65b9\u6cd5\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"sql")," \u7f16\u8bd1\u7f13\u5b58\u8d77\u6765\uff0c\u5927\u5927\u63d0\u9ad8\u5b58\u50a8\u8fc7\u7a0b\u7684\u6267\u884c\u6548\u7387\u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u8fd9\u91cc\u4e0d\u8ba8\u8bba\u5b58\u50a8\u8fc7\u7a0b\u7684\u4f18\u7f3a\u70b9\u3002")),Object(i.b)("h3",{id:"91311-\u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93"},"9.13.1.1 \u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93"),Object(i.b)("table",null,Object(i.b)("thead",{parentName:"table"},Object(i.b)("tr",{parentName:"thead"},Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(i.b)("tbody",{parentName:"table"},Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714")))),Object(i.b)("h2",{id:"9132-\u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528"},"9.13.2 \u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u63d0\u4f9b\u4e86\u591a\u79cd\u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c\u65b9\u5f0f\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"ISqlRepository"),"\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\uff0c\u53ef\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"li"},"\u4f9d\u8d56\u6ce8\u5165")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"ISqlDispatchProxy"),"\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"Sql")," \u4ee3\u7406\u65b9\u5f0f\uff08\u9ad8\u7ea7\u7528\u6cd5\uff0c\u63a8\u8350\uff09"),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7\u4efb\u610f\u5b9e\u4f53\u4ed3\u50a8\u64cd\u4f5c\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"personRepository.SqlProcedureQuery(procName)")),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7\u5b57\u7b26\u4e32\u62d3\u5c55\u65b9\u6cd5\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"procName.SqlProcedureQuery()")),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"li"},"repository.Sql().SqlProcedureQuery()")," \u65b9\u5f0f")),Object(i.b)("h3",{id:"91321-\u521d\u59cb\u5316\u65b9\u5f0f"},"9.13.2.1 \u521d\u59cb\u5316\u65b9\u5f0f"),Object(i.b)(c.a,{defaultValue:"one",values:[{label:"ISqlRepository",value:"one"},{label:"ISqlDispatchProxy",value:"two"},{label:"\u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f",value:"three"},{label:"\u5b57\u7b26\u4e32\u62d3\u5c55\u65b9\u5f0f",value:"four"}],mdxType:"Tabs"},Object(i.b)(o.a,{value:"one",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,9-12}","{1,9-12}":!0}),"using Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [DynamicApiController]\n public class SqlService\n {\n private ISqlRepository _sqlRepository;\n public SqlService(ISqlRepository sqlRepository)\n {\n _sqlRepository = sqlRepository;\n }\n }\n}\n"))),Object(i.b)(o.a,{value:"two",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,7,9-10}","{2,7,9-10}":!0}),'using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public interface ISqlExecuteProxy : ISqlDispatchProxy\n {\n [SqlProcedure("proc_GetPersons")]\n List GetPersons(string keyword);\n }\n}\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9-12}","{9-12}":!0}),"using Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [DynamicApiController]\n public class SqlService\n {\n private ISqlExecuteProxy _sqlExecuteProxy;\n public SqlService(ISqlExecuteProxy sqlExecuteProxy)\n {\n _sqlExecuteProxy = sqlExecuteProxy;\n }\n }\n}\n"))),Object(i.b)(o.a,{value:"three",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var persons = personRepository.SqlProcedureQuery("proc_GetPersons");\n'))),Object(i.b)(o.a,{value:"four",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var persons = "proc_GetPersons".SqlProcedureQuery();\n')))),Object(i.b)("h3",{id:"91322-\u8fd4\u56de-datatable"},"9.13.2.2 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar dataTable = _sqlRepository.SqlProcedureQuery("proc_GetPersons");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar dataTable = _sqlExecuteProxy.GetPersons(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar dataTable = _personRepository.SqlProcedureQuery("proc_GetPersons");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar dataTable = _repository.Sql().SqlProcedureQuery("proc_GetPersons");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar dataTable = "proc_GetPersons".SqlProcedureQuery();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91323-\u8fd4\u56de-dataset"},"9.13.2.3 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar dataSet = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar dataSet = _sqlExecuteProxy.GetPersons(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar dataSet = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar dataSet = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar dataSet = "proc_GetPersons".SqlProcedureQueries();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91324-\u8fd4\u56de-listt"},"9.13.2.4 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"List")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar list = _sqlRepository.SqlProcedureQuery("proc_GetPersons");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar list = _sqlExecuteProxy.GetPersons(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar list = _personRepository.SqlProcedureQuery("proc_GetPersons");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar list = _repository.Sql().SqlProcedureQuery("proc_GetPersons");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar list = "proc_GetPersons".SqlProcedureQuery();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91325-\u8fd4\u56de-tuplet1t8"},"9.13.2.5 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5927\u5927\u5229\u7528\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Tuple")," \u7684\u7279\u6027\uff0c\u5c06\u8fd4\u56de\u591a\u4e2a\u7ed3\u679c\u96c6\u8f6c\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},"Tuple")," \u7c7b\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// ==================================\n\n// ISqlDispatchProxy \u65b9\u5f0f\uff0c\u63a8\u8350\u65b9\u5f0f\uff0c\u81ea\u52a8\u5904\u7406\u591a\u4e2a\u7ed3\u679c\u96c6\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _sqlRepository.GetDatas();\n\n// ==================================\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// ==================================\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// ==================================\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = "proc_GetPersons".SqlProcedureQueries();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91326-\u8fd4\u56de-\u5355\u884c\u5355\u5217-object"},"9.13.2.6 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217 object")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlProcedureScalar("proc_GetName");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetName(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlProcedureScalar("proc_GetName");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlProcedureScalar("proc_GetName");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar value = "proc_GetName".SqlProcedureScalar();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91327-\u8fd4\u56de-\u5355\u884c\u5355\u5217-t"},"9.13.2.7 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217 ")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlProcedureScalar("proc_GetName");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetName(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlProcedureScalar("proc_GetName");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlProcedureScalar("proc_GetName");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar value = "proc_GetName".SqlProcedureScalar();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91328-\u6267\u884c\u4f46\u65e0\u8fd4\u56de"},"9.13.2.8 \u6267\u884c\u4f46\u65e0\u8fd4\u56de"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\n_sqlRepository.SqlProcedureNonQuery("proc_UpdateData");\n\n// ISqlDispatchProxy \u65b9\u5f0f\n_sqlExecuteProxy.UpdateData(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\n_personRepository.SqlProcedureNonQuery("proc_UpdateData");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\n_repository.Sql().SqlProcedureNonQuery("proc_UpdateData");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\n"proc_UpdateData".SqlProcedureNonQuery();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h2",{id:"9133-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"},"9.13.3 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"),Object(i.b)("p",null,"\u5728\u5b58\u50a8\u8fc7\u7a0b\u4e2d\uff0c\u6709\u4e00\u79cd\u4f8b\u5b50\u975e\u5e38\u590d\u6742\uff0c\u90a3\u5c31\u662f\u65e2\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"INPUT")," \u53c2\u6570\uff0c\u53c8\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"OUTPUT")," \u53c2\u6570\uff0c\u8fd8\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"RETURN")," \u53c2\u6570\uff0c\u540c\u65f6\u8fd8\u8f93\u51fa \u7ed3\u679c\u96c6 \ud83d\udca5\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql",metastring:"{3,4,10-12,15-17,22}","{3,4,10-12,15-17,22}":!0}),"CREATE PROC PROC_Output\n @Id INT, // \u8f93\u5165\u53c2\u6570\n @Name NVARCHAR(32) OUTPUT, // \u8f93\u51fa\u53c2\u6570\uff0c\u8fd8\u5e26\u957f\u5ea6\n @Age INT OUTPUT // \u8f93\u51fa\u53c2\u6570\nAS\nBEGIN\n SET @Name = 'Furion Output';\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT *\n FROM dbo.Test\n WHERE Id > @Id;\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT TOP 10\n *\n FROM dbo.Test;\n\n SET @Age = 27;\n\n // \u5e26 RETURN \u8fd4\u56de\n RETURN 10;\nEND;\n")),Object(i.b)("h3",{id:"91331-\u521b\u5efa\u53c2\u6570\u6a21\u578b"},"9.13.3.1 \u521b\u5efa\u53c2\u6570\u6a21\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,10,13,16}","{1,10,13,16}":!0}),"using Furion.DatabaseAccessor;\nusing System.Data;\n\nnamespace Furion.Application\n{\n public class ProcOutputModel\n {\n public int Id { get; set; } // \u8f93\u5165\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output, Size = 32)]\n public string Name { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output)]\n public int Age { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.ReturnValue)]\n public int ReturnValue { get; set; } // \u8fd4\u56de\u503c\n }\n}\n")),Object(i.b)("h3",{id:"91332-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"},"9.13.3.2 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"}," ",Object(i.b)("inlineCode",{parentName:"strong"},"DataSet")," ")," \u65b9\u5f0f")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nProcedureOutputResult result = _sqlRepository.SqlProcedureOutput("proc_Complex", new ProcOutputModel{});\n\n// ISqlDispatchProxy \u65b9\u5f0f\nProcedureOutputResult result = _sqlExecuteProxy.Complex(new ProcOutputModel{}); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nProcedureOutputResult result = _personRepository.SqlProcedureOutput("proc_Complex", new ProcOutputModel{});\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nProcedureOutputResult result = _repository.Sql().SqlProcedureOutput("proc_Complex", new ProcOutputModel{});\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nProcedureOutputResult result = "proc_Complex".SqlProcedureOutput(new ProcOutputModel{});\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u83b7\u53d6 OUTPUT \u53c2\u6570\u503c\nvar outputs = result.OutputValues;\n\n// \u83b7\u53d6 RETURN \u8fd4\u56de\u503c\nvar reval = result.ReturnValue;\n\n// \u83b7\u53d6\u8fd4\u56de\u7ed3\u679c\u96c6\nvar dataSet = result.Result;\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Tuple")," \u65b9\u5f0f")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nProcedureOutputResult<(List, List)> result = _sqlRepository.SqlProcedureOutput<(List, List)>("proc_Complex", new ProcOutputModel{});\n\n// ISqlDispatchProxy \u65b9\u5f0f\nProcedureOutputResult<(List, List)> result = _sqlExecuteProxy.Complex(new ProcOutputModel{}); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nProcedureOutputResult<(List, List)> result = _personRepository.SqlProcedureOutput<(List, List)>("proc_Complex", new ProcOutputModel{});\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nProcedureOutputResult<(List, List)> result = _repository.Sql().SqlProcedureOutput<(List, List)>("proc_Complex", new ProcOutputModel{});\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nProcedureOutputResult<(List, List)> result = "proc_Complex".SqlProcedureOutput<(List, List)>(new ProcOutputModel{});\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u83b7\u53d6 OUTPUT \u53c2\u6570\u503c\nvar outputs = result.OutputValues;\n\n// \u83b7\u53d6 RETURN \u8fd4\u56de\u503c\nvar reval = result.ReturnValue;\n\n// \u83b7\u53d6\u8fd4\u56de\u7ed3\u679c\u96c6\nvar (list1,list2) = result.Result;\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h2",{id:"9133-\u5173\u4e8e-dbparameter"},"9.13.3 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"[DbParameter]")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"[DbParameter]")," \u7279\u6027\u662f\u7528\u6765\u6807\u6ce8 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"\u51fd\u6570"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"\u5b58\u50a8\u8fc7\u7a0b")," \u53c2\u6570\u7684\uff0c\u53ef\u914d\u7f6e\u5c5e\u6027\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Direction"),"\uff1a\u8bbe\u7f6e\u53c2\u6570\u65b9\u5411\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"ParameterDirection")," \u679a\u4e3e\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(i.b)("inlineCode",{parentName:"li"},"ParameterDirection.Input")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DbType"),"\uff1a\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"DbType")," \u679a\u4e3e\u7c7b\u578b\uff0c\u65e0\u9ed8\u8ba4"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Size"),"\uff1a\u8bbe\u7f6e\u53c2\u6570\u957f\u5ea6\u7684\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"int")," \u7c7b\u578b")),Object(i.b)("p",null,"\u5176\u4e2d ",Object(i.b)("inlineCode",{parentName:"p"},"Direction")," \u5c5e\u6027\u662f\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u53c2\u6570\u3002"),Object(i.b)("h2",{id:"9134-\u5173\u4e8e-procedureoutputresult"},"9.13.4 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"ProcedureOutputResult")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"ProcedureOutputResult")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"ProcedureOutputResult")," \u662f\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b\u6267\u884c\u8fd4\u56de\u6a21\u578b\u7c7b\uff0c\u6709\u4ee5\u4e0b\u5c5e\u6027\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OutputValues"),"\uff1a\u591a\u4e2a\u8f93\u51fa\u503c\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"ProcedureOutputValue")," \u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"ReturnValue"),"\uff1a\u8fd4\u56de\u503c\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"object")," \u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Result"),"\uff1a\u7ed3\u679c\u96c6\uff0c\u975e\u6cdb\u578b\u7248\u672c\u662f ",Object(i.b)("inlineCode",{parentName:"li"},"DataSet"),"\u7c7b\u578b\uff0c\u5426\u5219\u662f \u6cdb\u578b\u7c7b\u578b")),Object(i.b)("h2",{id:"9135-\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570"},"9.13.5 \u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570"),Object(i.b)("p",null,"\u6240\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"sql")," \u53c2\u6570\u90fd\u652f\u6301\u56db\u79cd\u65b9\u5f0f\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DbParameter[]"),"\uff1a\u6570\u7ec4\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new {}"),"\uff1a\u533f\u540d\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new Class{}"),"\uff1a\u5f3a\u7c7b\u578b\u7c7b\u578b\uff08\u652f\u6301\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Dictionary")," \u7c7b\u578b")),Object(i.b)("h2",{id:"9136-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.13.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return l}));var a=n(21),r=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+l:l}(t,e,n,a)}}function l(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=r.a.createContext({}),b=function(e){var t=r.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=b(e.components);return r.a.createElement(s.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),p=b(n),d=a,m=p["".concat(l,".").concat(d)]||p[d]||u[d]||i;return n?r.a.createElement(m,c(c({ref:t},s),{},{components:n})):r.a.createElement(m,c({ref:t},s))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,l=new Array(i);l[0]=d;var c={};for(var o in t)hasOwnProperty.call(t,o)&&(c[o]=t[o]);c.originalType=e,c.mdxType="string"==typeof e?e:a,l[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tt.value===e)&&v(e)}const T=e=>{v(e),null!=u&&O(u,e)},P=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(l.a)("tabs",{"tabs--block":n},d)},p.map(({value:e,label:t})=>r.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(l.a)("tabs__item",o.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>P.push(e),onKeyDown:e=>{((e,t,n)=>{switch(n.keyCode){case b:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case s:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(P,e.target,e)},onFocus:()=>T(e),onClick:()=>{T(e)}},t))),t?Object(a.cloneElement)(N.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):r.a.createElement("div",{className:"margin-vert--md"},N.map((e,t)=>Object(a.cloneElement)(e,{key:t,hidden:e.props.value!==j}))))}},204:function(e,t,n){"use strict";var a=n(3),r=n(0),i=n.n(r);t.a=function({children:e,hidden:t,className:n}){return i.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:t,className:n}),e)}},79:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return s})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),i=(n(0),n(196)),l=n(197),c=(n(194),n(203)),o=n(204),s={id:"dbcontext-proc",title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",sidebar_label:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c"},b={unversionedId:"dbcontext-proc",id:"dbcontext-proc",isDocsHomePage:!1,title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",description:"\u63a8\u8350\u4f7f\u7528 \u300a9.17 Sql \u9ad8\u7ea7\u4ee3\u7406\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002Sql \u9ad8\u7ea7\u4ee3\u7406 \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002",source:"@site/docs\\dbcontext-proc.mdx",slug:"/dbcontext-proc",permalink:"/docs/dbcontext-proc",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-proc.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.12 \u89c6\u56fe\u64cd\u4f5c",permalink:"/docs/dbcontext-view"},next:{title:"9.14 \u51fd\u6570\u64cd\u4f5c",permalink:"/docs/dbcontext-function"}},p=[{value:"9.13.1 \u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b",id:"9131-\u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b",children:[{value:"9.13.1.1 \u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93",id:"91311-\u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93",children:[]}]},{value:"9.13.2 \u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528",id:"9132-\u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528",children:[{value:"9.13.2.1 \u521d\u59cb\u5316\u65b9\u5f0f",id:"91321-\u521d\u59cb\u5316\u65b9\u5f0f",children:[]},{value:"9.13.2.2 \u8fd4\u56de DataTable",id:"91322-\u8fd4\u56de-datatable",children:[]},{value:"9.13.2.3 \u8fd4\u56de DataSet",id:"91323-\u8fd4\u56de-dataset",children:[]},{value:"9.13.2.4 \u8fd4\u56de List<T>",id:"91324-\u8fd4\u56de-listt",children:[]},{value:"9.13.2.5 \u8fd4\u56de Tuple<T1,...T8>",id:"91325-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.13.2.6 \u8fd4\u56de \u5355\u884c\u5355\u5217 object",id:"91326-\u8fd4\u56de-\u5355\u884c\u5355\u5217-object",children:[]},{value:"9.13.2.7 \u8fd4\u56de \u5355\u884c\u5355\u5217 <T>",id:"91327-\u8fd4\u56de-\u5355\u884c\u5355\u5217-t",children:[]},{value:"9.13.2.8 \u6267\u884c\u4f46\u65e0\u8fd4\u56de",id:"91328-\u6267\u884c\u4f46\u65e0\u8fd4\u56de",children:[]}]},{value:"9.13.3 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",id:"9133-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",children:[{value:"9.13.3.1 \u521b\u5efa\u53c2\u6570\u6a21\u578b",id:"91331-\u521b\u5efa\u53c2\u6570\u6a21\u578b",children:[]},{value:"9.13.3.2 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",id:"91332-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b",children:[]}]},{value:"9.13.3 \u5173\u4e8e [DbParameter]",id:"9133-\u5173\u4e8e-dbparameter",children:[]},{value:"9.13.4 \u5173\u4e8e ProcedureOutputResult",id:"9134-\u5173\u4e8e-procedureoutputresult",children:[]},{value:"9.13.5 \u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570",id:"9135-\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570",children:[]},{value:"9.13.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9136-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:p};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(l.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/dbcontext-sql-proxy"}),"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002",Object(i.b)("inlineCode",{parentName:"p"},"Sql \u9ad8\u7ea7\u4ee3\u7406")," \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002"))),Object(i.b)("h2",{id:"9131-\u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b"},"9.13.1 \u5173\u4e8e\u5b58\u50a8\u8fc7\u7a0b"),Object(i.b)("p",null,"\u5f15\u7528\u767e\u5ea6\u767e\u79d1\uff1a"),Object(i.b)("blockquote",null,Object(i.b)("p",{parentName:"blockquote"},"\u5b58\u50a8\u8fc7\u7a0b\uff08Stored Procedure\uff09\u662f\u5728\u5927\u578b\u6570\u636e\u5e93\u7cfb\u7edf\u4e2d\uff0c\u4e00\u7ec4\u4e3a\u4e86\u5b8c\u6210\u7279\u5b9a\u529f\u80fd\u7684 SQL \u8bed\u53e5\u96c6\uff0c\u5b83\u5b58\u50a8\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u4e00\u6b21\u7f16\u8bd1\u540e\u6c38\u4e45\u6709\u6548\uff0c\u7528\u6237\u901a\u8fc7\u6307\u5b9a\u5b58\u50a8\u8fc7\u7a0b\u7684\u540d\u5b57\u5e76\u7ed9\u51fa\u53c2\u6570\uff08\u5982\u679c\u8be5\u5b58\u50a8\u8fc7\u7a0b\u5e26\u6709\u53c2\u6570\uff09\u6765\u6267\u884c\u5b83\u3002"),Object(i.b)("p",{parentName:"blockquote"},"\u5b58\u50a8\u8fc7\u7a0b\u662f\u6570\u636e\u5e93\u4e2d\u7684\u4e00\u4e2a\u91cd\u8981\u5bf9\u8c61\u3002\u5728\u6570\u636e\u91cf\u7279\u522b\u5e9e\u5927\u7684\u60c5\u51b5\u4e0b\u5229\u7528\u5b58\u50a8\u8fc7\u7a0b\u80fd\u8fbe\u5230\u500d\u901f\u7684\u6548\u7387\u63d0\u5347\u3002")),Object(i.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5b58\u50a8\u8fc7\u7a0b\u5c31\u662f\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\uff08",Object(i.b)("inlineCode",{parentName:"p"},"Sqlite")," \u9664\u5916\uff09\u4e2d\u7f16\u5199\u903b\u8f91\u7684\u51fd\u6570/\u65b9\u6cd5\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"sql")," \u7f16\u8bd1\u7f13\u5b58\u8d77\u6765\uff0c\u5927\u5927\u63d0\u9ad8\u5b58\u50a8\u8fc7\u7a0b\u7684\u6267\u884c\u6548\u7387\u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u8fd9\u91cc\u4e0d\u8ba8\u8bba\u5b58\u50a8\u8fc7\u7a0b\u7684\u4f18\u7f3a\u70b9\u3002")),Object(i.b)("h3",{id:"91311-\u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93"},"9.13.1.1 \u652f\u6301\u5b58\u50a8\u8fc7\u7a0b\u7684\u6570\u636e\u5e93"),Object(i.b)("table",null,Object(i.b)("thead",{parentName:"table"},Object(i.b)("tr",{parentName:"thead"},Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(i.b)("tbody",{parentName:"table"},Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714")))),Object(i.b)("h2",{id:"9132-\u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528"},"9.13.2 \u5b58\u50a8\u8fc7\u7a0b\u4f7f\u7528"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u63d0\u4f9b\u4e86\u591a\u79cd\u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c\u65b9\u5f0f\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"ISqlRepository"),"\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\uff0c\u53ef\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"li"},"\u4f9d\u8d56\u6ce8\u5165")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"ISqlDispatchProxy"),"\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"Sql")," \u4ee3\u7406\u65b9\u5f0f\uff08\u9ad8\u7ea7\u7528\u6cd5\uff0c\u63a8\u8350\uff09"),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7\u4efb\u610f\u5b9e\u4f53\u4ed3\u50a8\u64cd\u4f5c\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"personRepository.SqlProcedureQuery(procName)")),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7\u5b57\u7b26\u4e32\u62d3\u5c55\u65b9\u6cd5\uff1a",Object(i.b)("inlineCode",{parentName:"li"},"procName.SqlProcedureQuery()")),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"li"},"repository.Sql().SqlProcedureQuery()")," \u65b9\u5f0f")),Object(i.b)("h3",{id:"91321-\u521d\u59cb\u5316\u65b9\u5f0f"},"9.13.2.1 \u521d\u59cb\u5316\u65b9\u5f0f"),Object(i.b)(c.a,{defaultValue:"one",values:[{label:"ISqlRepository",value:"one"},{label:"ISqlDispatchProxy",value:"two"},{label:"\u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f",value:"three"},{label:"\u5b57\u7b26\u4e32\u62d3\u5c55\u65b9\u5f0f",value:"four"}],mdxType:"Tabs"},Object(i.b)(o.a,{value:"one",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,9-12}","{1,9-12}":!0}),"using Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [DynamicApiController]\n public class SqlService\n {\n private ISqlRepository _sqlRepository;\n public SqlService(ISqlRepository sqlRepository)\n {\n _sqlRepository = sqlRepository;\n }\n }\n}\n"))),Object(i.b)(o.a,{value:"two",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,7,9-10}","{2,7,9-10}":!0}),'using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public interface ISqlExecuteProxy : ISqlDispatchProxy\n {\n [SqlProcedure("proc_GetPersons")]\n List GetPersons(string keyword);\n }\n}\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9-12}","{9-12}":!0}),"using Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [DynamicApiController]\n public class SqlService\n {\n private ISqlExecuteProxy _sqlExecuteProxy;\n public SqlService(ISqlExecuteProxy sqlExecuteProxy)\n {\n _sqlExecuteProxy = sqlExecuteProxy;\n }\n }\n}\n"))),Object(i.b)(o.a,{value:"three",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var persons = personRepository.SqlProcedureQuery("proc_GetPersons");\n'))),Object(i.b)(o.a,{value:"four",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var persons = "proc_GetPersons".SqlProcedureQuery();\n')))),Object(i.b)("h3",{id:"91322-\u8fd4\u56de-datatable"},"9.13.2.2 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar dataTable = _sqlRepository.SqlProcedureQuery("proc_GetPersons");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar dataTable = _sqlExecuteProxy.GetPersons(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar dataTable = _personRepository.SqlProcedureQuery("proc_GetPersons");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar dataTable = _repository.Sql().SqlProcedureQuery("proc_GetPersons");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar dataTable = "proc_GetPersons".SqlProcedureQuery();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91323-\u8fd4\u56de-dataset"},"9.13.2.3 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar dataSet = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar dataSet = _sqlExecuteProxy.GetPersons(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar dataSet = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar dataSet = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar dataSet = "proc_GetPersons".SqlProcedureQueries();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91324-\u8fd4\u56de-listt"},"9.13.2.4 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"List")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar list = _sqlRepository.SqlProcedureQuery("proc_GetPersons");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar list = _sqlExecuteProxy.GetPersons(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar list = _personRepository.SqlProcedureQuery("proc_GetPersons");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar list = _repository.Sql().SqlProcedureQuery("proc_GetPersons");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar list = "proc_GetPersons".SqlProcedureQuery();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91325-\u8fd4\u56de-tuplet1t8"},"9.13.2.5 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5927\u5927\u5229\u7528\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Tuple")," \u7684\u7279\u6027\uff0c\u5c06\u8fd4\u56de\u591a\u4e2a\u7ed3\u679c\u96c6\u8f6c\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},"Tuple")," \u7c7b\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _sqlRepository.SqlProcedureQueries("proc_GetPersons");\n\n// ==================================\n\n// ISqlDispatchProxy \u65b9\u5f0f\uff0c\u63a8\u8350\u65b9\u5f0f\uff0c\u81ea\u52a8\u5904\u7406\u591a\u4e2a\u7ed3\u679c\u96c6\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _sqlRepository.GetDatas();\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _sqlRepository.GetDatas();\n\n// ==================================\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _personRepository.SqlProcedureQueries("proc_GetPersons");\n\n// ==================================\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = _repository.Sql().SqlProcedureQueries("proc_GetPersons");\n\n// ==================================\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\n\n// \u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6\nvar list1 = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e24\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e09\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u56db\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e94\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u516d\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u4e03\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7) = "proc_GetPersons".SqlProcedureQueries();\n\n// \u8fd4\u56de\u516b\u4e2a\u7ed3\u679c\u96c6\nvar (list1, list2, list3, list4, list5, list6, list7, list8) = "proc_GetPersons".SqlProcedureQueries();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91326-\u8fd4\u56de-\u5355\u884c\u5355\u5217-object"},"9.13.2.6 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217 object")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlProcedureScalar("proc_GetName");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetName(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlProcedureScalar("proc_GetName");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlProcedureScalar("proc_GetName");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar value = "proc_GetName".SqlProcedureScalar();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91327-\u8fd4\u56de-\u5355\u884c\u5355\u5217-t"},"9.13.2.7 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217 ")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlProcedureScalar("proc_GetName");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetName(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlProcedureScalar("proc_GetName");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlProcedureScalar("proc_GetName");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nvar value = "proc_GetName".SqlProcedureScalar();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h3",{id:"91328-\u6267\u884c\u4f46\u65e0\u8fd4\u56de"},"9.13.2.8 \u6267\u884c\u4f46\u65e0\u8fd4\u56de"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\n_sqlRepository.SqlProcedureNonQuery("proc_UpdateData");\n\n// ISqlDispatchProxy \u65b9\u5f0f\n_sqlExecuteProxy.UpdateData(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\n_personRepository.SqlProcedureNonQuery("proc_UpdateData");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\n_repository.Sql().SqlProcedureNonQuery("proc_UpdateData");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\n"proc_UpdateData".SqlProcedureNonQuery();\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h2",{id:"9133-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"},"9.13.3 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"),Object(i.b)("p",null,"\u5728\u5b58\u50a8\u8fc7\u7a0b\u4e2d\uff0c\u6709\u4e00\u79cd\u4f8b\u5b50\u975e\u5e38\u590d\u6742\uff0c\u90a3\u5c31\u662f\u65e2\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"INPUT")," \u53c2\u6570\uff0c\u53c8\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"OUTPUT")," \u53c2\u6570\uff0c\u8fd8\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"RETURN")," \u53c2\u6570\uff0c\u540c\u65f6\u8fd8\u8f93\u51fa \u7ed3\u679c\u96c6 \ud83d\udca5\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql",metastring:"{3,4,10-12,15-17,22}","{3,4,10-12,15-17,22}":!0}),"CREATE PROC PROC_Output\n @Id INT, // \u8f93\u5165\u53c2\u6570\n @Name NVARCHAR(32) OUTPUT, // \u8f93\u51fa\u53c2\u6570\uff0c\u8fd8\u5e26\u957f\u5ea6\n @Age INT OUTPUT // \u8f93\u51fa\u53c2\u6570\nAS\nBEGIN\n SET @Name = 'Furion Output';\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT *\n FROM dbo.Test\n WHERE Id > @Id;\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT TOP 10\n *\n FROM dbo.Test;\n\n SET @Age = 27;\n\n // \u5e26 RETURN \u8fd4\u56de\n RETURN 10;\nEND;\n")),Object(i.b)("h3",{id:"91331-\u521b\u5efa\u53c2\u6570\u6a21\u578b"},"9.13.3.1 \u521b\u5efa\u53c2\u6570\u6a21\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,10,13,16}","{1,10,13,16}":!0}),"using Furion.DatabaseAccessor;\nusing System.Data;\n\nnamespace Furion.Application\n{\n public class ProcOutputModel\n {\n public int Id { get; set; } // \u8f93\u5165\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output, Size = 32)]\n public string Name { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output)]\n public int Age { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.ReturnValue)]\n public int ReturnValue { get; set; } // \u8fd4\u56de\u503c\n }\n}\n")),Object(i.b)("h3",{id:"91332-\u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"},"9.13.3.2 \u6267\u884c\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"}," ",Object(i.b)("inlineCode",{parentName:"strong"},"DataSet")," ")," \u65b9\u5f0f")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nProcedureOutputResult result = _sqlRepository.SqlProcedureOutput("proc_Complex", new ProcOutputModel{});\n\n// ISqlDispatchProxy \u65b9\u5f0f\nProcedureOutputResult result = _sqlExecuteProxy.Complex(new ProcOutputModel{}); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nProcedureOutputResult result = _personRepository.SqlProcedureOutput("proc_Complex", new ProcOutputModel{});\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nProcedureOutputResult result = _repository.Sql().SqlProcedureOutput("proc_Complex", new ProcOutputModel{});\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nProcedureOutputResult result = "proc_Complex".SqlProcedureOutput(new ProcOutputModel{});\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u83b7\u53d6 OUTPUT \u53c2\u6570\u503c\nvar outputs = result.OutputValues;\n\n// \u83b7\u53d6 RETURN \u8fd4\u56de\u503c\nvar reval = result.ReturnValue;\n\n// \u83b7\u53d6\u8fd4\u56de\u7ed3\u679c\u96c6\nvar dataSet = result.Result;\n")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Tuple")," \u65b9\u5f0f")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nProcedureOutputResult<(List, List)> result = _sqlRepository.SqlProcedureOutput<(List, List)>("proc_Complex", new ProcOutputModel{});\n\n// ISqlDispatchProxy \u65b9\u5f0f\nProcedureOutputResult<(List, List)> result = _sqlExecuteProxy.Complex(new ProcOutputModel{}); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nProcedureOutputResult<(List, List)> result = _personRepository.SqlProcedureOutput<(List, List)>("proc_Complex", new ProcOutputModel{});\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nProcedureOutputResult<(List, List)> result = _repository.Sql().SqlProcedureOutput<(List, List)>("proc_Complex", new ProcOutputModel{});\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u5b58\u50a8\u8fc7\u7a0b\u540d\u6267\u884c\nProcedureOutputResult<(List, List)> result = "proc_Complex".SqlProcedureOutput<(List, List)>(new ProcOutputModel{});\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u83b7\u53d6 OUTPUT \u53c2\u6570\u503c\nvar outputs = result.OutputValues;\n\n// \u83b7\u53d6 RETURN \u8fd4\u56de\u503c\nvar reval = result.ReturnValue;\n\n// \u83b7\u53d6\u8fd4\u56de\u7ed3\u679c\u96c6\nvar (list1,list2) = result.Result;\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(i.b)("h2",{id:"9133-\u5173\u4e8e-dbparameter"},"9.13.3 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"[DbParameter]")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"[DbParameter]")," \u7279\u6027\u662f\u7528\u6765\u6807\u6ce8 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"\u51fd\u6570"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"\u5b58\u50a8\u8fc7\u7a0b")," \u53c2\u6570\u7684\uff0c\u53ef\u914d\u7f6e\u5c5e\u6027\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Direction"),"\uff1a\u8bbe\u7f6e\u53c2\u6570\u65b9\u5411\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"ParameterDirection")," \u679a\u4e3e\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(i.b)("inlineCode",{parentName:"li"},"ParameterDirection.Input")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DbType"),"\uff1a\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"DbType")," \u679a\u4e3e\u7c7b\u578b\uff0c\u65e0\u9ed8\u8ba4"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Size"),"\uff1a\u8bbe\u7f6e\u53c2\u6570\u957f\u5ea6\u7684\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"int")," \u7c7b\u578b")),Object(i.b)("p",null,"\u5176\u4e2d ",Object(i.b)("inlineCode",{parentName:"p"},"Direction")," \u5c5e\u6027\u662f\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u53c2\u6570\u3002"),Object(i.b)("h2",{id:"9134-\u5173\u4e8e-procedureoutputresult"},"9.13.4 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"ProcedureOutputResult")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"ProcedureOutputResult")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"ProcedureOutputResult")," \u662f\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b\u6267\u884c\u8fd4\u56de\u6a21\u578b\u7c7b\uff0c\u6709\u4ee5\u4e0b\u5c5e\u6027\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OutputValues"),"\uff1a\u591a\u4e2a\u8f93\u51fa\u503c\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"ProcedureOutputValue")," \u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"ReturnValue"),"\uff1a\u8fd4\u56de\u503c\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"object")," \u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Result"),"\uff1a\u7ed3\u679c\u96c6\uff0c\u975e\u6cdb\u578b\u7248\u672c\u662f ",Object(i.b)("inlineCode",{parentName:"li"},"DataSet"),"\u7c7b\u578b\uff0c\u5426\u5219\u662f \u6cdb\u578b\u7c7b\u578b")),Object(i.b)("h2",{id:"9135-\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570"},"9.13.5 \u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570"),Object(i.b)("p",null,"\u6240\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"sql")," \u53c2\u6570\u90fd\u652f\u6301\u56db\u79cd\u65b9\u5f0f\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DbParameter[]"),"\uff1a\u6570\u7ec4\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new {}"),"\uff1a\u533f\u540d\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new Class{}"),"\uff1a\u5f3a\u7c7b\u578b\u7c7b\u578b\uff08\u652f\u6301\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Dictionary")," \u7c7b\u578b")),Object(i.b)("h2",{id:"9136-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.13.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/17666df9.1fd7bf84.js b/docs/17666df9.ee70b916.js similarity index 98% rename from docs/17666df9.1fd7bf84.js rename to docs/17666df9.ee70b916.js index a0a0b973742..4b60a3188c8 100644 --- a/docs/17666df9.1fd7bf84.js +++ b/docs/17666df9.ee70b916.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{190:function(e,n,a){"use strict";a.d(n,"b",(function(){return s})),a.d(n,"a",(function(){return o}));var t=a(21),r=a(191);function s(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(a,t)=>function(e,n,a,{forcePrependBaseUrl:t=!1,absolute:s=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(r.b)(a))return a;if(t)return n+a;const o=a.startsWith(n)?a:n+a.replace(/^\//,"");return s?e+o:o}(n,e,a,t)}}function o(e,n={}){const{withBaseUrl:a}=s();return a(e,n)}},191:function(e,n,a){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!t(e)}a.d(n,"b",(function(){return t})),a.d(n,"a",(function(){return r}))},192:function(e,n,a){"use strict";a.d(n,"a",(function(){return p})),a.d(n,"b",(function(){return w}));var t=a(0),r=a.n(t);function s(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function o(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function c(e){for(var n=1;n=0||(r[a]=e[a]);return r}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=r.a.createContext({}),d=function(e){var n=r.a.useContext(i),a=n;return e&&(a="function"==typeof e?e(n):c(c({},n),e)),a},p=function(e){var n=d(e.components);return r.a.createElement(i.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},l=r.a.forwardRef((function(e,n){var a=e.components,t=e.mdxType,s=e.originalType,o=e.parentName,i=u(e,["components","mdxType","originalType","parentName"]),p=d(a),l=t,w=p["".concat(o,".").concat(l)]||p[l]||m[l]||s;return a?r.a.createElement(w,c(c({ref:n},i),{},{components:a})):r.a.createElement(w,c({ref:n},i))}));function w(e,n){var a=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var s=a.length,o=new Array(s);o[0]=l;var c={};for(var u in n)hasOwnProperty.call(n,u)&&(c[u]=n[u]);c.originalType=e,c.mdxType="string"==typeof e?e:t,o[1]=c;for(var i=2;in(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},80:function(e,n,a){"use strict";a.r(n),a.d(n,"frontMatter",(function(){return c})),a.d(n,"metadata",(function(){return u})),a.d(n,"toc",(function(){return i})),a.d(n,"default",(function(){return p}));var t=a(3),r=a(7),s=(a(0),a(192)),o=a(193),c={id:"dbcontext-update",title:"9.6 \u66f4\u65b0\u64cd\u4f5c",sidebar_label:"9.6 \u66f4\u65b0\u64cd\u4f5c"},u={unversionedId:"dbcontext-update",id:"dbcontext-update",isDocsHomePage:!1,title:"9.6 \u66f4\u65b0\u64cd\u4f5c",description:"9.6.1 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",source:"@site/docs\\dbcontext-update.mdx",slug:"/dbcontext-update",permalink:"/docs/dbcontext-update",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-update.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.6 \u66f4\u65b0\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.5 \u65b0\u589e\u64cd\u4f5c",permalink:"/docs/dbcontext-add"},next:{title:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",permalink:"/docs/dbcontext-add-or-update"}},i=[{value:"9.6.1 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"961-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.2 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"962-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.3 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"963-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.4 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"964-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.5 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"965-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.6 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"966-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.7 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"967-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.8 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"968-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.9 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"969-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.10 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"9610-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.11 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"9611-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.12 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"9612-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.13 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"9613-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.14 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"9614-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.15 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9615-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:i};function p(e){var n=e.components,a=Object(r.a)(e,["components"]);return Object(s.b)("wrapper",Object(t.a)({},d,a,{components:n,mdxType:"MDXLayout"}),Object(s.b)(o.a,{mdxType:"JoinGroup"}),Object(s.b)("h2",{id:"961-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.1 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Update(user);\n\n// \u793a\u4f8b\u4e8c\nuser.Update();\n\n// \u793a\u4f8b\u4e09\nrepository.ChangeEntityState(user, EntityState.Modified);\n\n// \u793a\u4f8b\u56db\nrepository.Entities.Update(user);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateAsync();\n")),Object(s.b)("h2",{id:"962-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.2 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.UpdateNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateNowAsync();\n")),Object(s.b)("h2",{id:"963-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.3 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateInclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateInclude(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateInclude(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateInclude(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateInclude(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateInclude(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"964-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.4 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateIncludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateIncludeNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateIncludeNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateIncludeNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateIncludeNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateInclude(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"965-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.5 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExclude(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExclude(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExclude(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExclude(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExclude(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"966-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.6 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExcludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExcludeNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExcludeNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExcludeNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExcludeNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExcludeNow(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"967-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.7 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExists(user);\n\n// \u793a\u4f8b\u4e8c\nuser.UpdateExists();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExistsAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateExistsAsync();\n")),Object(s.b)("h2",{id:"968-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.8 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExistsNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.UpdateExistsNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExistsNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateExistsNowAsync();\n")),Object(s.b)("h2",{id:"969-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.9 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateIncludeExists(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateIncludeExists(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateIncludeExists(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateIncludeExists(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateIncludeExists(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateIncludeExists(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeExistsAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeExistsAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9610-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.10 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateIncludeExistsNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateIncludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateIncludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateIncludeExistsNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateIncludeExistsNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateIncludeExistsNow(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeExistsNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeExistsNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9611-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.11 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExcludeExists(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExcludeExists(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExcludeExists(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExcludeExists(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExcludeExists(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExcludeExists(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeExistsAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeExistsAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9612-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.12 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExcludeExistsNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExcludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExcludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExcludeExistsNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExcludeExistsNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExcludeExistsNow(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeExistsNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeExistsNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9613-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.13 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Update(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.Update(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.Update(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateAsync(new[] {user, user2 });\n")),Object(s.b)("h2",{id:"9614-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.14 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateNow(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateNow(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateNow(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateNowAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateNowAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateNowAsync(new[] {user, user2 });\n")),Object(s.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(s.b)("h5",{parentName:"div"},Object(s.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(s.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(s.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(s.b)("p",{parentName:"div"},"\u6240\u6709\u5e26 ",Object(s.b)("inlineCode",{parentName:"p"},"Now")," \u7ed3\u5c3e\u7684\u8868\u793a\u7acb\u5373\u63d0\u4ea4\u5230\u6570\u636e\u5e93\uff0c\u4e5f\u5c31\u662f\u7acb\u5373\u8c03\u7528 ",Object(s.b)("inlineCode",{parentName:"p"},"SaveChanges")," \u6216 ",Object(s.b)("inlineCode",{parentName:"p"},"SaveChangesAsync"),"\u3002"))),Object(s.b)("h2",{id:"9615-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.6.15 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(s.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(s.b)("h5",{parentName:"div"},Object(s.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(s.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(s.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(s.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(s.b)("a",Object(t.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{194:function(e,n,a){"use strict";a.d(n,"b",(function(){return s})),a.d(n,"a",(function(){return o}));var t=a(21),r=a(195);function s(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(a,t)=>function(e,n,a,{forcePrependBaseUrl:t=!1,absolute:s=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(r.b)(a))return a;if(t)return n+a;const o=a.startsWith(n)?a:n+a.replace(/^\//,"");return s?e+o:o}(n,e,a,t)}}function o(e,n={}){const{withBaseUrl:a}=s();return a(e,n)}},195:function(e,n,a){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!t(e)}a.d(n,"b",(function(){return t})),a.d(n,"a",(function(){return r}))},196:function(e,n,a){"use strict";a.d(n,"a",(function(){return p})),a.d(n,"b",(function(){return w}));var t=a(0),r=a.n(t);function s(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function o(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function c(e){for(var n=1;n=0||(r[a]=e[a]);return r}(e,n);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=r.a.createContext({}),d=function(e){var n=r.a.useContext(i),a=n;return e&&(a="function"==typeof e?e(n):c(c({},n),e)),a},p=function(e){var n=d(e.components);return r.a.createElement(i.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},l=r.a.forwardRef((function(e,n){var a=e.components,t=e.mdxType,s=e.originalType,o=e.parentName,i=u(e,["components","mdxType","originalType","parentName"]),p=d(a),l=t,w=p["".concat(o,".").concat(l)]||p[l]||m[l]||s;return a?r.a.createElement(w,c(c({ref:n},i),{},{components:a})):r.a.createElement(w,c({ref:n},i))}));function w(e,n){var a=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var s=a.length,o=new Array(s);o[0]=l;var c={};for(var u in n)hasOwnProperty.call(n,u)&&(c[u]=n[u]);c.originalType=e,c.mdxType="string"==typeof e?e:t,o[1]=c;for(var i=2;in(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},80:function(e,n,a){"use strict";a.r(n),a.d(n,"frontMatter",(function(){return c})),a.d(n,"metadata",(function(){return u})),a.d(n,"toc",(function(){return i})),a.d(n,"default",(function(){return p}));var t=a(3),r=a(7),s=(a(0),a(196)),o=a(197),c={id:"dbcontext-update",title:"9.6 \u66f4\u65b0\u64cd\u4f5c",sidebar_label:"9.6 \u66f4\u65b0\u64cd\u4f5c"},u={unversionedId:"dbcontext-update",id:"dbcontext-update",isDocsHomePage:!1,title:"9.6 \u66f4\u65b0\u64cd\u4f5c",description:"9.6.1 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",source:"@site/docs\\dbcontext-update.mdx",slug:"/dbcontext-update",permalink:"/docs/dbcontext-update",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-update.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.6 \u66f4\u65b0\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.5 \u65b0\u589e\u64cd\u4f5c",permalink:"/docs/dbcontext-add"},next:{title:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",permalink:"/docs/dbcontext-add-or-update"}},i=[{value:"9.6.1 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"961-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.2 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"962-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.3 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"963-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.4 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"964-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.5 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"965-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.6 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"966-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.7 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"967-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.8 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"968-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.9 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"969-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.10 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"9610-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.11 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"9611-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.12 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"9612-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.13 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"9613-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.14 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"9614-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.6.15 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9615-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:i};function p(e){var n=e.components,a=Object(r.a)(e,["components"]);return Object(s.b)("wrapper",Object(t.a)({},d,a,{components:n,mdxType:"MDXLayout"}),Object(s.b)(o.a,{mdxType:"JoinGroup"}),Object(s.b)("h2",{id:"961-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.1 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Update(user);\n\n// \u793a\u4f8b\u4e8c\nuser.Update();\n\n// \u793a\u4f8b\u4e09\nrepository.ChangeEntityState(user, EntityState.Modified);\n\n// \u793a\u4f8b\u56db\nrepository.Entities.Update(user);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateAsync();\n")),Object(s.b)("h2",{id:"962-\u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.2 \u66f4\u65b0\u5168\u90e8\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.UpdateNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateNowAsync();\n")),Object(s.b)("h2",{id:"963-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.3 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateInclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateInclude(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateInclude(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateInclude(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateInclude(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateInclude(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"964-\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.4 \u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateIncludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateIncludeNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateIncludeNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateIncludeNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateIncludeNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateInclude(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"965-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.5 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExclude(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExclude(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExclude(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExclude(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExclude(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"966-\u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.6 \u6392\u9664\u7279\u5b9a\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExcludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExcludeNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExcludeNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExcludeNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExcludeNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExcludeNow(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"967-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.7 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExists(user);\n\n// \u793a\u4f8b\u4e8c\nuser.UpdateExists();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExistsAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateExistsAsync();\n")),Object(s.b)("h2",{id:"968-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.8 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u6240\u6709\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExistsNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.UpdateExistsNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExistsNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.UpdateExistsNowAsync();\n")),Object(s.b)("h2",{id:"969-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.9 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateIncludeExists(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateIncludeExists(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateIncludeExists(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateIncludeExists(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateIncludeExists(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateIncludeExists(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeExistsAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeExistsAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9610-\u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.10 \u6570\u636e\u5b58\u5728\u624d\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateIncludeExistsNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateIncludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateIncludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateIncludeExistsNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateIncludeExistsNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateIncludeExistsNow(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateIncludeExistsNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateIncludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateIncludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateIncludeExistsNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateIncludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateIncludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9611-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.11 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExcludeExists(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExcludeExists(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExcludeExists(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExcludeExists(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExcludeExists(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExcludeExists(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeExistsAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeExistsAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeExistsAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeExistsAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9612-\u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.12 \u6570\u636e\u5b58\u5728\u624d\u6392\u9664\u7279\u5b9a\u90e8\u5206\u5217\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateExcludeExistsNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateExcludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateExcludeExistsNow(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nuser.UpdateExcludeExistsNow(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.UpdateExcludeExistsNow(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nuser.UpdateExcludeExistsNow(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateExcludeExistsNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateExcludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)});\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateExcludeExistsNowAsync(user, new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n\n// \u793a\u4f8b\u56db\nawait user.UpdateExcludeExistsNowAsync(new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.UpdateExcludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age));\n\n// \u793a\u4f8b\u516d\nawait user.UpdateExcludeExistsNowAsync(new[] {nameof(User.Name), nameof(User.Age)}, true); // \u5ffd\u7565\u7a7a\u503c\n')),Object(s.b)("h2",{id:"9613-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.13 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Update(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.Update(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.Update(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateAsync(new[] {user, user2 });\n")),Object(s.b)("h2",{id:"9614-\u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.6.14 \u66f4\u65b0\u591a\u6761\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(s.b)("pre",null,Object(s.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.UpdateNow(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.UpdateNow(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.UpdateNow(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.UpdateNowAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.UpdateNowAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.UpdateNowAsync(new[] {user, user2 });\n")),Object(s.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(s.b)("h5",{parentName:"div"},Object(s.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(s.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(s.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(s.b)("p",{parentName:"div"},"\u6240\u6709\u5e26 ",Object(s.b)("inlineCode",{parentName:"p"},"Now")," \u7ed3\u5c3e\u7684\u8868\u793a\u7acb\u5373\u63d0\u4ea4\u5230\u6570\u636e\u5e93\uff0c\u4e5f\u5c31\u662f\u7acb\u5373\u8c03\u7528 ",Object(s.b)("inlineCode",{parentName:"p"},"SaveChanges")," \u6216 ",Object(s.b)("inlineCode",{parentName:"p"},"SaveChangesAsync"),"\u3002"))),Object(s.b)("h2",{id:"9615-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.6.15 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(s.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(s.b)("h5",{parentName:"div"},Object(s.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(s.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(s.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(s.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(s.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(s.b)("a",Object(t.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/1c7850a0.197ea15f.js b/docs/1c7850a0.9b517db8.js similarity index 94% rename from docs/1c7850a0.197ea15f.js rename to docs/1c7850a0.9b517db8.js index 314a99e13d2..b4552f45b11 100644 --- a/docs/1c7850a0.197ea15f.js +++ b/docs/1c7850a0.9b517db8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{190:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}));var r=t(21),i=t(191);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(r)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+o:o}(n,e,t,r)}}function o(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},191:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return m}));var r=t(0),i=t.n(r);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var b=i.a.createContext({}),p=function(e){var n=i.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(b.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),s=p(t),d=r,m=s["".concat(o,".").concat(d)]||s[d]||u[d]||a;return t?i.a.createElement(m,c(c({ref:n},b),{},{components:t})):i.a.createElement(m,c({ref:n},b))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var a=t.length,o=new Array(a);o[0]=d;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},84:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return s}));var r=t(3),i=t(7),a=(t(0),t(192)),o=t(193),c={id:"appsettings",title:"1. \u5e94\u7528\u914d\u7f6e",sidebar_label:"1. \u5e94\u7528\u914d\u7f6e"},l={unversionedId:"settings/appsettings",id:"settings/appsettings",isDocsHomePage:!1,title:"1. \u5e94\u7528\u914d\u7f6e",description:"1.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\appsettings.mdx",slug:"/settings/appsettings",permalink:"/docs/settings/appsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/appsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1. \u5e94\u7528\u914d\u7f6e",sidebar:"settings",next:{title:"2. \u8de8\u57df\u914d\u7f6e",permalink:"/docs/settings/corsaccessorsettings"}},b=[{value:"1.1 \u5173\u4e8e\u914d\u7f6e",id:"11-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"1.2 \u914d\u7f6e\u4fe1\u606f",id:"12-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"1.3 \u914d\u7f6e\u793a\u4f8b",id:"13-\u914d\u7f6e\u793a\u4f8b",children:[]},{value:"1.4 \u7279\u522b\u6ce8\u610f",id:"14-\u7279\u522b\u6ce8\u610f",children:[]}],p={toc:b};function s(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"11-\u5173\u4e8e\u914d\u7f6e"},"1.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u5e94\u7528\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5168\u5c40\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"12-\u914d\u7f6e\u4fe1\u606f"},"1.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AppSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"InjectMiniProfiler"),"\uff1a\u662f\u5426\u6ce8\u5165 ",Object(a.b)("inlineCode",{parentName:"li"},"MiniProfiler"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"InjectSpecificationDocument"),"\uff1a\u662f\u5426\u542f\u7528 ",Object(a.b)("inlineCode",{parentName:"li"},"Swagger")," \u6587\u6863\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"EnabledReferenceAssemblyScan"),"\uff1a\u662f\u5426\u542f\u7528\u901a\u8fc7 ",Object(a.b)("inlineCode",{parentName:"li"},"dll")," \u65b9\u5f0f\u6dfb\u52a0\u7684\u5f15\u7528\u7a0b\u5e8f\u96c6\u626b\u63cf\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ExternalAssemblies"),"\uff1a\u914d\u7f6e\u5916\u90e8\u7a0b\u5e8f\u96c6\u5b8c\u6574\u8def\u5f84\uff0c\u652f\u6301\u52a8\u6001\u52a0\u8f7d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"[]")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DynamicLogLevel"),"\uff1a\u914d\u7f6e\u52a8\u6001\u65e5\u5fd7\u7ea7\u522b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"LogLevel")," \u679a\u4e3e\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"LogLevel.Information"))))),Object(a.b)("h2",{id:"13-\u914d\u7f6e\u793a\u4f8b"},"1.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "AppSettings": {\n "InjectMiniProfiler": false\n }\n}\n')),Object(a.b)("h2",{id:"14-\u7279\u522b\u6ce8\u610f"},"1.4 \u7279\u522b\u6ce8\u610f"),Object(a.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u81ea\u52a8\u626b\u63cf ",Object(a.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(a.b)("inlineCode",{parentName:"p"},"*.config.xml")," \u6587\u4ef6\u8f7d\u5165\u914d\u7f6e\u4e2d\uff0c\u5982\u9700\u5ffd\u7565\u4e2a\u522b\u6587\u4ef6\uff0c\u9700\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u6587\u4ef6\u6839\u8282\u70b9\u4e0b\u914d\u7f6e ",Object(a.b)("inlineCode",{parentName:"p"},"IgnoreConfigurationFiles")," \u8282\u70b9\u5373\u53ef\uff0c",Object(a.b)("inlineCode",{parentName:"p"},"string[]")," \u7c7b\u578b\uff0c\u5982\uff1a"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "IgnoreConfigurationFiles": ["runtime.json"]\n}\n')),Object(a.b)("p",null,Object(a.b)("strong",{parentName:"p"},"\u5fc5\u987b\u5728 ",Object(a.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u6587\u4ef6\u4e2d\u914d\u7f6e\u624d\u6709\u6548")))}s.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{194:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}));var r=t(21),i=t(195);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(r)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+o:o}(n,e,t,r)}}function o(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},195:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return m}));var r=t(0),i=t.n(r);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var b=i.a.createContext({}),p=function(e){var n=i.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(b.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),s=p(t),d=r,m=s["".concat(o,".").concat(d)]||s[d]||u[d]||a;return t?i.a.createElement(m,c(c({ref:n},b),{},{components:t})):i.a.createElement(m,c({ref:n},b))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var a=t.length,o=new Array(a);o[0]=d;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},84:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return s}));var r=t(3),i=t(7),a=(t(0),t(196)),o=t(197),c={id:"appsettings",title:"1. \u5e94\u7528\u914d\u7f6e",sidebar_label:"1. \u5e94\u7528\u914d\u7f6e"},l={unversionedId:"settings/appsettings",id:"settings/appsettings",isDocsHomePage:!1,title:"1. \u5e94\u7528\u914d\u7f6e",description:"1.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\appsettings.mdx",slug:"/settings/appsettings",permalink:"/docs/settings/appsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/appsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1. \u5e94\u7528\u914d\u7f6e",sidebar:"settings",next:{title:"2. \u8de8\u57df\u914d\u7f6e",permalink:"/docs/settings/corsaccessorsettings"}},b=[{value:"1.1 \u5173\u4e8e\u914d\u7f6e",id:"11-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"1.2 \u914d\u7f6e\u4fe1\u606f",id:"12-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"1.3 \u914d\u7f6e\u793a\u4f8b",id:"13-\u914d\u7f6e\u793a\u4f8b",children:[]},{value:"1.4 \u7279\u522b\u6ce8\u610f",id:"14-\u7279\u522b\u6ce8\u610f",children:[]}],p={toc:b};function s(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"11-\u5173\u4e8e\u914d\u7f6e"},"1.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u5e94\u7528\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5168\u5c40\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"12-\u914d\u7f6e\u4fe1\u606f"},"1.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AppSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"InjectMiniProfiler"),"\uff1a\u662f\u5426\u6ce8\u5165 ",Object(a.b)("inlineCode",{parentName:"li"},"MiniProfiler"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"InjectSpecificationDocument"),"\uff1a\u662f\u5426\u542f\u7528 ",Object(a.b)("inlineCode",{parentName:"li"},"Swagger")," \u6587\u6863\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"EnabledReferenceAssemblyScan"),"\uff1a\u662f\u5426\u542f\u7528\u901a\u8fc7 ",Object(a.b)("inlineCode",{parentName:"li"},"dll")," \u65b9\u5f0f\u6dfb\u52a0\u7684\u5f15\u7528\u7a0b\u5e8f\u96c6\u626b\u63cf\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ExternalAssemblies"),"\uff1a\u914d\u7f6e\u5916\u90e8\u7a0b\u5e8f\u96c6\u5b8c\u6574\u8def\u5f84\uff0c\u652f\u6301\u52a8\u6001\u52a0\u8f7d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"[]")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DynamicLogLevel"),"\uff1a\u914d\u7f6e\u52a8\u6001\u65e5\u5fd7\u7ea7\u522b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"LogLevel")," \u679a\u4e3e\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"LogLevel.Information"))))),Object(a.b)("h2",{id:"13-\u914d\u7f6e\u793a\u4f8b"},"1.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "AppSettings": {\n "InjectMiniProfiler": false\n }\n}\n')),Object(a.b)("h2",{id:"14-\u7279\u522b\u6ce8\u610f"},"1.4 \u7279\u522b\u6ce8\u610f"),Object(a.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u81ea\u52a8\u626b\u63cf ",Object(a.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(a.b)("inlineCode",{parentName:"p"},"*.config.xml")," \u6587\u4ef6\u8f7d\u5165\u914d\u7f6e\u4e2d\uff0c\u5982\u9700\u5ffd\u7565\u4e2a\u522b\u6587\u4ef6\uff0c\u9700\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u6587\u4ef6\u6839\u8282\u70b9\u4e0b\u914d\u7f6e ",Object(a.b)("inlineCode",{parentName:"p"},"IgnoreConfigurationFiles")," \u8282\u70b9\u5373\u53ef\uff0c",Object(a.b)("inlineCode",{parentName:"p"},"string[]")," \u7c7b\u578b\uff0c\u5982\uff1a"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "IgnoreConfigurationFiles": ["runtime.json"]\n}\n')),Object(a.b)("p",null,Object(a.b)("strong",{parentName:"p"},"\u5fc5\u987b\u5728 ",Object(a.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u6587\u4ef6\u4e2d\u914d\u7f6e\u624d\u6709\u6548")))}s.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/1d7b962e.2cd7682a.js b/docs/1d7b962e.63894a9e.js similarity index 97% rename from docs/1d7b962e.2cd7682a.js rename to docs/1d7b962e.63894a9e.js index fb06483091f..ffd9f861e19 100644 --- a/docs/1d7b962e.2cd7682a.js +++ b/docs/1d7b962e.63894a9e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{190:function(e,n,t){"use strict";t.d(n,"b",(function(){return u})),t.d(n,"a",(function(){return s}));var r=t(21),a=t(191);function u(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:u=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(r)return n+t;const s=t.startsWith(n)?t:n+t.replace(/^\//,"");return u?e+s:s}(n,e,t,r)}}function s(e,n={}){const{withBaseUrl:t}=u();return t(e,n)}},191:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return a}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return p})),t.d(n,"b",(function(){return m}));var r=t(0),a=t.n(r);function u(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var d=a.a.createContext({}),i=function(e){var n=a.a.useContext(d),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},p=function(e){var n=i(e.components);return a.a.createElement(d.Provider,{value:n},e.children)},l={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},O=a.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,u=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=i(t),O=r,m=p["".concat(s,".").concat(O)]||p[O]||l[O]||u;return t?a.a.createElement(m,c(c({ref:n},d),{},{components:t})):a.a.createElement(m,c({ref:n},d))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var u=t.length,s=new Array(u);s[0]=O;var c={};for(var o in n)hasOwnProperty.call(n,o)&&(c[o]=n[o]);c.originalType=e,c.mdxType="string"==typeof e?e:r,s[1]=c;for(var d=2;dn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},85:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return d})),t.d(n,"default",(function(){return p}));var r=t(3),a=t(7),u=(t(0),t(192)),s=t(193),c={id:"dbcontext-add-or-update",title:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",sidebar_label:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c"},o={unversionedId:"dbcontext-add-or-update",id:"dbcontext-add-or-update",isDocsHomePage:!1,title:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",description:"9.7.1 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",source:"@site/docs\\dbcontext-add-or-update.mdx",slug:"/dbcontext-add-or-update",permalink:"/docs/dbcontext-add-or-update",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-add-or-update.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.6 \u66f4\u65b0\u64cd\u4f5c",permalink:"/docs/dbcontext-update"},next:{title:"9.8 \u5220\u9664\u64cd\u4f5c",permalink:"/docs/dbcontext-delete"}},d=[{value:"9.7.1 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"971-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.2 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"972-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.3 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"973-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.4 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"974-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.5 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"975-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.6 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"976-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.5.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"957-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],i={toc:d};function p(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(u.b)("wrapper",Object(r.a)({},i,t,{components:n,mdxType:"MDXLayout"}),Object(u.b)(s.a,{mdxType:"JoinGroup"}),Object(u.b)("h2",{id:"971-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.1 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdate(user);\n\n// \u793a\u4f8b\u4e8c\nuser.InsertOrUpdate();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.InsertOrUpdateAsync();\n")),Object(u.b)("h2",{id:"972-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.2 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.InsertOrUpdateNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.InsertOrUpdateNowAsync();\n")),Object(u.b)("h2",{id:"973-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.3 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateInclude(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateInclude(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateInclude(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateInclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateInclude(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateInclude("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateInclude(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateInclude(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateIncludeAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateIncludeAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateIncludeAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateIncludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateIncludeAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateIncludeAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateIncludeAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateIncludeAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"974-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.4 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateIncludeNow(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateIncludeNow(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateIncludeNow(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateIncludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateIncludeNow(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateIncludeNow("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateIncludeNow(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateIncludeNow(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateIncludeNowAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateIncludeNowAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateIncludeNowAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateIncludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateIncludeNowAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateIncludeNowAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateIncludeNowAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateIncludeNowAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"975-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.5 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateExclude(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateExclude(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateExclude(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateExclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateExclude(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateExclude("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateExclude(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateExclude(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateExcludeAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateExcludeAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateExcludeAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateExcludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateExcludeAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateExcludeAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateExcludeAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateExcludeAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"976-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.6 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateExcludeNow(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateExcludeNow(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateExcludeNow(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateExcludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateExcludeNow(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateExcludeNow("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateExcludeNow(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateExcludeNow(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateExcludeNowAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateExcludeNowAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateExcludeNowAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateExcludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateExcludeNowAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateExcludeNowAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateExcludeNowAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateExcludeNowAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"957-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.5.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(u.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(u.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(u.b)("h5",{parentName:"div"},Object(u.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(u.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(u.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(u.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(u.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(u.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{194:function(e,n,t){"use strict";t.d(n,"b",(function(){return u})),t.d(n,"a",(function(){return s}));var r=t(21),a=t(195);function u(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:u=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(r)return n+t;const s=t.startsWith(n)?t:n+t.replace(/^\//,"");return u?e+s:s}(n,e,t,r)}}function s(e,n={}){const{withBaseUrl:t}=u();return t(e,n)}},195:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return a}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return p})),t.d(n,"b",(function(){return m}));var r=t(0),a=t.n(r);function u(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var d=a.a.createContext({}),i=function(e){var n=a.a.useContext(d),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},p=function(e){var n=i(e.components);return a.a.createElement(d.Provider,{value:n},e.children)},l={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},O=a.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,u=e.originalType,s=e.parentName,d=o(e,["components","mdxType","originalType","parentName"]),p=i(t),O=r,m=p["".concat(s,".").concat(O)]||p[O]||l[O]||u;return t?a.a.createElement(m,c(c({ref:n},d),{},{components:t})):a.a.createElement(m,c({ref:n},d))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var u=t.length,s=new Array(u);s[0]=O;var c={};for(var o in n)hasOwnProperty.call(n,o)&&(c[o]=n[o]);c.originalType=e,c.mdxType="string"==typeof e?e:r,s[1]=c;for(var d=2;dn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},85:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return d})),t.d(n,"default",(function(){return p}));var r=t(3),a=t(7),u=(t(0),t(196)),s=t(197),c={id:"dbcontext-add-or-update",title:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",sidebar_label:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c"},o={unversionedId:"dbcontext-add-or-update",id:"dbcontext-add-or-update",isDocsHomePage:!1,title:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",description:"9.7.1 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",source:"@site/docs\\dbcontext-add-or-update.mdx",slug:"/dbcontext-add-or-update",permalink:"/docs/dbcontext-add-or-update",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-add-or-update.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.6 \u66f4\u65b0\u64cd\u4f5c",permalink:"/docs/dbcontext-update"},next:{title:"9.8 \u5220\u9664\u64cd\u4f5c",permalink:"/docs/dbcontext-delete"}},d=[{value:"9.7.1 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"971-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.2 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"972-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.3 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"973-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.4 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"974-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.5 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"975-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.7.6 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"976-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.5.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"957-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],i={toc:d};function p(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(u.b)("wrapper",Object(r.a)({},i,t,{components:n,mdxType:"MDXLayout"}),Object(u.b)(s.a,{mdxType:"JoinGroup"}),Object(u.b)("h2",{id:"971-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.1 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdate(user);\n\n// \u793a\u4f8b\u4e8c\nuser.InsertOrUpdate();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.InsertOrUpdateAsync();\n")),Object(u.b)("h2",{id:"972-\u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.2 \u65b0\u589e\u6216\u66f4\u65b0\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.InsertOrUpdateNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.InsertOrUpdateNowAsync();\n")),Object(u.b)("h2",{id:"973-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.3 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateInclude(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateInclude(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateInclude(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateInclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateInclude(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateInclude("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateInclude(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateInclude(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateIncludeAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateIncludeAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateIncludeAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateIncludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateIncludeAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateIncludeAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateIncludeAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateIncludeAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"974-\u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.4 \u65b0\u589e\u6216\u66f4\u65b0\u90e8\u5206\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateIncludeNow(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateIncludeNow(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateIncludeNow(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateIncludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateIncludeNow(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateIncludeNow("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateIncludeNow(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateIncludeNow(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateIncludeNowAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateIncludeNowAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateIncludeNowAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateIncludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateIncludeNowAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateIncludeNowAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateIncludeNowAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateIncludeNowAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"975-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.5 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateExclude(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateExclude(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateExclude(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateExclude(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateExclude(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateExclude("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateExclude(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateExclude(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateExcludeAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateExcludeAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateExcludeAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateExcludeAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateExcludeAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateExcludeAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateExcludeAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateExcludeAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"976-\u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.7.6 \u65b0\u589e\u6216\u66f4\u65b0\u6392\u9664\u7279\u5b9a\u5217\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(u.b)("pre",null,Object(u.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertOrUpdateExcludeNow(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertOrUpdateExcludeNow(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nrepository.InsertOrUpdateExcludeNow(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nrepository.InsertOrUpdateExcludeNow(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nuser.InsertOrUpdateExcludeNow(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nuser.InsertOrUpdateExcludeNow("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nuser.InsertOrUpdateExcludeNow(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nuser.InsertOrUpdateExcludeNow(new[] {"Age", "Name"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertOrUpdateExcludeNowAsync(user, u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertOrUpdateExcludeNowAsync(user, "Age", "Name");\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertOrUpdateExcludeNowAsync(user, new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u56db\nawait repository.InsertOrUpdateExcludeNowAsync(user, new[] {"Age", "Name"});\n\n// \u793a\u4f8b\u4e94\nawait user.InsertOrUpdateExcludeNowAsync(u=>u.Name, u=>u.Age);\n\n// \u793a\u4f8b\u516d\nawait user.InsertOrUpdateExcludeNowAsync("Age", "Name");\n\n// \u793a\u4f8b\u4e03\nawait user.InsertOrUpdateExcludeNowAsync(new[] { u=>u.Name, u=>u.Age});\n\n// \u793a\u4f8b\u516b\nawait user.InsertOrUpdateExcludeNowAsync(new[] {"Age", "Name"});\n')),Object(u.b)("h2",{id:"957-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.5.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(u.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(u.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(u.b)("h5",{parentName:"div"},Object(u.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(u.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(u.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(u.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(u.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(u.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/1e961311.345360a0.js b/docs/1e961311.0194a775.js similarity index 96% rename from docs/1e961311.345360a0.js rename to docs/1e961311.0194a775.js index 522ce7790f9..9934dcca0b0 100644 --- a/docs/1e961311.345360a0.js +++ b/docs/1e961311.0194a775.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return c}));var r=n(21),a=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return O}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},u=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,s=b(e,["components","mdxType","originalType","parentName"]),p=l(n),u=r,O=p["".concat(c,".").concat(u)]||p[u]||d[u]||i;return n?a.a.createElement(O,o(o({ref:t},s),{},{components:n})):a.a.createElement(O,o({ref:t},s))}));function O(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,c=new Array(i);c[0]=u;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:r,c[1]=o;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},86:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),a=n(7),i=(n(0),n(192)),c=n(193),o={id:"dbcontext-batch",title:"9.9 \u6279\u91cf\u64cd\u4f5c",sidebar_label:"9.9 \u6279\u91cf\u64cd\u4f5c"},b={unversionedId:"dbcontext-batch",id:"dbcontext-batch",isDocsHomePage:!1,title:"9.9 \u6279\u91cf\u64cd\u4f5c",description:"9.9.1 \u5173\u4e8e\u6279\u91cf\u64cd\u4f5c",source:"@site/docs\\dbcontext-batch.mdx",slug:"/dbcontext-batch",permalink:"/docs/dbcontext-batch",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-batch.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.9 \u6279\u91cf\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.8 \u5220\u9664\u64cd\u4f5c",permalink:"/docs/dbcontext-delete"},next:{title:"9.10 \u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-query"}},s=[{value:"9.9.1 \u5173\u4e8e\u6279\u91cf\u64cd\u4f5c",id:"991-\u5173\u4e8e\u6279\u91cf\u64cd\u4f5c",children:[]},{value:"9.9.2 EFCore.BulkExtensions \u4f7f\u7528",id:"992-efcorebulkextensions-\u4f7f\u7528",children:[{value:"9.9.2.1 \u5e38\u89c1\u6279\u91cf\u64cd\u4f5c",id:"9921-\u5e38\u89c1\u6279\u91cf\u64cd\u4f5c",children:[]},{value:"9.9.2.2 \u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c",id:"9922-\u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c",children:[]}]},{value:"9.9.3 \u6279\u91cf\u64cd\u4f5c\u6027\u80fd",id:"993-\u6279\u91cf\u64cd\u4f5c\u6027\u80fd",children:[]},{value:"9.9.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"994-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:s};function p(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"991-\u5173\u4e8e\u6279\u91cf\u64cd\u4f5c"},"9.9.1 \u5173\u4e8e\u6279\u91cf\u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u53ea\u63d0\u4f9b\u5c0f\u6570\u636e\uff08100 \u4ee5\u5185\uff09\u6279\u91cf\u6570\u636e\u64cd\u4f5c\uff0c\u5982\u679c\u9700\u8981\u66f4\u5927\u7684\u6570\u636e\u6279\u91cf\u5904\u7406\uff0c\u63a8\u8350\u4f7f\u7528\u7b2c\u4e09\u65b9\u5305 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/borisdj/EFCore.BulkExtensions"}),"EFCore.BulkExtensions"),"\uff0c\u652f\u6301\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u65e0\u7f1d\u8854\u63a5\u3002"),Object(i.b)("h2",{id:"992-efcorebulkextensions-\u4f7f\u7528"},"9.9.2 ",Object(i.b)("inlineCode",{parentName:"h2"},"EFCore.BulkExtensions")," \u4f7f\u7528"),Object(i.b)("h3",{id:"9921-\u5e38\u89c1\u6279\u91cf\u64cd\u4f5c"},"9.9.2.1 \u5e38\u89c1\u6279\u91cf\u64cd\u4f5c"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// \u6279\u91cf\u63d2\u5165\nrepository.Context.BulkInsert(entitiesList);\nrepository.Context.BulkInsertAsync(entitiesList);\n\n// \u6279\u91cf\u66f4\u65b0\nrepository.Context.BulkUpdate(entitiesList);\nrepository.Context.BulkUpdateAsync(entitiesList);\n\n// \u6279\u91cf\u5220\u9664\nrepository.Context.BulkDelete(entitiesList);\nrepository.Context.BulkDeleteAsync(entitiesList);\n\n// \u6279\u91cf\u63d2\u5165\u6216\u66f4\u65b0\nrepository.Context.BulkInsertOrUpdate(entitiesList);\nrepository.Context.BulkInsertOrUpdateAsync(entitiesList);\n\n// \u6279\u91cf\u63d2\u5165\u6216\u66f4\u65b0\u6216\u5220\u9664\nrepository.Context.BulkInsertOrUpdateOrDelete(entitiesList);\nrepository.Context.BulkInsertOrUpdateOrDeleteAsync(entitiesList);\n\n// \u6279\u91cf\u8bfb\u53d6\u591a\u4e2a\u5b9e\u4f53\nrepository.Context.BulkRead(entitiesList);\nrepository.Context.BulkReadAsync(entitiesList);\n\n// \u6279\u91cf\u6e05\u7a7a\u8868\uff08\u614e\u7528\uff01\uff01\uff01\uff01\uff01\uff09\nrepository.Context.Truncate();\nrepository.Context.TruncateAsync();\n")),Object(i.b)("h3",{id:"9922-\u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c"},"9.9.2.2 \u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6839\u636e\u6761\u4ef6\u6279\u91cf\u5220\u9664\nrepository.Where(a => a.ItemId > 500).BatchDelete();\nawait repository.Where(a => a.ItemId > 500).BatchDeleteAsync();\n\n// \u6839\u636e\u6761\u4ef6\u6279\u91cf\u66f4\u65b0\nrepository.Where(a => a.ItemId <= 500).BatchUpdate(a => new Item { Quantity = a.Quantity + 100 });\nrepository.Where(a => a.ItemId <= 500).BatchUpdate(new Item { Description = "Updated" });\nawait repository.Where(a => a.ItemId <= 500).BatchUpdateAsync(new Item { Description = "Updated" });\n\n// \u6279\u91cf\u66f4\u65b0\u6307\u5b9a\u5217\nvar updateColumns = new List { nameof(Item.Quantity) };\nvar q = repository.Where(a => a.ItemId <= 500);\nint affected = q.BatchUpdate(new Item { Description = "Updated" }, updateColumns);\n')),Object(i.b)("h2",{id:"993-\u6279\u91cf\u64cd\u4f5c\u6027\u80fd"},"9.9.3 \u6279\u91cf\u64cd\u4f5c\u6027\u80fd"),Object(i.b)("table",null,Object(i.b)("thead",{parentName:"table"},Object(i.b)("tr",{parentName:"thead"},Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:null}),"Operations\\Rows"),Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:"right"}),"100,000 EF"),Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:"right"}),"100,000 EFBulk"),Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:"right"}),"1,000,000 EFBulk"))),Object(i.b)("tbody",{parentName:"table"},Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"Insert"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"38.98 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"2.10 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"17.99 s")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"Update"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"109.25 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"3.96 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"31.45 s")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"Delete"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"7.26 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"2.04 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"12.18 s")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"-----------------"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"------------"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"----------------"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"------------------")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),Object(i.b)("strong",{parentName:"td"},"Together")),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"70.70 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"5.88 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"56.84 s")))),Object(i.b)("h2",{id:"994-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.9.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"EFCore.BulkExtensions")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/borisdj/EFCore.BulkExtensions"}),"EFCore.BulkExtensions \u5f00\u6e90\u4ed3\u5e93"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[13],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return c}));var r=n(21),a=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return O}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},p=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},u=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,s=b(e,["components","mdxType","originalType","parentName"]),p=l(n),u=r,O=p["".concat(c,".").concat(u)]||p[u]||d[u]||i;return n?a.a.createElement(O,o(o({ref:t},s),{},{components:n})):a.a.createElement(O,o({ref:t},s))}));function O(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,c=new Array(i);c[0]=u;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:r,c[1]=o;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},86:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),a=n(7),i=(n(0),n(196)),c=n(197),o={id:"dbcontext-batch",title:"9.9 \u6279\u91cf\u64cd\u4f5c",sidebar_label:"9.9 \u6279\u91cf\u64cd\u4f5c"},b={unversionedId:"dbcontext-batch",id:"dbcontext-batch",isDocsHomePage:!1,title:"9.9 \u6279\u91cf\u64cd\u4f5c",description:"9.9.1 \u5173\u4e8e\u6279\u91cf\u64cd\u4f5c",source:"@site/docs\\dbcontext-batch.mdx",slug:"/dbcontext-batch",permalink:"/docs/dbcontext-batch",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-batch.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.9 \u6279\u91cf\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.8 \u5220\u9664\u64cd\u4f5c",permalink:"/docs/dbcontext-delete"},next:{title:"9.10 \u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-query"}},s=[{value:"9.9.1 \u5173\u4e8e\u6279\u91cf\u64cd\u4f5c",id:"991-\u5173\u4e8e\u6279\u91cf\u64cd\u4f5c",children:[]},{value:"9.9.2 EFCore.BulkExtensions \u4f7f\u7528",id:"992-efcorebulkextensions-\u4f7f\u7528",children:[{value:"9.9.2.1 \u5e38\u89c1\u6279\u91cf\u64cd\u4f5c",id:"9921-\u5e38\u89c1\u6279\u91cf\u64cd\u4f5c",children:[]},{value:"9.9.2.2 \u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c",id:"9922-\u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c",children:[]}]},{value:"9.9.3 \u6279\u91cf\u64cd\u4f5c\u6027\u80fd",id:"993-\u6279\u91cf\u64cd\u4f5c\u6027\u80fd",children:[]},{value:"9.9.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"994-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:s};function p(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"991-\u5173\u4e8e\u6279\u91cf\u64cd\u4f5c"},"9.9.1 \u5173\u4e8e\u6279\u91cf\u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u53ea\u63d0\u4f9b\u5c0f\u6570\u636e\uff08100 \u4ee5\u5185\uff09\u6279\u91cf\u6570\u636e\u64cd\u4f5c\uff0c\u5982\u679c\u9700\u8981\u66f4\u5927\u7684\u6570\u636e\u6279\u91cf\u5904\u7406\uff0c\u63a8\u8350\u4f7f\u7528\u7b2c\u4e09\u65b9\u5305 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/borisdj/EFCore.BulkExtensions"}),"EFCore.BulkExtensions"),"\uff0c\u652f\u6301\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u65e0\u7f1d\u8854\u63a5\u3002"),Object(i.b)("h2",{id:"992-efcorebulkextensions-\u4f7f\u7528"},"9.9.2 ",Object(i.b)("inlineCode",{parentName:"h2"},"EFCore.BulkExtensions")," \u4f7f\u7528"),Object(i.b)("h3",{id:"9921-\u5e38\u89c1\u6279\u91cf\u64cd\u4f5c"},"9.9.2.1 \u5e38\u89c1\u6279\u91cf\u64cd\u4f5c"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// \u6279\u91cf\u63d2\u5165\nrepository.Context.BulkInsert(entitiesList);\nrepository.Context.BulkInsertAsync(entitiesList);\n\n// \u6279\u91cf\u66f4\u65b0\nrepository.Context.BulkUpdate(entitiesList);\nrepository.Context.BulkUpdateAsync(entitiesList);\n\n// \u6279\u91cf\u5220\u9664\nrepository.Context.BulkDelete(entitiesList);\nrepository.Context.BulkDeleteAsync(entitiesList);\n\n// \u6279\u91cf\u63d2\u5165\u6216\u66f4\u65b0\nrepository.Context.BulkInsertOrUpdate(entitiesList);\nrepository.Context.BulkInsertOrUpdateAsync(entitiesList);\n\n// \u6279\u91cf\u63d2\u5165\u6216\u66f4\u65b0\u6216\u5220\u9664\nrepository.Context.BulkInsertOrUpdateOrDelete(entitiesList);\nrepository.Context.BulkInsertOrUpdateOrDeleteAsync(entitiesList);\n\n// \u6279\u91cf\u8bfb\u53d6\u591a\u4e2a\u5b9e\u4f53\nrepository.Context.BulkRead(entitiesList);\nrepository.Context.BulkReadAsync(entitiesList);\n\n// \u6279\u91cf\u6e05\u7a7a\u8868\uff08\u614e\u7528\uff01\uff01\uff01\uff01\uff01\uff09\nrepository.Context.Truncate();\nrepository.Context.TruncateAsync();\n")),Object(i.b)("h3",{id:"9922-\u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c"},"9.9.2.2 \u67e5\u8be2\u540e\u6279\u91cf\u64cd\u4f5c"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6839\u636e\u6761\u4ef6\u6279\u91cf\u5220\u9664\nrepository.Where(a => a.ItemId > 500).BatchDelete();\nawait repository.Where(a => a.ItemId > 500).BatchDeleteAsync();\n\n// \u6839\u636e\u6761\u4ef6\u6279\u91cf\u66f4\u65b0\nrepository.Where(a => a.ItemId <= 500).BatchUpdate(a => new Item { Quantity = a.Quantity + 100 });\nrepository.Where(a => a.ItemId <= 500).BatchUpdate(new Item { Description = "Updated" });\nawait repository.Where(a => a.ItemId <= 500).BatchUpdateAsync(new Item { Description = "Updated" });\n\n// \u6279\u91cf\u66f4\u65b0\u6307\u5b9a\u5217\nvar updateColumns = new List { nameof(Item.Quantity) };\nvar q = repository.Where(a => a.ItemId <= 500);\nint affected = q.BatchUpdate(new Item { Description = "Updated" }, updateColumns);\n')),Object(i.b)("h2",{id:"993-\u6279\u91cf\u64cd\u4f5c\u6027\u80fd"},"9.9.3 \u6279\u91cf\u64cd\u4f5c\u6027\u80fd"),Object(i.b)("table",null,Object(i.b)("thead",{parentName:"table"},Object(i.b)("tr",{parentName:"thead"},Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:null}),"Operations\\Rows"),Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:"right"}),"100,000 EF"),Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:"right"}),"100,000 EFBulk"),Object(i.b)("th",Object(r.a)({parentName:"tr"},{align:"right"}),"1,000,000 EFBulk"))),Object(i.b)("tbody",{parentName:"table"},Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"Insert"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"38.98 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"2.10 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"17.99 s")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"Update"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"109.25 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"3.96 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"31.45 s")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"Delete"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"7.26 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"2.04 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"12.18 s")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),"-----------------"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"------------"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"----------------"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"------------------")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:null}),Object(i.b)("strong",{parentName:"td"},"Together")),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"70.70 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"5.88 s"),Object(i.b)("td",Object(r.a)({parentName:"tr"},{align:"right"}),"56.84 s")))),Object(i.b)("h2",{id:"994-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.9.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"EFCore.BulkExtensions")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/borisdj/EFCore.BulkExtensions"}),"EFCore.BulkExtensions \u5f00\u6e90\u4ed3\u5e93"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/1ea356f4.3d8ebad5.js b/docs/1ea356f4.d279bd8d.js similarity index 99% rename from docs/1ea356f4.3d8ebad5.js rename to docs/1ea356f4.d279bd8d.js index 6058197fb18..a8564fd78cf 100644 --- a/docs/1ea356f4.3d8ebad5.js +++ b/docs/1ea356f4.d279bd8d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{190:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(191);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return u}));var a=t(0),i=t.n(a);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=i.a.createContext({}),l=function(e){var n=i.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},d=function(e){var n=l(e.components);return i.a.createElement(s.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},m=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,s=b(e,["components","mdxType","originalType","parentName"]),d=l(t),m=a,u=d["".concat(r,".").concat(m)]||d[m]||p[m]||o;return t?i.a.createElement(u,c(c({ref:n},s),{},{components:t})):i.a.createElement(u,c({ref:n},s))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,r=new Array(o);r[0]=m;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,r[1]=c;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},87:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return p}));var a=t(3),i=t(7),o=(t(0),t(192)),r=t(190),c=t(193),b={id:"saas",title:"11. SaaS \u591a\u79df\u6237",sidebar_label:"11. SaaS \u591a\u79df\u6237"},s={unversionedId:"saas",id:"saas",isDocsHomePage:!1,title:"11. SaaS \u591a\u79df\u6237",description:"11.1 \u4ec0\u4e48\u662f SaaS",source:"@site/docs\\saas.mdx",slug:"/saas",permalink:"/docs/saas",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/saas.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"11. SaaS \u591a\u79df\u6237",sidebar:"docs",previous:{title:"10.2. Dapper \u96c6\u6210",permalink:"/docs/dapper"},next:{title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",permalink:"/docs/dependency-injection"}},l=[{value:"11.1 \u4ec0\u4e48\u662f SaaS",id:"111-\u4ec0\u4e48\u662f-saas",children:[]},{value:"11.2 \u4ec0\u4e48\u662f\u591a\u79df\u6237",id:"112-\u4ec0\u4e48\u662f\u591a\u79df\u6237",children:[]},{value:"11.3 \u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848",id:"113-\u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848",children:[{value:"11.3.1 \u72ec\u7acb\u6570\u636e\u5e93(\u57fa\u4e8e Database \u7684\u65b9\u5f0f)",id:"1131-\u72ec\u7acb\u6570\u636e\u5e93\u57fa\u4e8e-database-\u7684\u65b9\u5f0f",children:[]},{value:"11.3.2 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb Schema (\u57fa\u4e8e Schema \u7684\u65b9\u5f0f)",id:"1132-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb-schema-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f",children:[]},{value:"11.3.3 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab Schema (\u57fa\u4e8e TenantId \u7684\u65b9\u5f0f)",id:"1133-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab-schema-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f",children:[]}]},{value:"11.4 \u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848",id:"114-\u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848",children:[]},{value:"11.5 \u57fa\u4e8e TenantId \u7684\u65b9\u5f0f",id:"115-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f",children:[{value:"11.5.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1151-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.5.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1152-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.5.3 \u6dfb\u52a0 Tenant \u79cd\u5b50\u6570\u636e",id:"1153-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e",children:[]},{value:"11.5.4 \u6839\u636e\u6a21\u578b\u521b\u5efa Tenant \u8868",id:"1154-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868",children:[]},{value:"11.5.5 \u5b9e\u73b0 IMultiTenantOnTable \u63a5\u53e3",id:"1155-\u5b9e\u73b0-imultitenantontable-\u63a5\u53e3",children:[]},{value:"11.5.6 \u5b9e\u73b0 IModelBuilderFilter \u63a5\u53e3",id:"1156-\u5b9e\u73b0-imodelbuilderfilter-\u63a5\u53e3",children:[]},{value:"11.5.7 \u91cd\u5199 SavingChangesEvent \u4e8b\u4ef6\u65b9\u6cd5",id:"1157-\u91cd\u5199-savingchangesevent-\u4e8b\u4ef6\u65b9\u6cd5",children:[]}]},{value:"11.6 \u57fa\u4e8e Database \u7684\u65b9\u5f0f",id:"116-\u57fa\u4e8e-database-\u7684\u65b9\u5f0f",children:[{value:"11.6.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1161-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.6.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1162-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.6.3 \u6dfb\u52a0 Tenant \u79cd\u5b50\u6570\u636e",id:"1163-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e",children:[]},{value:"11.6.4 \u6839\u636e\u6a21\u578b\u521b\u5efa Tenant \u8868",id:"1164-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868",children:[]},{value:"11.6.5 \u5b9e\u73b0 IMultiTenantOnDatabase \u63a5\u53e3",id:"1165-\u5b9e\u73b0-imultitenantondatabase-\u63a5\u53e3",children:[]},{value:"11.6.6 \u91cd\u5199 OnConfiguring \u65b9\u6cd5",id:"1166-\u91cd\u5199-onconfiguring-\u65b9\u6cd5",children:[]}]},{value:"11.7 \u57fa\u4e8e Schema \u7684\u65b9\u5f0f",id:"117-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f",children:[{value:"11.7.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1171-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.7.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1172-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.7.3 \u6dfb\u52a0 Tenant \u79cd\u5b50\u6570\u636e",id:"1173-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e",children:[]},{value:"11.7.4 \u6839\u636e\u6a21\u578b\u521b\u5efa Tenant \u8868",id:"1174-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868",children:[]},{value:"11.7.5 \u5b9e\u73b0 IMultiTenantOnSchema \u63a5\u53e3",id:"1175-\u5b9e\u73b0-imultitenantonschema-\u63a5\u53e3",children:[]},{value:"11.7.6 \u5173\u4e8e Code First \u6570\u636e\u8fc1\u79fb",id:"1176-\u5173\u4e8e-code-first-\u6570\u636e\u8fc1\u79fb",children:[]}]},{value:"11.8 \u81ea\u5b9a\u4e49 Tenant \u7c7b\u578b",id:"118-\u81ea\u5b9a\u4e49-tenant-\u7c7b\u578b",children:[{value:"11.8.1 \u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e",id:"1181-\u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e",children:[]},{value:"11.8.2 \u81ea\u5b9a\u4e49\u79df\u6237\u7c7b",id:"1182-\u81ea\u5b9a\u4e49\u79df\u6237\u7c7b",children:[]}]},{value:"11.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"119-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:l};function p(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(c.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"111-\u4ec0\u4e48\u662f-saas"},"11.1 \u4ec0\u4e48\u662f ",Object(o.b)("inlineCode",{parentName:"h2"},"SaaS")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"SaaS \u662f Software-as-a-Service\uff08\u8f6f\u4ef6\u5373\u670d\u52a1\uff09\u7684\u7b80\u79f0\uff0c\u968f\u7740\u4e92\u8054\u7f51\u6280\u672f\u7684\u53d1\u5c55\u548c\u5e94\u7528\u8f6f\u4ef6\u7684\u6210\u719f\uff0c \u5728 21 \u4e16\u7eaa\u5f00\u59cb\u5174\u8d77\u7684\u4e00\u79cd\u5b8c\u5168\u521b\u65b0\u7684\u8f6f\u4ef6\u5e94\u7528\u6a21\u5f0f\u3002\u5b83\u4e0e\u201con-demand software\u201d\uff0cthe application service provider(ASP\uff0c\u5e94\u7528\u670d\u52a1\u63d0\u4f9b\u5546)\uff0chosted software(\u6258\u7ba1\u8f6f\u4ef6)\u6240\u5177\u6709\u76f8\u4f3c\u7684\u542b\u4e49\u3002"),Object(o.b)("p",{parentName:"blockquote"},"\u5b83\u662f\u4e00\u79cd\u901a\u8fc7 Internet \u63d0\u4f9b\u8f6f\u4ef6\u7684\u6a21\u5f0f\uff0c\u5382\u5546\u5c06\u5e94\u7528\u8f6f\u4ef6\u7edf\u4e00\u90e8\u7f72\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u5ba2\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u9700\u6c42\uff0c\u901a\u8fc7\u4e92\u8054\u7f51\u5411\u5382\u5546\u5b9a\u8d2d\u6240\u9700\u7684\u5e94\u7528\u8f6f\u4ef6\u670d\u52a1\uff0c\u6309\u5b9a\u8d2d\u7684\u670d\u52a1\u591a\u5c11\u548c\u65f6\u95f4\u957f\u77ed\u5411\u5382\u5546\u652f\u4ed8\u8d39\u7528\uff0c\u5e76\u901a\u8fc7\u4e92\u8054\u7f51\u83b7\u5f97\u5382\u5546\u63d0\u4f9b\u7684\u670d\u52a1\u3002\u7528\u6237\u4e0d\u7528\u518d\u8d2d\u4e70\u8f6f\u4ef6\uff0c\u800c\u6539\u7528\u5411\u63d0\u4f9b\u5546\u79df\u7528\u57fa\u4e8e Web \u7684\u8f6f\u4ef6\uff0c\u6765\u7ba1\u7406\u4f01\u4e1a\u7ecf\u8425\u6d3b\u52a8\uff0c\u4e14\u65e0\u9700\u5bf9\u8f6f\u4ef6\u8fdb\u884c\u7ef4\u62a4\uff0c\u670d\u52a1\u63d0\u4f9b\u5546\u4f1a\u5168\u6743\u7ba1\u7406\u548c\u7ef4\u62a4\u8f6f\u4ef6\uff0c\u8f6f\u4ef6\u5382\u5546\u5728\u5411\u5ba2\u6237\u63d0\u4f9b\u4e92\u8054\u7f51\u5e94\u7528\u7684\u540c\u65f6\uff0c\u4e5f\u63d0\u4f9b\u8f6f\u4ef6\u7684\u79bb\u7ebf\u64cd\u4f5c\u548c\u672c\u5730\u6570\u636e\u5b58\u50a8\uff0c\u8ba9\u7528\u6237\u968f\u65f6\u968f\u5730\u90fd\u53ef\u4ee5\u4f7f\u7528\u5176\u5b9a\u8d2d\u7684\u8f6f\u4ef6\u548c\u670d\u52a1\u3002"),Object(o.b)("p",{parentName:"blockquote"},"\u5bf9\u4e8e\u8bb8\u591a\u5c0f\u578b\u4f01\u4e1a\u6765\u8bf4\uff0cSaaS \u662f\u91c7\u7528\u5148\u8fdb\u6280\u672f\u7684\u6700\u597d\u9014\u5f84\uff0c\u5b83\u6d88\u9664\u4e86\u4f01\u4e1a\u8d2d\u4e70\u3001\u6784\u5efa\u548c\u7ef4\u62a4\u57fa\u7840\u8bbe\u65bd\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u9700\u8981\u3002")),Object(o.b)("h2",{id:"112-\u4ec0\u4e48\u662f\u591a\u79df\u6237"},"11.2 \u4ec0\u4e48\u662f\u591a\u79df\u6237"),Object(o.b)("p",null,"\u591a\u79df\u6237\u6280\u672f\u6216\u79f0\u591a\u91cd\u79df\u8d41\u6280\u672f\uff0c\u7b80\u79f0 ",Object(o.b)("inlineCode",{parentName:"p"},"SaaS"),"\uff0c\u662f\u4e00\u79cd\u8f6f\u4ef6\u67b6\u6784\u6280\u672f\uff0c\u662f\u5b9e\u73b0\u5982\u4f55\u5728\u591a\u7528\u6237\u73af\u5883\u4e0b\uff08\u6b64\u5904\u7684\u591a\u7528\u6237\u4e00\u822c\u662f\u9762\u5411\u4f01\u4e1a\u7528\u6237\uff09\u5171\u7528\u76f8\u540c\u7684\u7cfb\u7edf\u6216\u7a0b\u5e8f\u7ec4\u4ef6\uff0c\u5e76\u4e14\u53ef\u786e\u4fdd\u5404\u7528\u6237\u95f4\u6570\u636e\u7684\u9694\u79bb\u6027\u3002"),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"\u7b80\u5355\u8bb2\uff1a\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u5355\u4e2a\u5e94\u7528\u5b9e\u4f8b\uff0c\u5b83\u4e3a\u591a\u4e2a\u79df\u6237\uff08\u5ba2\u6237\uff09\u63d0\u4f9b\u670d\u52a1\u3002"),"\u4ece\u5b9a\u4e49\u4e2d\u6211\u4eec\u53ef\u4ee5\u7406\u89e3\uff1a\u591a\u79df\u6237\u662f\u4e00\u79cd\u67b6\u6784\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u8ba9\u591a\u7528\u6237\u73af\u5883\u4e0b\u4f7f\u7528\u540c\u4e00\u5957\u7a0b\u5e8f\uff0c\u4e14\u4fdd\u8bc1\u7528\u6237\u95f4\u6570\u636e\u9694\u79bb\u3002\u90a3\u4e48\u91cd\u70b9\u5c31\u5f88\u6d45\u663e\u6613\u61c2\u4e86\uff0c\u591a\u79df\u6237\u7684\u91cd\u70b9\u5c31\u662f\u540c\u4e00\u5957\u7a0b\u5e8f\u4e0b\u5b9e\u73b0\u591a\u7528\u6237\u6570\u636e\u7684\u9694\u79bb\u3002"),Object(o.b)("h2",{id:"113-\u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848"},"11.3 \u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848"),Object(o.b)("h3",{id:"1131-\u72ec\u7acb\u6570\u636e\u5e93\u57fa\u4e8e-database-\u7684\u65b9\u5f0f"},"11.3.1 \u72ec\u7acb\u6570\u636e\u5e93(\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"Database")," \u7684\u65b9\u5f0f)"),Object(o.b)("p",null,"\u8fd9\u662f\u7b2c\u4e00\u79cd\u65b9\u6848\uff0c\u5373\u4e00\u4e2a\u79df\u6237\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u8fd9\u79cd\u65b9\u6848\u7684\u7528\u6237\u6570\u636e\u9694\u79bb\u7ea7\u522b\u6700\u9ad8\uff0c\u5b89\u5168\u6027\u6700\u597d\uff0c\u4f46\u6210\u672c\u8f83\u9ad8\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u4f18\u70b9\uff1a"),"\n\u4e3a\u4e0d\u540c\u7684\u79df\u6237\u63d0\u4f9b\u72ec\u7acb\u7684\u6570\u636e\u5e93\uff0c\u6709\u52a9\u4e8e\u7b80\u5316\u6570\u636e\u6a21\u578b\u7684\u6269\u5c55\u8bbe\u8ba1\uff0c\u6ee1\u8db3\u4e0d\u540c\u79df\u6237\u7684\u72ec\u7279\u9700\u6c42\uff1b\u5982\u679c\u51fa\u73b0\u6545\u969c\uff0c\u6062\u590d\u6570\u636e\u6bd4\u8f83\u7b80\u5355\u3002")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u7f3a\u70b9\uff1a"),"\n\u589e\u591a\u4e86\u6570\u636e\u5e93\u7684\u5b89\u88c5\u6570\u91cf\uff0c\u968f\u4e4b\u5e26\u6765\u7ef4\u62a4\u6210\u672c\u548c\u8d2d\u7f6e\u6210\u672c\u7684\u589e\u52a0\u3002 \u8fd9\u79cd\u65b9\u6848\u4e0e\u4f20\u7edf\u7684\u4e00\u4e2a\u5ba2\u6237\u3001\u4e00\u5957\u6570\u636e\u3001\u4e00\u5957\u90e8\u7f72\u7c7b\u4f3c\uff0c\u5dee\u522b\u53ea\u5728\u4e8e\u8f6f\u4ef6\u7edf\u4e00\u90e8\u7f72\u5728\u8fd0\u8425\u5546\u90a3\u91cc\u3002\u5982\u679c\u9762\u5bf9\u7684\u662f\u94f6\u884c\u3001\u533b\u9662\u7b49\u9700\u8981\u975e\u5e38\u9ad8\u6570\u636e\u9694\u79bb\u7ea7\u522b\u7684\u79df\u6237\uff0c\u53ef\u4ee5\u9009\u62e9\u8fd9\u79cd\u6a21\u5f0f\uff0c\u63d0\u9ad8\u79df\u7528\u7684\u5b9a\u4ef7\u3002\u5982\u679c\u5b9a\u4ef7\u8f83\u4f4e\uff0c\u4ea7\u54c1\u8d70\u4f4e\u4ef7\u8def\u7ebf\uff0c\u8fd9\u79cd\u65b9\u6848\u4e00\u822c\u5bf9\u8fd0\u8425\u5546\u6765\u8bf4\u662f\u65e0\u6cd5\u627f\u53d7\u7684\u3002"))),Object(o.b)("h3",{id:"1132-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb-schema-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f"},"11.3.2 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb ",Object(o.b)("inlineCode",{parentName:"h3"},"Schema")," (\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"Schema")," \u7684\u65b9\u5f0f)"),Object(o.b)("p",null,"\u8fd9\u662f\u7b2c\u4e8c\u79cd\u65b9\u6848\uff0c\u5373\u591a\u4e2a\u6216\u6240\u6709\u79df\u6237\u5171\u4eab ",Object(o.b)("inlineCode",{parentName:"p"},"Database"),"\uff0c\u4f46\u662f\u6bcf\u4e2a\u79df\u6237\u4e00\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\uff08\u4e5f\u53ef\u53eb\u505a\u4e00\u4e2a user\uff09\u3002\u5e95\u5c42\u5e93\u6bd4\u5982\u662f\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"SqlServer"),"\u3001",Object(o.b)("inlineCode",{parentName:"p"},"Oracle")," \u7b49\uff0c\u4e00\u4e2a\u6570\u636e\u5e93\u4e0b\u53ef\u4ee5\u6709\u591a\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u4f18\u70b9\uff1a"),"\n\u4e3a\u5b89\u5168\u6027\u8981\u6c42\u8f83\u9ad8\u7684\u79df\u6237\u63d0\u4f9b\u4e86\u4e00\u5b9a\u7a0b\u5ea6\u7684\u903b\u8f91\u6570\u636e\u9694\u79bb\uff0c\u5e76\u4e0d\u662f\u5b8c\u5168\u9694\u79bb\uff1b\u6bcf\u4e2a\u6570\u636e\u5e93\u53ef\u652f\u6301\u66f4\u591a\u7684\u79df\u6237\u6570\u91cf\u3002")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u7f3a\u70b9\uff1a"),"\n\u5982\u679c\u51fa\u73b0\u6545\u969c\uff0c\u6570\u636e\u6062\u590d\u6bd4\u8f83\u56f0\u96be\uff0c\u56e0\u4e3a\u6062\u590d\u6570\u636e\u5e93\u5c06\u7275\u6d89\u5230\u5176\u4ed6\u79df\u6237\u7684\u6570\u636e\uff1b \u5982\u679c\u9700\u8981\u8de8\u79df\u6237\u7edf\u8ba1\u6570\u636e\uff0c\u5b58\u5728\u4e00\u5b9a\u56f0\u96be\u3002"))),Object(o.b)("h3",{id:"1133-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab-schema-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f"},"11.3.3 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab ",Object(o.b)("inlineCode",{parentName:"h3"},"Schema")," (\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"TenantId")," \u7684\u65b9\u5f0f)"),Object(o.b)("p",null,"\u5171\u4eab\u6570\u636e\u8868 \u8fd9\u662f\u7b2c\u4e09\u79cd\u65b9\u6848\uff0c\u5373\u79df\u6237\u5171\u4eab\u540c\u4e00\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Database"),"\u3001\u540c\u4e00\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\uff0c\u4f46\u5728\u8868\u4e2d\u589e\u52a0 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"TenantId"))," \u591a\u79df\u6237\u7684\u6570\u636e\u5b57\u6bb5\u3002\u8fd9\u662f\u5171\u4eab\u7a0b\u5ea6\u6700\u9ad8\u3001\u9694\u79bb\u7ea7\u522b\u6700\u4f4e\u7684\u6a21\u5f0f\u3002 \u5373\u6bcf\u63d2\u5165\u4e00\u6761\u6570\u636e\u65f6\u90fd\u9700\u8981\u6709\u4e00\u4e2a\u5ba2\u6237\u7684\u6807\u8bc6\u3002\u8fd9\u6837\u624d\u80fd\u5728\u540c\u4e00\u5f20\u8868\u4e2d\u533a\u5206\u51fa\u4e0d\u540c\u5ba2\u6237\u7684\u6570\u636e\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u4f18\u70b9\uff1a"),"\n\u4e09\u79cd\u65b9\u6848\u6bd4\u8f83\uff0c\u7b2c\u4e09\u79cd\u65b9\u6848\u7684\u7ef4\u62a4\u548c\u8d2d\u7f6e\u6210\u672c\u6700\u4f4e\uff0c\u5141\u8bb8\u6bcf\u4e2a\u6570\u636e\u5e93\u652f\u6301\u7684\u79df\u6237\u6570\u91cf\u6700\u591a\u3002")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u7f3a\u70b9\uff1a"),"\n\u9694\u79bb\u7ea7\u522b\u6700\u4f4e\uff0c\u5b89\u5168\u6027\u6700\u4f4e\uff0c\u9700\u8981\u5728\u8bbe\u8ba1\u5f00\u53d1\u65f6\u52a0\u5927\u5bf9\u5b89\u5168\u7684\u5f00\u53d1\u91cf\uff1b \u6570\u636e\u5907\u4efd\u548c\u6062\u590d\u6700\u56f0\u96be\uff0c\u9700\u8981\u9010\u8868\u9010\u6761\u5907\u4efd\u548c\u8fd8\u539f\u3002"))),Object(o.b)("h2",{id:"114-\u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848"},"11.4 \u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u652f\u6301\u4ee5\u4e0a\u4e09\u79cd\u591a\u79df\u6237\u5b9e\u73b0\u65b9\u6848\uff0c\u4f7f\u7528\u7b80\u5355\u4e14\u5bb9\u6613\u7ef4\u62a4\u3002\u4e0b\u9762\u5206\u522b\u4f7f\u7528\u4e09\u79cd\u4e0d\u540c\u65b9\u5f0f\u6f14\u793a\u591a\u79df\u6237\u65b9\u6848\u7528\u6cd5\u3002"),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u4e00\u65e6 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")," \u7c7b\u7ee7\u627f\u4e86\u79df\u6237\u4efb\u610f\u63a5\u53e3\uff0c\u5219\u81ea\u52a8\u5f00\u59cb\u591a\u79df\u6237\u529f\u80fd\u652f\u6301\u3002"))),Object(o.b)("h2",{id:"115-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f"},"11.5 \u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h2"},"TenantId")," \u7684\u65b9\u5f0f"),Object(o.b)("p",null,"\u6b64\u65b9\u5f0f\u5728\u4e2d\u5c0f\u578b\u4f01\u4e1a\u7cfb\u7edf\u4e2d\u6700\u4e3a\u5e38\u7528\uff0c\u7ef4\u62a4\u6210\u672c\u4f4e\uff0c\u8d2d\u7f6e\u6210\u672c\u4f4e\u3002"),Object(o.b)("h3",{id:"1151-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.5.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{6-7} title="Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"',"{6-7}":!0,title:'"Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class MultiTenantDbContext : AppDbContext\n {\n public MultiTenantDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u591a\u79df\u6237\u64cd\u4f5c\u5efa\u8bae\u5355\u72ec\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u800c\u4e14\u9700\u6307\u5b9a ",Object(o.b)("inlineCode",{parentName:"p"},"MultiTenantDbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002"))),Object(o.b)("h3",{id:"1152-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.5.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{14}","{14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDbPool(DbProvider.Sqlite);\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("h3",{id:"1153-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e"},"11.5.3 \u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u79cd\u5b50\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{8,12-28} title="Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"',"{8,12-28}":!0,title:'"Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.EntityFramework.Core\n{\n public class TenantSeedData : IEntitySeedData\n {\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Tenant\n {\n TenantId = Guid.Parse("383AFB88-F519-FFF8-B364-6D563BF3687F"),\n Name = "\u9ed8\u8ba4\u79df\u6237",\n Host = "localhost:44313",\n CreatedTime = DateTime.Parse("2020-10-06 20:19:07")\n },\n new Tenant\n {\n TenantId = Guid.Parse("C5798CB6-16D6-0F42-EB56-59C695353BC0"),\n Name = "\u5176\u4ed6\u79df\u6237",\n Host = "localhost:5000",\n CreatedTime = DateTime.Parse("2020-10-06 20:20:32")\n }\n };\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8be5\u6b65\u9aa4\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u65b9\u5f0f\u6267\u884c\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u65e0\u9700\u914d\u7f6e\u79cd\u5b50\u6570\u636e\u3002"))),Object(o.b)("h3",{id:"1154-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868"},"11.5.4 \u6839\u636e\u6a21\u578b\u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u8868"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration add_tenant_table -Context MultiTenantDbContext\n")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MultiTenantDbContext\n")),Object(o.b)("h3",{id:"1155-\u5b9e\u73b0-imultitenantontable-\u63a5\u53e3"},"11.5.5 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IMultiTenantOnTable")," \u63a5\u53e3"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"IMultiTenantOnTable")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,14-17}","{8,14-17}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnTable, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public object GetTenantId()\n {\n return base.Tenant?.TenantId ?? Guid.Empty;\n }\n }\n}\n')),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"GetTenantId()")," \u65b9\u6cd5\u4e2d\uff0c\u9996\u5148\u83b7\u53d6\u8bf7\u6c42\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"\u4e3b\u673a\u5730\u5740"),"\uff0c\u7136\u540e\u6839\u636e\u4e3b\u673a\u5730\u5740\u67e5\u8be2\u5bf9\u5e94\u7684\u79df\u6237 ",Object(o.b)("inlineCode",{parentName:"p"},"TenantIdId"),"\uff0c\u907f\u514d\u591a\u6b21\u67e5\u8be2\u6570\u636e\u5e93\uff0c\u8fd9\u91cc\u4f7f\u7528\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"IMemoryCache")," \u5185\u5b58\u7f13\u5b58\u3002"),Object(o.b)("h3",{id:"1156-\u5b9e\u73b0-imodelbuilderfilter-\u63a5\u53e3"},"11.5.6 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IModelBuilderFilter")," \u63a5\u53e3"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"IModelBuilderFilter")," \u63a5\u53e3\u662f\u5168\u5c40\u67e5\u8be2\u8fc7\u6ee4\u5668\u5b9e\u73b0\u63a5\u53e3\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u914d\u7f6e\u5b9e\u4f53 ",Object(o.b)("inlineCode",{parentName:"p"},"TenantId")," \u8fc7\u6ee4\u5668"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9,20-23}","{9,20-23}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnTable, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public object GetTenantId()\n {\n return base.Tenant?.TenantId ?? Guid.Empty;\n }\n\n public void OnCreating(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasQueryFilter(TenantIdQueryFilterExpression(entityBuilder, dbContext));\n }\n }\n}\n')),Object(o.b)("h3",{id:"1157-\u91cd\u5199-savingchangesevent-\u4e8b\u4ef6\u65b9\u6cd5"},"11.5.7 \u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"h3"},"SavingChangesEvent")," \u4e8b\u4ef6\u65b9\u6cd5"),Object(o.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u6b65\u9aa4\uff0c\u6211\u4eec\u5df2\u7ecf\u89e3\u51b3\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"\u67e5\u8be2")," \u79df\u6237\u8fc7\u6ee4\u529f\u80fd\uff0c\u4f46\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"\u65b0\u589e")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"\u66f4\u65b0")," \u8fd8\u672a\u5904\u7406\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"\u65b0\u589e")," \u6570\u636e\u7684\u65f6\u5019\u81ea\u52a8\u8bbe\u7f6e ",Object(o.b)("inlineCode",{parentName:"li"},"TenantId")," \u7684\u503c"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"\u66f4\u65b0")," \u6570\u636e\u7684\u65f6\u5019\u6392\u9664 ",Object(o.b)("inlineCode",{parentName:"li"},"TenantId")," \u5c5e\u6027\u66f4\u65b0")),Object(o.b)("p",null,"\u5b9e\u73b0\u4e0a\u9762\u7684\u6b65\u9aa4\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"p"},"SavingChangesEvent")," \u4e8b\u4ef6\u65b9\u6cd5\u5373\u53ef\u3002"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{26-48}","{26-48}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Linq;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnTable, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public object GetTenantId()\n {\n return base.Tenant?.TenantId ?? Guid.Empty;\n }\n\n public void OnCreating(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasQueryFilter(TenantIdQueryFilterExpression(entityBuilder, dbContext));\n }\n\n protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)\n {\n // \u83b7\u53d6\u5f53\u524d\u4e8b\u4ef6\u5bf9\u5e94\u4e0a\u4e0b\u6587\n var dbContext = eventData.Context;\n\n // \u83b7\u53d6\u6240\u6709\u65b0\u589e\u548c\u66f4\u65b0\u7684\u5b9e\u4f53\n var entities = dbContext.ChangeTracker.Entries().Where(u => u.State == EntityState.Added || u.State == EntityState.Modified);\n\n foreach (var entity in entities)\n {\n switch (entity.State)\n {\n // \u81ea\u52a8\u8bbe\u7f6e\u79df\u6237Id\n case EntityState.Added:\n entity.Property(nameof(Entity.TenantId)).CurrentValue = GetTenantId();\n break;\n // \u6392\u9664\u79df\u6237Id\n case EntityState.Modified:\n entity.Property(nameof(Entity.TenantId)).IsModified = false;\n break;\n }\n }\n }\n }\n}\n')),Object(o.b)("img",{src:Object(r.a)("img/saas1.png")}),Object(o.b)("h2",{id:"116-\u57fa\u4e8e-database-\u7684\u65b9\u5f0f"},"11.6 \u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h2"},"Database")," \u7684\u65b9\u5f0f"),Object(o.b)("p",null,"\u6b64\u65b9\u5f0f\u5728\u4e2d\u5927\u578b\u4f01\u4e1a\u7cfb\u7edf\u4e2d\u6700\u4e3a\u5e38\u7528\uff0c\u4e00\u4e2a\u79df\u6237\uff08\u5ba2\u6237\uff09\u4e00\u4e2a\u72ec\u7acb\u7684\u6570\u636e\u5e93\u3002"),Object(o.b)("h3",{id:"1161-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.6.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{6-7} title="Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"',"{6-7}":!0,title:'"Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class MultiTenantDbContext : AppDbContext\n {\n public MultiTenantDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u591a\u79df\u6237\u64cd\u4f5c\u5efa\u8bae\u5355\u72ec\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u800c\u4e14\u9700\u6307\u5b9a ",Object(o.b)("inlineCode",{parentName:"p"},"MultiTenantDbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002"))),Object(o.b)("h3",{id:"1162-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.6.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,14}","{13,14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDb(DbProvider.Sqlite);\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u9700\u8981 ",Object(o.b)("inlineCode",{parentName:"p"},"Database")," \u591a\u79df\u6237\u65b9\u6848\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u9700\u8981\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"AddDb")," \u6ce8\u518c\uff0c\u800c\u4e0d\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"AddDbPool"),"\u3002\u539f\u56e0\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"AddDbPool")," \u65b9\u5f0f\u6ce8\u518c\u540e\u7eed\u4e0d\u652f\u6301 ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring")," \u91cd\u5199\uff01\uff01\uff01"))),Object(o.b)("h3",{id:"1163-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e"},"11.6.3 \u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u79cd\u5b50\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{8,12-30} title="Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"',"{8,12-30}":!0,title:'"Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.EntityFramework.Core\n{\n public class TenantSeedData : IEntitySeedData\n {\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Tenant\n {\n TenantId = Guid.Parse("383AFB88-F519-FFF8-B364-6D563BF3687F"),\n Name = "\u9ed8\u8ba4\u79df\u6237",\n Host = "localhost:44313",\n CreatedTime = DateTime.Parse("2020-10-06 20:19:07"),\n ConnectionString = "Data Source=./Furion.db" // \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\n },\n new Tenant\n {\n TenantId = Guid.Parse("C5798CB6-16D6-0F42-EB56-59C695353BC0"),\n Name = "\u5176\u4ed6\u79df\u6237",\n Host = "localhost:5000",\n CreatedTime = DateTime.Parse("2020-10-06 20:20:32"),\n ConnectionString = "Data Source=./Fur2.db" // \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\n }\n };\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8be5\u6b65\u9aa4\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u65b9\u5f0f\u6267\u884c\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u65e0\u9700\u914d\u7f6e\u79cd\u5b50\u6570\u636e\u3002"))),Object(o.b)("h3",{id:"1164-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868"},"11.6.4 \u6839\u636e\u6a21\u578b\u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u8868"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration add_tenant_table -Context MultiTenantDbContext\n")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MultiTenantDbContext\n")),Object(o.b)("h3",{id:"1165-\u5b9e\u73b0-imultitenantondatabase-\u63a5\u53e3"},"11.6.5 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IMultiTenantOnDatabase")," \u63a5\u53e3"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"IMultiTenantOnDatabase")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,12-15}","{6,12-15}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n public class FurDbContext : AppDbContext, IMultiTenantOnDatabase\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public string GetDatabaseConnectionString()\n {\n return base.Tenant?.ConnectionString??"\u9ed8\u8ba4\u94fe\u63a5\u5b57\u7b26\u4e32";\n }\n }\n}\n')),Object(o.b)("h3",{id:"1166-\u91cd\u5199-onconfiguring-\u65b9\u6cd5"},"11.6.6 \u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"h3"},"OnConfiguring")," \u65b9\u6cd5"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring")," \u65b9\u6cd5\u5e76\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12-17}","{12-17}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n public class FurDbContext : AppDbContext, IMultiTenantOnDatabase\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n {\n optionsBuilder.UseSqlite(GetDatabaseConnectionString());\n\n base.OnConfiguring(optionsBuilder);\n }\n\n public string GetDatabaseConnectionString()\n {\n return base.Tenant?.ConnectionString??"\u9ed8\u8ba4\u94fe\u63a5\u5b57\u7b26\u4e32";\n }\n }\n}\n')),Object(o.b)("img",{src:Object(r.a)("img/saas2.png")}),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"Database")," \u65b9\u5f0f\u505a ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u7684\u65f6\u5019\uff0c\u9700\u8981\u624b\u52a8\u6307\u5b9a\u8fc1\u79fb\u7a0b\u5e8f\u540d\u79f0\uff0c\u5982\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'optionsBuilder.UseSqlite(GetDatabaseConnectionString(), options=>\n{\n options.MigrationsAssembly("My.Migrations");\n});\n')))),Object(o.b)("h2",{id:"117-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f"},"11.7 \u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h2"},"Schema")," \u7684\u65b9\u5f0f"),Object(o.b)("p",null,"\u6b64\u65b9\u5f0f\u5728\u4e2d\u5c0f\u578b\u4f01\u4e1a\u7cfb\u7edf\u4e2d\u4e5f\u4e0d\u5c11\u89c1\uff0c\u4e00\u4e2a\u79df\u6237\uff08\u5ba2\u6237\uff09\u5171\u4eab\u6570\u636e\u5e93\u4e14\u4e0d\u540c ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\u3002"),Object(o.b)("h3",{id:"1171-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.7.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{6-7} title="Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"',"{6-7}":!0,title:'"Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class MultiTenantDbContext : AppDbContext\n {\n public MultiTenantDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u591a\u79df\u6237\u64cd\u4f5c\u5efa\u8bae\u5355\u72ec\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u800c\u4e14\u9700\u6307\u5b9a ",Object(o.b)("inlineCode",{parentName:"p"},"MultiTenantDbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002"))),Object(o.b)("h3",{id:"1172-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.7.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{14}","{14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDbPool(DbProvider.Sqlite);\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("h3",{id:"1173-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e"},"11.7.3 \u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u79cd\u5b50\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{8,12-30} title="Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"',"{8,12-30}":!0,title:'"Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.EntityFramework.Core\n{\n public class TenantSeedData : IEntitySeedData\n {\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Tenant\n {\n TenantId = Guid.Parse("383AFB88-F519-FFF8-B364-6D563BF3687F"),\n Name = "\u9ed8\u8ba4\u79df\u6237",\n Host = "localhost:44313",\n CreatedTime = DateTime.Parse("2020-10-06 20:19:07"),\n Schema = "dbo" // Schema\n },\n new Tenant\n {\n TenantId = Guid.Parse("C5798CB6-16D6-0F42-EB56-59C695353BC0"),\n Name = "\u5176\u4ed6\u79df\u6237",\n Host = "localhost:5000",\n CreatedTime = DateTime.Parse("2020-10-06 20:20:32"),\n Schema = "furion" // Schema\n }\n };\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8be5\u6b65\u9aa4\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u65b9\u5f0f\u6267\u884c\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u65e0\u9700\u914d\u7f6e\u79cd\u5b50\u6570\u636e\u3002"))),Object(o.b)("h3",{id:"1174-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868"},"11.7.4 \u6839\u636e\u6a21\u578b\u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u8868"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration add_tenant_table -Context MultiTenantDbContext\n")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MultiTenantDbContext\n")),Object(o.b)("h3",{id:"1175-\u5b9e\u73b0-imultitenantonschema-\u63a5\u53e3"},"11.7.5 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IMultiTenantOnSchema")," \u63a5\u53e3"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"IMultiTenantOnSchema")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,12-15}","{6,12-15}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnSchema\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public string GetSchemaName()\n {\n return base.Tenant?.Schema??"dbo";\n }\n }\n}\n')),Object(o.b)("h3",{id:"1176-\u5173\u4e8e-code-first-\u6570\u636e\u8fc1\u79fb"},"11.7.6 \u5173\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"Code First \u6570\u636e\u8fc1\u79fb")),Object(o.b)("p",null,"\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"Schema")," \u65b9\u5f0f\u6bd4\u8f83\u7279\u522b\uff0c\u751f\u6210\u6570\u636e\u8fc1\u79fb\u7684\u65f6\u5019\u6ca1\u529e\u6cd5\u83b7\u53d6\u79df\u6237\u4fe1\u606f\uff0c\u6240\u4ee5\u5efa\u8bae",Object(o.b)("strong",{parentName:"p"},"\u5206\u5f00\u591a\u6b21\u8fc1\u79fb"),"\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public string GetSchemaName()\n{\n return base.Tenant?.Schema?? "\u79df\u6237\u4e00Schema";\n}\n')),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public string GetSchemaName()\n{\n return base.Tenant?.Schema?? "\u79df\u6237\u4e8cSchema";\n}\n')),Object(o.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728\u8fc1\u79fb\u7684\u65f6\u5019\u751f\u6210\u591a\u6b21\u8fc1\u79fb\u4e86\u3002"),Object(o.b)("h2",{id:"118-\u81ea\u5b9a\u4e49-tenant-\u7c7b\u578b"},"11.8 \u81ea\u5b9a\u4e49 ",Object(o.b)("inlineCode",{parentName:"h2"},"Tenant")," \u7c7b\u578b"),Object(o.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5185\u7f6e\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"Tenant")," \u7c7b\u578b\uff0c\u65b9\u4fbf\u5927\u5bb6\u5feb\u901f\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"SaaS")," \u591a\u79df\u6237\u529f\u80fd\uff0c\u5982\u679c\u9700\u8981\u81ea\u5b9a\u4e49\u591a\u79df\u6237 ",Object(o.b)("inlineCode",{parentName:"p"},"Tenant")," \u7c7b\u578b\uff0c\u53ea\u9700\u8981\u542f\u7528\u4ee5\u4e0b\u914d\u7f6e\u5373\u53ef\uff1a"),Object(o.b)("h3",{id:"1181-\u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e"},"11.8.1 \u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"services.AddDatabaseAccessor(options =>\n{\n options.CustomizeMultiTenants(); // \u542f\u7528\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\uff0c\u6709\u4e00\u4e2a\u9ed8\u8ba4\u53c2\u6570\uff0c\u914d\u7f6e\u591a\u79df\u6237\u8868\u5b57\u6bb5\u540d\n options.AddDbPool(DbProvider.Sqlite);\n});\n")),Object(o.b)("h3",{id:"1182-\u81ea\u5b9a\u4e49\u79df\u6237\u7c7b"},"11.8.2 \u81ea\u5b9a\u4e49\u79df\u6237\u7c7b"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6}","{6}":!0}),"using System;\nusing System.ComponentModel.DataAnnotations.Schema;\n\nnamespace Furion.Core\n{\n public class MyTenant : IEntity\n {\n [Key]\n public Guid TenantId { get; set; }\n\n public string Name { get; set; }\n\n public string Host { get; set; }\n }\n}\n")),Object(o.b)("p",null,"\u5982\u679c\u9700\u8981\u67e5\u8be2\u8be5\u79df\u6237\u4fe1\u606f\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u83b7\u53d6\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var tenantDbContext = Db.GetDbContext();\nvar myTenant = tenantDbContext.Set();\n")),Object(o.b)("h2",{id:"119-\u53cd\u9988\u4e0e\u5efa\u8bae"},"11.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[14],{194:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(195);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return u}));var a=t(0),i=t.n(a);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var s=i.a.createContext({}),l=function(e){var n=i.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},d=function(e){var n=l(e.components);return i.a.createElement(s.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},m=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,s=b(e,["components","mdxType","originalType","parentName"]),d=l(t),m=a,u=d["".concat(r,".").concat(m)]||d[m]||p[m]||o;return t?i.a.createElement(u,c(c({ref:n},s),{},{components:t})):i.a.createElement(u,c({ref:n},s))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,r=new Array(o);r[0]=m;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,r[1]=c;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},87:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return p}));var a=t(3),i=t(7),o=(t(0),t(196)),r=t(194),c=t(197),b={id:"saas",title:"11. SaaS \u591a\u79df\u6237",sidebar_label:"11. SaaS \u591a\u79df\u6237"},s={unversionedId:"saas",id:"saas",isDocsHomePage:!1,title:"11. SaaS \u591a\u79df\u6237",description:"11.1 \u4ec0\u4e48\u662f SaaS",source:"@site/docs\\saas.mdx",slug:"/saas",permalink:"/docs/saas",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/saas.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"11. SaaS \u591a\u79df\u6237",sidebar:"docs",previous:{title:"10.2. Dapper \u96c6\u6210",permalink:"/docs/dapper"},next:{title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",permalink:"/docs/dependency-injection"}},l=[{value:"11.1 \u4ec0\u4e48\u662f SaaS",id:"111-\u4ec0\u4e48\u662f-saas",children:[]},{value:"11.2 \u4ec0\u4e48\u662f\u591a\u79df\u6237",id:"112-\u4ec0\u4e48\u662f\u591a\u79df\u6237",children:[]},{value:"11.3 \u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848",id:"113-\u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848",children:[{value:"11.3.1 \u72ec\u7acb\u6570\u636e\u5e93(\u57fa\u4e8e Database \u7684\u65b9\u5f0f)",id:"1131-\u72ec\u7acb\u6570\u636e\u5e93\u57fa\u4e8e-database-\u7684\u65b9\u5f0f",children:[]},{value:"11.3.2 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb Schema (\u57fa\u4e8e Schema \u7684\u65b9\u5f0f)",id:"1132-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb-schema-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f",children:[]},{value:"11.3.3 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab Schema (\u57fa\u4e8e TenantId \u7684\u65b9\u5f0f)",id:"1133-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab-schema-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f",children:[]}]},{value:"11.4 \u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848",id:"114-\u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848",children:[]},{value:"11.5 \u57fa\u4e8e TenantId \u7684\u65b9\u5f0f",id:"115-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f",children:[{value:"11.5.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1151-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.5.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1152-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.5.3 \u6dfb\u52a0 Tenant \u79cd\u5b50\u6570\u636e",id:"1153-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e",children:[]},{value:"11.5.4 \u6839\u636e\u6a21\u578b\u521b\u5efa Tenant \u8868",id:"1154-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868",children:[]},{value:"11.5.5 \u5b9e\u73b0 IMultiTenantOnTable \u63a5\u53e3",id:"1155-\u5b9e\u73b0-imultitenantontable-\u63a5\u53e3",children:[]},{value:"11.5.6 \u5b9e\u73b0 IModelBuilderFilter \u63a5\u53e3",id:"1156-\u5b9e\u73b0-imodelbuilderfilter-\u63a5\u53e3",children:[]},{value:"11.5.7 \u91cd\u5199 SavingChangesEvent \u4e8b\u4ef6\u65b9\u6cd5",id:"1157-\u91cd\u5199-savingchangesevent-\u4e8b\u4ef6\u65b9\u6cd5",children:[]}]},{value:"11.6 \u57fa\u4e8e Database \u7684\u65b9\u5f0f",id:"116-\u57fa\u4e8e-database-\u7684\u65b9\u5f0f",children:[{value:"11.6.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1161-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.6.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1162-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.6.3 \u6dfb\u52a0 Tenant \u79cd\u5b50\u6570\u636e",id:"1163-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e",children:[]},{value:"11.6.4 \u6839\u636e\u6a21\u578b\u521b\u5efa Tenant \u8868",id:"1164-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868",children:[]},{value:"11.6.5 \u5b9e\u73b0 IMultiTenantOnDatabase \u63a5\u53e3",id:"1165-\u5b9e\u73b0-imultitenantondatabase-\u63a5\u53e3",children:[]},{value:"11.6.6 \u91cd\u5199 OnConfiguring \u65b9\u6cd5",id:"1166-\u91cd\u5199-onconfiguring-\u65b9\u6cd5",children:[]}]},{value:"11.7 \u57fa\u4e8e Schema \u7684\u65b9\u5f0f",id:"117-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f",children:[{value:"11.7.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1171-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.7.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"1172-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"11.7.3 \u6dfb\u52a0 Tenant \u79cd\u5b50\u6570\u636e",id:"1173-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e",children:[]},{value:"11.7.4 \u6839\u636e\u6a21\u578b\u521b\u5efa Tenant \u8868",id:"1174-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868",children:[]},{value:"11.7.5 \u5b9e\u73b0 IMultiTenantOnSchema \u63a5\u53e3",id:"1175-\u5b9e\u73b0-imultitenantonschema-\u63a5\u53e3",children:[]},{value:"11.7.6 \u5173\u4e8e Code First \u6570\u636e\u8fc1\u79fb",id:"1176-\u5173\u4e8e-code-first-\u6570\u636e\u8fc1\u79fb",children:[]}]},{value:"11.8 \u81ea\u5b9a\u4e49 Tenant \u7c7b\u578b",id:"118-\u81ea\u5b9a\u4e49-tenant-\u7c7b\u578b",children:[{value:"11.8.1 \u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e",id:"1181-\u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e",children:[]},{value:"11.8.2 \u81ea\u5b9a\u4e49\u79df\u6237\u7c7b",id:"1182-\u81ea\u5b9a\u4e49\u79df\u6237\u7c7b",children:[]}]},{value:"11.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"119-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:l};function p(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(c.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"111-\u4ec0\u4e48\u662f-saas"},"11.1 \u4ec0\u4e48\u662f ",Object(o.b)("inlineCode",{parentName:"h2"},"SaaS")),Object(o.b)("blockquote",null,Object(o.b)("p",{parentName:"blockquote"},"SaaS \u662f Software-as-a-Service\uff08\u8f6f\u4ef6\u5373\u670d\u52a1\uff09\u7684\u7b80\u79f0\uff0c\u968f\u7740\u4e92\u8054\u7f51\u6280\u672f\u7684\u53d1\u5c55\u548c\u5e94\u7528\u8f6f\u4ef6\u7684\u6210\u719f\uff0c \u5728 21 \u4e16\u7eaa\u5f00\u59cb\u5174\u8d77\u7684\u4e00\u79cd\u5b8c\u5168\u521b\u65b0\u7684\u8f6f\u4ef6\u5e94\u7528\u6a21\u5f0f\u3002\u5b83\u4e0e\u201con-demand software\u201d\uff0cthe application service provider(ASP\uff0c\u5e94\u7528\u670d\u52a1\u63d0\u4f9b\u5546)\uff0chosted software(\u6258\u7ba1\u8f6f\u4ef6)\u6240\u5177\u6709\u76f8\u4f3c\u7684\u542b\u4e49\u3002"),Object(o.b)("p",{parentName:"blockquote"},"\u5b83\u662f\u4e00\u79cd\u901a\u8fc7 Internet \u63d0\u4f9b\u8f6f\u4ef6\u7684\u6a21\u5f0f\uff0c\u5382\u5546\u5c06\u5e94\u7528\u8f6f\u4ef6\u7edf\u4e00\u90e8\u7f72\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u4e0a\uff0c\u5ba2\u6237\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u9700\u6c42\uff0c\u901a\u8fc7\u4e92\u8054\u7f51\u5411\u5382\u5546\u5b9a\u8d2d\u6240\u9700\u7684\u5e94\u7528\u8f6f\u4ef6\u670d\u52a1\uff0c\u6309\u5b9a\u8d2d\u7684\u670d\u52a1\u591a\u5c11\u548c\u65f6\u95f4\u957f\u77ed\u5411\u5382\u5546\u652f\u4ed8\u8d39\u7528\uff0c\u5e76\u901a\u8fc7\u4e92\u8054\u7f51\u83b7\u5f97\u5382\u5546\u63d0\u4f9b\u7684\u670d\u52a1\u3002\u7528\u6237\u4e0d\u7528\u518d\u8d2d\u4e70\u8f6f\u4ef6\uff0c\u800c\u6539\u7528\u5411\u63d0\u4f9b\u5546\u79df\u7528\u57fa\u4e8e Web \u7684\u8f6f\u4ef6\uff0c\u6765\u7ba1\u7406\u4f01\u4e1a\u7ecf\u8425\u6d3b\u52a8\uff0c\u4e14\u65e0\u9700\u5bf9\u8f6f\u4ef6\u8fdb\u884c\u7ef4\u62a4\uff0c\u670d\u52a1\u63d0\u4f9b\u5546\u4f1a\u5168\u6743\u7ba1\u7406\u548c\u7ef4\u62a4\u8f6f\u4ef6\uff0c\u8f6f\u4ef6\u5382\u5546\u5728\u5411\u5ba2\u6237\u63d0\u4f9b\u4e92\u8054\u7f51\u5e94\u7528\u7684\u540c\u65f6\uff0c\u4e5f\u63d0\u4f9b\u8f6f\u4ef6\u7684\u79bb\u7ebf\u64cd\u4f5c\u548c\u672c\u5730\u6570\u636e\u5b58\u50a8\uff0c\u8ba9\u7528\u6237\u968f\u65f6\u968f\u5730\u90fd\u53ef\u4ee5\u4f7f\u7528\u5176\u5b9a\u8d2d\u7684\u8f6f\u4ef6\u548c\u670d\u52a1\u3002"),Object(o.b)("p",{parentName:"blockquote"},"\u5bf9\u4e8e\u8bb8\u591a\u5c0f\u578b\u4f01\u4e1a\u6765\u8bf4\uff0cSaaS \u662f\u91c7\u7528\u5148\u8fdb\u6280\u672f\u7684\u6700\u597d\u9014\u5f84\uff0c\u5b83\u6d88\u9664\u4e86\u4f01\u4e1a\u8d2d\u4e70\u3001\u6784\u5efa\u548c\u7ef4\u62a4\u57fa\u7840\u8bbe\u65bd\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u9700\u8981\u3002")),Object(o.b)("h2",{id:"112-\u4ec0\u4e48\u662f\u591a\u79df\u6237"},"11.2 \u4ec0\u4e48\u662f\u591a\u79df\u6237"),Object(o.b)("p",null,"\u591a\u79df\u6237\u6280\u672f\u6216\u79f0\u591a\u91cd\u79df\u8d41\u6280\u672f\uff0c\u7b80\u79f0 ",Object(o.b)("inlineCode",{parentName:"p"},"SaaS"),"\uff0c\u662f\u4e00\u79cd\u8f6f\u4ef6\u67b6\u6784\u6280\u672f\uff0c\u662f\u5b9e\u73b0\u5982\u4f55\u5728\u591a\u7528\u6237\u73af\u5883\u4e0b\uff08\u6b64\u5904\u7684\u591a\u7528\u6237\u4e00\u822c\u662f\u9762\u5411\u4f01\u4e1a\u7528\u6237\uff09\u5171\u7528\u76f8\u540c\u7684\u7cfb\u7edf\u6216\u7a0b\u5e8f\u7ec4\u4ef6\uff0c\u5e76\u4e14\u53ef\u786e\u4fdd\u5404\u7528\u6237\u95f4\u6570\u636e\u7684\u9694\u79bb\u6027\u3002"),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"\u7b80\u5355\u8bb2\uff1a\u5728\u4e00\u53f0\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u5355\u4e2a\u5e94\u7528\u5b9e\u4f8b\uff0c\u5b83\u4e3a\u591a\u4e2a\u79df\u6237\uff08\u5ba2\u6237\uff09\u63d0\u4f9b\u670d\u52a1\u3002"),"\u4ece\u5b9a\u4e49\u4e2d\u6211\u4eec\u53ef\u4ee5\u7406\u89e3\uff1a\u591a\u79df\u6237\u662f\u4e00\u79cd\u67b6\u6784\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u8ba9\u591a\u7528\u6237\u73af\u5883\u4e0b\u4f7f\u7528\u540c\u4e00\u5957\u7a0b\u5e8f\uff0c\u4e14\u4fdd\u8bc1\u7528\u6237\u95f4\u6570\u636e\u9694\u79bb\u3002\u90a3\u4e48\u91cd\u70b9\u5c31\u5f88\u6d45\u663e\u6613\u61c2\u4e86\uff0c\u591a\u79df\u6237\u7684\u91cd\u70b9\u5c31\u662f\u540c\u4e00\u5957\u7a0b\u5e8f\u4e0b\u5b9e\u73b0\u591a\u7528\u6237\u6570\u636e\u7684\u9694\u79bb\u3002"),Object(o.b)("h2",{id:"113-\u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848"},"11.3 \u5b9e\u73b0\u591a\u79df\u6237\u65b9\u6848"),Object(o.b)("h3",{id:"1131-\u72ec\u7acb\u6570\u636e\u5e93\u57fa\u4e8e-database-\u7684\u65b9\u5f0f"},"11.3.1 \u72ec\u7acb\u6570\u636e\u5e93(\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"Database")," \u7684\u65b9\u5f0f)"),Object(o.b)("p",null,"\u8fd9\u662f\u7b2c\u4e00\u79cd\u65b9\u6848\uff0c\u5373\u4e00\u4e2a\u79df\u6237\u4e00\u4e2a\u6570\u636e\u5e93\uff0c\u8fd9\u79cd\u65b9\u6848\u7684\u7528\u6237\u6570\u636e\u9694\u79bb\u7ea7\u522b\u6700\u9ad8\uff0c\u5b89\u5168\u6027\u6700\u597d\uff0c\u4f46\u6210\u672c\u8f83\u9ad8\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u4f18\u70b9\uff1a"),"\n\u4e3a\u4e0d\u540c\u7684\u79df\u6237\u63d0\u4f9b\u72ec\u7acb\u7684\u6570\u636e\u5e93\uff0c\u6709\u52a9\u4e8e\u7b80\u5316\u6570\u636e\u6a21\u578b\u7684\u6269\u5c55\u8bbe\u8ba1\uff0c\u6ee1\u8db3\u4e0d\u540c\u79df\u6237\u7684\u72ec\u7279\u9700\u6c42\uff1b\u5982\u679c\u51fa\u73b0\u6545\u969c\uff0c\u6062\u590d\u6570\u636e\u6bd4\u8f83\u7b80\u5355\u3002")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u7f3a\u70b9\uff1a"),"\n\u589e\u591a\u4e86\u6570\u636e\u5e93\u7684\u5b89\u88c5\u6570\u91cf\uff0c\u968f\u4e4b\u5e26\u6765\u7ef4\u62a4\u6210\u672c\u548c\u8d2d\u7f6e\u6210\u672c\u7684\u589e\u52a0\u3002 \u8fd9\u79cd\u65b9\u6848\u4e0e\u4f20\u7edf\u7684\u4e00\u4e2a\u5ba2\u6237\u3001\u4e00\u5957\u6570\u636e\u3001\u4e00\u5957\u90e8\u7f72\u7c7b\u4f3c\uff0c\u5dee\u522b\u53ea\u5728\u4e8e\u8f6f\u4ef6\u7edf\u4e00\u90e8\u7f72\u5728\u8fd0\u8425\u5546\u90a3\u91cc\u3002\u5982\u679c\u9762\u5bf9\u7684\u662f\u94f6\u884c\u3001\u533b\u9662\u7b49\u9700\u8981\u975e\u5e38\u9ad8\u6570\u636e\u9694\u79bb\u7ea7\u522b\u7684\u79df\u6237\uff0c\u53ef\u4ee5\u9009\u62e9\u8fd9\u79cd\u6a21\u5f0f\uff0c\u63d0\u9ad8\u79df\u7528\u7684\u5b9a\u4ef7\u3002\u5982\u679c\u5b9a\u4ef7\u8f83\u4f4e\uff0c\u4ea7\u54c1\u8d70\u4f4e\u4ef7\u8def\u7ebf\uff0c\u8fd9\u79cd\u65b9\u6848\u4e00\u822c\u5bf9\u8fd0\u8425\u5546\u6765\u8bf4\u662f\u65e0\u6cd5\u627f\u53d7\u7684\u3002"))),Object(o.b)("h3",{id:"1132-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb-schema-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f"},"11.3.2 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u72ec\u7acb ",Object(o.b)("inlineCode",{parentName:"h3"},"Schema")," (\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"Schema")," \u7684\u65b9\u5f0f)"),Object(o.b)("p",null,"\u8fd9\u662f\u7b2c\u4e8c\u79cd\u65b9\u6848\uff0c\u5373\u591a\u4e2a\u6216\u6240\u6709\u79df\u6237\u5171\u4eab ",Object(o.b)("inlineCode",{parentName:"p"},"Database"),"\uff0c\u4f46\u662f\u6bcf\u4e2a\u79df\u6237\u4e00\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\uff08\u4e5f\u53ef\u53eb\u505a\u4e00\u4e2a user\uff09\u3002\u5e95\u5c42\u5e93\u6bd4\u5982\u662f\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"SqlServer"),"\u3001",Object(o.b)("inlineCode",{parentName:"p"},"Oracle")," \u7b49\uff0c\u4e00\u4e2a\u6570\u636e\u5e93\u4e0b\u53ef\u4ee5\u6709\u591a\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u4f18\u70b9\uff1a"),"\n\u4e3a\u5b89\u5168\u6027\u8981\u6c42\u8f83\u9ad8\u7684\u79df\u6237\u63d0\u4f9b\u4e86\u4e00\u5b9a\u7a0b\u5ea6\u7684\u903b\u8f91\u6570\u636e\u9694\u79bb\uff0c\u5e76\u4e0d\u662f\u5b8c\u5168\u9694\u79bb\uff1b\u6bcf\u4e2a\u6570\u636e\u5e93\u53ef\u652f\u6301\u66f4\u591a\u7684\u79df\u6237\u6570\u91cf\u3002")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u7f3a\u70b9\uff1a"),"\n\u5982\u679c\u51fa\u73b0\u6545\u969c\uff0c\u6570\u636e\u6062\u590d\u6bd4\u8f83\u56f0\u96be\uff0c\u56e0\u4e3a\u6062\u590d\u6570\u636e\u5e93\u5c06\u7275\u6d89\u5230\u5176\u4ed6\u79df\u6237\u7684\u6570\u636e\uff1b \u5982\u679c\u9700\u8981\u8de8\u79df\u6237\u7edf\u8ba1\u6570\u636e\uff0c\u5b58\u5728\u4e00\u5b9a\u56f0\u96be\u3002"))),Object(o.b)("h3",{id:"1133-\u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab-schema-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f"},"11.3.3 \u5171\u4eab\u6570\u636e\u5e93\uff0c\u5171\u4eab ",Object(o.b)("inlineCode",{parentName:"h3"},"Schema")," (\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"TenantId")," \u7684\u65b9\u5f0f)"),Object(o.b)("p",null,"\u5171\u4eab\u6570\u636e\u8868 \u8fd9\u662f\u7b2c\u4e09\u79cd\u65b9\u6848\uff0c\u5373\u79df\u6237\u5171\u4eab\u540c\u4e00\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Database"),"\u3001\u540c\u4e00\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\uff0c\u4f46\u5728\u8868\u4e2d\u589e\u52a0 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"TenantId"))," \u591a\u79df\u6237\u7684\u6570\u636e\u5b57\u6bb5\u3002\u8fd9\u662f\u5171\u4eab\u7a0b\u5ea6\u6700\u9ad8\u3001\u9694\u79bb\u7ea7\u522b\u6700\u4f4e\u7684\u6a21\u5f0f\u3002 \u5373\u6bcf\u63d2\u5165\u4e00\u6761\u6570\u636e\u65f6\u90fd\u9700\u8981\u6709\u4e00\u4e2a\u5ba2\u6237\u7684\u6807\u8bc6\u3002\u8fd9\u6837\u624d\u80fd\u5728\u540c\u4e00\u5f20\u8868\u4e2d\u533a\u5206\u51fa\u4e0d\u540c\u5ba2\u6237\u7684\u6570\u636e\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u4f18\u70b9\uff1a"),"\n\u4e09\u79cd\u65b9\u6848\u6bd4\u8f83\uff0c\u7b2c\u4e09\u79cd\u65b9\u6848\u7684\u7ef4\u62a4\u548c\u8d2d\u7f6e\u6210\u672c\u6700\u4f4e\uff0c\u5141\u8bb8\u6bcf\u4e2a\u6570\u636e\u5e93\u652f\u6301\u7684\u79df\u6237\u6570\u91cf\u6700\u591a\u3002")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},Object(o.b)("strong",{parentName:"p"},"\u7f3a\u70b9\uff1a"),"\n\u9694\u79bb\u7ea7\u522b\u6700\u4f4e\uff0c\u5b89\u5168\u6027\u6700\u4f4e\uff0c\u9700\u8981\u5728\u8bbe\u8ba1\u5f00\u53d1\u65f6\u52a0\u5927\u5bf9\u5b89\u5168\u7684\u5f00\u53d1\u91cf\uff1b \u6570\u636e\u5907\u4efd\u548c\u6062\u590d\u6700\u56f0\u96be\uff0c\u9700\u8981\u9010\u8868\u9010\u6761\u5907\u4efd\u548c\u8fd8\u539f\u3002"))),Object(o.b)("h2",{id:"114-\u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848"},"11.4 \u591a\u79df\u6237\u4f7f\u7528\u65b9\u6848"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u652f\u6301\u4ee5\u4e0a\u4e09\u79cd\u591a\u79df\u6237\u5b9e\u73b0\u65b9\u6848\uff0c\u4f7f\u7528\u7b80\u5355\u4e14\u5bb9\u6613\u7ef4\u62a4\u3002\u4e0b\u9762\u5206\u522b\u4f7f\u7528\u4e09\u79cd\u4e0d\u540c\u65b9\u5f0f\u6f14\u793a\u591a\u79df\u6237\u65b9\u6848\u7528\u6cd5\u3002"),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u4e00\u65e6 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")," \u7c7b\u7ee7\u627f\u4e86\u79df\u6237\u4efb\u610f\u63a5\u53e3\uff0c\u5219\u81ea\u52a8\u5f00\u59cb\u591a\u79df\u6237\u529f\u80fd\u652f\u6301\u3002"))),Object(o.b)("h2",{id:"115-\u57fa\u4e8e-tenantid-\u7684\u65b9\u5f0f"},"11.5 \u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h2"},"TenantId")," \u7684\u65b9\u5f0f"),Object(o.b)("p",null,"\u6b64\u65b9\u5f0f\u5728\u4e2d\u5c0f\u578b\u4f01\u4e1a\u7cfb\u7edf\u4e2d\u6700\u4e3a\u5e38\u7528\uff0c\u7ef4\u62a4\u6210\u672c\u4f4e\uff0c\u8d2d\u7f6e\u6210\u672c\u4f4e\u3002"),Object(o.b)("h3",{id:"1151-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.5.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{6-7} title="Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"',"{6-7}":!0,title:'"Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class MultiTenantDbContext : AppDbContext\n {\n public MultiTenantDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u591a\u79df\u6237\u64cd\u4f5c\u5efa\u8bae\u5355\u72ec\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u800c\u4e14\u9700\u6307\u5b9a ",Object(o.b)("inlineCode",{parentName:"p"},"MultiTenantDbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002"))),Object(o.b)("h3",{id:"1152-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.5.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{14}","{14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDbPool(DbProvider.Sqlite);\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("h3",{id:"1153-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e"},"11.5.3 \u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u79cd\u5b50\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{8,12-28} title="Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"',"{8,12-28}":!0,title:'"Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.EntityFramework.Core\n{\n public class TenantSeedData : IEntitySeedData\n {\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Tenant\n {\n TenantId = Guid.Parse("383AFB88-F519-FFF8-B364-6D563BF3687F"),\n Name = "\u9ed8\u8ba4\u79df\u6237",\n Host = "localhost:44313",\n CreatedTime = DateTime.Parse("2020-10-06 20:19:07")\n },\n new Tenant\n {\n TenantId = Guid.Parse("C5798CB6-16D6-0F42-EB56-59C695353BC0"),\n Name = "\u5176\u4ed6\u79df\u6237",\n Host = "localhost:5000",\n CreatedTime = DateTime.Parse("2020-10-06 20:20:32")\n }\n };\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8be5\u6b65\u9aa4\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u65b9\u5f0f\u6267\u884c\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u65e0\u9700\u914d\u7f6e\u79cd\u5b50\u6570\u636e\u3002"))),Object(o.b)("h3",{id:"1154-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868"},"11.5.4 \u6839\u636e\u6a21\u578b\u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u8868"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration add_tenant_table -Context MultiTenantDbContext\n")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MultiTenantDbContext\n")),Object(o.b)("h3",{id:"1155-\u5b9e\u73b0-imultitenantontable-\u63a5\u53e3"},"11.5.5 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IMultiTenantOnTable")," \u63a5\u53e3"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"IMultiTenantOnTable")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,14-17}","{8,14-17}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnTable, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public object GetTenantId()\n {\n return base.Tenant?.TenantId ?? Guid.Empty;\n }\n }\n}\n')),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"GetTenantId()")," \u65b9\u6cd5\u4e2d\uff0c\u9996\u5148\u83b7\u53d6\u8bf7\u6c42\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"\u4e3b\u673a\u5730\u5740"),"\uff0c\u7136\u540e\u6839\u636e\u4e3b\u673a\u5730\u5740\u67e5\u8be2\u5bf9\u5e94\u7684\u79df\u6237 ",Object(o.b)("inlineCode",{parentName:"p"},"TenantIdId"),"\uff0c\u907f\u514d\u591a\u6b21\u67e5\u8be2\u6570\u636e\u5e93\uff0c\u8fd9\u91cc\u4f7f\u7528\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"IMemoryCache")," \u5185\u5b58\u7f13\u5b58\u3002"),Object(o.b)("h3",{id:"1156-\u5b9e\u73b0-imodelbuilderfilter-\u63a5\u53e3"},"11.5.6 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IModelBuilderFilter")," \u63a5\u53e3"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"IModelBuilderFilter")," \u63a5\u53e3\u662f\u5168\u5c40\u67e5\u8be2\u8fc7\u6ee4\u5668\u5b9e\u73b0\u63a5\u53e3\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u914d\u7f6e\u5b9e\u4f53 ",Object(o.b)("inlineCode",{parentName:"p"},"TenantId")," \u8fc7\u6ee4\u5668"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9,20-23}","{9,20-23}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnTable, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public object GetTenantId()\n {\n return base.Tenant?.TenantId ?? Guid.Empty;\n }\n\n public void OnCreating(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasQueryFilter(TenantIdQueryFilterExpression(entityBuilder, dbContext));\n }\n }\n}\n')),Object(o.b)("h3",{id:"1157-\u91cd\u5199-savingchangesevent-\u4e8b\u4ef6\u65b9\u6cd5"},"11.5.7 \u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"h3"},"SavingChangesEvent")," \u4e8b\u4ef6\u65b9\u6cd5"),Object(o.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u6b65\u9aa4\uff0c\u6211\u4eec\u5df2\u7ecf\u89e3\u51b3\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"\u67e5\u8be2")," \u79df\u6237\u8fc7\u6ee4\u529f\u80fd\uff0c\u4f46\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"\u65b0\u589e")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"\u66f4\u65b0")," \u8fd8\u672a\u5904\u7406\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"\u65b0\u589e")," \u6570\u636e\u7684\u65f6\u5019\u81ea\u52a8\u8bbe\u7f6e ",Object(o.b)("inlineCode",{parentName:"li"},"TenantId")," \u7684\u503c"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"\u66f4\u65b0")," \u6570\u636e\u7684\u65f6\u5019\u6392\u9664 ",Object(o.b)("inlineCode",{parentName:"li"},"TenantId")," \u5c5e\u6027\u66f4\u65b0")),Object(o.b)("p",null,"\u5b9e\u73b0\u4e0a\u9762\u7684\u6b65\u9aa4\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"p"},"SavingChangesEvent")," \u4e8b\u4ef6\u65b9\u6cd5\u5373\u53ef\u3002"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{26-48}","{26-48}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Linq;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnTable, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public object GetTenantId()\n {\n return base.Tenant?.TenantId ?? Guid.Empty;\n }\n\n public void OnCreating(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasQueryFilter(TenantIdQueryFilterExpression(entityBuilder, dbContext));\n }\n\n protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)\n {\n // \u83b7\u53d6\u5f53\u524d\u4e8b\u4ef6\u5bf9\u5e94\u4e0a\u4e0b\u6587\n var dbContext = eventData.Context;\n\n // \u83b7\u53d6\u6240\u6709\u65b0\u589e\u548c\u66f4\u65b0\u7684\u5b9e\u4f53\n var entities = dbContext.ChangeTracker.Entries().Where(u => u.State == EntityState.Added || u.State == EntityState.Modified);\n\n foreach (var entity in entities)\n {\n switch (entity.State)\n {\n // \u81ea\u52a8\u8bbe\u7f6e\u79df\u6237Id\n case EntityState.Added:\n entity.Property(nameof(Entity.TenantId)).CurrentValue = GetTenantId();\n break;\n // \u6392\u9664\u79df\u6237Id\n case EntityState.Modified:\n entity.Property(nameof(Entity.TenantId)).IsModified = false;\n break;\n }\n }\n }\n }\n}\n')),Object(o.b)("img",{src:Object(r.a)("img/saas1.png")}),Object(o.b)("h2",{id:"116-\u57fa\u4e8e-database-\u7684\u65b9\u5f0f"},"11.6 \u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h2"},"Database")," \u7684\u65b9\u5f0f"),Object(o.b)("p",null,"\u6b64\u65b9\u5f0f\u5728\u4e2d\u5927\u578b\u4f01\u4e1a\u7cfb\u7edf\u4e2d\u6700\u4e3a\u5e38\u7528\uff0c\u4e00\u4e2a\u79df\u6237\uff08\u5ba2\u6237\uff09\u4e00\u4e2a\u72ec\u7acb\u7684\u6570\u636e\u5e93\u3002"),Object(o.b)("h3",{id:"1161-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.6.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{6-7} title="Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"',"{6-7}":!0,title:'"Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class MultiTenantDbContext : AppDbContext\n {\n public MultiTenantDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u591a\u79df\u6237\u64cd\u4f5c\u5efa\u8bae\u5355\u72ec\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u800c\u4e14\u9700\u6307\u5b9a ",Object(o.b)("inlineCode",{parentName:"p"},"MultiTenantDbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002"))),Object(o.b)("h3",{id:"1162-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.6.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,14}","{13,14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDb(DbProvider.Sqlite);\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u9700\u8981 ",Object(o.b)("inlineCode",{parentName:"p"},"Database")," \u591a\u79df\u6237\u65b9\u6848\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u9700\u8981\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"AddDb")," \u6ce8\u518c\uff0c\u800c\u4e0d\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"AddDbPool"),"\u3002\u539f\u56e0\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"AddDbPool")," \u65b9\u5f0f\u6ce8\u518c\u540e\u7eed\u4e0d\u652f\u6301 ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring")," \u91cd\u5199\uff01\uff01\uff01"))),Object(o.b)("h3",{id:"1163-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e"},"11.6.3 \u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u79cd\u5b50\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{8,12-30} title="Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"',"{8,12-30}":!0,title:'"Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.EntityFramework.Core\n{\n public class TenantSeedData : IEntitySeedData\n {\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Tenant\n {\n TenantId = Guid.Parse("383AFB88-F519-FFF8-B364-6D563BF3687F"),\n Name = "\u9ed8\u8ba4\u79df\u6237",\n Host = "localhost:44313",\n CreatedTime = DateTime.Parse("2020-10-06 20:19:07"),\n ConnectionString = "Data Source=./Furion.db" // \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\n },\n new Tenant\n {\n TenantId = Guid.Parse("C5798CB6-16D6-0F42-EB56-59C695353BC0"),\n Name = "\u5176\u4ed6\u79df\u6237",\n Host = "localhost:5000",\n CreatedTime = DateTime.Parse("2020-10-06 20:20:32"),\n ConnectionString = "Data Source=./Fur2.db" // \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\n }\n };\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8be5\u6b65\u9aa4\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u65b9\u5f0f\u6267\u884c\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u65e0\u9700\u914d\u7f6e\u79cd\u5b50\u6570\u636e\u3002"))),Object(o.b)("h3",{id:"1164-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868"},"11.6.4 \u6839\u636e\u6a21\u578b\u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u8868"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration add_tenant_table -Context MultiTenantDbContext\n")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MultiTenantDbContext\n")),Object(o.b)("h3",{id:"1165-\u5b9e\u73b0-imultitenantondatabase-\u63a5\u53e3"},"11.6.5 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IMultiTenantOnDatabase")," \u63a5\u53e3"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"IMultiTenantOnDatabase")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,12-15}","{6,12-15}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n public class FurDbContext : AppDbContext, IMultiTenantOnDatabase\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public string GetDatabaseConnectionString()\n {\n return base.Tenant?.ConnectionString??"\u9ed8\u8ba4\u94fe\u63a5\u5b57\u7b26\u4e32";\n }\n }\n}\n')),Object(o.b)("h3",{id:"1166-\u91cd\u5199-onconfiguring-\u65b9\u6cd5"},"11.6.6 \u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"h3"},"OnConfiguring")," \u65b9\u6cd5"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring")," \u65b9\u6cd5\u5e76\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12-17}","{12-17}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n public class FurDbContext : AppDbContext, IMultiTenantOnDatabase\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n {\n optionsBuilder.UseSqlite(GetDatabaseConnectionString());\n\n base.OnConfiguring(optionsBuilder);\n }\n\n public string GetDatabaseConnectionString()\n {\n return base.Tenant?.ConnectionString??"\u9ed8\u8ba4\u94fe\u63a5\u5b57\u7b26\u4e32";\n }\n }\n}\n')),Object(o.b)("img",{src:Object(r.a)("img/saas2.png")}),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"Database")," \u65b9\u5f0f\u505a ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u7684\u65f6\u5019\uff0c\u9700\u8981\u624b\u52a8\u6307\u5b9a\u8fc1\u79fb\u7a0b\u5e8f\u540d\u79f0\uff0c\u5982\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'optionsBuilder.UseSqlite(GetDatabaseConnectionString(), options=>\n{\n options.MigrationsAssembly("My.Migrations");\n});\n')))),Object(o.b)("h2",{id:"117-\u57fa\u4e8e-schema-\u7684\u65b9\u5f0f"},"11.7 \u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"h2"},"Schema")," \u7684\u65b9\u5f0f"),Object(o.b)("p",null,"\u6b64\u65b9\u5f0f\u5728\u4e2d\u5c0f\u578b\u4f01\u4e1a\u7cfb\u7edf\u4e2d\u4e5f\u4e0d\u5c11\u89c1\uff0c\u4e00\u4e2a\u79df\u6237\uff08\u5ba2\u6237\uff09\u5171\u4eab\u6570\u636e\u5e93\u4e14\u4e0d\u540c ",Object(o.b)("inlineCode",{parentName:"p"},"Schema"),"\u3002"),Object(o.b)("h3",{id:"1171-\u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.7.1 \u521b\u5efa\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{6-7} title="Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"',"{6-7}":!0,title:'"Furion.EntityFramework.Core\\DbContexts\\MultiTenantDbContext.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class MultiTenantDbContext : AppDbContext\n {\n public MultiTenantDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u591a\u79df\u6237\u64cd\u4f5c\u5efa\u8bae\u5355\u72ec\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u800c\u4e14\u9700\u6307\u5b9a ",Object(o.b)("inlineCode",{parentName:"p"},"MultiTenantDbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002"))),Object(o.b)("h3",{id:"1172-\u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"11.7.2 \u6ce8\u518c\u591a\u79df\u6237\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{14}","{14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDbPool(DbProvider.Sqlite);\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("h3",{id:"1173-\u6dfb\u52a0-tenant-\u79cd\u5b50\u6570\u636e"},"11.7.3 \u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u79cd\u5b50\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{8,12-30} title="Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"',"{8,12-30}":!0,title:'"Furion.EntityFramework.Core\\SeedDatas\\TenantSeedData.cs"'}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.EntityFramework.Core\n{\n public class TenantSeedData : IEntitySeedData\n {\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Tenant\n {\n TenantId = Guid.Parse("383AFB88-F519-FFF8-B364-6D563BF3687F"),\n Name = "\u9ed8\u8ba4\u79df\u6237",\n Host = "localhost:44313",\n CreatedTime = DateTime.Parse("2020-10-06 20:19:07"),\n Schema = "dbo" // Schema\n },\n new Tenant\n {\n TenantId = Guid.Parse("C5798CB6-16D6-0F42-EB56-59C695353BC0"),\n Name = "\u5176\u4ed6\u79df\u6237",\n Host = "localhost:5000",\n CreatedTime = DateTime.Parse("2020-10-06 20:20:32"),\n Schema = "furion" // Schema\n }\n };\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8be5\u6b65\u9aa4\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u65b9\u5f0f\u6267\u884c\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u65e0\u9700\u914d\u7f6e\u79cd\u5b50\u6570\u636e\u3002"))),Object(o.b)("h3",{id:"1174-\u6839\u636e\u6a21\u578b\u521b\u5efa-tenant-\u8868"},"11.7.4 \u6839\u636e\u6a21\u578b\u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"Tenant")," \u8868"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration add_tenant_table -Context MultiTenantDbContext\n")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MultiTenantDbContext\n")),Object(o.b)("h3",{id:"1175-\u5b9e\u73b0-imultitenantonschema-\u63a5\u53e3"},"11.7.5 \u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"h3"},"IMultiTenantOnSchema")," \u63a5\u53e3"),Object(o.b)("p",null,"\u5728\u9700\u8981\u591a\u79df\u6237\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"IMultiTenantOnSchema")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,12-15}","{6,12-15}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IMultiTenantOnSchema\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public string GetSchemaName()\n {\n return base.Tenant?.Schema??"dbo";\n }\n }\n}\n')),Object(o.b)("h3",{id:"1176-\u5173\u4e8e-code-first-\u6570\u636e\u8fc1\u79fb"},"11.7.6 \u5173\u4e8e ",Object(o.b)("inlineCode",{parentName:"h3"},"Code First \u6570\u636e\u8fc1\u79fb")),Object(o.b)("p",null,"\u57fa\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"Schema")," \u65b9\u5f0f\u6bd4\u8f83\u7279\u522b\uff0c\u751f\u6210\u6570\u636e\u8fc1\u79fb\u7684\u65f6\u5019\u6ca1\u529e\u6cd5\u83b7\u53d6\u79df\u6237\u4fe1\u606f\uff0c\u6240\u4ee5\u5efa\u8bae",Object(o.b)("strong",{parentName:"p"},"\u5206\u5f00\u591a\u6b21\u8fc1\u79fb"),"\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public string GetSchemaName()\n{\n return base.Tenant?.Schema?? "\u79df\u6237\u4e00Schema";\n}\n')),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public string GetSchemaName()\n{\n return base.Tenant?.Schema?? "\u79df\u6237\u4e8cSchema";\n}\n')),Object(o.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728\u8fc1\u79fb\u7684\u65f6\u5019\u751f\u6210\u591a\u6b21\u8fc1\u79fb\u4e86\u3002"),Object(o.b)("h2",{id:"118-\u81ea\u5b9a\u4e49-tenant-\u7c7b\u578b"},"11.8 \u81ea\u5b9a\u4e49 ",Object(o.b)("inlineCode",{parentName:"h2"},"Tenant")," \u7c7b\u578b"),Object(o.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5185\u7f6e\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"Tenant")," \u7c7b\u578b\uff0c\u65b9\u4fbf\u5927\u5bb6\u5feb\u901f\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"SaaS")," \u591a\u79df\u6237\u529f\u80fd\uff0c\u5982\u679c\u9700\u8981\u81ea\u5b9a\u4e49\u591a\u79df\u6237 ",Object(o.b)("inlineCode",{parentName:"p"},"Tenant")," \u7c7b\u578b\uff0c\u53ea\u9700\u8981\u542f\u7528\u4ee5\u4e0b\u914d\u7f6e\u5373\u53ef\uff1a"),Object(o.b)("h3",{id:"1181-\u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e"},"11.8.1 \u542f\u52a8\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"services.AddDatabaseAccessor(options =>\n{\n options.CustomizeMultiTenants(); // \u542f\u7528\u81ea\u5b9a\u4e49\u591a\u79df\u6237\u7c7b\u578b\uff0c\u6709\u4e00\u4e2a\u9ed8\u8ba4\u53c2\u6570\uff0c\u914d\u7f6e\u591a\u79df\u6237\u8868\u5b57\u6bb5\u540d\n options.AddDbPool(DbProvider.Sqlite);\n});\n")),Object(o.b)("h3",{id:"1182-\u81ea\u5b9a\u4e49\u79df\u6237\u7c7b"},"11.8.2 \u81ea\u5b9a\u4e49\u79df\u6237\u7c7b"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6}","{6}":!0}),"using System;\nusing System.ComponentModel.DataAnnotations.Schema;\n\nnamespace Furion.Core\n{\n public class MyTenant : IEntity\n {\n [Key]\n public Guid TenantId { get; set; }\n\n public string Name { get; set; }\n\n public string Host { get; set; }\n }\n}\n")),Object(o.b)("p",null,"\u5982\u679c\u9700\u8981\u67e5\u8be2\u8be5\u79df\u6237\u4fe1\u606f\uff0c\u53ef\u901a\u8fc7\u4ee5\u4e0b\u4ee3\u7801\u83b7\u53d6\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var tenantDbContext = Db.GetDbContext();\nvar myTenant = tenantDbContext.Set();\n")),Object(o.b)("h2",{id:"119-\u53cd\u9988\u4e0e\u5efa\u8bae"},"11.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/handbook/build/2.4b3c6036.js b/docs/2.64f790d4.js similarity index 94% rename from handbook/build/2.4b3c6036.js rename to docs/2.64f790d4.js index 367b17492df..77096f0eb7f 100644 --- a/handbook/build/2.4b3c6036.js +++ b/docs/2.64f790d4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{192:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return d}));var n=a(0),r=a.n(n);function l(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function c(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=r.a.createContext({}),m=function(e){var t=r.a.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):c(c({},t),e)),a},p=function(e){var t=m(e.components);return r.a.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},y=r.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,o=e.parentName,i=s(e,["components","mdxType","originalType","parentName"]),p=m(a),y=n,d=p["".concat(o,".").concat(y)]||p[y]||u[y]||l;return a?r.a.createElement(d,c(c({ref:t},i),{},{components:a})):r.a.createElement(d,c({ref:t},i))}));function d(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,o=new Array(l);o[0]=y;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var i=2;ir.a.createElement("li",{key:e.permalink,className:s.a.sidebarItem},r.a.createElement(o.a,{isNavLink:!0,to:e.permalink,className:s.a.sidebarItemLink,activeClassName:s.a.sidebarItemLinkActive},e.title)))))}},211:function(e,t,a){"use strict";const n=(e,{target:t=document.body}={})=>{const a=document.createElement("textarea"),n=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection();let l=!1;r.rangeCount>0&&(l=r.getRangeAt(0)),t.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch(c){}return a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),n&&n.focus(),o};e.exports=n,e.exports.default=n},212:function(e,t){function a(e){let t,a=[];for(let n of e.split(",").map(e=>e.trim()))if(/^-?\d+$/.test(n))a.push(parseInt(n,10));else if(t=n.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,n,r,l]=t;if(n&&l){n=parseInt(n),l=parseInt(l);const e=n0&&e[a-1]===t?e:e.concat(t)},g=function(e,t){var a=e.plain,n=Object.create(null),r=e.styles.reduce((function(e,a){var n=a.languages,r=a.style;return n&&!n.includes(t)||a.types.forEach((function(t){var a=p({},e[t],r);e[t]=a})),e}),n);return r.root=a,r.plain=p({},a,{backgroundColor:null}),r};function h(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(a[n]=e[n]);return a}var f=function(e){function t(){for(var t=this,a=[],n=arguments.length;n--;)a[n]=arguments[n];e.apply(this,a),m(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var a=e.theme?g(e.theme,e.language):void 0;return t.themeDict=a})),m(this,"getLineProps",(function(e){var a=e.key,n=e.className,r=e.style,l=p({},h(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),o=t.getThemeDict(t.props);return void 0!==o&&(l.style=o.plain),void 0!==r&&(l.style=void 0!==l.style?p({},l.style,r):r),void 0!==a&&(l.key=a),n&&(l.className+=" "+n),l})),m(this,"getStyleForToken",(function(e){var a=e.types,n=e.empty,r=a.length,l=t.getThemeDict(t.props);if(void 0!==l){if(1===r&&"plain"===a[0])return n?{display:"inline-block"}:void 0;if(1===r&&!n)return l[a[0]];var o=n?{display:"inline-block"}:{},c=a.map((function(e){return l[e]}));return Object.assign.apply(Object,[o].concat(c))}})),m(this,"getTokenProps",(function(e){var a=e.key,n=e.className,r=e.style,l=e.token,o=p({},h(e,["key","className","style","token"]),{className:"token "+l.types.join(" "),children:l.content,style:t.getStyleForToken(l),key:void 0});return void 0!==r&&(o.style=void 0!==o.style?p({},o.style,r):r),void 0!==a&&(o.key=a),n&&(o.className+=" "+n),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,a=e.language,n=e.code,r=e.children,l=this.getThemeDict(this.props),o=t.languages[a];return r({tokens:function(e){for(var t=[[]],a=[e],n=[0],r=[e.length],l=0,o=0,c=[],s=[c];o>-1;){for(;(l=n[o]++)0?m:["plain"],i=p):(m=d(m,p.type),p.alias&&(m=d(m,p.alias)),i=p.content),"string"==typeof i){var g=i.split(u),h=g.length;c.push({types:m,content:g[0]});for(var f=1;f{const{prism:e}=Object(N.useThemeConfig)(),{isDarkTheme:t}=Object(O.a)(),a=e.theme||j,n=e.darkTheme||a;return t?n:a},x=a(57),T=a.n(x);const P=/{([\d,-]+)}/,C=(e=["js","jsBlock","jsx","python","html"])=>{const t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},a=["highlight-next-line","highlight-start","highlight-end"].join("|"),n=e.map(e=>`(?:${t[e].start}\\s*(${a})\\s*${t[e].end})`).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)},_=/(?:title=")(.*)(?:")/;var D=({children:e,className:t,metastring:a})=>{const{prism:o}=Object(N.useThemeConfig)(),[s,m]=Object(r.useState)(!1),[p,u]=Object(r.useState)(!1);Object(r.useEffect)(()=>{u(!0)},[]);const y=Object(r.useRef)(null);let d=[],g="";const h=w(),b=Array.isArray(e)?e.join(""):e;if(a&&P.test(a)){const e=a.match(P)[1];d=E()(e).filter(e=>e>0)}a&&_.test(a)&&(g=a.match(_)[1]);let k=t&&t.replace(/language-/,"");!k&&o.defaultLanguage&&(k=o.defaultLanguage);let j=b.replace(/\n$/,"");if(0===d.length&&void 0!==k){let e="";const t=(e=>{switch(e){case"js":case"javascript":case"ts":case"typescript":return C(["js","jsBlock"]);case"jsx":case"tsx":return C(["js","jsBlock","jsx"]);case"html":return C(["js","jsBlock","html"]);case"python":case"py":return C(["python"]);default:return C()}})(k),a=b.replace(/\n$/,"").split("\n");let n;for(let r=0;re||t,void 0)){case"highlight-next-line":e+=l+",";break;case"highlight-start":n=l;break;case"highlight-end":e+=`${n}-${l-1},`}a.splice(r,1)}else r+=1}d=E()(e),j=a.join("\n")}const O=()=>{v()(j),m(!0),setTimeout(()=>m(!1),2e3)};return l.a.createElement(f,Object(n.a)({},i,{key:String(p),theme:h,code:j,language:k}),({className:e,style:t,tokens:a,getLineProps:r,getTokenProps:o})=>l.a.createElement(l.a.Fragment,null,g&&l.a.createElement("div",{style:t,className:T.a.codeBlockTitle},g),l.a.createElement("div",{className:T.a.codeBlockContent},l.a.createElement("div",{tabIndex:0,className:Object(c.a)(e,T.a.codeBlock,"thin-scrollbar",{[T.a.codeBlockWithTitle]:g})},l.a.createElement("div",{className:T.a.codeBlockLines,style:t},a.map((e,t)=>{1===e.length&&""===e[0].content&&(e[0].content="\n");const a=r({line:e,key:t});return d.includes(t+1)&&(a.className=a.className+" docusaurus-highlight-code-line"),l.a.createElement("div",Object(n.a)({key:t},a),e.map((e,t)=>l.a.createElement("span",Object(n.a)({key:t},o({token:e,key:t})))))}))),l.a.createElement("button",{ref:y,type:"button","aria-label":"Copy code to clipboard",className:Object(c.a)(T.a.copyButton),onClick:O},s?"Copied":"Copy"))))},S=(a(58),a(59)),L=a.n(S);var I=e=>function({id:t,...a}){const{navbar:{hideOnScroll:n}}=Object(N.useThemeConfig)();return t?l.a.createElement(e,a,l.a.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:Object(c.a)("anchor",{[L.a.enhancedAnchor]:!n}),id:t}),a.children,l.a.createElement("a",{className:"hash-link",href:"#"+t,title:"Direct link to heading"},"#")):l.a.createElement(e,a)},B=a(60),$=a.n(B);const A={code:e=>{const{children:t}=e;return"string"==typeof t?t.includes("\n")?l.a.createElement(D,e):l.a.createElement("code",e):t},a:e=>l.a.createElement(o.a,e),pre:e=>l.a.createElement("div",Object(n.a)({className:$.a.mdxCodeBlock},e)),h1:I("h1"),h2:I("h2"),h3:I("h3"),h4:I("h4"),h5:I("h5"),h6:I("h6")};t.a=A},230:function(e,t,a){"use strict";var n=a(0),r=a.n(n),l=a(194),o=a(192),c=a(23),s=a(198),i=a(213),m=a(190),p=a(123),u=a.n(p);const y=["January","February","March","April","May","June","July","August","September","October","November","December"];t.a=function(e){const{children:t,frontMatter:a,metadata:n,truncated:p,isBlogPostPage:d=!1}=e,{date:g,permalink:h,tags:f,readingTime:b}=n,{author:v,title:k,image:E,keywords:j}=a,O=a.author_url||a.authorURL,N=a.author_title||a.authorTitle,w=a.author_image_url||a.authorImageURL,x=Object(m.a)(E,{absolute:!0});return r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,null,j&&j.length&&r.a.createElement("meta",{name:"keywords",content:j.join(",")}),E&&r.a.createElement("meta",{property:"og:image",content:x}),E&&r.a.createElement("meta",{name:"twitter:image",content:x}),E&&r.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+k})),r.a.createElement("article",{className:d?void 0:"margin-bottom--xl"},(()=>{const e=d?"h1":"h2",t=g.substring(0,10).split("-"),a=t[0],n=y[parseInt(t[1],10)-1],o=parseInt(t[2],10);return r.a.createElement("header",null,r.a.createElement(e,{className:Object(l.a)("margin-bottom--sm",u.a.blogPostTitle)},d?k:r.a.createElement(s.a,{to:h},k)),r.a.createElement("div",{className:"margin-vert--md"},r.a.createElement("time",{dateTime:g,className:u.a.blogPostDate},n," ",o,", ",a," ",b&&r.a.createElement(r.a.Fragment,null," \xb7 ",Math.ceil(b)," min read"))),r.a.createElement("div",{className:"avatar margin-vert--md"},w&&r.a.createElement("a",{className:"avatar__photo-link avatar__photo",href:O,target:"_blank",rel:"noreferrer noopener"},r.a.createElement("img",{src:w,alt:v})),r.a.createElement("div",{className:"avatar__intro"},v&&r.a.createElement(r.a.Fragment,null,r.a.createElement("h4",{className:"avatar__name"},r.a.createElement("a",{href:O,target:"_blank",rel:"noreferrer noopener"},v)),r.a.createElement("small",{className:"avatar__subtitle"},N)))))})(),r.a.createElement("section",{className:"markdown"},r.a.createElement(o.a,{components:i.a},t)),(f.length>0||p)&&r.a.createElement("footer",{className:"row margin-vert--lg"},f.length>0&&r.a.createElement("div",{className:"col"},r.a.createElement("strong",null,"Tags:"),f.map(({label:e,permalink:t})=>r.a.createElement(s.a,{key:t,className:"margin-horiz--sm",to:t},e))),p&&r.a.createElement("div",{className:"col text--right"},r.a.createElement(s.a,{to:n.permalink,"aria-label":"Read more about "+k},r.a.createElement("strong",null,"Read More"))))))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{196:function(e,t,a){"use strict";a.d(t,"a",(function(){return p})),a.d(t,"b",(function(){return d}));var n=a(0),r=a.n(n);function l(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function c(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var i=r.a.createContext({}),m=function(e){var t=r.a.useContext(i),a=t;return e&&(a="function"==typeof e?e(t):c(c({},t),e)),a},p=function(e){var t=m(e.components);return r.a.createElement(i.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},y=r.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,l=e.originalType,o=e.parentName,i=s(e,["components","mdxType","originalType","parentName"]),p=m(a),y=n,d=p["".concat(o,".").concat(y)]||p[y]||u[y]||l;return a?r.a.createElement(d,c(c({ref:t},i),{},{components:a})):r.a.createElement(d,c({ref:t},i))}));function d(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var l=a.length,o=new Array(l);o[0]=y;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:n,o[1]=c;for(var i=2;ir.a.createElement("li",{key:e.permalink,className:s.a.sidebarItem},r.a.createElement(o.a,{isNavLink:!0,to:e.permalink,className:s.a.sidebarItemLink,activeClassName:s.a.sidebarItemLinkActive},e.title)))))}},215:function(e,t,a){"use strict";const n=(e,{target:t=document.body}={})=>{const a=document.createElement("textarea"),n=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection();let l=!1;r.rangeCount>0&&(l=r.getRangeAt(0)),t.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let o=!1;try{o=document.execCommand("copy")}catch(c){}return a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),n&&n.focus(),o};e.exports=n,e.exports.default=n},216:function(e,t){function a(e){let t,a=[];for(let n of e.split(",").map(e=>e.trim()))if(/^-?\d+$/.test(n))a.push(parseInt(n,10));else if(t=n.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,n,r,l]=t;if(n&&l){n=parseInt(n),l=parseInt(l);const e=n0&&e[a-1]===t?e:e.concat(t)},g=function(e,t){var a=e.plain,n=Object.create(null),r=e.styles.reduce((function(e,a){var n=a.languages,r=a.style;return n&&!n.includes(t)||a.types.forEach((function(t){var a=p({},e[t],r);e[t]=a})),e}),n);return r.root=a,r.plain=p({},a,{backgroundColor:null}),r};function h(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(a[n]=e[n]);return a}var f=function(e){function t(){for(var t=this,a=[],n=arguments.length;n--;)a[n]=arguments[n];e.apply(this,a),m(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var a=e.theme?g(e.theme,e.language):void 0;return t.themeDict=a})),m(this,"getLineProps",(function(e){var a=e.key,n=e.className,r=e.style,l=p({},h(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),o=t.getThemeDict(t.props);return void 0!==o&&(l.style=o.plain),void 0!==r&&(l.style=void 0!==l.style?p({},l.style,r):r),void 0!==a&&(l.key=a),n&&(l.className+=" "+n),l})),m(this,"getStyleForToken",(function(e){var a=e.types,n=e.empty,r=a.length,l=t.getThemeDict(t.props);if(void 0!==l){if(1===r&&"plain"===a[0])return n?{display:"inline-block"}:void 0;if(1===r&&!n)return l[a[0]];var o=n?{display:"inline-block"}:{},c=a.map((function(e){return l[e]}));return Object.assign.apply(Object,[o].concat(c))}})),m(this,"getTokenProps",(function(e){var a=e.key,n=e.className,r=e.style,l=e.token,o=p({},h(e,["key","className","style","token"]),{className:"token "+l.types.join(" "),children:l.content,style:t.getStyleForToken(l),key:void 0});return void 0!==r&&(o.style=void 0!==o.style?p({},o.style,r):r),void 0!==a&&(o.key=a),n&&(o.className+=" "+n),o}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,a=e.language,n=e.code,r=e.children,l=this.getThemeDict(this.props),o=t.languages[a];return r({tokens:function(e){for(var t=[[]],a=[e],n=[0],r=[e.length],l=0,o=0,c=[],s=[c];o>-1;){for(;(l=n[o]++)0?m:["plain"],i=p):(m=d(m,p.type),p.alias&&(m=d(m,p.alias)),i=p.content),"string"==typeof i){var g=i.split(u),h=g.length;c.push({types:m,content:g[0]});for(var f=1;f{const{prism:e}=Object(N.useThemeConfig)(),{isDarkTheme:t}=Object(O.a)(),a=e.theme||j,n=e.darkTheme||a;return t?n:a},x=a(57),T=a.n(x);const P=/{([\d,-]+)}/,C=(e=["js","jsBlock","jsx","python","html"])=>{const t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},a=["highlight-next-line","highlight-start","highlight-end"].join("|"),n=e.map(e=>`(?:${t[e].start}\\s*(${a})\\s*${t[e].end})`).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)},_=/(?:title=")(.*)(?:")/;var D=({children:e,className:t,metastring:a})=>{const{prism:o}=Object(N.useThemeConfig)(),[s,m]=Object(r.useState)(!1),[p,u]=Object(r.useState)(!1);Object(r.useEffect)(()=>{u(!0)},[]);const y=Object(r.useRef)(null);let d=[],g="";const h=w(),b=Array.isArray(e)?e.join(""):e;if(a&&P.test(a)){const e=a.match(P)[1];d=E()(e).filter(e=>e>0)}a&&_.test(a)&&(g=a.match(_)[1]);let k=t&&t.replace(/language-/,"");!k&&o.defaultLanguage&&(k=o.defaultLanguage);let j=b.replace(/\n$/,"");if(0===d.length&&void 0!==k){let e="";const t=(e=>{switch(e){case"js":case"javascript":case"ts":case"typescript":return C(["js","jsBlock"]);case"jsx":case"tsx":return C(["js","jsBlock","jsx"]);case"html":return C(["js","jsBlock","html"]);case"python":case"py":return C(["python"]);default:return C()}})(k),a=b.replace(/\n$/,"").split("\n");let n;for(let r=0;re||t,void 0)){case"highlight-next-line":e+=l+",";break;case"highlight-start":n=l;break;case"highlight-end":e+=`${n}-${l-1},`}a.splice(r,1)}else r+=1}d=E()(e),j=a.join("\n")}const O=()=>{v()(j),m(!0),setTimeout(()=>m(!1),2e3)};return l.a.createElement(f,Object(n.a)({},i,{key:String(p),theme:h,code:j,language:k}),({className:e,style:t,tokens:a,getLineProps:r,getTokenProps:o})=>l.a.createElement(l.a.Fragment,null,g&&l.a.createElement("div",{style:t,className:T.a.codeBlockTitle},g),l.a.createElement("div",{className:T.a.codeBlockContent},l.a.createElement("div",{tabIndex:0,className:Object(c.a)(e,T.a.codeBlock,"thin-scrollbar",{[T.a.codeBlockWithTitle]:g})},l.a.createElement("div",{className:T.a.codeBlockLines,style:t},a.map((e,t)=>{1===e.length&&""===e[0].content&&(e[0].content="\n");const a=r({line:e,key:t});return d.includes(t+1)&&(a.className=a.className+" docusaurus-highlight-code-line"),l.a.createElement("div",Object(n.a)({key:t},a),e.map((e,t)=>l.a.createElement("span",Object(n.a)({key:t},o({token:e,key:t})))))}))),l.a.createElement("button",{ref:y,type:"button","aria-label":"Copy code to clipboard",className:Object(c.a)(T.a.copyButton),onClick:O},s?"Copied":"Copy"))))},S=(a(58),a(59)),L=a.n(S);var I=e=>function({id:t,...a}){const{navbar:{hideOnScroll:n}}=Object(N.useThemeConfig)();return t?l.a.createElement(e,a,l.a.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:Object(c.a)("anchor",{[L.a.enhancedAnchor]:!n}),id:t}),a.children,l.a.createElement("a",{className:"hash-link",href:"#"+t,title:"Direct link to heading"},"#")):l.a.createElement(e,a)},B=a(60),$=a.n(B);const A={code:e=>{const{children:t}=e;return"string"==typeof t?t.includes("\n")?l.a.createElement(D,e):l.a.createElement("code",e):t},a:e=>l.a.createElement(o.a,e),pre:e=>l.a.createElement("div",Object(n.a)({className:$.a.mdxCodeBlock},e)),h1:I("h1"),h2:I("h2"),h3:I("h3"),h4:I("h4"),h5:I("h5"),h6:I("h6")};t.a=A},234:function(e,t,a){"use strict";var n=a(0),r=a.n(n),l=a(198),o=a(196),c=a(23),s=a(202),i=a(217),m=a(194),p=a(124),u=a.n(p);const y=["January","February","March","April","May","June","July","August","September","October","November","December"];t.a=function(e){const{children:t,frontMatter:a,metadata:n,truncated:p,isBlogPostPage:d=!1}=e,{date:g,permalink:h,tags:f,readingTime:b}=n,{author:v,title:k,image:E,keywords:j}=a,O=a.author_url||a.authorURL,N=a.author_title||a.authorTitle,w=a.author_image_url||a.authorImageURL,x=Object(m.a)(E,{absolute:!0});return r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,null,j&&j.length&&r.a.createElement("meta",{name:"keywords",content:j.join(",")}),E&&r.a.createElement("meta",{property:"og:image",content:x}),E&&r.a.createElement("meta",{name:"twitter:image",content:x}),E&&r.a.createElement("meta",{name:"twitter:image:alt",content:"Image for "+k})),r.a.createElement("article",{className:d?void 0:"margin-bottom--xl"},(()=>{const e=d?"h1":"h2",t=g.substring(0,10).split("-"),a=t[0],n=y[parseInt(t[1],10)-1],o=parseInt(t[2],10);return r.a.createElement("header",null,r.a.createElement(e,{className:Object(l.a)("margin-bottom--sm",u.a.blogPostTitle)},d?k:r.a.createElement(s.a,{to:h},k)),r.a.createElement("div",{className:"margin-vert--md"},r.a.createElement("time",{dateTime:g,className:u.a.blogPostDate},n," ",o,", ",a," ",b&&r.a.createElement(r.a.Fragment,null," \xb7 ",Math.ceil(b)," min read"))),r.a.createElement("div",{className:"avatar margin-vert--md"},w&&r.a.createElement("a",{className:"avatar__photo-link avatar__photo",href:O,target:"_blank",rel:"noreferrer noopener"},r.a.createElement("img",{src:w,alt:v})),r.a.createElement("div",{className:"avatar__intro"},v&&r.a.createElement(r.a.Fragment,null,r.a.createElement("h4",{className:"avatar__name"},r.a.createElement("a",{href:O,target:"_blank",rel:"noreferrer noopener"},v)),r.a.createElement("small",{className:"avatar__subtitle"},N)))))})(),r.a.createElement("section",{className:"markdown"},r.a.createElement(o.a,{components:i.a},t)),(f.length>0||p)&&r.a.createElement("footer",{className:"row margin-vert--lg"},f.length>0&&r.a.createElement("div",{className:"col"},r.a.createElement("strong",null,"Tags:"),f.map(({label:e,permalink:t})=>r.a.createElement(s.a,{key:t,className:"margin-horiz--sm",to:t},e))),p&&r.a.createElement("div",{className:"col text--right"},r.a.createElement(s.a,{to:n.permalink,"aria-label":"Read more about "+k},r.a.createElement("strong",null,"Read More"))))))}}}]); \ No newline at end of file diff --git a/docs/20b95fcb.03499017.js b/docs/20b95fcb.03499017.js deleted file mode 100644 index 96615907040..00000000000 --- a/docs/20b95fcb.03499017.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(n),b=r,d=p["".concat(c,".").concat(b)]||p[b]||f[b]||a;return n?o.a.createElement(d,i(i({ref:t},s),{},{components:n})):o.a.createElement(d,i({ref:t},s))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=b;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},88:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),a=(n(0),n(192)),c=n(193),i={id:"benchmark",title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",sidebar_label:"29.3 \u57fa\u51c6\u6d4b\u8bd5"},u={unversionedId:"benchmark",id:"benchmark",isDocsHomePage:!1,title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\benchmark.mdx",slug:"/benchmark",permalink:"/docs/benchmark",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/benchmark.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"29.3 \u57fa\u51c6\u6d4b\u8bd5",sidebar:"docs",previous:{title:"29.2 \u6027\u80fd\u6d4b\u8bd5",permalink:"/docs/performance"},next:{title:"30. \u8d21\u732e\u6307\u5357",permalink:"/docs/contribute"}},s=[],l={toc:s};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/20b95fcb.15db29a1.js b/docs/20b95fcb.15db29a1.js new file mode 100644 index 00000000000..2addc04c0d1 --- /dev/null +++ b/docs/20b95fcb.15db29a1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{194:function(t,e,a){"use strict";a.d(e,"b",(function(){return b})),a.d(e,"a",(function(){return c}));var n=a(21),r=a(195);function b(){const{siteConfig:{baseUrl:t="/",url:e}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(t,e,a,{forcePrependBaseUrl:n=!1,absolute:b=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(r.b)(a))return a;if(n)return e+a;const c=a.startsWith(e)?a:e+a.replace(/^\//,"");return b?t+c:c}(e,t,a,n)}}function c(t,e={}){const{withBaseUrl:a}=b();return a(t,e)}},195:function(t,e,a){"use strict";function n(t){return!0===/^(\w*:|\/\/)/.test(t)}function r(t){return void 0!==t&&!n(t)}a.d(e,"b",(function(){return n})),a.d(e,"a",(function(){return r}))},196:function(t,e,a){"use strict";a.d(e,"a",(function(){return p})),a.d(e,"b",(function(){return g}));var n=a(0),r=a.n(n);function b(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function i(t){for(var e=1;e=0||(r[a]=t[a]);return r}(t,e);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(r[a]=t[a])}return r}var O=r.a.createContext({}),j=function(t){var e=r.a.useContext(O),a=e;return t&&(a="function"==typeof t?t(e):i(i({},e),t)),a},p=function(t){var e=j(t.components);return r.a.createElement(O.Provider,{value:e},t.children)},d={inlineCode:"code",wrapper:function(t){var e=t.children;return r.a.createElement(r.a.Fragment,{},e)}},m=r.a.forwardRef((function(t,e){var a=t.components,n=t.mdxType,b=t.originalType,c=t.parentName,O=l(t,["components","mdxType","originalType","parentName"]),p=j(a),m=n,g=p["".concat(c,".").concat(m)]||p[m]||d[m]||b;return a?r.a.createElement(g,i(i({ref:e},O),{},{components:a})):r.a.createElement(g,i({ref:e},O))}));function g(t,e){var a=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var b=a.length,c=new Array(b);c[0]=m;var i={};for(var l in e)hasOwnProperty.call(e,l)&&(i[l]=e[l]);i.originalType=t,i.mdxType="string"==typeof t?t:n,c[1]=i;for(var O=2;Oe(!t)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},88:function(t,e,a){"use strict";a.r(e),a.d(e,"frontMatter",(function(){return l})),a.d(e,"metadata",(function(){return O})),a.d(e,"toc",(function(){return j})),a.d(e,"default",(function(){return d}));var n=a(3),r=a(7),b=(a(0),a(196)),c=a(194),i=a(197),l={id:"benchmark",title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",sidebar_label:"29.3 \u57fa\u51c6\u6d4b\u8bd5"},O={unversionedId:"benchmark",id:"benchmark",isDocsHomePage:!1,title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",description:"29.3.1 \u57fa\u51c6\u6d4b\u8bd5",source:"@site/docs\\benchmark.mdx",slug:"/benchmark",permalink:"/docs/benchmark",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/benchmark.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"29.3 \u57fa\u51c6\u6d4b\u8bd5",sidebar:"docs",previous:{title:"29.2 \u6027\u80fd\u6d4b\u8bd5",permalink:"/docs/performance"},next:{title:"30. \u8d21\u732e\u6307\u5357",permalink:"/docs/contribute"}},j=[{value:"29.3.1 \u57fa\u51c6\u6d4b\u8bd5",id:"2931-\u57fa\u51c6\u6d4b\u8bd5",children:[]},{value:"29.3.2 \u57fa\u51c6\u6d4b\u8bd5\u7279\u8d28\u53ca\u610f\u4e49",id:"2932-\u57fa\u51c6\u6d4b\u8bd5\u7279\u8d28\u53ca\u610f\u4e49",children:[{value:"29.3.2.1 \u7279\u8d28",id:"29321-\u7279\u8d28",children:[]},{value:"29.3.2.2 \u610f\u4e49",id:"29322-\u610f\u4e49",children:[]}]},{value:"29.3.3 BenchmarkDotNet",id:"2933-benchmarkdotnet",children:[{value:"29.3.3.1 \u5982\u4f55\u4f7f\u7528",id:"29331-\u5982\u4f55\u4f7f\u7528",children:[]},{value:"29.3.3.2 \u67e5\u770b\u7ed3\u679c",id:"29332-\u67e5\u770b\u7ed3\u679c",children:[]},{value:"29.3.3.3 \u5bfc\u51fa\u62a5\u8868",id:"29333-\u5bfc\u51fa\u62a5\u8868",children:[]}]},{value:"29.3.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2934-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:j};function d(t){var e=t.components,a=Object(r.a)(t,["components"]);return Object(b.b)("wrapper",Object(n.a)({},p,a,{components:e,mdxType:"MDXLayout"}),Object(b.b)(i.a,{mdxType:"JoinGroup"}),Object(b.b)("h2",{id:"2931-\u57fa\u51c6\u6d4b\u8bd5"},"29.3.1 \u57fa\u51c6\u6d4b\u8bd5"),Object(b.b)("p",null,"\u57fa\u51c6\u6d4b\u8bd5\uff08benchmarking\uff09\u662f\u4e00\u79cd\u6d4b\u91cf\u548c\u8bc4\u4f30\u8f6f\u4ef6\u6027\u80fd\u6307\u6807\u7684\u6d3b\u52a8\u3002\u4f60\u53ef\u4ee5\u5728\u67d0\u4e2a\u65f6\u5019\u901a\u8fc7\u57fa\u51c6\u6d4b\u8bd5\u5efa\u7acb\u4e00\u4e2a\u5df2\u77e5\u7684\u6027\u80fd\u6c34\u5e73\uff08\u79f0\u4e3a\u57fa\u51c6\u7ebf\uff09\uff0c\u5f53\u7cfb\u7edf\u7684\u8f6f\u786c\u4ef6\u73af\u5883\u53d1\u751f\u53d8\u5316\u4e4b\u540e\u518d\u8fdb\u884c\u4e00\u6b21\u57fa\u51c6\u6d4b\u8bd5\u4ee5\u786e\u5b9a\u90a3\u4e9b\u53d8\u5316\u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u3002\u8fd9\u662f\u57fa\u51c6\u6d4b\u8bd5\u6700\u5e38\u89c1\u7684\u7528\u9014\u3002\u5176\u4ed6\u7528\u9014\u5305\u62ec\u6d4b\u5b9a\u67d0\u79cd\u8d1f\u8f7d\u6c34\u5e73\u4e0b\u7684\u6027\u80fd\u6781\u9650\u3001\u7ba1\u7406\u7cfb\u7edf\u6216\u73af\u5883\u7684\u53d8\u5316\u3001\u53d1\u73b0\u53ef\u80fd\u5bfc\u81f4\u6027\u80fd\u95ee\u9898\u7684\u6761\u4ef6\uff0c\u7b49\u7b49\u3002"),Object(b.b)("h2",{id:"2932-\u57fa\u51c6\u6d4b\u8bd5\u7279\u8d28\u53ca\u610f\u4e49"},"29.3.2 \u57fa\u51c6\u6d4b\u8bd5\u7279\u8d28\u53ca\u610f\u4e49"),Object(b.b)("h3",{id:"29321-\u7279\u8d28"},"29.3.2.1 \u7279\u8d28"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u53ef\u91cd\u590d\u6027"),"\uff1a\u53ef\u8fdb\u884c\u91cd\u590d\u6027\u7684\u6d4b\u8bd5\uff0c\u8fd9\u6837\u505a\u6709\u5229\u4e8e\u6bd4\u8f83\u6bcf\u6b21\u7684\u6d4b\u8bd5\u7ed3\u679c\uff0c\u5f97\u5230\u6027\u80fd\u7ed3\u679c\u7684\u957f\u671f\u53d8\u5316\u8d8b\u52bf\uff0c\u4e3a\u7cfb\u7edf\u8c03\u4f18\u548c\u4e0a\u7ebf\u524d\u7684\u5bb9\u91cf\u89c4\u5212\u505a\u53c2\u8003\u3002"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u53ef\u89c2\u6d4b\u6027"),"\uff1a\u901a\u8fc7\u5168\u65b9\u4f4d\u7684\u76d1\u63a7\uff08\u5305\u62ec\u6d4b\u8bd5\u5f00\u59cb\u5230\u7ed3\u675f\uff0c\u6267\u884c\u673a\u3001\u670d\u52a1\u5668\u3001\u6570\u636e\u5e93\uff09\uff0c\u53ca\u65f6\u4e86\u89e3\u548c\u5206\u6790\u6d4b\u8bd5\u8fc7\u7a0b\u53d1\u751f\u4e86\u4ec0\u4e48\u3002"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u53ef\u5c55\u793a\u6027"),"\uff1a\u76f8\u5173\u4eba\u5458\u53ef\u4ee5\u76f4\u89c2\u660e\u4e86\u7684\u4e86\u89e3\u6d4b\u8bd5\u7ed3\u679c\uff08web \u754c\u9762\u3001\u4eea\u8868\u76d8\u3001\u6298\u7ebf\u56fe\u6811\u72b6\u56fe\u7b49\u5f62\u5f0f\uff09\u3002"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u771f\u5b9e\u6027"),"\uff1a\u6d4b\u8bd5\u7684\u7ed3\u679c\u53cd\u6620\u4e86\u5ba2\u6237\u4f53\u9a8c\u5230\u7684\u771f\u5b9e\u7684\u60c5\u51b5\uff08\u771f\u5b9e\u51c6\u786e\u7684\u4e1a\u52a1\u573a\u666f+\u4e0e\u751f\u4ea7\u4e00\u81f4\u7684\u914d\u7f6e+\u5408\u7406\u6b63\u786e\u7684\u6d4b\u8bd5\u65b9\u6cd5\uff09\u3002"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("strong",{parentName:"li"},"\u53ef\u6267\u884c\u6027"),"\uff1a\u76f8\u5173\u4eba\u5458\u53ef\u4ee5\u5feb\u901f\u7684\u8fdb\u884c\u6d4b\u8bd5\u9a8c\u8bc1\u4fee\u6539\u8c03\u4f18\uff08\u53ef\u5b9a\u4f4d\u53ef\u5206\u6790\uff09\u3002")),Object(b.b)("h3",{id:"29322-\u610f\u4e49"},"29.3.2.2 \u610f\u4e49"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"\u4e3a\u5bb9\u91cf\u89c4\u5212\u786e\u5b9a\u7cfb\u7edf\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u6781\u9650\uff1b"),Object(b.b)("li",{parentName:"ul"},"\u4e3a\u914d\u7f6e\u6d4b\u8bd5\u7684\u53c2\u6570\u548c\u914d\u7f6e\u9009\u9879\u63d0\u4f9b\u53c2\u8003\u4f9d\u636e\uff1b"),Object(b.b)("li",{parentName:"ul"},"\u4e3a\u9a8c\u6536\u6d4b\u8bd5\u786e\u5b9a\u7cfb\u7edf\u662f\u5426\u5177\u5907\u81ea\u5df1\u6240\u5ba3\u79f0\u7684\u80fd\u529b\uff1b"),Object(b.b)("li",{parentName:"ul"},"\u4e3a\u6027\u80fd\u57fa\u7ebf\u7684\u5efa\u7acb\u63d0\u4f9b\u957f\u671f\u7684\u6570\u636e\u7edf\u8ba1\u6765\u6e90\u4ee5\u53ca\u6bd4\u8f83\u57fa\u51c6\uff1b")),Object(b.b)("h2",{id:"2933-benchmarkdotnet"},"29.3.3 ",Object(b.b)("inlineCode",{parentName:"h2"},"BenchmarkDotNet")),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"BenchmarkDotNet")," \u662f ",Object(b.b)("inlineCode",{parentName:"p"},".NET")," \u5e73\u53f0\u63d0\u4f9b\u7684\u57fa\u51c6\u6d4b\u8bd5\u5de5\u5177\uff0c",Object(b.b)("inlineCode",{parentName:"p"},"BenchmarkDotNet")," \u53ef\u5e2e\u52a9\u60a8\u5c06\u65b9\u6cd5\u8f6c\u6362\u4e3a\u57fa\u51c6\uff0c\u8ddf\u8e2a\u5176\u6027\u80fd\uff0c\u5e76\u5171\u4eab\u53ef\u91cd\u590d\u7684\u6d4b\u91cf\u5b9e\u9a8c\u3002",Object(b.b)("inlineCode",{parentName:"p"},"BenchmarkDotNet")," \u53ef\u4fdd\u62a4\u60a8\u514d\u53d7\u6d41\u884c\u7684\u57fa\u51c6\u6d4b\u8bd5\u9519\u8bef\uff0c\u5e76\u5728\u57fa\u51c6\u8bbe\u8ba1\u6216\u83b7\u5f97\u7684\u6d4b\u91cf\u4e2d\u51fa\u73b0\u95ee\u9898\u65f6\u8b66\u544a\u60a8\u3002\u7ed3\u679c\u4ee5\u7528\u6237\u53cb\u597d\u7684\u5f62\u5f0f\u5448\u73b0\uff0c\u7a81\u51fa\u663e\u793a\u4e86\u6709\u5173\u5b9e\u9a8c\u7684\u6240\u6709\u91cd\u8981\u4e8b\u5b9e\u3002"),Object(b.b)("h3",{id:"29331-\u5982\u4f55\u4f7f\u7528"},"29.3.3.1 \u5982\u4f55\u4f7f\u7528"),Object(b.b)("p",null,"\u521b\u5efa\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u53f0")," \u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"Nuget")," \u6309\u7167 ",Object(b.b)("a",Object(n.a)({parentName:"p"},{href:"https://www.nuget.org/packages/BenchmarkDotNet/"}),"BenchmarkDotNet")," \u62d3\u5c55\u5305\u3002\u7f16\u5199\u6d4b\u8bd5\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:"{3-4,22,25,33}","{3-4,22,25,33}":!0}),"using System;\nusing System.Security.Cryptography;\nusing BenchmarkDotNet.Attributes;\nusing BenchmarkDotNet.Running;\n\nnamespace MyBenchmarks\n{\n public class Md5VsSha256\n {\n private const int N = 10000;\n private readonly byte[] data;\n\n private readonly SHA256 sha256 = SHA256.Create();\n private readonly MD5 md5 = MD5.Create();\n\n public Md5VsSha256()\n {\n data = new byte[N];\n new Random(42).NextBytes(data);\n }\n\n [Benchmark]\n public byte[] Sha256() => sha256.ComputeHash(data);\n\n [Benchmark]\n public byte[] Md5() => md5.ComputeHash(data);\n }\n\n public class Program\n {\n public static void Main(string[] args)\n {\n var summary = BenchmarkRunner.Run();\n }\n }\n}\n")),Object(b.b)("h3",{id:"29332-\u67e5\u770b\u7ed3\u679c"},"29.3.3.2 \u67e5\u770b\u7ed3\u679c"),Object(b.b)("p",null,"\u8fd0\u884c\u63a7\u5236\u5668\u7a0b\u5e8f\uff0c\u5c06\u5f97\u5230\u4ee5\u4e0b\u7ed3\u679c"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{}),"BenchmarkDotNet=v0.12.0, OS=Windows 10.0.17763.805 (1809/October2018Update/Redstone5)\nIntel Core i7-7700K CPU 4.20GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores\n [Host] : .NET Framework 4.7.2 (4.7.3468.0), X64 RyuJIT\n Net472 : .NET Framework 4.7.2 (4.7.3468.0), X64 RyuJIT\n NetCoreApp30 : .NET Core 3.0.0 (CoreCLR 4.700.19.46205, CoreFX 4.700.19.46214), X64 RyuJIT\n CoreRt30 : .NET CoreRT 1.0.28231.02 @Commit: 741d61493c560ba96e8151f9e56876d4d3828489, X64 AOT\n Mono : Mono 6.4.0 (Visual Studio), X64\n")),Object(b.b)("table",null,Object(b.b)("thead",{parentName:"table"},Object(b.b)("tr",{parentName:"thead"},Object(b.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Method"),Object(b.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"Runtime"),Object(b.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"N"),Object(b.b)("th",Object(n.a)({parentName:"tr"},{align:"right"}),"Mean"),Object(b.b)("th",Object(n.a)({parentName:"tr"},{align:"right"}),"Error"),Object(b.b)("th",Object(n.a)({parentName:"tr"},{align:"right"}),"StdDev"),Object(b.b)("th",Object(n.a)({parentName:"tr"},{align:"right"}),"Ratio"))),Object(b.b)("tbody",{parentName:"table"},Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET 4.7.2"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"7.735 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.1913 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.4034 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.00")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET Core 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"3.989 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0796 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0745 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.50")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"CoreRt 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"4.091 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0811 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.1562 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.53")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mono"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"13.117 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.2485 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.5019 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.70")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}))),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET 4.7.2"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"2.872 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0552 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0737 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.00")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET Core 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.848 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0348 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0326 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.64")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"CoreRt 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.817 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0359 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0427 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.63")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mono"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"1000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"3.574 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0678 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.0753 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.24")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}))),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET 4.7.2"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"74.509 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.5787 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"4.6052 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.00")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET Core 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"36.049 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.7151 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.0025 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.49")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"CoreRt 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"36.253 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.7076 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.7571 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.49")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Sha256"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mono"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"116.350 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"2.2555 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"3.0110 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.58")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"})),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}))),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET 4.7.2"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"17.308 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.3361 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.4250 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.00")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),".NET Core 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"15.726 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.2064 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.1930 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.90")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"CoreRt 3.0"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"15.627 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.2631 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.2461 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.89")),Object(b.b)("tr",{parentName:"tbody"},Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Md5"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mono"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"10000"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"30.205 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.5868 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"0.6522 us"),Object(b.b)("td",Object(n.a)({parentName:"tr"},{align:"right"}),"1.74")))),Object(b.b)("h3",{id:"29333-\u5bfc\u51fa\u62a5\u8868"},"29.3.3.3 \u5bfc\u51fa\u62a5\u8868"),Object(b.b)("p",null,"\u4e5f\u53ef\u4ee5\u5bfc\u51fa\u5404\u79cd\u56fe\u8868"),Object(b.b)("img",{src:Object(c.a)("img/bm1.png")}),Object(b.b)("h2",{id:"2934-\u53cd\u9988\u4e0e\u5efa\u8bae"},"29.3.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(b.b)("a",Object(n.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(b.b)("hr",null),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(b.b)("inlineCode",{parentName:"p"},"BenchmarkDotNet")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(b.b)("a",Object(n.a)({parentName:"p"},{href:"https://benchmarkdotnet.org/"}),"BenchmarkDotNet \u5b98\u7f51"),"\u3002"))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/24dcd402.789e6747.js b/docs/24dcd402.47ac0c47.js similarity index 98% rename from docs/24dcd402.789e6747.js rename to docs/24dcd402.47ac0c47.js index 9ac8ffcc9c4..bb5545a5a34 100644 --- a/docs/24dcd402.789e6747.js +++ b/docs/24dcd402.47ac0c47.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{190:function(e,t,a){"use strict";a.d(t,"b",(function(){return b})),a.d(t,"a",(function(){return r}));var n=a(21),l=a(191);function b(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:b=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(l.b)(a))return a;if(n)return t+a;const r=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+r:r}(t,e,a,n)}}function r(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},191:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function l(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return l}))},192:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return j}));var n=a(0),l=a.n(n);function b(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(l[a]=e[a]);return l}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}var p=l.a.createContext({}),u=function(e){var t=l.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},o=function(e){var t=u(e.components);return l.a.createElement(p.Provider,{value:t},e.children)},O={inlineCode:"code",wrapper:function(e){var t=e.children;return l.a.createElement(l.a.Fragment,{},t)}},m=l.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,b=e.originalType,r=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),o=u(a),m=n,j=o["".concat(r,".").concat(m)]||o[m]||O[m]||b;return a?l.a.createElement(j,i(i({ref:t},p),{},{components:a})):l.a.createElement(j,i({ref:t},p))}));function j(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var b=a.length,r=new Array(b);r[0]=m;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i.mdxType="string"==typeof e?e:n,r[1]=i;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},89:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return c})),a.d(t,"metadata",(function(){return p})),a.d(t,"toc",(function(){return u})),a.d(t,"default",(function(){return O}));var n=a(3),l=a(7),b=(a(0),a(192)),r=a(190),i=a(193),c={id:"local-language",title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",sidebar_label:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09"},p={unversionedId:"local-language",id:"local-language",isDocsHomePage:!1,title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",description:"21.1 \u5168\u7403\u5316\u548c\u672c\u5730\u5316",source:"@site/docs\\local-language.mdx",slug:"/local-language",permalink:"/docs/local-language",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/local-language.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09",sidebar:"docs",previous:{title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",permalink:"/docs/encryption"},next:{title:"22. \u4e8b\u4ef6\u603b\u7ebf",permalink:"/docs/event-bus"}},u=[{value:"21.1 \u5168\u7403\u5316\u548c\u672c\u5730\u5316",id:"211-\u5168\u7403\u5316\u548c\u672c\u5730\u5316",children:[]},{value:"21.2 \u6ce8\u518c\u670d\u52a1",id:"212-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"21.3 \u5982\u4f55\u4f7f\u7528",id:"213-\u5982\u4f55\u4f7f\u7528",children:[{value:"21.3.1 \u521b\u5efa Lang.cs \u7c7b",id:"2131-\u521b\u5efa-langcs-\u7c7b",children:[]},{value:"21.3.2 \u914d\u7f6e LocalizationSettings",id:"2132-\u914d\u7f6e-localizationsettings",children:[]},{value:"21.3.3 \u521b\u5efa Resources \u6587\u4ef6\u5939",id:"2133-\u521b\u5efa-resources-\u6587\u4ef6\u5939",children:[]}]},{value:"21.4 L \u9759\u6001\u7c7b",id:"214-l-\u9759\u6001\u7c7b",children:[]},{value:"21.5 \u4f7f\u7528\u4f8b\u5b50",id:"215-\u4f7f\u7528\u4f8b\u5b50",children:[{value:"21.5.1 \u5728\u7c7b\u4e2d\u4f7f\u7528",id:"2151-\u5728\u7c7b\u4e2d\u4f7f\u7528",children:[]},{value:"21.5.2 \u5728\u89c6\u56fe\u4e2d\u4f7f\u7528",id:"2152-\u5728\u89c6\u56fe\u4e2d\u4f7f\u7528",children:[]},{value:"21.5.3 \u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528",id:"2153-\u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528",children:[]},{value:"21.5.4 \u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528",id:"2154-\u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528",children:[]}]},{value:"21.6 \u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6",id:"216-\u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6",children:[{value:"21.6.1 \u5728 Resources \u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6",id:"2161-\u5728-resources-\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6",children:[]}]},{value:"21.7 \u5207\u6362\u8bed\u8a00",id:"217-\u5207\u6362\u8bed\u8a00",children:[{value:"21.7.1 URL \u53c2\u6570 \u65b9\u5f0f",id:"2171-url-\u53c2\u6570-\u65b9\u5f0f",children:[]},{value:"21.7.2 Cookies \u65b9\u5f0f",id:"2172-cookies-\u65b9\u5f0f",children:[]},{value:"21.7.3 \u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362",id:"2173-\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362",children:[]}]},{value:"21.8 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528",id:"218-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528",children:[]},{value:"21.9 LocalizationSettings \u914d\u7f6e",id:"219-localizationsettings-\u914d\u7f6e",children:[]},{value:"21.10 \u533a\u57df\u7801\u5217\u8868",id:"2110-\u533a\u57df\u7801\u5217\u8868",children:[]},{value:"21.11 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2111-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],o={toc:u};function O(e){var t=e.components,a=Object(l.a)(e,["components"]);return Object(b.b)("wrapper",Object(n.a)({},o,a,{components:t,mdxType:"MDXLayout"}),Object(b.b)(i.a,{mdxType:"JoinGroup"}),Object(b.b)("h2",{id:"211-\u5168\u7403\u5316\u548c\u672c\u5730\u5316"},"21.1 \u5168\u7403\u5316\u548c\u672c\u5730\u5316"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u5168\u7403\u5316")," \u662f\u8bbe\u8ba1\u652f\u6301\u4e0d\u540c\u533a\u57df\u6027\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u8fc7\u7a0b\u3002 \u5168\u7403\u5316\u6dfb\u52a0\u4e86\u5bf9\u4e00\u7ec4\u6709\u5173\u7279\u5b9a\u5730\u7406\u533a\u57df\u7684\u5df2\u5b9a\u4e49\u8bed\u8a00\u811a\u672c\u7684\u8f93\u5165\u3001\u663e\u793a\u548c\u8f93\u51fa\u652f\u6301\u3002"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u672c\u5730\u5316")," \u662f\u5c06\u5df2\u7ecf\u9488\u5bf9\u53ef\u672c\u5730\u5316\u6027\u8fdb\u884c\u5904\u7406\u7684\u5168\u7403\u5316\u5e94\u7528\u8c03\u6574\u4e3a\u7279\u5b9a\u7684\u533a\u57df\u6027/\u533a\u57df\u8bbe\u7f6e\u7684\u8fc7\u7a0b\u3002"),Object(b.b)("p",null,"\u901a\u4fd7\u6765\u8bf4\uff0c\u5c31\u662f\u4f7f\u5e94\u7528\u6216\u7cfb\u7edf\u652f\u6301\u591a\u8bed\u8a00\u5207\u6362\u3002",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5b8c\u6574\u652f\u6301\u591a\u8bed\u8a00\u5904\u7406\u7684\u670d\u52a1\u3002"),Object(b.b)("h2",{id:"212-\u6ce8\u518c\u670d\u52a1"},"21.2 \u6ce8\u518c\u670d\u52a1"),Object(b.b)("p",null,"\u5728\u4f7f\u7528\u591a\u8bed\u8a00\u670d\u52a1\u4e4b\u524d\uff0c\u5fc5\u987b\u5148\u6ce8\u518c\u670d\u52a1\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,14-15}","{4,14-15}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddControllersWithViews()\n .AddAppLocalization(); // \u6ce8\u518c\u591a\u8bed\u8a00\n}\n\npublic void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n // \u914d\u7f6e\u591a\u8bed\u8a00\uff0c\u5fc5\u987b\u5728 \u8def\u7531\u6ce8\u518c\u4e4b\u524d\n app.UseAppLocalization();\n\n app.UseStaticFiles();\n app.UseRouting();\n\n // \u5176\u4ed6\u4e2d\u95f4\u4ef6\n}\n")),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"app.UseAppLocalization();")," \u5fc5\u987b\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"app.UseRouting();")," \u4e4b\u524d\u6ce8\u518c\u3002"))),Object(b.b)("h2",{id:"213-\u5982\u4f55\u4f7f\u7528"},"21.3 \u5982\u4f55\u4f7f\u7528"),Object(b.b)("h3",{id:"2131-\u521b\u5efa-langcs-\u7c7b"},"21.3.1 \u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"h3"},"Lang.cs")," \u7c7b"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u91c7\u7528\u4e00\u79cd\u6bd4\u8f83\u7279\u6b8a\u7684\u65b9\u5f0f\u52a8\u6001\u6ce8\u5165\u591a\u8bed\u8a00\u673a\u5236\uff0c\u6240\u4ee5\u5fc5\u987b\u9075\u5b88\u4e00\u4e2a\u7ea6\u5b9a\uff0c\u90a3\u5c31\u662f",Object(b.b)("strong",{parentName:"p"},"\u5fc5\u987b\u5728 ",Object(b.b)("inlineCode",{parentName:"strong"},"Web\u542f\u52a8\u9879\u76ee\u5c42")," \u6839\u76ee\u5f55\u4e0b\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"strong"},"Lang.cs")," \u7a7a\u7c7b"),"\uff0c\u4e5f\u5c31\u662f\u548c ",Object(b.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u548c ",Object(b.b)("inlineCode",{parentName:"p"},"Progame.cs")," \u540c\u7ea7\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Entry\\Lang.cs"',title:'"Furion.Web.Entry\\Lang.cs"'}),"namespace Furion.Web.Entry\n{\n public class Lang { }\n}\n")),Object(b.b)("h3",{id:"2132-\u914d\u7f6e-localizationsettings"},"21.3.2 \u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"h3"},"LocalizationSettings")),Object(b.b)("p",null,"\u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"p"},"Lang.cs")," \u7a7a\u7c7b\u4e4b\u540e\uff0c\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"LocalizationSettings")," \u914d\u7f6e\u9009\u9879\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-json",metastring:"{2,3}","{2,3}":!0}),'{\n "LocalizationSettings": {\n "SupportedCultures": ["zh-CN", "en-US"], // \u914d\u7f6e\u652f\u6301\u7684\u8bed\u8a00\u5217\u8868\n "DefaultCulture": "zh-CN" // \u914d\u7f6e\u9ed8\u8ba4\u8bed\u8a00\uff0c\u5982\u679c\u4e0d\u914d\u7f6e\uff0c\u53d6 SupportedCultures \u7684\u7b2c\u4e00\u9879\n }\n}\n')),Object(b.b)("h3",{id:"2133-\u521b\u5efa-resources-\u6587\u4ef6\u5939"},"21.3.3 \u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"h3"},"Resources")," \u6587\u4ef6\u5939"),Object(b.b)("p",null,"\u63a5\u4e0b\u6765\u5728 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"Web\u542f\u52a8\u9879\u76ee\u5c42")," \u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"strong"},"Resources")," \u6587\u4ef6\u5939"),"\uff0c\u5982\u56fe\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/lang1.png")}),Object(b.b)("h2",{id:"214-l-\u9759\u6001\u7c7b"},"21.4 ",Object(b.b)("inlineCode",{parentName:"h2"},"L")," \u9759\u6001\u7c7b"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e3b\u8981\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"L")," \u9759\u6001\u7c7b\u5b8c\u6574\u591a\u8bed\u8a00\u8f6c\u6362\uff0c\u8be5\u9759\u6001\u7c7b\u6709\u4ee5\u4e0b\u5c5e\u6027\u548c\u65b9\u6cd5\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.Text[\u6587\u672c]"),"\uff1a\u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.Html[HTML\u4ee3\u7801, \u683c\u5f0f\u5316]"),"\uff1a\u8f6c\u6362 ",Object(b.b)("inlineCode",{parentName:"li"},"Html")," \u591a\u8bed\u8a00"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.SetCulture(\u533a\u57df\u7801)"),"\uff1a\u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00\u533a\u57df"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.GetCultures()"),"\uff1a\u83b7\u53d6\u7cfb\u7edf\u652f\u6301\u7684\u591a\u8bed\u8a00\u5217\u8868")),Object(b.b)("h2",{id:"215-\u4f7f\u7528\u4f8b\u5b50"},"21.5 \u4f7f\u7528\u4f8b\u5b50"),Object(b.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u914d\u7f6e\u6b65\u9aa4\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"L")," \u9759\u6001\u7c7b\u5728\u4ee3\u7801\u4efb\u4f55\u4f4d\u7f6e\u4f7f\u7528\u4e86\uff0c\u5982\uff1a"),Object(b.b)("h3",{id:"2151-\u5728\u7c7b\u4e2d\u4f7f\u7528"},"21.5.1 \u5728\u7c7b\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'// \u6587\u672c\u591a\u8bed\u8a00\nvar apiInterface = L.Text["API \u63a5\u53e3"];\nvar sourceCode = L.Text["\u6e90\u7801\u5730\u5740"];\n\n// HTML \u6807\u8bb0\u591a\u8bed\u8a00\nvar name = L.Html["Hello {0}", name];\n')),Object(b.b)("h3",{id:"2152-\u5728\u89c6\u56fe\u4e2d\u4f7f\u7528"},"21.5.2 \u5728\u89c6\u56fe\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-html",metastring:"{1,6,9}","{1,6,9}":!0}),'@using Furion.Localization\n\n
\n

\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002

\n

\n @L.Text["API \u63a5\u53e3"]      @L.Text["\u6e90\u7801\u5730\u5740"]\n

\n
\n')),Object(b.b)("h3",{id:"2153-\u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528"},"21.5.3 \u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'[Required(ErrorMessage = "\u5fc5\u586b\u6d88\u606f")]\n')),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u6240\u6709\u9a8c\u8bc1\u7279\u6027\u5df2\u7ecf\u81ea\u52a8\u652f\u6301\u591a\u8bed\u8a00\u914d\u7f6e\u4e86\uff0c\u65e0\u9700\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"strong"},"L.Text[]")," \u8c03\u7528\u3002")),Object(b.b)("h3",{id:"2154-\u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528"},"21.5.4 \u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),'using Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n [ErrorCodeType]\n public enum ErrorCodes\n {\n [ErrorCodeItemMetadata("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a")]\n z1000\n }\n}\n')),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u6240\u6709\u5f02\u5e38\u6d88\u606f\u7279\u6027\u5df2\u7ecf\u81ea\u52a8\u652f\u6301\u591a\u8bed\u8a00\u914d\u7f6e\u4e86\uff0c\u65e0\u9700\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"strong"},"L.Text[]")," \u8c03\u7528\u3002")),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"throw Oops.Oh(ErrorCodes.z1000); // \u81ea\u52a8\u5e94\u7528\u591a\u8bed\u8a00\n")),Object(b.b)("h2",{id:"216-\u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6"},"21.6 \u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6"),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5982\u679c\u6ca1\u627e\u5230\u5bf9\u5e94\u7684\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\uff0c\u5219\u81ea\u52a8\u663e\u793a\u5b57\u7b26\u4e32\u6587\u672c\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'L.Text["\u6ca1\u627e\u5230"]; // => \u5982\u679c\u8bbe\u7f6e\u4e3a\u82f1\u6587\uff0c\u4f46\u662f\u6ca1\u6709\u6587\u4ef6\uff0c\u5219\u76f4\u63a5\u8f93\u51fa \u201c\u6ca1\u627e\u5230\u201d\n')),Object(b.b)("h3",{id:"2161-\u5728-resources-\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6"},"21.6.1 \u5728 ",Object(b.b)("inlineCode",{parentName:"h3"},"Resources")," \u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6"),Object(b.b)("p",null,"\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u521a\u521a\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"Resources")," \u6587\u4ef6\u5939\u4e2d\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"\u8d44\u6e90\u6587\u4ef6")," \u5373\u53ef\uff0c\u8d44\u6e90\u6587\u4ef6\u547d\u540d\u89c4\u5219\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"Lang.\u533a\u57df\u7801.resx"),"\uff0c\u5982\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"Lang.en-US.resx"),"\u3002"),Object(b.b)("img",{src:Object(r.a)("img/lang2.png")}),Object(b.b)("img",{src:Object(r.a)("img/lang3.png")}),Object(b.b)("p",null),Object(b.b)("p",null,"\u63a5\u4e0b\u6765\uff0c\u53ea\u9700\u8981\u628a\u5bf9\u5e94\u8bed\u8a00\u7248\u672c\u7684\u952e\u503c\u5bf9\u586b\u5199\u5373\u53ef\u3002"),Object(b.b)("h2",{id:"217-\u5207\u6362\u8bed\u8a00"},"21.7 \u5207\u6362\u8bed\u8a00"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u4e09\u79cd\u8bed\u8a00\u5207\u6362\u65b9\u5f0f\u8fdb\u884c\u5207\u6362\u8bed\u8a00\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"URL \u53c2\u6570")," \u65b9\u5f0f\uff1a ",Object(b.b)("inlineCode",{parentName:"li"},"?culture=en-US"),"\uff0c",Object(b.b)("strong",{parentName:"li"},"\u6b64\u65b9\u5f0f\u4f18\u5148\u7ea7\u6700\u9ad8"),"\uff0c\u683c\u5f0f\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"culture=\u533a\u57df\u7801")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Cookies")," \u65b9\u5f0f\uff1a\u8c03\u7528 ",Object(b.b)("inlineCode",{parentName:"li"},"L.SetCulture(\u533a\u57df\u7801)")," \u65b9\u5f0f\u5207\u6362"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5339\u914d"),"\uff1a\u5982\u679c\u524d\u9762\u4e24\u79cd\u65b9\u5f0f\u90fd\u6ca1\u6709\u8bbe\u7f6e\uff0c",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u52a8\u6839\u636e\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u8fdb\u884c\u5339\u914d\u3002"))),Object(b.b)("h3",{id:"2171-url-\u53c2\u6570-\u65b9\u5f0f"},"21.7.1 ",Object(b.b)("inlineCode",{parentName:"h3"},"URL \u53c2\u6570")," \u65b9\u5f0f"),Object(b.b)("img",{src:Object(r.a)("img/lang4.gif")}),Object(b.b)("h3",{id:"2172-cookies-\u65b9\u5f0f"},"21.7.2 ",Object(b.b)("inlineCode",{parentName:"h3"},"Cookies")," \u65b9\u5f0f"),Object(b.b)("p",null,"\u6b64\u65b9\u5f0f\u53ea\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"api")," \u6216\u8bbe\u7f6e\u4ee3\u7801\u5373\u53ef\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'L.SetCulture("en-US"); // en-US \u4e5f\u53ef\u4ee5\u901a\u8fc7\u524d\u7aef\u4f20\u9012\u8fc7\u6765\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e0d\u7528 `culture` \u53c2\u6570\u4e86\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u53c2\u6570\u3002\n')),Object(b.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u76f4\u63a5\u6839\u636e\u5ba2\u6237\u7aef\u5b58\u50a8\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"cookies")," \u81ea\u52a8\u5207\u6362\u4e86\u3002"),Object(b.b)("h3",{id:"2173-\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362"},"21.7.3 ",Object(b.b)("inlineCode",{parentName:"h3"},"\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362")),Object(b.b)("p",null,"\u63a8\u8350\u6b64\u65b9\u5f0f\uff0c\u53ef\u4ee5\u81ea\u52a8\u6839\u636e\u6d4f\u89c8\u5668\u7684\u8bed\u8a00\u81ea\u52a8\u914d\u7f6e\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/lang5.gif")}),Object(b.b)("h2",{id:"218-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528"},"21.8 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e5f\u517c\u5bb9 ",Object(b.b)("inlineCode",{parentName:"p"},".NET Core")," \u81ea\u5e26\u7684\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:"{3,5,7,12}","{3,5,7,12}":!0}),' public class TestController : Controller\n {\n private readonly IStringLocalizer _localizer;\n\n public TestController(IStringLocalizerFactory factory)\n {\n _localizer = factory.Create(L.LangType);\n }\n\n public IActionResult About()\n {\n ViewData["Message"] = _localizer["Your application description page."];\n }\n }\n')),Object(b.b)("h2",{id:"219-localizationsettings-\u914d\u7f6e"},"21.9 ",Object(b.b)("inlineCode",{parentName:"h2"},"LocalizationSettings")," \u914d\u7f6e"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"LocalizationSettings")," \u591a\u8bed\u8a00\u914d\u7f6e\u6839\u8282\u70b9",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ResourcesPath"),"\uff1a\u8d44\u6e90\u76ee\u5f55\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"Resources")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"SupportedCultures"),"\uff1a\u652f\u6301\u7684\u8bed\u8a00\u533a\u57df\u7801\u7c7b\u522b\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultCulture"),"\uff1a\u9ed8\u8ba4\u8bed\u8a00\u533a\u57df\u7801\uff0c\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u53d6 ",Object(b.b)("inlineCode",{parentName:"li"},"SupportedCultures")," \u7b2c\u4e00\u9879")))),Object(b.b)("h2",{id:"2110-\u533a\u57df\u7801\u5217\u8868"},"21.10 \u533a\u57df\u7801\u5217\u8868"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"af \u516c\u7528\u8377\u5170\u8bed"),Object(b.b)("li",{parentName:"ul"},"af-ZA \u516c\u7528\u8377\u5170\u8bed - \u5357\u975e"),Object(b.b)("li",{parentName:"ul"},"sq \u963f\u5c14\u5df4\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"sq-AL \u963f\u5c14\u5df4\u5c3c\u4e9a -\u963f\u5c14\u5df4\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ar \u963f\u62c9\u4f2f\u8bed"),Object(b.b)("li",{parentName:"ul"},"ar-DZ \u963f\u62c9\u4f2f\u8bed -\u963f\u5c14\u53ca\u5229\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ar-BH \u963f\u62c9\u4f2f\u8bed -\u5df4\u6797"),Object(b.b)("li",{parentName:"ul"},"ar-EG \u963f\u62c9\u4f2f\u8bed -\u57c3\u53ca"),Object(b.b)("li",{parentName:"ul"},"ar-IQ \u963f\u62c9\u4f2f\u8bed -\u4f0a\u62c9\u514b"),Object(b.b)("li",{parentName:"ul"},"ar-JO \u963f\u62c9\u4f2f\u8bed -\u7ea6\u65e6"),Object(b.b)("li",{parentName:"ul"},"ar-KW \u963f\u62c9\u4f2f\u8bed -\u79d1\u5a01\u7279"),Object(b.b)("li",{parentName:"ul"},"ar-LB \u963f\u62c9\u4f2f\u8bed -\u9ece\u5df4\u5ae9"),Object(b.b)("li",{parentName:"ul"},"ar-LY \u963f\u62c9\u4f2f\u8bed -\u5229\u6bd4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ar-MA \u963f\u62c9\u4f2f\u8bed -\u6469\u6d1b\u54e5"),Object(b.b)("li",{parentName:"ul"},"ar-OM \u963f\u62c9\u4f2f\u8bed -\u963f\u66fc"),Object(b.b)("li",{parentName:"ul"},"ar-QA \u963f\u62c9\u4f2f\u8bed -\u5361\u5854\u5c14"),Object(b.b)("li",{parentName:"ul"},"ar-SA \u963f\u62c9\u4f2f\u8bed - \u6c99\u7279\u963f\u62c9\u4f2f"),Object(b.b)("li",{parentName:"ul"},"ar-SY \u963f\u62c9\u4f2f\u8bed -\u53d9\u5229\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"ar-TN \u963f\u62c9\u4f2f\u8bed -\u5317\u975e\u7684\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"ar-AE \u963f\u62c9\u4f2f\u8bed - \u963f\u62c9\u4f2f\u8054\u5408\u914b\u957f\u56fd"),Object(b.b)("li",{parentName:"ul"},"ar-YE \u963f\u62c9\u4f2f\u8bed -\u4e5f\u95e8"),Object(b.b)("li",{parentName:"ul"},"hy \u4e9a\u7f8e\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"hy-AM \u4e9a\u7f8e\u5c3c\u4e9a\u7684 -\u4e9a\u7f8e\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"az Azeri"),Object(b.b)("li",{parentName:"ul"},"az-AZ-Cyrl Azeri-(\u897f\u91cc\u5c14\u5b57\u6bcd\u7684) \u963f\u585e\u62dc\u7586"),Object(b.b)("li",{parentName:"ul"},"az-AZ-Latn Azeri(\u62c9\u4e01\u6587)- \u963f\u585e\u62dc\u7586"),Object(b.b)("li",{parentName:"ul"},"eu \u5df4\u65af\u514b"),Object(b.b)("li",{parentName:"ul"},"eu-ES \u5df4\u65af\u514b -\u5df4\u65af\u514b"),Object(b.b)("li",{parentName:"ul"},"be Belarusian"),Object(b.b)("li",{parentName:"ul"},"be-BY Belarusian-\u767d\u4fc4\u7f57\u65af"),Object(b.b)("li",{parentName:"ul"},"bg \u4fdd\u52a0\u5229\u4e9a"),Object(b.b)("li",{parentName:"ul"},"bg-BG \u4fdd\u52a0\u5229\u4e9a -\u4fdd\u52a0\u5229\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ca \u5609\u6cf0\u7f57\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ca-ES \u5609\u6cf0\u7f57\u5c3c\u4e9a -\u5609\u6cf0\u7f57\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"zh-HK \u534e - \u9999\u6e2f\u7684 SAR"),Object(b.b)("li",{parentName:"ul"},"zh-MO \u534e - \u6fb3\u95e8\u7684 SAR"),Object(b.b)("li",{parentName:"ul"},"zh-CN \u534e -\u4e2d\u56fd"),Object(b.b)("li",{parentName:"ul"},"zh-CHS \u534e (\u5355\u4e00\u5316)"),Object(b.b)("li",{parentName:"ul"},"zh-SG \u534e -\u65b0\u52a0\u5761"),Object(b.b)("li",{parentName:"ul"},"zh-TW \u534e -\u53f0\u6e7e"),Object(b.b)("li",{parentName:"ul"},"zh-CHT \u534e (\u4f20\u7edf\u7684)"),Object(b.b)("li",{parentName:"ul"},"hr \u514b\u7f57\u57c3\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"hr-HR \u514b\u7f57\u57c3\u897f\u4e9a -\u514b\u7f57\u57c3\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"cs \u6377\u514b"),Object(b.b)("li",{parentName:"ul"},"cs-CZ \u6377\u514b - \u6377\u514b"),Object(b.b)("li",{parentName:"ul"},"da \u4e39\u9ea6\u6587"),Object(b.b)("li",{parentName:"ul"},"da-DK \u4e39\u9ea6\u6587 -\u4e39\u9ea6"),Object(b.b)("li",{parentName:"ul"},"div Dhivehi"),Object(b.b)("li",{parentName:"ul"},"div-MV Dhivehi-\u9a6c\u5c14\u4ee3\u592b"),Object(b.b)("li",{parentName:"ul"},"nl \u8377\u5170"),Object(b.b)("li",{parentName:"ul"},"nl-BE \u8377\u5170 -\u6bd4\u5229\u65f6"),Object(b.b)("li",{parentName:"ul"},"nl-NL \u8377\u5170 - \u8377\u5170"),Object(b.b)("li",{parentName:"ul"},"en \u82f1\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-AU \u82f1\u56fd -\u6fb3\u6d32"),Object(b.b)("li",{parentName:"ul"},"en-BZ \u82f1\u56fd -\u4f2f\u5229\u5179"),Object(b.b)("li",{parentName:"ul"},"en-CA \u82f1\u56fd -\u52a0\u62ff\u5927"),Object(b.b)("li",{parentName:"ul"},"en-CB \u82f1\u56fd -\u52a0\u52d2\u6bd4\u6d77"),Object(b.b)("li",{parentName:"ul"},"en-IE \u82f1\u56fd -\u7231\u5c14\u5170"),Object(b.b)("li",{parentName:"ul"},"en-JM \u82f1\u56fd -\u7259\u4e70\u52a0"),Object(b.b)("li",{parentName:"ul"},"en-NZ \u82f1\u56fd - \u65b0\u897f\u5170"),Object(b.b)("li",{parentName:"ul"},"en-PH \u82f1\u56fd -\u83f2\u5f8b\u5bbe\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-ZA \u82f1\u56fd - \u5357\u975e"),Object(b.b)("li",{parentName:"ul"},"en-TT \u82f1\u56fd - \u5343\u91cc\u8fbe\u6258\u8d1d\u54e5\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-GB \u82f1\u56fd - \u82f1\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-US \u82f1\u56fd - \u7f8e\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-ZW \u82f1\u56fd -\u6d25\u5df4\u5e03\u97e6"),Object(b.b)("li",{parentName:"ul"},"et \u7231\u6c99\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"et-EE \u7231\u6c99\u5c3c\u4e9a\u7684 -\u7231\u6c99\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"fo Faroese"),Object(b.b)("li",{parentName:"ul"},"fo-FO Faroese- \u6cd5\u7f57\u7fa4\u5c9b"),Object(b.b)("li",{parentName:"ul"},"fa \u6ce2\u65af\u8bed"),Object(b.b)("li",{parentName:"ul"},"fa-IR \u6ce2\u65af\u8bed -\u4f0a\u6717\u738b\u56fd"),Object(b.b)("li",{parentName:"ul"},"fi \u82ac\u5170\u8bed"),Object(b.b)("li",{parentName:"ul"},"fi-FI \u82ac\u5170\u8bed -\u82ac\u5170"),Object(b.b)("li",{parentName:"ul"},"fr \u6cd5\u56fd"),Object(b.b)("li",{parentName:"ul"},"fr-BE \u6cd5\u56fd -\u6bd4\u5229\u65f6"),Object(b.b)("li",{parentName:"ul"},"fr-CA \u6cd5\u56fd -\u52a0\u62ff\u5927"),Object(b.b)("li",{parentName:"ul"},"fr-FR \u6cd5\u56fd -\u6cd5\u56fd"),Object(b.b)("li",{parentName:"ul"},"fr-LU \u6cd5\u56fd -\u5362\u68ee\u5821"),Object(b.b)("li",{parentName:"ul"},"fr-MC \u6cd5\u56fd -\u6469\u7eb3\u54e5"),Object(b.b)("li",{parentName:"ul"},"fr-CH \u6cd5\u56fd -\u745e\u58eb"),Object(b.b)("li",{parentName:"ul"},"gl \u52a0\u5229\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"gl-ES \u52a0\u5229\u897f\u4e9a -\u52a0\u5229\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ka \u683c\u9c81\u5409\u4e9a\u5dde"),Object(b.b)("li",{parentName:"ul"},"ka-GE \u683c\u9c81\u5409\u4e9a\u5dde -\u683c\u9c81\u5409\u4e9a\u5dde"),Object(b.b)("li",{parentName:"ul"},"de \u5fb7\u56fd"),Object(b.b)("li",{parentName:"ul"},"de-AT \u5fb7\u56fd -\u5965\u5730\u5229"),Object(b.b)("li",{parentName:"ul"},"de-DE \u5fb7\u56fd -\u5fb7\u56fd"),Object(b.b)("li",{parentName:"ul"},"de-LI \u5fb7\u56fd -\u5217\u652f\u6566\u58eb\u767b"),Object(b.b)("li",{parentName:"ul"},"de-LU \u5fb7\u56fd -\u5362\u68ee\u5821"),Object(b.b)("li",{parentName:"ul"},"de-CH \u5fb7\u56fd -\u745e\u58eb"),Object(b.b)("li",{parentName:"ul"},"el \u5e0c\u814a"),Object(b.b)("li",{parentName:"ul"},"el-GR \u5e0c\u814a -\u5e0c\u814a"),Object(b.b)("li",{parentName:"ul"},"gu Gujarati"),Object(b.b)("li",{parentName:"ul"},"gu-IN Gujarati-\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"he \u5e0c\u4f2f\u6765"),Object(b.b)("li",{parentName:"ul"},"he-IL \u5e0c\u4f2f\u6765 -\u4ee5\u8272\u5217"),Object(b.b)("li",{parentName:"ul"},"hi \u5317\u5370\u5ea6\u8bed"),Object(b.b)("li",{parentName:"ul"},"hi-IN \u5317\u5370\u5ea6\u7684 -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"hu \u5308\u7259\u5229"),Object(b.b)("li",{parentName:"ul"},"hu-HU \u5308\u7259\u5229\u7684 -\u5308\u7259\u5229"),Object(b.b)("li",{parentName:"ul"},"is \u51b0\u5c9b\u8bed"),Object(b.b)("li",{parentName:"ul"},"is-IS \u51b0\u5c9b\u7684 -\u51b0\u5c9b"),Object(b.b)("li",{parentName:"ul"},"id \u5370\u5c3c"),Object(b.b)("li",{parentName:"ul"},"id-ID \u5370\u5c3c -\u5370\u5c3c"),Object(b.b)("li",{parentName:"ul"},"it \u610f\u5927\u5229"),Object(b.b)("li",{parentName:"ul"},"it-IT \u610f\u5927\u5229 -\u610f\u5927\u5229"),Object(b.b)("li",{parentName:"ul"},"it-CH \u610f\u5927\u5229 -\u745e\u58eb"),Object(b.b)("li",{parentName:"ul"},"ja \u65e5\u672c"),Object(b.b)("li",{parentName:"ul"},"ja-JP \u65e5\u672c -\u65e5\u672c"),Object(b.b)("li",{parentName:"ul"},"kn \u5361\u7eb3\u8fbe\u8bed"),Object(b.b)("li",{parentName:"ul"},"kn-IN \u5361\u7eb3\u8fbe\u8bed -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"kk Kazakh"),Object(b.b)("li",{parentName:"ul"},"kk-KZ Kazakh-\u54c8\u8428\u514b"),Object(b.b)("li",{parentName:"ul"},"kok Konkani"),Object(b.b)("li",{parentName:"ul"},"kok-IN Konkani-\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"ko \u97e9\u56fd"),Object(b.b)("li",{parentName:"ul"},"ko-KR \u97e9\u56fd -\u97e9\u56fd"),Object(b.b)("li",{parentName:"ul"},"ky Kyrgyz"),Object(b.b)("li",{parentName:"ul"},"ky-KZ Kyrgyz-\u54c8\u8428\u514b"),Object(b.b)("li",{parentName:"ul"},"lv \u62c9\u8131\u7ef4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"lv-LV \u62c9\u8131\u7ef4\u4e9a\u7684 -\u62c9\u8131\u7ef4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"lt \u7acb\u9676\u5b9b"),Object(b.b)("li",{parentName:"ul"},"lt-LT \u7acb\u9676\u5b9b -\u7acb\u9676\u5b9b"),Object(b.b)("li",{parentName:"ul"},"mk \u9a6c\u5176\u987f"),Object(b.b)("li",{parentName:"ul"},"mk-MK \u9a6c\u5176\u987f -FYROM"),Object(b.b)("li",{parentName:"ul"},"ms \u9a6c\u6765"),Object(b.b)("li",{parentName:"ul"},"ms-BN \u9a6c\u6765 -\u6c76\u83b1"),Object(b.b)("li",{parentName:"ul"},"ms-MY \u9a6c\u6765 -\u9a6c\u6765\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"mr \u9a6c\u62c9\u5730\u8bed"),Object(b.b)("li",{parentName:"ul"},"mr-IN \u9a6c\u62c9\u5730\u8bed -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"mn \u8499\u53e4"),Object(b.b)("li",{parentName:"ul"},"mn-MN \u8499\u53e4 -\u8499\u53e4"),Object(b.b)("li",{parentName:"ul"},"no \u632a\u5a01"),Object(b.b)("li",{parentName:"ul"},"nb-NO \u632a\u5a01 (Bokm?l) - \u632a\u5a01"),Object(b.b)("li",{parentName:"ul"},"nn-NO \u632a\u5a01 (Nynorsk)- \u632a\u5a01"),Object(b.b)("li",{parentName:"ul"},"pl \u6ce2\u5170"),Object(b.b)("li",{parentName:"ul"},"pl-PL \u6ce2\u5170 -\u6ce2\u5170"),Object(b.b)("li",{parentName:"ul"},"pt \u8461\u8404\u7259"),Object(b.b)("li",{parentName:"ul"},"pt-BR \u8461\u8404\u7259 -\u5df4\u897f"),Object(b.b)("li",{parentName:"ul"},"pt-PT \u8461\u8404\u7259 -\u8461\u8404\u7259"),Object(b.b)("li",{parentName:"ul"},"pa Punjab \u8bed"),Object(b.b)("li",{parentName:"ul"},"pa-IN Punjab \u8bed -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"ro \u7f57\u9a6c\u5c3c\u4e9a\u8bed"),Object(b.b)("li",{parentName:"ul"},"ro-RO \u7f57\u9a6c\u5c3c\u4e9a\u8bed -\u7f57\u9a6c\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ru \u4fc4\u56fd"),Object(b.b)("li",{parentName:"ul"},"ru-RU \u4fc4\u56fd -\u4fc4\u56fd"),Object(b.b)("li",{parentName:"ul"},"sa \u68b5\u6587"),Object(b.b)("li",{parentName:"ul"},"sa-IN \u68b5\u6587 -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"sr-SP-Cyrl \u585e\u5c14\u7ef4\u4e9a -(\u897f\u91cc\u5c14\u5b57\u6bcd\u7684) \u585e\u5c14\u7ef4\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"sr-SP-Latn \u585e\u5c14\u7ef4\u4e9a (\u62c9\u4e01\u6587)- \u585e\u5c14\u7ef4\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"sk \u65af\u6d1b\u4f10\u514b"),Object(b.b)("li",{parentName:"ul"},"sk-SK \u65af\u6d1b\u4f10\u514b -\u65af\u6d1b\u4f10\u514b"),Object(b.b)("li",{parentName:"ul"},"sl \u65af\u6d1b\u6587\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"sl-SI \u65af\u6d1b\u6587\u5c3c\u4e9a -\u65af\u6d1b\u6587\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"es \u897f\u73ed\u7259"),Object(b.b)("li",{parentName:"ul"},"es-AR \u897f\u73ed\u7259 -\u963f\u6839\u5ef7"),Object(b.b)("li",{parentName:"ul"},"es-BO \u897f\u73ed\u7259 -\u73bb\u5229\u7ef4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"es-CL \u897f\u73ed\u7259 -\u667a\u5229"),Object(b.b)("li",{parentName:"ul"},"es-CO \u897f\u73ed\u7259 -\u54e5\u4f26\u6bd4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"es-CR \u897f\u73ed\u7259 - \u54e5\u65af\u8fbe\u9ece\u52a0"),Object(b.b)("li",{parentName:"ul"},"es-DO \u897f\u73ed\u7259 - \u591a\u7c73\u5c3c\u52a0\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"es-EC \u897f\u73ed\u7259 -\u5384\u74dc\u591a\u5c14"),Object(b.b)("li",{parentName:"ul"},"es-SV \u897f\u73ed\u7259 - \u8428\u5c14\u74e6\u591a"),Object(b.b)("li",{parentName:"ul"},"es-GT \u897f\u73ed\u7259 -\u5371\u5730\u9a6c\u62c9"),Object(b.b)("li",{parentName:"ul"},"es-HN \u897f\u73ed\u7259 -\u6d2a\u90fd\u62c9\u65af"),Object(b.b)("li",{parentName:"ul"},"es-MX \u897f\u73ed\u7259 -\u58a8\u897f\u54e5"),Object(b.b)("li",{parentName:"ul"},"es-NI \u897f\u73ed\u7259 -\u5c3c\u52a0\u62c9\u74dc"),Object(b.b)("li",{parentName:"ul"},"es-PA \u897f\u73ed\u7259 -\u5df4\u62ff\u9a6c"),Object(b.b)("li",{parentName:"ul"},"es-PY \u897f\u73ed\u7259 -\u5df4\u62c9\u572d"),Object(b.b)("li",{parentName:"ul"},"es-PE \u897f\u73ed\u7259 -\u79d8\u9c81"),Object(b.b)("li",{parentName:"ul"},"es-PR \u897f\u73ed\u7259 - \u6ce2\u591a\u9ece\u5404"),Object(b.b)("li",{parentName:"ul"},"es-ES \u897f\u73ed\u7259 -\u897f\u73ed\u7259"),Object(b.b)("li",{parentName:"ul"},"es-UY \u897f\u73ed\u7259 -\u4e4c\u62c9\u572d"),Object(b.b)("li",{parentName:"ul"},"es-VE \u897f\u73ed\u7259 -\u59d4\u5185\u745e\u62c9"),Object(b.b)("li",{parentName:"ul"},"sw Swahili"),Object(b.b)("li",{parentName:"ul"},"sw-KE Swahili-\u80af\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"sv \u745e\u5178"),Object(b.b)("li",{parentName:"ul"},"sv-FI \u745e\u5178 -\u82ac\u5170"),Object(b.b)("li",{parentName:"ul"},"sv-SE \u745e\u5178 -\u745e\u5178"),Object(b.b)("li",{parentName:"ul"},"syr Syriac"),Object(b.b)("li",{parentName:"ul"},"syr-SY Syriac-\u53d9\u5229\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"ta \u5766\u7c73\u5c14"),Object(b.b)("li",{parentName:"ul"},"ta-IN \u5766\u7c73\u5c14 -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"tt Tatar"),Object(b.b)("li",{parentName:"ul"},"tt-RU Tatar-\u4fc4\u56fd"),Object(b.b)("li",{parentName:"ul"},"te Telugu"),Object(b.b)("li",{parentName:"ul"},"te-IN Telugu-\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"th \u6cf0\u56fd"),Object(b.b)("li",{parentName:"ul"},"th-TH \u6cf0\u56fd -\u6cf0\u56fd"),Object(b.b)("li",{parentName:"ul"},"tr \u571f\u8033\u5176\u8bed"),Object(b.b)("li",{parentName:"ul"},"tr-TR \u571f\u8033\u5176\u8bed -\u571f\u8033\u5176"),Object(b.b)("li",{parentName:"ul"},"uk \u4e4c\u514b\u5170"),Object(b.b)("li",{parentName:"ul"},"uk-UA \u4e4c\u514b\u5170 -\u4e4c\u514b\u5170"),Object(b.b)("li",{parentName:"ul"},"ur Urdu"),Object(b.b)("li",{parentName:"ul"},"ur-PK Urdu-\u5df4\u57fa\u65af\u5766"),Object(b.b)("li",{parentName:"ul"},"uz Uzbek"),Object(b.b)("li",{parentName:"ul"},"uz-UZ-Cyrl Uzbek-(\u897f\u91cc\u5c14\u5b57\u6bcd\u7684) \u4e4c\u5179\u522b\u514b\u65af\u5766"),Object(b.b)("li",{parentName:"ul"},"uz-UZ-Latn Uzbek(\u62c9\u4e01\u6587)- \u4e4c\u5179\u522b\u514b\u65af\u5766"),Object(b.b)("li",{parentName:"ul"},"vi \u8d8a\u5357"),Object(b.b)("li",{parentName:"ul"},"vi-VN \u8d8a\u5357 -\u8d8a\u5357")),Object(b.b)("h2",{id:"2111-\u53cd\u9988\u4e0e\u5efa\u8bae"},"21.11 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(b.b)("a",Object(n.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(b.b)("hr",null),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(b.b)("inlineCode",{parentName:"p"},"\u591a\u8bed\u8a00")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(b.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/localization?view=aspnetcore-5.0"}),"ASP.NET Core - \u5168\u5c40\u5316\u548c\u672c\u5730\u5316")," \u7ae0\u8282\u3002"))))}O.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{194:function(e,t,a){"use strict";a.d(t,"b",(function(){return b})),a.d(t,"a",(function(){return r}));var n=a(21),l=a(195);function b(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:b=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(l.b)(a))return a;if(n)return t+a;const r=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+r:r}(t,e,a,n)}}function r(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},195:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function l(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return l}))},196:function(e,t,a){"use strict";a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return j}));var n=a(0),l=a.n(n);function b(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(l[a]=e[a]);return l}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}var p=l.a.createContext({}),u=function(e){var t=l.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},o=function(e){var t=u(e.components);return l.a.createElement(p.Provider,{value:t},e.children)},O={inlineCode:"code",wrapper:function(e){var t=e.children;return l.a.createElement(l.a.Fragment,{},t)}},m=l.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,b=e.originalType,r=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),o=u(a),m=n,j=o["".concat(r,".").concat(m)]||o[m]||O[m]||b;return a?l.a.createElement(j,i(i({ref:t},p),{},{components:a})):l.a.createElement(j,i({ref:t},p))}));function j(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var b=a.length,r=new Array(b);r[0]=m;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i.mdxType="string"==typeof e?e:n,r[1]=i;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},89:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return c})),a.d(t,"metadata",(function(){return p})),a.d(t,"toc",(function(){return u})),a.d(t,"default",(function(){return O}));var n=a(3),l=a(7),b=(a(0),a(196)),r=a(194),i=a(197),c={id:"local-language",title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",sidebar_label:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09"},p={unversionedId:"local-language",id:"local-language",isDocsHomePage:!1,title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",description:"21.1 \u5168\u7403\u5316\u548c\u672c\u5730\u5316",source:"@site/docs\\local-language.mdx",slug:"/local-language",permalink:"/docs/local-language",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/local-language.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09",sidebar:"docs",previous:{title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",permalink:"/docs/encryption"},next:{title:"22. \u4e8b\u4ef6\u603b\u7ebf",permalink:"/docs/event-bus"}},u=[{value:"21.1 \u5168\u7403\u5316\u548c\u672c\u5730\u5316",id:"211-\u5168\u7403\u5316\u548c\u672c\u5730\u5316",children:[]},{value:"21.2 \u6ce8\u518c\u670d\u52a1",id:"212-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"21.3 \u5982\u4f55\u4f7f\u7528",id:"213-\u5982\u4f55\u4f7f\u7528",children:[{value:"21.3.1 \u521b\u5efa Lang.cs \u7c7b",id:"2131-\u521b\u5efa-langcs-\u7c7b",children:[]},{value:"21.3.2 \u914d\u7f6e LocalizationSettings",id:"2132-\u914d\u7f6e-localizationsettings",children:[]},{value:"21.3.3 \u521b\u5efa Resources \u6587\u4ef6\u5939",id:"2133-\u521b\u5efa-resources-\u6587\u4ef6\u5939",children:[]}]},{value:"21.4 L \u9759\u6001\u7c7b",id:"214-l-\u9759\u6001\u7c7b",children:[]},{value:"21.5 \u4f7f\u7528\u4f8b\u5b50",id:"215-\u4f7f\u7528\u4f8b\u5b50",children:[{value:"21.5.1 \u5728\u7c7b\u4e2d\u4f7f\u7528",id:"2151-\u5728\u7c7b\u4e2d\u4f7f\u7528",children:[]},{value:"21.5.2 \u5728\u89c6\u56fe\u4e2d\u4f7f\u7528",id:"2152-\u5728\u89c6\u56fe\u4e2d\u4f7f\u7528",children:[]},{value:"21.5.3 \u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528",id:"2153-\u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528",children:[]},{value:"21.5.4 \u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528",id:"2154-\u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528",children:[]}]},{value:"21.6 \u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6",id:"216-\u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6",children:[{value:"21.6.1 \u5728 Resources \u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6",id:"2161-\u5728-resources-\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6",children:[]}]},{value:"21.7 \u5207\u6362\u8bed\u8a00",id:"217-\u5207\u6362\u8bed\u8a00",children:[{value:"21.7.1 URL \u53c2\u6570 \u65b9\u5f0f",id:"2171-url-\u53c2\u6570-\u65b9\u5f0f",children:[]},{value:"21.7.2 Cookies \u65b9\u5f0f",id:"2172-cookies-\u65b9\u5f0f",children:[]},{value:"21.7.3 \u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362",id:"2173-\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362",children:[]}]},{value:"21.8 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528",id:"218-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528",children:[]},{value:"21.9 LocalizationSettings \u914d\u7f6e",id:"219-localizationsettings-\u914d\u7f6e",children:[]},{value:"21.10 \u533a\u57df\u7801\u5217\u8868",id:"2110-\u533a\u57df\u7801\u5217\u8868",children:[]},{value:"21.11 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2111-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],o={toc:u};function O(e){var t=e.components,a=Object(l.a)(e,["components"]);return Object(b.b)("wrapper",Object(n.a)({},o,a,{components:t,mdxType:"MDXLayout"}),Object(b.b)(i.a,{mdxType:"JoinGroup"}),Object(b.b)("h2",{id:"211-\u5168\u7403\u5316\u548c\u672c\u5730\u5316"},"21.1 \u5168\u7403\u5316\u548c\u672c\u5730\u5316"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u5168\u7403\u5316")," \u662f\u8bbe\u8ba1\u652f\u6301\u4e0d\u540c\u533a\u57df\u6027\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u8fc7\u7a0b\u3002 \u5168\u7403\u5316\u6dfb\u52a0\u4e86\u5bf9\u4e00\u7ec4\u6709\u5173\u7279\u5b9a\u5730\u7406\u533a\u57df\u7684\u5df2\u5b9a\u4e49\u8bed\u8a00\u811a\u672c\u7684\u8f93\u5165\u3001\u663e\u793a\u548c\u8f93\u51fa\u652f\u6301\u3002"),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u672c\u5730\u5316")," \u662f\u5c06\u5df2\u7ecf\u9488\u5bf9\u53ef\u672c\u5730\u5316\u6027\u8fdb\u884c\u5904\u7406\u7684\u5168\u7403\u5316\u5e94\u7528\u8c03\u6574\u4e3a\u7279\u5b9a\u7684\u533a\u57df\u6027/\u533a\u57df\u8bbe\u7f6e\u7684\u8fc7\u7a0b\u3002"),Object(b.b)("p",null,"\u901a\u4fd7\u6765\u8bf4\uff0c\u5c31\u662f\u4f7f\u5e94\u7528\u6216\u7cfb\u7edf\u652f\u6301\u591a\u8bed\u8a00\u5207\u6362\u3002",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u5b8c\u6574\u652f\u6301\u591a\u8bed\u8a00\u5904\u7406\u7684\u670d\u52a1\u3002"),Object(b.b)("h2",{id:"212-\u6ce8\u518c\u670d\u52a1"},"21.2 \u6ce8\u518c\u670d\u52a1"),Object(b.b)("p",null,"\u5728\u4f7f\u7528\u591a\u8bed\u8a00\u670d\u52a1\u4e4b\u524d\uff0c\u5fc5\u987b\u5148\u6ce8\u518c\u670d\u52a1\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,14-15}","{4,14-15}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddControllersWithViews()\n .AddAppLocalization(); // \u6ce8\u518c\u591a\u8bed\u8a00\n}\n\npublic void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n // \u914d\u7f6e\u591a\u8bed\u8a00\uff0c\u5fc5\u987b\u5728 \u8def\u7531\u6ce8\u518c\u4e4b\u524d\n app.UseAppLocalization();\n\n app.UseStaticFiles();\n app.UseRouting();\n\n // \u5176\u4ed6\u4e2d\u95f4\u4ef6\n}\n")),Object(b.b)("div",{className:"admonition admonition-important alert alert--info"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},Object(b.b)("inlineCode",{parentName:"p"},"app.UseAppLocalization();")," \u5fc5\u987b\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"app.UseRouting();")," \u4e4b\u524d\u6ce8\u518c\u3002"))),Object(b.b)("h2",{id:"213-\u5982\u4f55\u4f7f\u7528"},"21.3 \u5982\u4f55\u4f7f\u7528"),Object(b.b)("h3",{id:"2131-\u521b\u5efa-langcs-\u7c7b"},"21.3.1 \u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"h3"},"Lang.cs")," \u7c7b"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u91c7\u7528\u4e00\u79cd\u6bd4\u8f83\u7279\u6b8a\u7684\u65b9\u5f0f\u52a8\u6001\u6ce8\u5165\u591a\u8bed\u8a00\u673a\u5236\uff0c\u6240\u4ee5\u5fc5\u987b\u9075\u5b88\u4e00\u4e2a\u7ea6\u5b9a\uff0c\u90a3\u5c31\u662f",Object(b.b)("strong",{parentName:"p"},"\u5fc5\u987b\u5728 ",Object(b.b)("inlineCode",{parentName:"strong"},"Web\u542f\u52a8\u9879\u76ee\u5c42")," \u6839\u76ee\u5f55\u4e0b\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"strong"},"Lang.cs")," \u7a7a\u7c7b"),"\uff0c\u4e5f\u5c31\u662f\u548c ",Object(b.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u548c ",Object(b.b)("inlineCode",{parentName:"p"},"Progame.cs")," \u540c\u7ea7\u3002"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Entry\\Lang.cs"',title:'"Furion.Web.Entry\\Lang.cs"'}),"namespace Furion.Web.Entry\n{\n public class Lang { }\n}\n")),Object(b.b)("h3",{id:"2132-\u914d\u7f6e-localizationsettings"},"21.3.2 \u914d\u7f6e ",Object(b.b)("inlineCode",{parentName:"h3"},"LocalizationSettings")),Object(b.b)("p",null,"\u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"p"},"Lang.cs")," \u7a7a\u7c7b\u4e4b\u540e\uff0c\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"LocalizationSettings")," \u914d\u7f6e\u9009\u9879\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-json",metastring:"{2,3}","{2,3}":!0}),'{\n "LocalizationSettings": {\n "SupportedCultures": ["zh-CN", "en-US"], // \u914d\u7f6e\u652f\u6301\u7684\u8bed\u8a00\u5217\u8868\n "DefaultCulture": "zh-CN" // \u914d\u7f6e\u9ed8\u8ba4\u8bed\u8a00\uff0c\u5982\u679c\u4e0d\u914d\u7f6e\uff0c\u53d6 SupportedCultures \u7684\u7b2c\u4e00\u9879\n }\n}\n')),Object(b.b)("h3",{id:"2133-\u521b\u5efa-resources-\u6587\u4ef6\u5939"},"21.3.3 \u521b\u5efa ",Object(b.b)("inlineCode",{parentName:"h3"},"Resources")," \u6587\u4ef6\u5939"),Object(b.b)("p",null,"\u63a5\u4e0b\u6765\u5728 ",Object(b.b)("strong",{parentName:"p"},Object(b.b)("inlineCode",{parentName:"strong"},"Web\u542f\u52a8\u9879\u76ee\u5c42")," \u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"strong"},"Resources")," \u6587\u4ef6\u5939"),"\uff0c\u5982\u56fe\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/lang1.png")}),Object(b.b)("h2",{id:"214-l-\u9759\u6001\u7c7b"},"21.4 ",Object(b.b)("inlineCode",{parentName:"h2"},"L")," \u9759\u6001\u7c7b"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e3b\u8981\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"L")," \u9759\u6001\u7c7b\u5b8c\u6574\u591a\u8bed\u8a00\u8f6c\u6362\uff0c\u8be5\u9759\u6001\u7c7b\u6709\u4ee5\u4e0b\u5c5e\u6027\u548c\u65b9\u6cd5\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.Text[\u6587\u672c]"),"\uff1a\u8f6c\u6362\u6587\u672c\u591a\u8bed\u8a00"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.Html[HTML\u4ee3\u7801, \u683c\u5f0f\u5316]"),"\uff1a\u8f6c\u6362 ",Object(b.b)("inlineCode",{parentName:"li"},"Html")," \u591a\u8bed\u8a00"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.SetCulture(\u533a\u57df\u7801)"),"\uff1a\u8bbe\u7f6e\u5f53\u524d\u8bed\u8a00\u533a\u57df"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"L.GetCultures()"),"\uff1a\u83b7\u53d6\u7cfb\u7edf\u652f\u6301\u7684\u591a\u8bed\u8a00\u5217\u8868")),Object(b.b)("h2",{id:"215-\u4f7f\u7528\u4f8b\u5b50"},"21.5 \u4f7f\u7528\u4f8b\u5b50"),Object(b.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u914d\u7f6e\u6b65\u9aa4\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"p"},"L")," \u9759\u6001\u7c7b\u5728\u4ee3\u7801\u4efb\u4f55\u4f4d\u7f6e\u4f7f\u7528\u4e86\uff0c\u5982\uff1a"),Object(b.b)("h3",{id:"2151-\u5728\u7c7b\u4e2d\u4f7f\u7528"},"21.5.1 \u5728\u7c7b\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'// \u6587\u672c\u591a\u8bed\u8a00\nvar apiInterface = L.Text["API \u63a5\u53e3"];\nvar sourceCode = L.Text["\u6e90\u7801\u5730\u5740"];\n\n// HTML \u6807\u8bb0\u591a\u8bed\u8a00\nvar name = L.Html["Hello {0}", name];\n')),Object(b.b)("h3",{id:"2152-\u5728\u89c6\u56fe\u4e2d\u4f7f\u7528"},"21.5.2 \u5728\u89c6\u56fe\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-html",metastring:"{1,6,9}","{1,6,9}":!0}),'@using Furion.Localization\n\n
\n

\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002

\n

\n @L.Text["API \u63a5\u53e3"]      @L.Text["\u6e90\u7801\u5730\u5740"]\n

\n
\n')),Object(b.b)("h3",{id:"2153-\u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528"},"21.5.3 \u5728\u9a8c\u8bc1\u7279\u6027\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'[Required(ErrorMessage = "\u5fc5\u586b\u6d88\u606f")]\n')),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u6240\u6709\u9a8c\u8bc1\u7279\u6027\u5df2\u7ecf\u81ea\u52a8\u652f\u6301\u591a\u8bed\u8a00\u914d\u7f6e\u4e86\uff0c\u65e0\u9700\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"strong"},"L.Text[]")," \u8c03\u7528\u3002")),Object(b.b)("h3",{id:"2154-\u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528"},"21.5.4 \u5728\u5f02\u5e38\u6d88\u606f\u4e2d\u4f7f\u7528"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),'using Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n [ErrorCodeType]\n public enum ErrorCodes\n {\n [ErrorCodeItemMetadata("\u7528\u6237\u540d\u4e0d\u80fd\u4e3a\u7a7a")]\n z1000\n }\n}\n')),Object(b.b)("p",null,Object(b.b)("strong",{parentName:"p"},"\u6240\u6709\u5f02\u5e38\u6d88\u606f\u7279\u6027\u5df2\u7ecf\u81ea\u52a8\u652f\u6301\u591a\u8bed\u8a00\u914d\u7f6e\u4e86\uff0c\u65e0\u9700\u901a\u8fc7 ",Object(b.b)("inlineCode",{parentName:"strong"},"L.Text[]")," \u8c03\u7528\u3002")),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"throw Oops.Oh(ErrorCodes.z1000); // \u81ea\u52a8\u5e94\u7528\u591a\u8bed\u8a00\n")),Object(b.b)("h2",{id:"216-\u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6"},"21.6 \u521b\u5efa\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6"),Object(b.b)("p",null,"\u5728 ",Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5982\u679c\u6ca1\u627e\u5230\u5bf9\u5e94\u7684\u8bed\u8a00\u7ffb\u8bd1\u6587\u4ef6\uff0c\u5219\u81ea\u52a8\u663e\u793a\u5b57\u7b26\u4e32\u6587\u672c\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'L.Text["\u6ca1\u627e\u5230"]; // => \u5982\u679c\u8bbe\u7f6e\u4e3a\u82f1\u6587\uff0c\u4f46\u662f\u6ca1\u6709\u6587\u4ef6\uff0c\u5219\u76f4\u63a5\u8f93\u51fa \u201c\u6ca1\u627e\u5230\u201d\n')),Object(b.b)("h3",{id:"2161-\u5728-resources-\u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6"},"21.6.1 \u5728 ",Object(b.b)("inlineCode",{parentName:"h3"},"Resources")," \u6587\u4ef6\u5939\u4e2d\u521b\u5efa\u8bed\u8a00\u6587\u4ef6"),Object(b.b)("p",null,"\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u521a\u521a\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"Resources")," \u6587\u4ef6\u5939\u4e2d\u6dfb\u52a0 ",Object(b.b)("inlineCode",{parentName:"p"},"\u8d44\u6e90\u6587\u4ef6")," \u5373\u53ef\uff0c\u8d44\u6e90\u6587\u4ef6\u547d\u540d\u89c4\u5219\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"Lang.\u533a\u57df\u7801.resx"),"\uff0c\u5982\uff1a",Object(b.b)("inlineCode",{parentName:"p"},"Lang.en-US.resx"),"\u3002"),Object(b.b)("img",{src:Object(r.a)("img/lang2.png")}),Object(b.b)("img",{src:Object(r.a)("img/lang3.png")}),Object(b.b)("p",null),Object(b.b)("p",null,"\u63a5\u4e0b\u6765\uff0c\u53ea\u9700\u8981\u628a\u5bf9\u5e94\u8bed\u8a00\u7248\u672c\u7684\u952e\u503c\u5bf9\u586b\u5199\u5373\u53ef\u3002"),Object(b.b)("h2",{id:"217-\u5207\u6362\u8bed\u8a00"},"21.7 \u5207\u6362\u8bed\u8a00"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u4e09\u79cd\u8bed\u8a00\u5207\u6362\u65b9\u5f0f\u8fdb\u884c\u5207\u6362\u8bed\u8a00\uff1a"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"URL \u53c2\u6570")," \u65b9\u5f0f\uff1a ",Object(b.b)("inlineCode",{parentName:"li"},"?culture=en-US"),"\uff0c",Object(b.b)("strong",{parentName:"li"},"\u6b64\u65b9\u5f0f\u4f18\u5148\u7ea7\u6700\u9ad8"),"\uff0c\u683c\u5f0f\u4e3a\uff1a",Object(b.b)("inlineCode",{parentName:"li"},"culture=\u533a\u57df\u7801")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"Cookies")," \u65b9\u5f0f\uff1a\u8c03\u7528 ",Object(b.b)("inlineCode",{parentName:"li"},"L.SetCulture(\u533a\u57df\u7801)")," \u65b9\u5f0f\u5207\u6362"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5339\u914d"),"\uff1a\u5982\u679c\u524d\u9762\u4e24\u79cd\u65b9\u5f0f\u90fd\u6ca1\u6709\u8bbe\u7f6e\uff0c",Object(b.b)("strong",{parentName:"li"},"\u652f\u6301\u81ea\u52a8\u6839\u636e\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u8fdb\u884c\u5339\u914d\u3002"))),Object(b.b)("h3",{id:"2171-url-\u53c2\u6570-\u65b9\u5f0f"},"21.7.1 ",Object(b.b)("inlineCode",{parentName:"h3"},"URL \u53c2\u6570")," \u65b9\u5f0f"),Object(b.b)("img",{src:Object(r.a)("img/lang4.gif")}),Object(b.b)("h3",{id:"2172-cookies-\u65b9\u5f0f"},"21.7.2 ",Object(b.b)("inlineCode",{parentName:"h3"},"Cookies")," \u65b9\u5f0f"),Object(b.b)("p",null,"\u6b64\u65b9\u5f0f\u53ea\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a ",Object(b.b)("inlineCode",{parentName:"p"},"api")," \u6216\u8bbe\u7f6e\u4ee3\u7801\u5373\u53ef\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),'L.SetCulture("en-US"); // en-US \u4e5f\u53ef\u4ee5\u901a\u8fc7\u524d\u7aef\u4f20\u9012\u8fc7\u6765\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4e0d\u7528 `culture` \u53c2\u6570\u4e86\uff0c\u53ef\u4ee5\u81ea\u5b9a\u4e49\u53c2\u6570\u3002\n')),Object(b.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u76f4\u63a5\u6839\u636e\u5ba2\u6237\u7aef\u5b58\u50a8\u7684 ",Object(b.b)("inlineCode",{parentName:"p"},"cookies")," \u81ea\u52a8\u5207\u6362\u4e86\u3002"),Object(b.b)("h3",{id:"2173-\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362"},"21.7.3 ",Object(b.b)("inlineCode",{parentName:"h3"},"\u5ba2\u6237\u7aef\u6d4f\u89c8\u5668\u8bed\u8a00\u81ea\u52a8\u5207\u6362")),Object(b.b)("p",null,"\u63a8\u8350\u6b64\u65b9\u5f0f\uff0c\u53ef\u4ee5\u81ea\u52a8\u6839\u636e\u6d4f\u89c8\u5668\u7684\u8bed\u8a00\u81ea\u52a8\u914d\u7f6e\uff1a"),Object(b.b)("img",{src:Object(r.a)("img/lang5.gif")}),Object(b.b)("h2",{id:"218-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528"},"21.8 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\u4f7f\u7528"),Object(b.b)("p",null,Object(b.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e5f\u517c\u5bb9 ",Object(b.b)("inlineCode",{parentName:"p"},".NET Core")," \u81ea\u5e26\u7684\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f\uff0c\u5982\uff1a"),Object(b.b)("pre",null,Object(b.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs",metastring:"{3,5,7,12}","{3,5,7,12}":!0}),' public class TestController : Controller\n {\n private readonly IStringLocalizer _localizer;\n\n public TestController(IStringLocalizerFactory factory)\n {\n _localizer = factory.Create(L.LangType);\n }\n\n public IActionResult About()\n {\n ViewData["Message"] = _localizer["Your application description page."];\n }\n }\n')),Object(b.b)("h2",{id:"219-localizationsettings-\u914d\u7f6e"},"21.9 ",Object(b.b)("inlineCode",{parentName:"h2"},"LocalizationSettings")," \u914d\u7f6e"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"LocalizationSettings")," \u591a\u8bed\u8a00\u914d\u7f6e\u6839\u8282\u70b9",Object(b.b)("ul",{parentName:"li"},Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"ResourcesPath"),"\uff1a\u8d44\u6e90\u76ee\u5f55\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(b.b)("inlineCode",{parentName:"li"},"Resources")),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"SupportedCultures"),"\uff1a\u652f\u6301\u7684\u8bed\u8a00\u533a\u57df\u7801\u7c7b\u522b\uff0c",Object(b.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(b.b)("li",{parentName:"ul"},Object(b.b)("inlineCode",{parentName:"li"},"DefaultCulture"),"\uff1a\u9ed8\u8ba4\u8bed\u8a00\u533a\u57df\u7801\uff0c\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u53d6 ",Object(b.b)("inlineCode",{parentName:"li"},"SupportedCultures")," \u7b2c\u4e00\u9879")))),Object(b.b)("h2",{id:"2110-\u533a\u57df\u7801\u5217\u8868"},"21.10 \u533a\u57df\u7801\u5217\u8868"),Object(b.b)("ul",null,Object(b.b)("li",{parentName:"ul"},"af \u516c\u7528\u8377\u5170\u8bed"),Object(b.b)("li",{parentName:"ul"},"af-ZA \u516c\u7528\u8377\u5170\u8bed - \u5357\u975e"),Object(b.b)("li",{parentName:"ul"},"sq \u963f\u5c14\u5df4\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"sq-AL \u963f\u5c14\u5df4\u5c3c\u4e9a -\u963f\u5c14\u5df4\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ar \u963f\u62c9\u4f2f\u8bed"),Object(b.b)("li",{parentName:"ul"},"ar-DZ \u963f\u62c9\u4f2f\u8bed -\u963f\u5c14\u53ca\u5229\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ar-BH \u963f\u62c9\u4f2f\u8bed -\u5df4\u6797"),Object(b.b)("li",{parentName:"ul"},"ar-EG \u963f\u62c9\u4f2f\u8bed -\u57c3\u53ca"),Object(b.b)("li",{parentName:"ul"},"ar-IQ \u963f\u62c9\u4f2f\u8bed -\u4f0a\u62c9\u514b"),Object(b.b)("li",{parentName:"ul"},"ar-JO \u963f\u62c9\u4f2f\u8bed -\u7ea6\u65e6"),Object(b.b)("li",{parentName:"ul"},"ar-KW \u963f\u62c9\u4f2f\u8bed -\u79d1\u5a01\u7279"),Object(b.b)("li",{parentName:"ul"},"ar-LB \u963f\u62c9\u4f2f\u8bed -\u9ece\u5df4\u5ae9"),Object(b.b)("li",{parentName:"ul"},"ar-LY \u963f\u62c9\u4f2f\u8bed -\u5229\u6bd4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ar-MA \u963f\u62c9\u4f2f\u8bed -\u6469\u6d1b\u54e5"),Object(b.b)("li",{parentName:"ul"},"ar-OM \u963f\u62c9\u4f2f\u8bed -\u963f\u66fc"),Object(b.b)("li",{parentName:"ul"},"ar-QA \u963f\u62c9\u4f2f\u8bed -\u5361\u5854\u5c14"),Object(b.b)("li",{parentName:"ul"},"ar-SA \u963f\u62c9\u4f2f\u8bed - \u6c99\u7279\u963f\u62c9\u4f2f"),Object(b.b)("li",{parentName:"ul"},"ar-SY \u963f\u62c9\u4f2f\u8bed -\u53d9\u5229\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"ar-TN \u963f\u62c9\u4f2f\u8bed -\u5317\u975e\u7684\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"ar-AE \u963f\u62c9\u4f2f\u8bed - \u963f\u62c9\u4f2f\u8054\u5408\u914b\u957f\u56fd"),Object(b.b)("li",{parentName:"ul"},"ar-YE \u963f\u62c9\u4f2f\u8bed -\u4e5f\u95e8"),Object(b.b)("li",{parentName:"ul"},"hy \u4e9a\u7f8e\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"hy-AM \u4e9a\u7f8e\u5c3c\u4e9a\u7684 -\u4e9a\u7f8e\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"az Azeri"),Object(b.b)("li",{parentName:"ul"},"az-AZ-Cyrl Azeri-(\u897f\u91cc\u5c14\u5b57\u6bcd\u7684) \u963f\u585e\u62dc\u7586"),Object(b.b)("li",{parentName:"ul"},"az-AZ-Latn Azeri(\u62c9\u4e01\u6587)- \u963f\u585e\u62dc\u7586"),Object(b.b)("li",{parentName:"ul"},"eu \u5df4\u65af\u514b"),Object(b.b)("li",{parentName:"ul"},"eu-ES \u5df4\u65af\u514b -\u5df4\u65af\u514b"),Object(b.b)("li",{parentName:"ul"},"be Belarusian"),Object(b.b)("li",{parentName:"ul"},"be-BY Belarusian-\u767d\u4fc4\u7f57\u65af"),Object(b.b)("li",{parentName:"ul"},"bg \u4fdd\u52a0\u5229\u4e9a"),Object(b.b)("li",{parentName:"ul"},"bg-BG \u4fdd\u52a0\u5229\u4e9a -\u4fdd\u52a0\u5229\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ca \u5609\u6cf0\u7f57\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ca-ES \u5609\u6cf0\u7f57\u5c3c\u4e9a -\u5609\u6cf0\u7f57\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"zh-HK \u534e - \u9999\u6e2f\u7684 SAR"),Object(b.b)("li",{parentName:"ul"},"zh-MO \u534e - \u6fb3\u95e8\u7684 SAR"),Object(b.b)("li",{parentName:"ul"},"zh-CN \u534e -\u4e2d\u56fd"),Object(b.b)("li",{parentName:"ul"},"zh-CHS \u534e (\u5355\u4e00\u5316)"),Object(b.b)("li",{parentName:"ul"},"zh-SG \u534e -\u65b0\u52a0\u5761"),Object(b.b)("li",{parentName:"ul"},"zh-TW \u534e -\u53f0\u6e7e"),Object(b.b)("li",{parentName:"ul"},"zh-CHT \u534e (\u4f20\u7edf\u7684)"),Object(b.b)("li",{parentName:"ul"},"hr \u514b\u7f57\u57c3\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"hr-HR \u514b\u7f57\u57c3\u897f\u4e9a -\u514b\u7f57\u57c3\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"cs \u6377\u514b"),Object(b.b)("li",{parentName:"ul"},"cs-CZ \u6377\u514b - \u6377\u514b"),Object(b.b)("li",{parentName:"ul"},"da \u4e39\u9ea6\u6587"),Object(b.b)("li",{parentName:"ul"},"da-DK \u4e39\u9ea6\u6587 -\u4e39\u9ea6"),Object(b.b)("li",{parentName:"ul"},"div Dhivehi"),Object(b.b)("li",{parentName:"ul"},"div-MV Dhivehi-\u9a6c\u5c14\u4ee3\u592b"),Object(b.b)("li",{parentName:"ul"},"nl \u8377\u5170"),Object(b.b)("li",{parentName:"ul"},"nl-BE \u8377\u5170 -\u6bd4\u5229\u65f6"),Object(b.b)("li",{parentName:"ul"},"nl-NL \u8377\u5170 - \u8377\u5170"),Object(b.b)("li",{parentName:"ul"},"en \u82f1\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-AU \u82f1\u56fd -\u6fb3\u6d32"),Object(b.b)("li",{parentName:"ul"},"en-BZ \u82f1\u56fd -\u4f2f\u5229\u5179"),Object(b.b)("li",{parentName:"ul"},"en-CA \u82f1\u56fd -\u52a0\u62ff\u5927"),Object(b.b)("li",{parentName:"ul"},"en-CB \u82f1\u56fd -\u52a0\u52d2\u6bd4\u6d77"),Object(b.b)("li",{parentName:"ul"},"en-IE \u82f1\u56fd -\u7231\u5c14\u5170"),Object(b.b)("li",{parentName:"ul"},"en-JM \u82f1\u56fd -\u7259\u4e70\u52a0"),Object(b.b)("li",{parentName:"ul"},"en-NZ \u82f1\u56fd - \u65b0\u897f\u5170"),Object(b.b)("li",{parentName:"ul"},"en-PH \u82f1\u56fd -\u83f2\u5f8b\u5bbe\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-ZA \u82f1\u56fd - \u5357\u975e"),Object(b.b)("li",{parentName:"ul"},"en-TT \u82f1\u56fd - \u5343\u91cc\u8fbe\u6258\u8d1d\u54e5\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-GB \u82f1\u56fd - \u82f1\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-US \u82f1\u56fd - \u7f8e\u56fd"),Object(b.b)("li",{parentName:"ul"},"en-ZW \u82f1\u56fd -\u6d25\u5df4\u5e03\u97e6"),Object(b.b)("li",{parentName:"ul"},"et \u7231\u6c99\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"et-EE \u7231\u6c99\u5c3c\u4e9a\u7684 -\u7231\u6c99\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"fo Faroese"),Object(b.b)("li",{parentName:"ul"},"fo-FO Faroese- \u6cd5\u7f57\u7fa4\u5c9b"),Object(b.b)("li",{parentName:"ul"},"fa \u6ce2\u65af\u8bed"),Object(b.b)("li",{parentName:"ul"},"fa-IR \u6ce2\u65af\u8bed -\u4f0a\u6717\u738b\u56fd"),Object(b.b)("li",{parentName:"ul"},"fi \u82ac\u5170\u8bed"),Object(b.b)("li",{parentName:"ul"},"fi-FI \u82ac\u5170\u8bed -\u82ac\u5170"),Object(b.b)("li",{parentName:"ul"},"fr \u6cd5\u56fd"),Object(b.b)("li",{parentName:"ul"},"fr-BE \u6cd5\u56fd -\u6bd4\u5229\u65f6"),Object(b.b)("li",{parentName:"ul"},"fr-CA \u6cd5\u56fd -\u52a0\u62ff\u5927"),Object(b.b)("li",{parentName:"ul"},"fr-FR \u6cd5\u56fd -\u6cd5\u56fd"),Object(b.b)("li",{parentName:"ul"},"fr-LU \u6cd5\u56fd -\u5362\u68ee\u5821"),Object(b.b)("li",{parentName:"ul"},"fr-MC \u6cd5\u56fd -\u6469\u7eb3\u54e5"),Object(b.b)("li",{parentName:"ul"},"fr-CH \u6cd5\u56fd -\u745e\u58eb"),Object(b.b)("li",{parentName:"ul"},"gl \u52a0\u5229\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"gl-ES \u52a0\u5229\u897f\u4e9a -\u52a0\u5229\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ka \u683c\u9c81\u5409\u4e9a\u5dde"),Object(b.b)("li",{parentName:"ul"},"ka-GE \u683c\u9c81\u5409\u4e9a\u5dde -\u683c\u9c81\u5409\u4e9a\u5dde"),Object(b.b)("li",{parentName:"ul"},"de \u5fb7\u56fd"),Object(b.b)("li",{parentName:"ul"},"de-AT \u5fb7\u56fd -\u5965\u5730\u5229"),Object(b.b)("li",{parentName:"ul"},"de-DE \u5fb7\u56fd -\u5fb7\u56fd"),Object(b.b)("li",{parentName:"ul"},"de-LI \u5fb7\u56fd -\u5217\u652f\u6566\u58eb\u767b"),Object(b.b)("li",{parentName:"ul"},"de-LU \u5fb7\u56fd -\u5362\u68ee\u5821"),Object(b.b)("li",{parentName:"ul"},"de-CH \u5fb7\u56fd -\u745e\u58eb"),Object(b.b)("li",{parentName:"ul"},"el \u5e0c\u814a"),Object(b.b)("li",{parentName:"ul"},"el-GR \u5e0c\u814a -\u5e0c\u814a"),Object(b.b)("li",{parentName:"ul"},"gu Gujarati"),Object(b.b)("li",{parentName:"ul"},"gu-IN Gujarati-\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"he \u5e0c\u4f2f\u6765"),Object(b.b)("li",{parentName:"ul"},"he-IL \u5e0c\u4f2f\u6765 -\u4ee5\u8272\u5217"),Object(b.b)("li",{parentName:"ul"},"hi \u5317\u5370\u5ea6\u8bed"),Object(b.b)("li",{parentName:"ul"},"hi-IN \u5317\u5370\u5ea6\u7684 -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"hu \u5308\u7259\u5229"),Object(b.b)("li",{parentName:"ul"},"hu-HU \u5308\u7259\u5229\u7684 -\u5308\u7259\u5229"),Object(b.b)("li",{parentName:"ul"},"is \u51b0\u5c9b\u8bed"),Object(b.b)("li",{parentName:"ul"},"is-IS \u51b0\u5c9b\u7684 -\u51b0\u5c9b"),Object(b.b)("li",{parentName:"ul"},"id \u5370\u5c3c"),Object(b.b)("li",{parentName:"ul"},"id-ID \u5370\u5c3c -\u5370\u5c3c"),Object(b.b)("li",{parentName:"ul"},"it \u610f\u5927\u5229"),Object(b.b)("li",{parentName:"ul"},"it-IT \u610f\u5927\u5229 -\u610f\u5927\u5229"),Object(b.b)("li",{parentName:"ul"},"it-CH \u610f\u5927\u5229 -\u745e\u58eb"),Object(b.b)("li",{parentName:"ul"},"ja \u65e5\u672c"),Object(b.b)("li",{parentName:"ul"},"ja-JP \u65e5\u672c -\u65e5\u672c"),Object(b.b)("li",{parentName:"ul"},"kn \u5361\u7eb3\u8fbe\u8bed"),Object(b.b)("li",{parentName:"ul"},"kn-IN \u5361\u7eb3\u8fbe\u8bed -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"kk Kazakh"),Object(b.b)("li",{parentName:"ul"},"kk-KZ Kazakh-\u54c8\u8428\u514b"),Object(b.b)("li",{parentName:"ul"},"kok Konkani"),Object(b.b)("li",{parentName:"ul"},"kok-IN Konkani-\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"ko \u97e9\u56fd"),Object(b.b)("li",{parentName:"ul"},"ko-KR \u97e9\u56fd -\u97e9\u56fd"),Object(b.b)("li",{parentName:"ul"},"ky Kyrgyz"),Object(b.b)("li",{parentName:"ul"},"ky-KZ Kyrgyz-\u54c8\u8428\u514b"),Object(b.b)("li",{parentName:"ul"},"lv \u62c9\u8131\u7ef4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"lv-LV \u62c9\u8131\u7ef4\u4e9a\u7684 -\u62c9\u8131\u7ef4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"lt \u7acb\u9676\u5b9b"),Object(b.b)("li",{parentName:"ul"},"lt-LT \u7acb\u9676\u5b9b -\u7acb\u9676\u5b9b"),Object(b.b)("li",{parentName:"ul"},"mk \u9a6c\u5176\u987f"),Object(b.b)("li",{parentName:"ul"},"mk-MK \u9a6c\u5176\u987f -FYROM"),Object(b.b)("li",{parentName:"ul"},"ms \u9a6c\u6765"),Object(b.b)("li",{parentName:"ul"},"ms-BN \u9a6c\u6765 -\u6c76\u83b1"),Object(b.b)("li",{parentName:"ul"},"ms-MY \u9a6c\u6765 -\u9a6c\u6765\u897f\u4e9a"),Object(b.b)("li",{parentName:"ul"},"mr \u9a6c\u62c9\u5730\u8bed"),Object(b.b)("li",{parentName:"ul"},"mr-IN \u9a6c\u62c9\u5730\u8bed -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"mn \u8499\u53e4"),Object(b.b)("li",{parentName:"ul"},"mn-MN \u8499\u53e4 -\u8499\u53e4"),Object(b.b)("li",{parentName:"ul"},"no \u632a\u5a01"),Object(b.b)("li",{parentName:"ul"},"nb-NO \u632a\u5a01 (Bokm?l) - \u632a\u5a01"),Object(b.b)("li",{parentName:"ul"},"nn-NO \u632a\u5a01 (Nynorsk)- \u632a\u5a01"),Object(b.b)("li",{parentName:"ul"},"pl \u6ce2\u5170"),Object(b.b)("li",{parentName:"ul"},"pl-PL \u6ce2\u5170 -\u6ce2\u5170"),Object(b.b)("li",{parentName:"ul"},"pt \u8461\u8404\u7259"),Object(b.b)("li",{parentName:"ul"},"pt-BR \u8461\u8404\u7259 -\u5df4\u897f"),Object(b.b)("li",{parentName:"ul"},"pt-PT \u8461\u8404\u7259 -\u8461\u8404\u7259"),Object(b.b)("li",{parentName:"ul"},"pa Punjab \u8bed"),Object(b.b)("li",{parentName:"ul"},"pa-IN Punjab \u8bed -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"ro \u7f57\u9a6c\u5c3c\u4e9a\u8bed"),Object(b.b)("li",{parentName:"ul"},"ro-RO \u7f57\u9a6c\u5c3c\u4e9a\u8bed -\u7f57\u9a6c\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"ru \u4fc4\u56fd"),Object(b.b)("li",{parentName:"ul"},"ru-RU \u4fc4\u56fd -\u4fc4\u56fd"),Object(b.b)("li",{parentName:"ul"},"sa \u68b5\u6587"),Object(b.b)("li",{parentName:"ul"},"sa-IN \u68b5\u6587 -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"sr-SP-Cyrl \u585e\u5c14\u7ef4\u4e9a -(\u897f\u91cc\u5c14\u5b57\u6bcd\u7684) \u585e\u5c14\u7ef4\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"sr-SP-Latn \u585e\u5c14\u7ef4\u4e9a (\u62c9\u4e01\u6587)- \u585e\u5c14\u7ef4\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"sk \u65af\u6d1b\u4f10\u514b"),Object(b.b)("li",{parentName:"ul"},"sk-SK \u65af\u6d1b\u4f10\u514b -\u65af\u6d1b\u4f10\u514b"),Object(b.b)("li",{parentName:"ul"},"sl \u65af\u6d1b\u6587\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"sl-SI \u65af\u6d1b\u6587\u5c3c\u4e9a -\u65af\u6d1b\u6587\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"es \u897f\u73ed\u7259"),Object(b.b)("li",{parentName:"ul"},"es-AR \u897f\u73ed\u7259 -\u963f\u6839\u5ef7"),Object(b.b)("li",{parentName:"ul"},"es-BO \u897f\u73ed\u7259 -\u73bb\u5229\u7ef4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"es-CL \u897f\u73ed\u7259 -\u667a\u5229"),Object(b.b)("li",{parentName:"ul"},"es-CO \u897f\u73ed\u7259 -\u54e5\u4f26\u6bd4\u4e9a"),Object(b.b)("li",{parentName:"ul"},"es-CR \u897f\u73ed\u7259 - \u54e5\u65af\u8fbe\u9ece\u52a0"),Object(b.b)("li",{parentName:"ul"},"es-DO \u897f\u73ed\u7259 - \u591a\u7c73\u5c3c\u52a0\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"es-EC \u897f\u73ed\u7259 -\u5384\u74dc\u591a\u5c14"),Object(b.b)("li",{parentName:"ul"},"es-SV \u897f\u73ed\u7259 - \u8428\u5c14\u74e6\u591a"),Object(b.b)("li",{parentName:"ul"},"es-GT \u897f\u73ed\u7259 -\u5371\u5730\u9a6c\u62c9"),Object(b.b)("li",{parentName:"ul"},"es-HN \u897f\u73ed\u7259 -\u6d2a\u90fd\u62c9\u65af"),Object(b.b)("li",{parentName:"ul"},"es-MX \u897f\u73ed\u7259 -\u58a8\u897f\u54e5"),Object(b.b)("li",{parentName:"ul"},"es-NI \u897f\u73ed\u7259 -\u5c3c\u52a0\u62c9\u74dc"),Object(b.b)("li",{parentName:"ul"},"es-PA \u897f\u73ed\u7259 -\u5df4\u62ff\u9a6c"),Object(b.b)("li",{parentName:"ul"},"es-PY \u897f\u73ed\u7259 -\u5df4\u62c9\u572d"),Object(b.b)("li",{parentName:"ul"},"es-PE \u897f\u73ed\u7259 -\u79d8\u9c81"),Object(b.b)("li",{parentName:"ul"},"es-PR \u897f\u73ed\u7259 - \u6ce2\u591a\u9ece\u5404"),Object(b.b)("li",{parentName:"ul"},"es-ES \u897f\u73ed\u7259 -\u897f\u73ed\u7259"),Object(b.b)("li",{parentName:"ul"},"es-UY \u897f\u73ed\u7259 -\u4e4c\u62c9\u572d"),Object(b.b)("li",{parentName:"ul"},"es-VE \u897f\u73ed\u7259 -\u59d4\u5185\u745e\u62c9"),Object(b.b)("li",{parentName:"ul"},"sw Swahili"),Object(b.b)("li",{parentName:"ul"},"sw-KE Swahili-\u80af\u5c3c\u4e9a"),Object(b.b)("li",{parentName:"ul"},"sv \u745e\u5178"),Object(b.b)("li",{parentName:"ul"},"sv-FI \u745e\u5178 -\u82ac\u5170"),Object(b.b)("li",{parentName:"ul"},"sv-SE \u745e\u5178 -\u745e\u5178"),Object(b.b)("li",{parentName:"ul"},"syr Syriac"),Object(b.b)("li",{parentName:"ul"},"syr-SY Syriac-\u53d9\u5229\u4e9a\u5171\u548c\u56fd"),Object(b.b)("li",{parentName:"ul"},"ta \u5766\u7c73\u5c14"),Object(b.b)("li",{parentName:"ul"},"ta-IN \u5766\u7c73\u5c14 -\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"tt Tatar"),Object(b.b)("li",{parentName:"ul"},"tt-RU Tatar-\u4fc4\u56fd"),Object(b.b)("li",{parentName:"ul"},"te Telugu"),Object(b.b)("li",{parentName:"ul"},"te-IN Telugu-\u5370\u5ea6"),Object(b.b)("li",{parentName:"ul"},"th \u6cf0\u56fd"),Object(b.b)("li",{parentName:"ul"},"th-TH \u6cf0\u56fd -\u6cf0\u56fd"),Object(b.b)("li",{parentName:"ul"},"tr \u571f\u8033\u5176\u8bed"),Object(b.b)("li",{parentName:"ul"},"tr-TR \u571f\u8033\u5176\u8bed -\u571f\u8033\u5176"),Object(b.b)("li",{parentName:"ul"},"uk \u4e4c\u514b\u5170"),Object(b.b)("li",{parentName:"ul"},"uk-UA \u4e4c\u514b\u5170 -\u4e4c\u514b\u5170"),Object(b.b)("li",{parentName:"ul"},"ur Urdu"),Object(b.b)("li",{parentName:"ul"},"ur-PK Urdu-\u5df4\u57fa\u65af\u5766"),Object(b.b)("li",{parentName:"ul"},"uz Uzbek"),Object(b.b)("li",{parentName:"ul"},"uz-UZ-Cyrl Uzbek-(\u897f\u91cc\u5c14\u5b57\u6bcd\u7684) \u4e4c\u5179\u522b\u514b\u65af\u5766"),Object(b.b)("li",{parentName:"ul"},"uz-UZ-Latn Uzbek(\u62c9\u4e01\u6587)- \u4e4c\u5179\u522b\u514b\u65af\u5766"),Object(b.b)("li",{parentName:"ul"},"vi \u8d8a\u5357"),Object(b.b)("li",{parentName:"ul"},"vi-VN \u8d8a\u5357 -\u8d8a\u5357")),Object(b.b)("h2",{id:"2111-\u53cd\u9988\u4e0e\u5efa\u8bae"},"21.11 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(b.b)("a",Object(n.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(b.b)("hr",null),Object(b.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(b.b)("h5",{parentName:"div"},Object(b.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(b.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(b.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(b.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(b.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(b.b)("inlineCode",{parentName:"p"},"\u591a\u8bed\u8a00")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(b.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/localization?view=aspnetcore-5.0"}),"ASP.NET Core - \u5168\u5c40\u5316\u548c\u672c\u5730\u5316")," \u7ae0\u8282\u3002"))))}O.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/25d2ee50.4422b922.js b/docs/25d2ee50.d3267e77.js similarity index 94% rename from docs/25d2ee50.4422b922.js rename to docs/25d2ee50.d3267e77.js index 963511144e1..b98fe373b93 100644 --- a/docs/25d2ee50.4422b922.js +++ b/docs/25d2ee50.d3267e77.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=i.a.createContext({}),u=function(e){var t=i.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return i.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,m=b["".concat(o,".").concat(d)]||b[d]||p[d]||a;return n?i.a.createElement(m,c(c({ref:t},l),{},{components:n})):i.a.createElement(m,c({ref:t},l))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},90:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),i=n(7),a=(n(0),n(192)),o=n(193),c={id:"corsaccessorsettings",title:"2. \u8de8\u57df\u914d\u7f6e",sidebar_label:"2. \u8de8\u57df\u914d\u7f6e"},s={unversionedId:"settings/corsaccessorsettings",id:"settings/corsaccessorsettings",isDocsHomePage:!1,title:"2. \u8de8\u57df\u914d\u7f6e",description:"2.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\corsaccessorsettings.mdx",slug:"/settings/corsaccessorsettings",permalink:"/docs/settings/corsaccessorsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/corsaccessorsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2. \u8de8\u57df\u914d\u7f6e",sidebar:"settings",previous:{title:"1. \u5e94\u7528\u914d\u7f6e",permalink:"/docs/settings/appsettings"},next:{title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",permalink:"/docs/settings/validationTypemessagesettings"}},l=[{value:"2.1 \u5173\u4e8e\u914d\u7f6e",id:"21-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"2.2 \u914d\u7f6e\u4fe1\u606f",id:"22-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"2.3 \u914d\u7f6e\u793a\u4f8b",id:"23-\u914d\u7f6e\u793a\u4f8b",children:[]}],u={toc:l};function b(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"21-\u5173\u4e8e\u914d\u7f6e"},"2.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u8de8\u57df\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5ba2\u6237\u7aef\u8de8\u57df\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"22-\u914d\u7f6e\u4fe1\u606f"},"2.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"CorsAccessorSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"PolicyName"),"\uff1a\u8de8\u57df\u7b56\u7565\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"sting")," \u7c7b\u578b\uff0c\u5fc5\u586b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"FurCorsAccessor")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithOrigins"),"\uff1a\u5141\u8bb8\u8de8\u57df\u7684\u57df\u540d\u5217\u8868\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},'[ "http://localhost:4200" ]')),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithHeaders"),"\uff1a\u8bf7\u6c42\u8868\u5934\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\u8868\u5934\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithExposedHeaders"),"\uff1a\u54cd\u5e94\u6807\u5934\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithMethods"),"\uff1a\u8bbe\u7f6e\u8de8\u57df\u5141\u8bb8\u8bf7\u6c42\u8c13\u8bcd\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AllowCredentials"),"\uff1a\u8de8\u57df\u8bf7\u6c42\u4e2d\u7684\u51ed\u636e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SetPreflightMaxAge"),"\uff1a\u8bbe\u7f6e\u9884\u68c0\u8fc7\u671f\u65f6\u95f4\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"int")," \u7c7b\u578b")))),Object(a.b)("h2",{id:"23-\u914d\u7f6e\u793a\u4f8b"},"2.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "CorsAccessorSettings": {\n "PolicyName": "MyPolicy",\n "WithOrigins": ["http://localhost:4200", "https://furion.pro"]\n }\n}\n')))}b.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=i.a.createContext({}),u=function(e){var t=i.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return i.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,m=b["".concat(o,".").concat(d)]||b[d]||p[d]||a;return n?i.a.createElement(m,c(c({ref:t},l),{},{components:n})):i.a.createElement(m,c({ref:t},l))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},90:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),i=n(7),a=(n(0),n(196)),o=n(197),c={id:"corsaccessorsettings",title:"2. \u8de8\u57df\u914d\u7f6e",sidebar_label:"2. \u8de8\u57df\u914d\u7f6e"},s={unversionedId:"settings/corsaccessorsettings",id:"settings/corsaccessorsettings",isDocsHomePage:!1,title:"2. \u8de8\u57df\u914d\u7f6e",description:"2.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\corsaccessorsettings.mdx",slug:"/settings/corsaccessorsettings",permalink:"/docs/settings/corsaccessorsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/corsaccessorsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2. \u8de8\u57df\u914d\u7f6e",sidebar:"settings",previous:{title:"1. \u5e94\u7528\u914d\u7f6e",permalink:"/docs/settings/appsettings"},next:{title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",permalink:"/docs/settings/validationTypemessagesettings"}},l=[{value:"2.1 \u5173\u4e8e\u914d\u7f6e",id:"21-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"2.2 \u914d\u7f6e\u4fe1\u606f",id:"22-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"2.3 \u914d\u7f6e\u793a\u4f8b",id:"23-\u914d\u7f6e\u793a\u4f8b",children:[]}],u={toc:l};function b(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"21-\u5173\u4e8e\u914d\u7f6e"},"2.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u8de8\u57df\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5ba2\u6237\u7aef\u8de8\u57df\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"22-\u914d\u7f6e\u4fe1\u606f"},"2.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"CorsAccessorSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"PolicyName"),"\uff1a\u8de8\u57df\u7b56\u7565\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"sting")," \u7c7b\u578b\uff0c\u5fc5\u586b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"FurCorsAccessor")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithOrigins"),"\uff1a\u5141\u8bb8\u8de8\u57df\u7684\u57df\u540d\u5217\u8868\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},'[ "http://localhost:4200" ]')),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithHeaders"),"\uff1a\u8bf7\u6c42\u8868\u5934\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\u8868\u5934\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithExposedHeaders"),"\uff1a\u54cd\u5e94\u6807\u5934\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"WithMethods"),"\uff1a\u8bbe\u7f6e\u8de8\u57df\u5141\u8bb8\u8bf7\u6c42\u8c13\u8bcd\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AllowCredentials"),"\uff1a\u8de8\u57df\u8bf7\u6c42\u4e2d\u7684\u51ed\u636e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SetPreflightMaxAge"),"\uff1a\u8bbe\u7f6e\u9884\u68c0\u8fc7\u671f\u65f6\u95f4\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"int")," \u7c7b\u578b")))),Object(a.b)("h2",{id:"23-\u914d\u7f6e\u793a\u4f8b"},"2.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "CorsAccessorSettings": {\n "PolicyName": "MyPolicy",\n "WithOrigins": ["http://localhost:4200", "https://furion.pro"]\n }\n}\n')))}b.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/2792faa0.cf5a6e57.js b/docs/2792faa0.b3f402a3.js similarity index 90% rename from docs/2792faa0.cf5a6e57.js rename to docs/2792faa0.b3f402a3.js index 5795375002a..79e977bbe5f 100644 --- a/docs/2792faa0.cf5a6e57.js +++ b/docs/2792faa0.b3f402a3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{190:function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return a}));var n=r(21),o=r(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const a=r.startsWith(t)?r:t+r.replace(/^\//,"");return c?e+a:a}(t,e,r,n)}}function a(e,t={}){const{withBaseUrl:r}=c();return r(e,t)}},191:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(0),o=r.n(n);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,a=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(r),d=n,b=l["".concat(a,".").concat(d)]||l[d]||f[d]||c;return r?o.a.createElement(b,i(i({ref:t},s),{},{components:r})):o.a.createElement(b,i({ref:t},s))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,a=new Array(c);a[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:n,a[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},91:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return u})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return l}));var n=r(3),o=r(7),c=(r(0),r(192)),a=r(193),i={id:"grpc",title:"26. Grpc \u670d\u52a1",sidebar_label:"26. Grpc \u670d\u52a1"},u={unversionedId:"grpc",id:"grpc",isDocsHomePage:!1,title:"26. Grpc \u670d\u52a1",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1ahttps://docs.microsoft.com/zh-cn/aspnet/core/grpc/?view=aspnetcore-5.0",source:"@site/docs\\grpc.mdx",slug:"/grpc",permalink:"/docs/grpc",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/grpc.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"26. Grpc \u670d\u52a1",sidebar:"docs",previous:{title:"25. \u5373\u65f6\u901a\u8baf",permalink:"/docs/signalr"},next:{title:"27.1 \u5728 IIS \u90e8\u7f72",permalink:"/docs/deploy-iis"}},s=[],p={toc:s};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(c.b)(a.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1a",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/grpc/?view=aspnetcore-5.0"}),"https://docs.microsoft.com/zh-cn/aspnet/core/grpc/?view=aspnetcore-5.0")))}l.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[18],{194:function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return a}));var n=r(21),o=r(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const a=r.startsWith(t)?r:t+r.replace(/^\//,"");return c?e+a:a}(t,e,r,n)}}function a(e,t={}){const{withBaseUrl:r}=c();return r(e,t)}},195:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return b}));var n=r(0),o=r.n(n);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,a=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(r),d=n,b=l["".concat(a,".").concat(d)]||l[d]||f[d]||c;return r?o.a.createElement(b,i(i({ref:t},s),{},{components:r})):o.a.createElement(b,i({ref:t},s))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,a=new Array(c);a[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:n,a[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},91:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return u})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return l}));var n=r(3),o=r(7),c=(r(0),r(196)),a=r(197),i={id:"grpc",title:"26. Grpc \u670d\u52a1",sidebar_label:"26. Grpc \u670d\u52a1"},u={unversionedId:"grpc",id:"grpc",isDocsHomePage:!1,title:"26. Grpc \u670d\u52a1",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1ahttps://docs.microsoft.com/zh-cn/aspnet/core/grpc/?view=aspnetcore-5.0",source:"@site/docs\\grpc.mdx",slug:"/grpc",permalink:"/docs/grpc",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/grpc.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"26. Grpc \u670d\u52a1",sidebar:"docs",previous:{title:"25. \u5373\u65f6\u901a\u8baf",permalink:"/docs/signalr"},next:{title:"27.1 \u5728 IIS \u90e8\u7f72",permalink:"/docs/deploy-iis"}},s=[],p={toc:s};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(c.b)(a.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1a",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/grpc/?view=aspnetcore-5.0"}),"https://docs.microsoft.com/zh-cn/aspnet/core/grpc/?view=aspnetcore-5.0")))}l.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/2a4cb773.37bd835e.js b/docs/2a4cb773.6e77761e.js similarity index 96% rename from docs/2a4cb773.37bd835e.js rename to docs/2a4cb773.6e77761e.js index 0b2c7f1714a..f0b4f12e51c 100644 --- a/docs/2a4cb773.37bd835e.js +++ b/docs/2a4cb773.6e77761e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),d=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},l=function(e){var t=d(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),l=d(n),u=a,m=l["".concat(i,".").concat(u)]||l[u]||p[u]||c;return n?r.a.createElement(m,o(o({ref:t},b),{},{components:n})):r.a.createElement(m,o({ref:t},b))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},92:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return l}));var a=n(3),r=n(7),c=(n(0),n(192)),i=n(193),o={id:"dbcontext-seed-data",title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",sidebar_label:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e"},s={unversionedId:"dbcontext-seed-data",id:"dbcontext-seed-data",isDocsHomePage:!1,title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",description:"9.21.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",source:"@site/docs\\dbcontext-seed-data.mdx",slug:"/dbcontext-seed-data",permalink:"/docs/dbcontext-seed-data",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-seed-data.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",sidebar:"docs",previous:{title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",permalink:"/docs/dbcontext-code-first"},next:{title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",permalink:"/docs/dbcontext-audit"}},b=[{value:"9.21.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",id:"9211-\u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",children:[]},{value:"9.21.2 \u5982\u4f55\u914d\u7f6e",id:"9212-\u5982\u4f55\u914d\u7f6e",children:[{value:"9.21.2.1 \u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528",id:"92121-\u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528",children:[]},{value:"9.21.2.2 \u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528",id:"92122-\u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528",children:[]}]},{value:"9.21.3 \u5bfc\u822a\u5c5e\u6027",id:"9213-\u5bfc\u822a\u5c5e\u6027",children:[]},{value:"9.21.4 \u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e",id:"9214-\u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e",children:[]},{value:"9.21.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9215-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:b};function l(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},d,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9211-\u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e"},"9.21.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u79cd\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"),Object(c.b)("p",null,"\u5982\u6027\u522b\uff1a\u7537/\u5973\uff0c\u5730\u533a\uff0c\u884c\u4e1a\u4fe1\u606f\u7b49\u7b49\u3002"),Object(c.b)("h2",{id:"9212-\u5982\u4f55\u914d\u7f6e"},"9.21.2 \u5982\u4f55\u914d\u7f6e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"IEntitySeedData")," \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\u3002\u5982\u6211\u4eec\u9700\u8981\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"Person")," \u8868\u63d2\u5165\u521d\u59cb\u5316\u6570\u636e\uff1a"),Object(c.b)("h3",{id:"92121-\u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528"},"9.21.2.1 \u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,16-23}","{7,16-23}":!0}),'using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Person : EntityBase, IEntitySeedData\n {\n public string Name { get; set; }\n\n public int Age { get; set; }\n\n public string Address { get; set; }\n\n // \u914d\u7f6e\u79cd\u5b50\u6570\u636e\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Person { Id = 1, Name = "\u767e\u5c0f\u50e7", Address = "\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02" },\n new Person { Id = 2, Name = "\u65b0\u751f\u5e1d", Address = "\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02" }\n };\n }\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"\u4e3b\u952e")," \u503c\u5fc5\u987b\u624b\u52a8\u63d2\u5165\uff0c\u56e0\u4e3a\u4f1a\u81ea\u52a8\u5173\u95ed\u4e3b\u952e\u6216\u81ea\u589e\u6807\u8bc6\u68c0\u67e5\u3002"))),Object(c.b)("h3",{id:"92122-\u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528"},"9.21.2.2 \u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,9-16}","{6,9-16}":!0}),'using Furion.DatabaseAccessor;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public class PersonSeedData : IEntitySeedData\n {\n // \u914d\u7f6e\u79cd\u5b50\u6570\u636e\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Person { Id = 1, Name = "\u767e\u5c0f\u50e7", Address = "\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02" },\n new Person { Id = 2, Name = "\u65b0\u751f\u5e1d", Address = "\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02" }\n };\n }\n }\n}\n')),Object(c.b)("h2",{id:"9213-\u5bfc\u822a\u5c5e\u6027"},"9.21.3 \u5bfc\u822a\u5c5e\u6027"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u7684\u5b9e\u4f53\u6709 ",Object(c.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u591a"),"\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"\u591a\u5bf9\u591a"),"\u7b49\u5916\u952e\u5173\u7cfb\uff0c\u90a3\u4e48",Object(c.b)("strong",{parentName:"p"},"\u6211\u4eec\u9700\u8981\u5355\u72ec\u4e3a\u6bcf\u4e00\u4e2a\u5b9e\u4f53\u6dfb\u52a0\u6570\u636e\u79cd\u5b50\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u5199\u5728\u4e3b\u8868\u4e2d\u3002")),Object(c.b)("h2",{id:"9214-\u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e"},"9.21.4 \u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u6cdb\u578b\u7684\u65b9\u5f0f\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e\u8bbe\u5b9a\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,9-16}","{6,9-16}":!0}),'using Furion.DatabaseAccessor;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public class PersonSeedData : IEntitySeedData\n {\n // \u914d\u7f6e\u79cd\u5b50\u6570\u636e\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Person { Id = 1, Name = "\u767e\u5c0f\u50e7", Address = "\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02" },\n new Person { Id = 2, Name = "\u65b0\u751f\u5e1d", Address = "\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02" }\n };\n }\n }\n}\n')),Object(c.b)("p",null,"\u4e0a\u9762\u7684\u4f8b\u5b50\u8868\u793a\u540c\u65f6\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"MySqlDbContext")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"SqliteDbContext")," \u521b\u5efa\u79cd\u5b50\u6570\u636e\u3002"),Object(c.b)("h2",{id:"9215-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.21.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u79cd\u5b50")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/modeling/data-seeding"}),"EF Core - \u6570\u636e\u79cd\u5b50\u8bbe\u5b9a")," \u7ae0\u8282\u3002"))))}l.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),d=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},l=function(e){var t=d(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),l=d(n),u=a,m=l["".concat(i,".").concat(u)]||l[u]||p[u]||c;return n?r.a.createElement(m,o(o({ref:t},b),{},{components:n})):r.a.createElement(m,o({ref:t},b))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},92:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return l}));var a=n(3),r=n(7),c=(n(0),n(196)),i=n(197),o={id:"dbcontext-seed-data",title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",sidebar_label:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e"},s={unversionedId:"dbcontext-seed-data",id:"dbcontext-seed-data",isDocsHomePage:!1,title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",description:"9.21.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",source:"@site/docs\\dbcontext-seed-data.mdx",slug:"/dbcontext-seed-data",permalink:"/docs/dbcontext-seed-data",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-seed-data.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",sidebar:"docs",previous:{title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",permalink:"/docs/dbcontext-code-first"},next:{title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",permalink:"/docs/dbcontext-audit"}},b=[{value:"9.21.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",id:"9211-\u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e",children:[]},{value:"9.21.2 \u5982\u4f55\u914d\u7f6e",id:"9212-\u5982\u4f55\u914d\u7f6e",children:[{value:"9.21.2.1 \u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528",id:"92121-\u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528",children:[]},{value:"9.21.2.2 \u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528",id:"92122-\u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528",children:[]}]},{value:"9.21.3 \u5bfc\u822a\u5c5e\u6027",id:"9213-\u5bfc\u822a\u5c5e\u6027",children:[]},{value:"9.21.4 \u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e",id:"9214-\u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e",children:[]},{value:"9.21.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9215-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:b};function l(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},d,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9211-\u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e"},"9.21.1 \u4ec0\u4e48\u662f\u79cd\u5b50\u6570\u636e"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u79cd\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"),Object(c.b)("p",null,"\u5982\u6027\u522b\uff1a\u7537/\u5973\uff0c\u5730\u533a\uff0c\u884c\u4e1a\u4fe1\u606f\u7b49\u7b49\u3002"),Object(c.b)("h2",{id:"9212-\u5982\u4f55\u914d\u7f6e"},"9.21.2 \u5982\u4f55\u914d\u7f6e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"IEntitySeedData")," \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\u3002\u5982\u6211\u4eec\u9700\u8981\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"Person")," \u8868\u63d2\u5165\u521d\u59cb\u5316\u6570\u636e\uff1a"),Object(c.b)("h3",{id:"92121-\u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528"},"9.21.2.1 \u5728\u5b9e\u4f53\u5b9a\u4e49\u4e2d\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,16-23}","{7,16-23}":!0}),'using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Person : EntityBase, IEntitySeedData\n {\n public string Name { get; set; }\n\n public int Age { get; set; }\n\n public string Address { get; set; }\n\n // \u914d\u7f6e\u79cd\u5b50\u6570\u636e\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Person { Id = 1, Name = "\u767e\u5c0f\u50e7", Address = "\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02" },\n new Person { Id = 2, Name = "\u65b0\u751f\u5e1d", Address = "\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02" }\n };\n }\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"\u4e3b\u952e")," \u503c\u5fc5\u987b\u624b\u52a8\u63d2\u5165\uff0c\u56e0\u4e3a\u4f1a\u81ea\u52a8\u5173\u95ed\u4e3b\u952e\u6216\u81ea\u589e\u6807\u8bc6\u68c0\u67e5\u3002"))),Object(c.b)("h3",{id:"92122-\u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528"},"9.21.2.2 \u5728\u4efb\u610f\u5bf9\u8c61\u7c7b\u4e2d\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,9-16}","{6,9-16}":!0}),'using Furion.DatabaseAccessor;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public class PersonSeedData : IEntitySeedData\n {\n // \u914d\u7f6e\u79cd\u5b50\u6570\u636e\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Person { Id = 1, Name = "\u767e\u5c0f\u50e7", Address = "\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02" },\n new Person { Id = 2, Name = "\u65b0\u751f\u5e1d", Address = "\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02" }\n };\n }\n }\n}\n')),Object(c.b)("h2",{id:"9213-\u5bfc\u822a\u5c5e\u6027"},"9.21.3 \u5bfc\u822a\u5c5e\u6027"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u7684\u5b9e\u4f53\u6709 ",Object(c.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u591a"),"\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"\u591a\u5bf9\u591a"),"\u7b49\u5916\u952e\u5173\u7cfb\uff0c\u90a3\u4e48",Object(c.b)("strong",{parentName:"p"},"\u6211\u4eec\u9700\u8981\u5355\u72ec\u4e3a\u6bcf\u4e00\u4e2a\u5b9e\u4f53\u6dfb\u52a0\u6570\u636e\u79cd\u5b50\uff0c\u800c\u4e0d\u662f\u76f4\u63a5\u5199\u5728\u4e3b\u8868\u4e2d\u3002")),Object(c.b)("h2",{id:"9214-\u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e"},"9.21.4 \u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u6cdb\u578b\u7684\u65b9\u5f0f\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u79cd\u5b50\u6570\u636e\u8bbe\u5b9a\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,9-16}","{6,9-16}":!0}),'using Furion.DatabaseAccessor;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public class PersonSeedData : IEntitySeedData\n {\n // \u914d\u7f6e\u79cd\u5b50\u6570\u636e\n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new Person { Id = 1, Name = "\u767e\u5c0f\u50e7", Address = "\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02" },\n new Person { Id = 2, Name = "\u65b0\u751f\u5e1d", Address = "\u5e7f\u4e1c\u7701\u73e0\u6d77\u5e02" }\n };\n }\n }\n}\n')),Object(c.b)("p",null,"\u4e0a\u9762\u7684\u4f8b\u5b50\u8868\u793a\u540c\u65f6\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"MySqlDbContext")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"SqliteDbContext")," \u521b\u5efa\u79cd\u5b50\u6570\u636e\u3002"),Object(c.b)("h2",{id:"9215-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.21.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u79cd\u5b50")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/modeling/data-seeding"}),"EF Core - \u6570\u636e\u79cd\u5b50\u8bbe\u5b9a")," \u7ae0\u8282\u3002"))))}l.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/2a83d377.655a97e6.js b/docs/2a83d377.e6ffc6b5.js similarity index 92% rename from docs/2a83d377.655a97e6.js rename to docs/2a83d377.e6ffc6b5.js index 1b62045fe04..7c73da2f4a9 100644 --- a/docs/2a83d377.655a97e6.js +++ b/docs/2a83d377.e6ffc6b5.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{190:function(e,n,r){"use strict";r.d(n,"b",(function(){return i})),r.d(n,"a",(function(){return a}));var t=r(21),o=r(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(r,t)=>function(e,n,r,{forcePrependBaseUrl:t=!1,absolute:i=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(t)return n+r;const a=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?e+a:a}(n,e,r,t)}}function a(e,n={}){const{withBaseUrl:r}=i();return r(e,n)}},191:function(e,n,r){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!t(e)}r.d(n,"b",(function(){return t})),r.d(n,"a",(function(){return o}))},192:function(e,n,r){"use strict";r.d(n,"a",(function(){return p})),r.d(n,"b",(function(){return f}));var t=r(0),o=r.n(t);function i(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function a(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function s(e){for(var n=1;n=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var u=o.a.createContext({}),l=function(e){var n=o.a.useContext(u),r=n;return e&&(r="function"==typeof e?e(n):s(s({},n),e)),r},p=function(e){var n=l(e.components);return o.a.createElement(u.Provider,{value:n},e.children)},b={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},d=o.a.forwardRef((function(e,n){var r=e.components,t=e.mdxType,i=e.originalType,a=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),p=l(r),d=t,f=p["".concat(a,".").concat(d)]||p[d]||b[d]||i;return r?o.a.createElement(f,s(s({ref:n},u),{},{components:r})):o.a.createElement(f,s({ref:n},u))}));function f(e,n){var r=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var i=r.length,a=new Array(i);a[0]=d;var s={};for(var c in n)hasOwnProperty.call(n,c)&&(s[c]=n[c]);s.originalType=e,s.mdxType="string"==typeof e?e:t,a[1]=s;for(var u=2;un(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},93:function(e,n,r){"use strict";r.r(n),r.d(n,"frontMatter",(function(){return s})),r.d(n,"metadata",(function(){return c})),r.d(n,"toc",(function(){return u})),r.d(n,"default",(function(){return p}));var t=r(3),o=r(7),i=(r(0),r(192)),a=r(193),s={id:"linqexpression",title:"5. LinqExpression \u9759\u6001\u7c7b",sidebar_label:"5. LinqExpression \u9759\u6001\u7c7b"},c={unversionedId:"global/linqexpression",id:"global/linqexpression",isDocsHomePage:!1,title:"5. LinqExpression \u9759\u6001\u7c7b",description:"5.1 \u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f",source:"@site/docs\\global\\linqexpression.mdx",slug:"/global/linqexpression",permalink:"/docs/global/linqexpression",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/linqexpression.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"5. LinqExpression \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"4. Oops \u9759\u6001\u7c7b",permalink:"/docs/global/oops"},next:{title:"6. Http \u9759\u6001\u7c7b",permalink:"/docs/global/shttp"}},u=[{value:"5.1 \u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f",id:"51-\u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f",children:[]},{value:"5.2 \u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f",id:"52-\u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f",children:[]}],l={toc:u};function p(e){var n=e.components,r=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(t.a)({},l,r,{components:n,mdxType:"MDXLayout"}),Object(i.b)(a.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"51-\u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f"},"5.1 \u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"var expression = LinqExpression.Create(u => u.Id == 1);\nvar expression2 = LinqExpression.Create((u,i) => u.Id ==1 && i > 0);\n")),Object(i.b)("h2",{id:"52-\u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f"},"5.2 \u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"var expression = LinqExpression.And(expression1, expression2);\nvar expression2 = LinqExpression.IndexAnd(expression1, expression2);\nvar expression3 = LinqExpression.Or(expression2, expression3);\nvar expression4 = LinqExpression.IndexOr(expression2, expression3);\n")))}p.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[20],{194:function(e,n,r){"use strict";r.d(n,"b",(function(){return i})),r.d(n,"a",(function(){return a}));var t=r(21),o=r(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(r,t)=>function(e,n,r,{forcePrependBaseUrl:t=!1,absolute:i=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(t)return n+r;const a=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?e+a:a}(n,e,r,t)}}function a(e,n={}){const{withBaseUrl:r}=i();return r(e,n)}},195:function(e,n,r){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!t(e)}r.d(n,"b",(function(){return t})),r.d(n,"a",(function(){return o}))},196:function(e,n,r){"use strict";r.d(n,"a",(function(){return p})),r.d(n,"b",(function(){return f}));var t=r(0),o=r.n(t);function i(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function a(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function s(e){for(var n=1;n=0||(o[r]=e[r]);return o}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var u=o.a.createContext({}),l=function(e){var n=o.a.useContext(u),r=n;return e&&(r="function"==typeof e?e(n):s(s({},n),e)),r},p=function(e){var n=l(e.components);return o.a.createElement(u.Provider,{value:n},e.children)},b={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},d=o.a.forwardRef((function(e,n){var r=e.components,t=e.mdxType,i=e.originalType,a=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),p=l(r),d=t,f=p["".concat(a,".").concat(d)]||p[d]||b[d]||i;return r?o.a.createElement(f,s(s({ref:n},u),{},{components:r})):o.a.createElement(f,s({ref:n},u))}));function f(e,n){var r=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var i=r.length,a=new Array(i);a[0]=d;var s={};for(var c in n)hasOwnProperty.call(n,c)&&(s[c]=n[c]);s.originalType=e,s.mdxType="string"==typeof e?e:t,a[1]=s;for(var u=2;un(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},93:function(e,n,r){"use strict";r.r(n),r.d(n,"frontMatter",(function(){return s})),r.d(n,"metadata",(function(){return c})),r.d(n,"toc",(function(){return u})),r.d(n,"default",(function(){return p}));var t=r(3),o=r(7),i=(r(0),r(196)),a=r(197),s={id:"linqexpression",title:"5. LinqExpression \u9759\u6001\u7c7b",sidebar_label:"5. LinqExpression \u9759\u6001\u7c7b"},c={unversionedId:"global/linqexpression",id:"global/linqexpression",isDocsHomePage:!1,title:"5. LinqExpression \u9759\u6001\u7c7b",description:"5.1 \u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f",source:"@site/docs\\global\\linqexpression.mdx",slug:"/global/linqexpression",permalink:"/docs/global/linqexpression",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/linqexpression.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"5. LinqExpression \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"4. Oops \u9759\u6001\u7c7b",permalink:"/docs/global/oops"},next:{title:"6. Http \u9759\u6001\u7c7b",permalink:"/docs/global/shttp"}},u=[{value:"5.1 \u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f",id:"51-\u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f",children:[]},{value:"5.2 \u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f",id:"52-\u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f",children:[]}],l={toc:u};function p(e){var n=e.components,r=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(t.a)({},l,r,{components:n,mdxType:"MDXLayout"}),Object(i.b)(a.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"51-\u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f"},"5.1 \u521b\u5efa\u4e00\u4e2a\u8868\u8fbe\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"var expression = LinqExpression.Create(u => u.Id == 1);\nvar expression2 = LinqExpression.Create((u,i) => u.Id ==1 && i > 0);\n")),Object(i.b)("h2",{id:"52-\u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f"},"5.2 \u62fc\u63a5\u4e24\u4e2a\u8868\u8fbe\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"var expression = LinqExpression.And(expression1, expression2);\nvar expression2 = LinqExpression.IndexAnd(expression1, expression2);\nvar expression3 = LinqExpression.Or(expression2, expression3);\nvar expression4 = LinqExpression.IndexOr(expression2, expression3);\n")))}p.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/2ae73ff4.63b9dd45.js b/docs/2ae73ff4.bbd4d721.js similarity index 98% rename from docs/2ae73ff4.63b9dd45.js rename to docs/2ae73ff4.bbd4d721.js index 7758dcf6817..0eb8888462b 100644 --- a/docs/2ae73ff4.63b9dd45.js +++ b/docs/2ae73ff4.bbd4d721.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{190:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return r}));var a=t(21),c=t(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(c.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return c}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return O}));var a=t(0),c=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(c[t]=e[t]);return c}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(c[t]=e[t])}return c}var l=c.a.createContext({}),p=function(e){var n=c.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},d=function(e){var n=p(e.components);return c.a.createElement(l.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return c.a.createElement(c.a.Fragment,{},n)}},m=c.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,r=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),d=p(t),m=a,O=d["".concat(r,".").concat(m)]||d[m]||s[m]||i;return t?c.a.createElement(O,b(b({ref:n},l),{},{components:t})):c.a.createElement(O,b({ref:n},l))}));function O(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,r=new Array(i);r[0]=m;var b={};for(var o in n)hasOwnProperty.call(n,o)&&(b[o]=n[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},94:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return d}));var a=t(3),c=t(7),i=(t(0),t(192)),r=t(193),b={id:"cache",title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",sidebar_label:"14. \u5206\u5e03\u5f0f\u7f13\u5b58"},o={unversionedId:"cache",id:"cache",isDocsHomePage:!1,title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",description:"14.1 \u4ec0\u4e48\u662f\u7f13\u5b58",source:"@site/docs\\cache.mdx",slug:"/cache",permalink:"/docs/cache",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/cache.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",sidebar:"docs",previous:{title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",permalink:"/docs/object-mapper"},next:{title:"15. \u5b89\u5168\u9274\u6743",permalink:"/docs/auth-control"}},l=[{value:"14.1 \u4ec0\u4e48\u662f\u7f13\u5b58",id:"141-\u4ec0\u4e48\u662f\u7f13\u5b58",children:[]},{value:"14.2 \u7f13\u5b58\u7c7b\u578b",id:"142-\u7f13\u5b58\u7c7b\u578b",children:[]},{value:"14.3 \u5185\u5b58\u7f13\u5b58\u4f7f\u7528",id:"143-\u5185\u5b58\u7f13\u5b58\u4f7f\u7528",children:[{value:"14.3.1 \u57fa\u672c\u4f7f\u7528",id:"1431-\u57fa\u672c\u4f7f\u7528",children:[]},{value:"14.3.2 \u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",id:"1432-\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",children:[]},{value:"14.3.3 \u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",id:"1433-\u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",children:[]},{value:"14.3.4 \u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb",id:"1434-\u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb",children:[]}]},{value:"14.4 \u5206\u5e03\u5f0f\u7f13\u5b58",id:"144-\u5206\u5e03\u5f0f\u7f13\u5b58",children:[{value:"14.4.1 \u4f7f\u7528\u6761\u4ef6",id:"1441-\u4f7f\u7528\u6761\u4ef6",children:[]},{value:"14.4.2 IDistributedCache",id:"1442-idistributedcache",children:[]},{value:"14.4.3 \u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58",id:"1443-\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58",children:[]},{value:"14.4.4 \u5206\u5e03\u5f0f SQL Server \u7f13\u5b58",id:"1444-\u5206\u5e03\u5f0f-sql-server-\u7f13\u5b58",children:[]},{value:"14.4.5 \u5206\u5e03\u5f0f Redis \u7f13\u5b58",id:"1445-\u5206\u5e03\u5f0f-redis-\u7f13\u5b58",children:[]},{value:"14.4.6 \u5206\u5e03\u5f0f NCache \u7f13\u5b58",id:"1446-\u5206\u5e03\u5f0f-ncache-\u7f13\u5b58",children:[]}]},{value:"14.5 \u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528",id:"145-\u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528",children:[]},{value:"14.6 \u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae",id:"146-\u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae",children:[]},{value:"14.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"147-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function d(e){var n=e.components,t=Object(c.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(r.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"141-\u4ec0\u4e48\u662f\u7f13\u5b58"},"14.1 \u4ec0\u4e48\u662f\u7f13\u5b58"),Object(i.b)("p",null,"\u7f13\u5b58\u53ef\u4ee5\u51cf\u5c11\u751f\u6210\u5185\u5bb9\u6240\u9700\u7684\u5de5\u4f5c\uff0c\u4ece\u800c\u663e\u8457\u63d0\u9ad8\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u4f38\u7f29\u6027\u3002 ",Object(i.b)("strong",{parentName:"p"},"\u7f13\u5b58\u6700\u9002\u7528\u4e8e\u4e0d\u7ecf\u5e38\u66f4\u6539\u7684\u6570\u636e\uff0c\u56e0\u4e3a\u751f\u6210\u6210\u672c\u5f88\u9ad8"),"\u3002 \u901a\u8fc7\u7f13\u5b58\uff0c\u53ef\u4ee5\u6bd4\u4ece\u6570\u636e\u6e90\u8fd4\u56de\u7684\u6570\u636e\u7684\u526f\u672c\u901f\u5ea6\u5feb\u5f97\u591a\u3002 \u5e94\u8be5\u5bf9\u5e94\u7528\u8fdb\u884c\u7f16\u5199\u548c\u6d4b\u8bd5\uff0c\u4f7f\u5176\u6c38\u4e0d\u4f9d\u8d56\u4e8e\u7f13\u5b58\u7684\u6570\u636e\u3002"),Object(i.b)("h2",{id:"142-\u7f13\u5b58\u7c7b\u578b"},"14.2 \u7f13\u5b58\u7c7b\u578b"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5185\u5b58\u7f13\u5b58\uff1a\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662f\u7f13\u5b58\u5728\u5e94\u7528\u90e8\u7f72\u6240\u5728\u670d\u52a1\u5668\u7684\u5185\u5b58\u4e2d"),Object(i.b)("li",{parentName:"ul"},"\u5206\u5e03\u5f0f\u7f13\u5b58\uff1a\u5206\u5e03\u5f0f\u7f13\u5b58\u662f\u7531\u591a\u4e2a\u5e94\u7528\u670d\u52a1\u5668\u5171\u4eab\u7684\u7f13\u5b58"),Object(i.b)("li",{parentName:"ul"},"\u54cd\u5e94\u7f13\u5b58\uff1a\u7f13\u5b58\u670d\u52a1\u5668\u7aef ",Object(i.b)("inlineCode",{parentName:"li"},"Not Modified")," \u7684\u6570\u636e")),Object(i.b)("h2",{id:"143-\u5185\u5b58\u7f13\u5b58\u4f7f\u7528"},"14.3 \u5185\u5b58\u7f13\u5b58\u4f7f\u7528"),Object(i.b)("p",null,"\u5185\u5b58\u7f13\u5b58\u662f\u6700\u5e38\u7528\u7684\u7f13\u5b58\u65b9\u5f0f\uff0c\u5177\u6709\u5b58\u53d6\u5feb\uff0c\u6548\u7387\u9ad8\u7279\u70b9\u3002"),Object(i.b)("p",null,"\u5185\u5b58\u7f13\u5b58\u901a\u8fc7\u6ce8\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"IMemoryCache")," \u65b9\u5f0f\u6ce8\u5165\u5373\u53ef\u3002"),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5185\u5b58\u7f13\u5b58\u670d\u52a1\u5df2\u7ecf\u9ed8\u8ba4\u6ce8\u518c\uff0c\u65e0\u9700\u624b\u52a8\u6ce8\u518c\u3002"))),Object(i.b)("h3",{id:"1431-\u57fa\u672c\u4f7f\u7528"},"14.3.1 \u57fa\u672c\u4f7f\u7528"),Object(i.b)("p",null,"\u5982\uff0c\u7f13\u5b58\u5f53\u524d\u65f6\u95f4\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,21-24}","{13,21-24}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.Extensions.Caching.Memory;\nusing System;\n\nnamespace Furion.Application\n{\n public class CacheServices : IDynamicApiController\n {\n private const string _timeCacheKey = "cache_time";\n\n private readonly IMemoryCache _memoryCache;\n\n public CacheServices(IMemoryCache memoryCache)\n {\n _memoryCache = memoryCache;\n }\n\n [ApiDescriptionSettings(KeepName = true)]\n public DateTimeOffset GetOrCreate()\n {\n return _memoryCache.GetOrCreate(_timeCacheKey, entry =>\n {\n return DateTimeOffset.UtcNow;\n });\n }\n }\n}\n')),Object(i.b)("h3",{id:"1432-\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"},"14.3.2 \u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"),Object(i.b)("p",null,"\u5185\u5b58\u7f13\u5b58\u652f\u6301\u8bbe\u7f6e\u7f13\u5b58\u65f6\u95f4\u3001\u7f13\u5b58\u5927\u5c0f\u3001\u53ca\u7edd\u5bf9\u7f13\u5b58\u8fc7\u671f\u65f6\u95f4\u7b49"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_memoryCache.GetOrCreate(_timeCacheKey, entry =>\n{\n entry.SlidingExpiration = TimeSpan.FromSeconds(3); // \u6ed1\u52a8\u7f13\u5b58\u65f6\u95f4\n return DateTimeOffset.UtcNow;\n});\n\nawait _memoryCache.GetOrCreateAsync(_timeCacheKey, async entry =>\n{\n // \u8fd9\u91cc\u53ef\u4ee5\u4f7f\u7528\u5f02\u6b65~~\n});\n")),Object(i.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u5173\u4e8e\u7f13\u5b58\u65f6\u95f4")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u53ea\u6709\u5177\u6709\u53ef\u8c03\u8fc7\u671f\u7684\u7f13\u5b58\u9879\u96c6\u5b58\u5728\u8fc7\u65f6\u7684\u98ce\u9669\u3002 \u5982\u679c\u8bbf\u95ee\u7684\u65f6\u95f4\u6bd4\u6ed1\u52a8\u8fc7\u671f\u65f6\u95f4\u95f4\u9694\u66f4\u9891\u7e41\uff0c\u5219\u8be5\u9879\u5c06\u6c38\u4e0d\u8fc7\u671f\u3002"),Object(i.b)("p",{parentName:"div"},"\u5c06\u5f39\u6027\u8fc7\u671f\u4e0e\u7edd\u5bf9\u8fc7\u671f\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u4ee5\u4fdd\u8bc1\u9879\u76ee\u5728\u5176\u7edd\u5bf9\u8fc7\u671f\u65f6\u95f4\u901a\u8fc7\u540e\u8fc7\u671f\u3002 \u7edd\u5bf9\u8fc7\u671f\u4f1a\u5c06\u9879\u7684\u4e0a\u9650\u8bbe\u7f6e\u4e3a\u53ef\u7f13\u5b58\u9879\u7684\u65f6\u95f4\uff0c\u540c\u65f6\u4ecd\u5141\u8bb8\u9879\u5728\u53ef\u8c03\u6574\u8fc7\u671f\u65f6\u95f4\u95f4\u9694\u5185\u672a\u8bf7\u6c42\u65f6\u63d0\u524d\u8fc7\u671f\u3002"),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u540c\u65f6\u6307\u5b9a\u4e86\u7edd\u5bf9\u8fc7\u671f\u548c\u53ef\u8c03\u8fc7\u671f\u65f6\u95f4\uff0c\u5219\u8fc7\u671f\u65f6\u95f4\u4ee5\u903b\u8f91\u65b9\u5f0f\u8fd0\u7b97\u3002 \u5982\u679c\u6ed1\u52a8\u8fc7\u671f\u65f6\u95f4\u95f4\u9694 \u6216 \u7edd\u5bf9\u8fc7\u671f\u65f6\u95f4\u901a\u8fc7\uff0c\u5219\u4ece\u7f13\u5b58\u4e2d\u9010\u51fa\u8be5\u9879\u3002"),Object(i.b)("p",{parentName:"div"},"\u5982\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_memoryCache.GetOrCreate(_timeCacheKey, entry =>\n{\n entry.SetSlidingExpiration(TimeSpan.FromSeconds(3));\n entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(20);\n return DateTime.Now;\n});\n")),Object(i.b)("p",{parentName:"div"},"\u524d\u9762\u7684\u4ee3\u7801\u4fdd\u8bc1\u6570\u636e\u7684\u7f13\u5b58\u65f6\u95f4\u4e0d\u8d85\u8fc7\u7edd\u5bf9\u65f6\u95f4\u3002"))),Object(i.b)("h3",{id:"1433-\u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"},"14.3.3 \u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"),Object(i.b)("p",null,"\u9664\u4e86\u4e0a\u9762\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Func")," \u65b9\u5f0f\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879\uff0c\u6211\u4eec\u53ef\u4ee5\u624b\u52a8\u521b\u5efa\u5e76\u8bbe\u7f6e\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var cacheEntryOptions = new MemoryCacheEntryOptions()\n .SetSlidingExpiration(TimeSpan.FromSeconds(3));\n\n_memoryCache.Set(_timeCacheKey, DateTimeOffset.UtcNow, cacheEntryOptions);\n")),Object(i.b)("h3",{id:"1434-\u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb"},"14.3.4 \u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb"),Object(i.b)("p",null,"\u4e0b\u9762\u7684\u793a\u4f8b\u6f14\u793a\u5982\u4f55\u5728\u4f9d\u8d56\u6761\u76ee\u8fc7\u671f\u65f6\u4f7f\u7f13\u5b58\u6761\u76ee\u8fc7\u671f\u3002 ",Object(i.b)("inlineCode",{parentName:"p"},"CancellationChangeToken")," \u6dfb\u52a0\u5230\u7f13\u5b58\u7684\u9879\u3002 \u5f53 ",Object(i.b)("inlineCode",{parentName:"p"},"Cancel")," \u5728\u4e0a\u8c03\u7528\u65f6 ",Object(i.b)("inlineCode",{parentName:"p"},"CancellationTokenSource")," \uff0c\u5c06\u9010\u51fa\u4e24\u4e2a\u7f13\u5b58\u9879\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public IActionResult CreateDependentEntries()\n{\n var cts = new CancellationTokenSource();\n _cache.Set(CacheKeys.DependentCTS, cts);\n\n using (var entry = _cache.CreateEntry(CacheKeys.Parent))\n {\n // expire this entry if the dependant entry expires.\n entry.Value = DateTime.Now;\n entry.RegisterPostEvictionCallback(DependentEvictionCallback, this);\n\n _cache.Set(CacheKeys.Child,\n DateTime.Now,\n new CancellationChangeToken(cts.Token));\n }\n\n return RedirectToAction("GetDependentEntries");\n}\n\npublic IActionResult GetDependentEntries()\n{\n return View("Dependent", new DependentViewModel\n {\n ParentCachedTime = _cache.Get(CacheKeys.Parent),\n ChildCachedTime = _cache.Get(CacheKeys.Child),\n Message = _cache.Get(CacheKeys.DependentMessage)\n });\n}\n\npublic IActionResult RemoveChildEntry()\n{\n _cache.Get(CacheKeys.DependentCTS).Cancel();\n return RedirectToAction("GetDependentEntries");\n}\n\nprivate static void DependentEvictionCallback(object key, object value,\n EvictionReason reason, object state)\n{\n var message = $"Parent entry was evicted. Reason: {reason}.";\n ((HomeController)state)._cache.Set(CacheKeys.DependentMessage, message);\n}\n')),Object(i.b)("p",null,"\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"CancellationTokenSource")," \u5141\u8bb8\u5c06\u591a\u4e2a\u7f13\u5b58\u6761\u76ee\u4f5c\u4e3a\u4e00\u4e2a\u7ec4\u9010\u51fa\u3002 ",Object(i.b)("inlineCode",{parentName:"p"},"using")," \u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u5728\u5757\u4e2d\u521b\u5efa\u7684\u7f13\u5b58\u6761\u76ee ",Object(i.b)("inlineCode",{parentName:"p"},"using")," \u5c06\u7ee7\u627f\u89e6\u53d1\u5668\u548c\u8fc7\u671f\u8bbe\u7f6e\u3002"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u5185\u5b58\u4e2d\u7684\u7f13\u5b58")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/memory?view=aspnetcore-5.0"}),"ASP.NET Core - \u5185\u5b58\u7f13\u5b58")," \u7ae0\u8282\u3002"))),Object(i.b)("h2",{id:"144-\u5206\u5e03\u5f0f\u7f13\u5b58"},"14.4 \u5206\u5e03\u5f0f\u7f13\u5b58"),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u7f13\u5b58\u662f\u7531\u591a\u4e2a\u5e94\u7528\u670d\u52a1\u5668\u5171\u4eab\u7684\u7f13\u5b58\uff0c\u901a\u5e38\u4f5c\u4e3a\u5916\u90e8\u670d\u52a1\u5728\u8bbf\u95ee\u5b83\u7684\u5e94\u7528\u670d\u52a1\u5668\u4e0a\u7ef4\u62a4\u3002 \u5206\u5e03\u5f0f\u7f13\u5b58\u53ef\u4ee5\u63d0\u9ad8 ",Object(i.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u4f38\u7f29\u6027\uff0c\u5c24\u5176\u662f\u5728\u5e94\u7528\u7a0b\u5e8f\u7531\u4e91\u670d\u52a1\u6216\u670d\u52a1\u5668\u573a\u6258\u7ba1\u65f6\u3002"),Object(i.b)("p",null,"\u4e0e\u5176\u4ed6\u7f13\u5b58\u65b9\u6848\u76f8\u6bd4\uff0c\u5206\u5e03\u5f0f\u7f13\u5b58\u5177\u6709\u591a\u9879\u4f18\u52bf\uff0c\u5176\u4e2d\u7f13\u5b58\u7684\u6570\u636e\u5b58\u50a8\u5728\u5355\u4e2a\u5e94\u7528\u670d\u52a1\u5668\u4e0a\u3002"),Object(i.b)("p",null,"\u5f53\u5206\u5e03\u5f0f\u7f13\u5b58\u6570\u636e\u65f6\uff0c\u6570\u636e\u5c06\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"(\u4e00\u81f4\u6027) \u8de8\u591a\u4e2a \u670d\u52a1\u5668\u7684\u8bf7\u6c42"),Object(i.b)("li",{parentName:"ul"},"\u5b58\u6d3b\u5728\u670d\u52a1\u5668\u91cd\u542f\u548c\u5e94\u7528\u90e8\u7f72\u4e4b\u95f4"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u4f7f\u7528\u672c\u5730\u5185\u5b58")),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u7f13\u5b58\u914d\u7f6e\u662f\u7279\u5b9a\u4e8e\u5b9e\u73b0\u7684\u3002 \u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u914d\u7f6e ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Redis")," \u5206\u5e03\u5f0f\u7f13\u5b58\u3002 \u7b2c\u4e09\u65b9\u5b9e\u73b0\u4e5f\u53ef\u7528\uff0c\u4f8b\u5982 GitHub \u4e0a\u7684 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/Alachisoft/NCache"}),"NCache")," (NCache) \u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u5b9e\u73b0\uff0c\u5e94\u7528\u90fd\u4f1a\u4f7f\u7528\u63a5\u53e3\u4e0e\u7f13\u5b58\u4ea4\u4e92 ",Object(i.b)("inlineCode",{parentName:"strong"},"IDistributedCache")," \u3002")),Object(i.b)("h3",{id:"1441-\u4f7f\u7528\u6761\u4ef6"},"14.4.1 \u4f7f\u7528\u6761\u4ef6"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"SQL Server")," \u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u5219\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"li"},"Microsoft.Extensions.Caching.SqlServer")," \u5305"),Object(i.b)("li",{parentName:"ul"},"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"Redis")," \u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u5219\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"li"},"Microsoft.Extensions.Caching.StackExchangeRedis")," \u5305"),Object(i.b)("li",{parentName:"ul"},"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"NCache")," \u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u5219\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"li"},"NCache.Microsoft.Extensions.Caching.OpenSource")," \u5305")),Object(i.b)("h3",{id:"1442-idistributedcache"},"14.4.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"IDistributedCache")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u63a5\u53e3\u63d0\u4f9b\u4ee5\u4e0b\u65b9\u6cd5\u6765\u5904\u7406\u5206\u5e03\u5f0f\u7f13\u5b58\u5b9e\u73b0\u4e2d\u7684\u9879\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"GetGetAsync"),"\uff1a\u63a5\u53d7\u5b57\u7b26\u4e32\u952e\uff0c\u5e76\u68c0\u7d22\u7f13\u5b58\u9879\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"li"},"byte[]")," \u6570\u7ec4\uff08\u5982\u679c\u5728\u7f13\u5b58\u4e2d\u627e\u5230\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SetSetAsync"),"\uff1a\u4f7f\u7528\u5b57\u7b26\u4e32\u952e\u5c06\u9879 (\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"li"},"byte[]")," \u6570\u7ec4) \u6dfb\u52a0\u5230\u7f13\u5b58\u4e2d"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Refresh/RefreshAsync")," \uff1a\u6839\u636e\u9879\u7684\u952e\u5237\u65b0\u7f13\u5b58\u4e2d\u7684\u9879\uff0c\u91cd\u7f6e\u5176\u6ed1\u52a8\u8fc7\u671f\u8d85\u65f6\uff08\u5982\u679c\u6709\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"RemoveRemoveAsync"),"\uff1a\u6839\u636e\u7f13\u5b58\u9879\u7684\u5b57\u7b26\u4e32\u952e\u5220\u9664\u7f13\u5b58\u9879")),Object(i.b)("h3",{id:"1443-\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58"},"14.4.3 \u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58"),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\uff08",Object(i.b)("inlineCode",{parentName:"p"},"AddDistributedMemoryCache"),"\uff09\u662f\u4e00\u4e2a\u6846\u67b6\u63d0\u4f9b\u7684\u5b9e\u73b0 ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \uff0c\u5b83\u5c06\u9879\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\u3002 ",Object(i.b)("strong",{parentName:"p"},"\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u4e0d\u662f\u5b9e\u9645\u7684\u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u7f13\u5b58\u9879\u7531\u5e94\u7528\u7a0b\u5e8f\u5b9e\u4f8b\u5b58\u50a8\u5728\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u670d\u52a1\u5668\u4e0a\u3002")),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u4f18\u70b9\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u7528\u4e8e\u5f00\u53d1\u548c\u6d4b\u8bd5\u65b9\u6848\u3002"),Object(i.b)("li",{parentName:"ul"},"\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4f7f\u7528\u5355\u4e00\u670d\u52a1\u5668\u5e76\u4e14\u5185\u5b58\u6d88\u8017\u4e0d\u662f\u95ee\u9898\u3002 \u5b9e\u73b0\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u4f1a\u62bd\u8c61\u5316\u7f13\u5b58\u7684\u6570\u636e\u5b58\u50a8\u3002 \u5982\u679c\u9700\u8981\u591a\u4e2a\u8282\u70b9\u6216\u5bb9\u9519\uff0c\u53ef\u4ee5\u5728\u5c06\u6765\u5b9e\u73b0\u771f\u6b63\u7684\u5206\u5e03\u5f0f\u7f13\u5b58\u89e3\u51b3\u65b9\u6848\u3002")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u670d\u52a1\u5df2\u7ecf\u9ed8\u8ba4\u6ce8\u518c\uff0c\u65e0\u9700\u624b\u52a8\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"services.AddDistributedMemoryCache();")," \u6ce8\u518c\u3002"))),Object(i.b)("h3",{id:"1444-\u5206\u5e03\u5f0f-sql-server-\u7f13\u5b58"},"14.4.4 \u5206\u5e03\u5f0f SQL Server \u7f13\u5b58"),Object(i.b)("p",null,"\u5206\u5e03\u5f0f ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u7f13\u5b58\u5b9e\u73b0 (",Object(i.b)("inlineCode",{parentName:"p"},"AddDistributedSqlServerCache"),") \u5141\u8bb8\u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u6570\u636e\u5e93\u4f5c\u4e3a\u5176\u540e\u5907\u5b58\u50a8\u3002"),Object(i.b)("p",null,"\u82e5\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u5b9e\u4f8b\u4e2d\u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u7f13\u5b58\u7684\u9879\u8868\uff0c\u53ef\u4ee5\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"sql-cache")," \u5de5\u5177\u3002 \u8be5\u5de5\u5177\u5c06\u521b\u5efa\u4e00\u4e2a\u8868\uff0c\u5176\u4e2d\u5305\u542b\u6307\u5b9a\u7684\u540d\u79f0\u548c\u67b6\u6784\u3002"),Object(i.b)("p",null,"\u901a\u8fc7\u8fd0\u884c\u547d\u4ee4 ",Object(i.b)("inlineCode",{parentName:"p"},"sql-cache create")," \u521b\u5efa\u4e00\u4e2a\u8868\uff0c\u63d0\u4f9b ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u5b9e\u4f8b (Data Source) \u3001\u6570\u636e\u5e93 (Initial Catalog) \u3001\u67b6\u6784 (\u4f8b\u5982) dbo \u548c\u8868\u540d\u79f0\u3002\u4f8b\u5982 ",Object(i.b)("inlineCode",{parentName:"p"},"TestCache"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),'dotnet sql-cache create "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=DistCache;Integrated Security=True;" dbo TestCache\n')),Object(i.b)("p",null,"\u521b\u5efa\u6210\u529f\u540e\uff0c\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDistributedSqlServerCache(options =>\n{\n options.ConnectionString =\n _config["DistCache_ConnectionString"];\n options.SchemaName = "dbo";\n options.TableName = "TestCache";\n});\n')),Object(i.b)("h3",{id:"1445-\u5206\u5e03\u5f0f-redis-\u7f13\u5b58"},"14.4.5 \u5206\u5e03\u5f0f ",Object(i.b)("inlineCode",{parentName:"h3"},"Redis")," \u7f13\u5b58"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Redis")," \u662f\u5185\u5b58\u4e2d\u6570\u636e\u5b58\u50a8\u7684\u5f00\u6e90\u6570\u636e\u5b58\u50a8\uff0c\u901a\u5e38\u7528\u4f5c\u5206\u5e03\u5f0f\u7f13\u5b58\u3002\u5728\u4f7f\u7528\u65f6\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"services.AddStackExchangeRedisCache()")," \u4e2d\u6ce8\u518c\u5373\u53ef\u3002"),Object(i.b)("p",null,"\u8fd9\u91cc\u4e0d\u7ec6\u8bb2 ",Object(i.b)("inlineCode",{parentName:"p"},"Redis")," \u76f8\u5173\u5185\u5bb9\uff0c\u540e\u7eed\u7ae0\u8282\u4f1a\u4f7f\u7528\u57fa\u672c\u4f8b\u5b50\u6f14\u793a\u3002"),Object(i.b)("h3",{id:"1446-\u5206\u5e03\u5f0f-ncache-\u7f13\u5b58"},"14.4.6 \u5206\u5e03\u5f0f ",Object(i.b)("inlineCode",{parentName:"h3"},"NCache")," \u7f13\u5b58"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"NCache")," \u662f\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},".NET")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},".Net Core")," \u4e2d\u4ee5\u672c\u673a\u65b9\u5f0f\u5f00\u53d1\u7684\u5f00\u6e90\u5185\u5b58\u4e2d\u5206\u5e03\u5f0f\u7f13\u5b58\u3002 ",Object(i.b)("inlineCode",{parentName:"p"},"NCache")," \u5728\u672c\u5730\u5de5\u4f5c\u5e76\u914d\u7f6e\u4e3a\u5206\u5e03\u5f0f\u7f13\u5b58\u7fa4\u96c6\uff0c\u9002\u7528\u4e8e\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Azure")," \u6216\u5176\u4ed6\u6258\u7ba1\u5e73\u53f0\u4e0a\u8fd0\u884c\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u3002\n\u82e5\u8981\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e ",Object(i.b)("inlineCode",{parentName:"p"},"NCache"),"\uff0c\u8bf7\u53c2\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://www.alachisoft.com/resources/docs/ncache-oss/getting-started-guide-windows/"}),"\u9002\u7528\u4e8e Windows \u7684 NCache \u5165\u95e8\u6307\u5357"),"\u3002"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"NCache")," \u57fa\u672c\u914d\u7f6e\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"li"},"Alachisoft.NCache.OpenSource.SDK")," \u5305"),Object(i.b)("li",{parentName:"ul"},"\u5728 ",Object(i.b)("a",Object(a.a)({parentName:"li"},{href:"https://www.alachisoft.com/resources/docs/ncache-oss/admin-guide/client-config.html"}),"ncconf")," \u4e2d\u914d\u7f6e\u7f13\u5b58\u7fa4\u96c6"),Object(i.b)("li",{parentName:"ul"},"\u6ce8\u518c ",Object(i.b)("inlineCode",{parentName:"li"},"NCache")," \u670d\u52a1")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddNCacheDistributedCache(configuration =>\n{\n configuration.CacheName = "demoClusteredCache";\n configuration.EnableLogs = true;\n configuration.ExceptionsEnabled = true;\n});\n')),Object(i.b)("h2",{id:"145-\u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528"},"14.5 \u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528"),Object(i.b)("p",null,"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u63a5\u53e3\uff0c\u8bf7 ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u901a\u8fc7\u6784\u9020\u51fd\u6570\u4f9d\u8d56\u5173\u7cfb\u6ce8\u5165\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,16,30-33}","{5,16,30-33}":!0}),'public class IndexModel : PageModel\n{\n private readonly IDistributedCache _cache;\n\n public IndexModel(IDistributedCache cache)\n {\n _cache = cache;\n }\n\n public string CachedTimeUTC { get; set; }\n\n public async Task OnGetAsync()\n {\n CachedTimeUTC = "Cached Time Expired";\n // \u83b7\u53d6\u5206\u5e03\u5f0f\u7f13\u5b58\n var encodedCachedTimeUTC = await _cache.GetAsync("cachedTimeUTC");\n\n if (encodedCachedTimeUTC != null)\n {\n CachedTimeUTC = Encoding.UTF8.GetString(encodedCachedTimeUTC);\n }\n }\n\n public async Task OnPostResetCachedTime()\n {\n var currentTimeUTC = DateTime.UtcNow.ToString();\n byte[] encodedCurrentTimeUTC = Encoding.UTF8.GetBytes(currentTimeUTC);\n\n // \u8bbe\u7f6e\u5206\u5e03\u5f0f\u7f13\u5b58\n var options = new DistributedCacheEntryOptions()\n .SetSlidingExpiration(TimeSpan.FromSeconds(20));\n\n await _cache.SetAsync("cachedTimeUTC", encodedCurrentTimeUTC, options);\n\n return RedirectToPage();\n }\n}\n')),Object(i.b)("h2",{id:"146-\u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae"},"14.6 \u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae"),Object(i.b)("p",null,"\u786e\u5b9a ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u6700\u9002\u5408\u4f60\u7684\u5e94\u7528\u7684\u5b9e\u73b0\u65f6\uff0c\u8bf7\u8003\u8651\u4ee5\u4e0b\u4e8b\u9879\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u73b0\u6709\u57fa\u7840\u7ed3\u6784"),Object(i.b)("li",{parentName:"ul"},"\u6027\u80fd\u8981\u6c42"),Object(i.b)("li",{parentName:"ul"},"\u6210\u672c"),Object(i.b)("li",{parentName:"ul"},"\u56e2\u961f\u7ecf\u9a8c")),Object(i.b)("p",null,"\u7f13\u5b58\u89e3\u51b3\u65b9\u6848\u901a\u5e38\u4f9d\u8d56\u4e8e\u5185\u5b58\u4e2d\u7684\u5b58\u50a8\u4ee5\u5feb\u901f\u68c0\u7d22\u7f13\u5b58\u7684\u6570\u636e\uff0c\u4f46\u662f\uff0c\u5185\u5b58\u662f\u6709\u9650\u7684\u8d44\u6e90\uff0c\u5e76\u4e14\u5f88\u6602\u8d35\u3002 \u4ec5\u5c06\u5e38\u7528\u6570\u636e\u5b58\u50a8\u5728\u7f13\u5b58\u4e2d\u3002"),Object(i.b)("p",null,"\u901a\u5e38\uff0c",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Redis")," \u7f13\u5b58\u63d0\u4f9b\u6bd4 ",Object(i.b)("inlineCode",{parentName:"strong"},"SQL Server")," \u7f13\u5b58\u66f4\u9ad8\u7684\u541e\u5410\u91cf\u548c\u66f4\u4f4e\u7684\u5ef6\u8fdf\u3002")," \u4f46\u662f\uff0c\u901a\u5e38\u9700\u8981\u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5\u6765\u786e\u5b9a\u7f13\u5b58\u7b56\u7565\u7684\u6027\u80fd\u7279\u5f81\u3002"),Object(i.b)("p",null,"\u5f53 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u7528\u4f5c\u5206\u5e03\u5f0f\u7f13\u5b58\u540e\u5907\u5b58\u50a8\u65f6\uff0c\u5bf9\u7f13\u5b58\u4f7f\u7528\u540c\u4e00\u6570\u636e\u5e93\uff0c\u5e76\u4e14\u5e94\u7528\u7684\u666e\u901a\u6570\u636e\u5b58\u50a8\u548c\u68c0\u7d22\u4f1a\u5bf9\u8fd9\u4e24\u79cd\u60c5\u51b5\u7684\u6027\u80fd\u4ea7\u751f\u8d1f\u9762\u5f71\u54cd\u3002 \u5efa\u8bae\u4f7f\u7528\u5206\u5e03\u5f0f\u7f13\u5b58\u540e\u5907\u5b58\u50a8\u7684\u4e13\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u5b9e\u4f8b\u3002"),Object(i.b)("h2",{id:"147-\u53cd\u9988\u4e0e\u5efa\u8bae"},"14.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u5206\u5e03\u5f0f\u7f13\u5b58")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/distributed?view=aspnetcore-5.0"}),"ASP.NET Core - \u5206\u5e03\u5f0f\u7f13\u5b58")," \u7ae0\u8282\u3002"))))}d.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{194:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return r}));var a=t(21),c=t(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(c.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return c}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return O}));var a=t(0),c=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(c[t]=e[t]);return c}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(c[t]=e[t])}return c}var l=c.a.createContext({}),p=function(e){var n=c.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},d=function(e){var n=p(e.components);return c.a.createElement(l.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return c.a.createElement(c.a.Fragment,{},n)}},m=c.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,r=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),d=p(t),m=a,O=d["".concat(r,".").concat(m)]||d[m]||s[m]||i;return t?c.a.createElement(O,b(b({ref:n},l),{},{components:t})):c.a.createElement(O,b({ref:n},l))}));function O(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,r=new Array(i);r[0]=m;var b={};for(var o in n)hasOwnProperty.call(n,o)&&(b[o]=n[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},94:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return d}));var a=t(3),c=t(7),i=(t(0),t(196)),r=t(197),b={id:"cache",title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",sidebar_label:"14. \u5206\u5e03\u5f0f\u7f13\u5b58"},o={unversionedId:"cache",id:"cache",isDocsHomePage:!1,title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",description:"14.1 \u4ec0\u4e48\u662f\u7f13\u5b58",source:"@site/docs\\cache.mdx",slug:"/cache",permalink:"/docs/cache",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/cache.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",sidebar:"docs",previous:{title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",permalink:"/docs/object-mapper"},next:{title:"15. \u5b89\u5168\u9274\u6743",permalink:"/docs/auth-control"}},l=[{value:"14.1 \u4ec0\u4e48\u662f\u7f13\u5b58",id:"141-\u4ec0\u4e48\u662f\u7f13\u5b58",children:[]},{value:"14.2 \u7f13\u5b58\u7c7b\u578b",id:"142-\u7f13\u5b58\u7c7b\u578b",children:[]},{value:"14.3 \u5185\u5b58\u7f13\u5b58\u4f7f\u7528",id:"143-\u5185\u5b58\u7f13\u5b58\u4f7f\u7528",children:[{value:"14.3.1 \u57fa\u672c\u4f7f\u7528",id:"1431-\u57fa\u672c\u4f7f\u7528",children:[]},{value:"14.3.2 \u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",id:"1432-\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",children:[]},{value:"14.3.3 \u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",id:"1433-\u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879",children:[]},{value:"14.3.4 \u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb",id:"1434-\u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb",children:[]}]},{value:"14.4 \u5206\u5e03\u5f0f\u7f13\u5b58",id:"144-\u5206\u5e03\u5f0f\u7f13\u5b58",children:[{value:"14.4.1 \u4f7f\u7528\u6761\u4ef6",id:"1441-\u4f7f\u7528\u6761\u4ef6",children:[]},{value:"14.4.2 IDistributedCache",id:"1442-idistributedcache",children:[]},{value:"14.4.3 \u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58",id:"1443-\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58",children:[]},{value:"14.4.4 \u5206\u5e03\u5f0f SQL Server \u7f13\u5b58",id:"1444-\u5206\u5e03\u5f0f-sql-server-\u7f13\u5b58",children:[]},{value:"14.4.5 \u5206\u5e03\u5f0f Redis \u7f13\u5b58",id:"1445-\u5206\u5e03\u5f0f-redis-\u7f13\u5b58",children:[]},{value:"14.4.6 \u5206\u5e03\u5f0f NCache \u7f13\u5b58",id:"1446-\u5206\u5e03\u5f0f-ncache-\u7f13\u5b58",children:[]}]},{value:"14.5 \u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528",id:"145-\u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528",children:[]},{value:"14.6 \u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae",id:"146-\u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae",children:[]},{value:"14.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"147-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function d(e){var n=e.components,t=Object(c.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(r.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"141-\u4ec0\u4e48\u662f\u7f13\u5b58"},"14.1 \u4ec0\u4e48\u662f\u7f13\u5b58"),Object(i.b)("p",null,"\u7f13\u5b58\u53ef\u4ee5\u51cf\u5c11\u751f\u6210\u5185\u5bb9\u6240\u9700\u7684\u5de5\u4f5c\uff0c\u4ece\u800c\u663e\u8457\u63d0\u9ad8\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u4f38\u7f29\u6027\u3002 ",Object(i.b)("strong",{parentName:"p"},"\u7f13\u5b58\u6700\u9002\u7528\u4e8e\u4e0d\u7ecf\u5e38\u66f4\u6539\u7684\u6570\u636e\uff0c\u56e0\u4e3a\u751f\u6210\u6210\u672c\u5f88\u9ad8"),"\u3002 \u901a\u8fc7\u7f13\u5b58\uff0c\u53ef\u4ee5\u6bd4\u4ece\u6570\u636e\u6e90\u8fd4\u56de\u7684\u6570\u636e\u7684\u526f\u672c\u901f\u5ea6\u5feb\u5f97\u591a\u3002 \u5e94\u8be5\u5bf9\u5e94\u7528\u8fdb\u884c\u7f16\u5199\u548c\u6d4b\u8bd5\uff0c\u4f7f\u5176\u6c38\u4e0d\u4f9d\u8d56\u4e8e\u7f13\u5b58\u7684\u6570\u636e\u3002"),Object(i.b)("h2",{id:"142-\u7f13\u5b58\u7c7b\u578b"},"14.2 \u7f13\u5b58\u7c7b\u578b"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5185\u5b58\u7f13\u5b58\uff1a\u987e\u540d\u601d\u4e49\uff0c\u5c31\u662f\u7f13\u5b58\u5728\u5e94\u7528\u90e8\u7f72\u6240\u5728\u670d\u52a1\u5668\u7684\u5185\u5b58\u4e2d"),Object(i.b)("li",{parentName:"ul"},"\u5206\u5e03\u5f0f\u7f13\u5b58\uff1a\u5206\u5e03\u5f0f\u7f13\u5b58\u662f\u7531\u591a\u4e2a\u5e94\u7528\u670d\u52a1\u5668\u5171\u4eab\u7684\u7f13\u5b58"),Object(i.b)("li",{parentName:"ul"},"\u54cd\u5e94\u7f13\u5b58\uff1a\u7f13\u5b58\u670d\u52a1\u5668\u7aef ",Object(i.b)("inlineCode",{parentName:"li"},"Not Modified")," \u7684\u6570\u636e")),Object(i.b)("h2",{id:"143-\u5185\u5b58\u7f13\u5b58\u4f7f\u7528"},"14.3 \u5185\u5b58\u7f13\u5b58\u4f7f\u7528"),Object(i.b)("p",null,"\u5185\u5b58\u7f13\u5b58\u662f\u6700\u5e38\u7528\u7684\u7f13\u5b58\u65b9\u5f0f\uff0c\u5177\u6709\u5b58\u53d6\u5feb\uff0c\u6548\u7387\u9ad8\u7279\u70b9\u3002"),Object(i.b)("p",null,"\u5185\u5b58\u7f13\u5b58\u901a\u8fc7\u6ce8\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"IMemoryCache")," \u65b9\u5f0f\u6ce8\u5165\u5373\u53ef\u3002"),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5185\u5b58\u7f13\u5b58\u670d\u52a1\u5df2\u7ecf\u9ed8\u8ba4\u6ce8\u518c\uff0c\u65e0\u9700\u624b\u52a8\u6ce8\u518c\u3002"))),Object(i.b)("h3",{id:"1431-\u57fa\u672c\u4f7f\u7528"},"14.3.1 \u57fa\u672c\u4f7f\u7528"),Object(i.b)("p",null,"\u5982\uff0c\u7f13\u5b58\u5f53\u524d\u65f6\u95f4\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,21-24}","{13,21-24}":!0}),'using Furion.DynamicApiController;\nusing Microsoft.Extensions.Caching.Memory;\nusing System;\n\nnamespace Furion.Application\n{\n public class CacheServices : IDynamicApiController\n {\n private const string _timeCacheKey = "cache_time";\n\n private readonly IMemoryCache _memoryCache;\n\n public CacheServices(IMemoryCache memoryCache)\n {\n _memoryCache = memoryCache;\n }\n\n [ApiDescriptionSettings(KeepName = true)]\n public DateTimeOffset GetOrCreate()\n {\n return _memoryCache.GetOrCreate(_timeCacheKey, entry =>\n {\n return DateTimeOffset.UtcNow;\n });\n }\n }\n}\n')),Object(i.b)("h3",{id:"1432-\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"},"14.3.2 \u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"),Object(i.b)("p",null,"\u5185\u5b58\u7f13\u5b58\u652f\u6301\u8bbe\u7f6e\u7f13\u5b58\u65f6\u95f4\u3001\u7f13\u5b58\u5927\u5c0f\u3001\u53ca\u7edd\u5bf9\u7f13\u5b58\u8fc7\u671f\u65f6\u95f4\u7b49"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_memoryCache.GetOrCreate(_timeCacheKey, entry =>\n{\n entry.SlidingExpiration = TimeSpan.FromSeconds(3); // \u6ed1\u52a8\u7f13\u5b58\u65f6\u95f4\n return DateTimeOffset.UtcNow;\n});\n\nawait _memoryCache.GetOrCreateAsync(_timeCacheKey, async entry =>\n{\n // \u8fd9\u91cc\u53ef\u4ee5\u4f7f\u7528\u5f02\u6b65~~\n});\n")),Object(i.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u5173\u4e8e\u7f13\u5b58\u65f6\u95f4")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u53ea\u6709\u5177\u6709\u53ef\u8c03\u8fc7\u671f\u7684\u7f13\u5b58\u9879\u96c6\u5b58\u5728\u8fc7\u65f6\u7684\u98ce\u9669\u3002 \u5982\u679c\u8bbf\u95ee\u7684\u65f6\u95f4\u6bd4\u6ed1\u52a8\u8fc7\u671f\u65f6\u95f4\u95f4\u9694\u66f4\u9891\u7e41\uff0c\u5219\u8be5\u9879\u5c06\u6c38\u4e0d\u8fc7\u671f\u3002"),Object(i.b)("p",{parentName:"div"},"\u5c06\u5f39\u6027\u8fc7\u671f\u4e0e\u7edd\u5bf9\u8fc7\u671f\u7ec4\u5408\u5728\u4e00\u8d77\uff0c\u4ee5\u4fdd\u8bc1\u9879\u76ee\u5728\u5176\u7edd\u5bf9\u8fc7\u671f\u65f6\u95f4\u901a\u8fc7\u540e\u8fc7\u671f\u3002 \u7edd\u5bf9\u8fc7\u671f\u4f1a\u5c06\u9879\u7684\u4e0a\u9650\u8bbe\u7f6e\u4e3a\u53ef\u7f13\u5b58\u9879\u7684\u65f6\u95f4\uff0c\u540c\u65f6\u4ecd\u5141\u8bb8\u9879\u5728\u53ef\u8c03\u6574\u8fc7\u671f\u65f6\u95f4\u95f4\u9694\u5185\u672a\u8bf7\u6c42\u65f6\u63d0\u524d\u8fc7\u671f\u3002"),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u540c\u65f6\u6307\u5b9a\u4e86\u7edd\u5bf9\u8fc7\u671f\u548c\u53ef\u8c03\u8fc7\u671f\u65f6\u95f4\uff0c\u5219\u8fc7\u671f\u65f6\u95f4\u4ee5\u903b\u8f91\u65b9\u5f0f\u8fd0\u7b97\u3002 \u5982\u679c\u6ed1\u52a8\u8fc7\u671f\u65f6\u95f4\u95f4\u9694 \u6216 \u7edd\u5bf9\u8fc7\u671f\u65f6\u95f4\u901a\u8fc7\uff0c\u5219\u4ece\u7f13\u5b58\u4e2d\u9010\u51fa\u8be5\u9879\u3002"),Object(i.b)("p",{parentName:"div"},"\u5982\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_memoryCache.GetOrCreate(_timeCacheKey, entry =>\n{\n entry.SetSlidingExpiration(TimeSpan.FromSeconds(3));\n entry.AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(20);\n return DateTime.Now;\n});\n")),Object(i.b)("p",{parentName:"div"},"\u524d\u9762\u7684\u4ee3\u7801\u4fdd\u8bc1\u6570\u636e\u7684\u7f13\u5b58\u65f6\u95f4\u4e0d\u8d85\u8fc7\u7edd\u5bf9\u65f6\u95f4\u3002"))),Object(i.b)("h3",{id:"1433-\u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"},"14.3.3 \u624b\u52a8\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879"),Object(i.b)("p",null,"\u9664\u4e86\u4e0a\u9762\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Func")," \u65b9\u5f0f\u8bbe\u7f6e\u7f13\u5b58\u9009\u9879\uff0c\u6211\u4eec\u53ef\u4ee5\u624b\u52a8\u521b\u5efa\u5e76\u8bbe\u7f6e\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var cacheEntryOptions = new MemoryCacheEntryOptions()\n .SetSlidingExpiration(TimeSpan.FromSeconds(3));\n\n_memoryCache.Set(_timeCacheKey, DateTimeOffset.UtcNow, cacheEntryOptions);\n")),Object(i.b)("h3",{id:"1434-\u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb"},"14.3.4 \u7f13\u5b58\u4f9d\u8d56\u5173\u7cfb"),Object(i.b)("p",null,"\u4e0b\u9762\u7684\u793a\u4f8b\u6f14\u793a\u5982\u4f55\u5728\u4f9d\u8d56\u6761\u76ee\u8fc7\u671f\u65f6\u4f7f\u7f13\u5b58\u6761\u76ee\u8fc7\u671f\u3002 ",Object(i.b)("inlineCode",{parentName:"p"},"CancellationChangeToken")," \u6dfb\u52a0\u5230\u7f13\u5b58\u7684\u9879\u3002 \u5f53 ",Object(i.b)("inlineCode",{parentName:"p"},"Cancel")," \u5728\u4e0a\u8c03\u7528\u65f6 ",Object(i.b)("inlineCode",{parentName:"p"},"CancellationTokenSource")," \uff0c\u5c06\u9010\u51fa\u4e24\u4e2a\u7f13\u5b58\u9879\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public IActionResult CreateDependentEntries()\n{\n var cts = new CancellationTokenSource();\n _cache.Set(CacheKeys.DependentCTS, cts);\n\n using (var entry = _cache.CreateEntry(CacheKeys.Parent))\n {\n // expire this entry if the dependant entry expires.\n entry.Value = DateTime.Now;\n entry.RegisterPostEvictionCallback(DependentEvictionCallback, this);\n\n _cache.Set(CacheKeys.Child,\n DateTime.Now,\n new CancellationChangeToken(cts.Token));\n }\n\n return RedirectToAction("GetDependentEntries");\n}\n\npublic IActionResult GetDependentEntries()\n{\n return View("Dependent", new DependentViewModel\n {\n ParentCachedTime = _cache.Get(CacheKeys.Parent),\n ChildCachedTime = _cache.Get(CacheKeys.Child),\n Message = _cache.Get(CacheKeys.DependentMessage)\n });\n}\n\npublic IActionResult RemoveChildEntry()\n{\n _cache.Get(CacheKeys.DependentCTS).Cancel();\n return RedirectToAction("GetDependentEntries");\n}\n\nprivate static void DependentEvictionCallback(object key, object value,\n EvictionReason reason, object state)\n{\n var message = $"Parent entry was evicted. Reason: {reason}.";\n ((HomeController)state)._cache.Set(CacheKeys.DependentMessage, message);\n}\n')),Object(i.b)("p",null,"\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"CancellationTokenSource")," \u5141\u8bb8\u5c06\u591a\u4e2a\u7f13\u5b58\u6761\u76ee\u4f5c\u4e3a\u4e00\u4e2a\u7ec4\u9010\u51fa\u3002 ",Object(i.b)("inlineCode",{parentName:"p"},"using")," \u5728\u4e0a\u9762\u7684\u4ee3\u7801\u4e2d\uff0c\u5728\u5757\u4e2d\u521b\u5efa\u7684\u7f13\u5b58\u6761\u76ee ",Object(i.b)("inlineCode",{parentName:"p"},"using")," \u5c06\u7ee7\u627f\u89e6\u53d1\u5668\u548c\u8fc7\u671f\u8bbe\u7f6e\u3002"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u5185\u5b58\u4e2d\u7684\u7f13\u5b58")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/memory?view=aspnetcore-5.0"}),"ASP.NET Core - \u5185\u5b58\u7f13\u5b58")," \u7ae0\u8282\u3002"))),Object(i.b)("h2",{id:"144-\u5206\u5e03\u5f0f\u7f13\u5b58"},"14.4 \u5206\u5e03\u5f0f\u7f13\u5b58"),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u7f13\u5b58\u662f\u7531\u591a\u4e2a\u5e94\u7528\u670d\u52a1\u5668\u5171\u4eab\u7684\u7f13\u5b58\uff0c\u901a\u5e38\u4f5c\u4e3a\u5916\u90e8\u670d\u52a1\u5728\u8bbf\u95ee\u5b83\u7684\u5e94\u7528\u670d\u52a1\u5668\u4e0a\u7ef4\u62a4\u3002 \u5206\u5e03\u5f0f\u7f13\u5b58\u53ef\u4ee5\u63d0\u9ad8 ",Object(i.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u53ef\u4f38\u7f29\u6027\uff0c\u5c24\u5176\u662f\u5728\u5e94\u7528\u7a0b\u5e8f\u7531\u4e91\u670d\u52a1\u6216\u670d\u52a1\u5668\u573a\u6258\u7ba1\u65f6\u3002"),Object(i.b)("p",null,"\u4e0e\u5176\u4ed6\u7f13\u5b58\u65b9\u6848\u76f8\u6bd4\uff0c\u5206\u5e03\u5f0f\u7f13\u5b58\u5177\u6709\u591a\u9879\u4f18\u52bf\uff0c\u5176\u4e2d\u7f13\u5b58\u7684\u6570\u636e\u5b58\u50a8\u5728\u5355\u4e2a\u5e94\u7528\u670d\u52a1\u5668\u4e0a\u3002"),Object(i.b)("p",null,"\u5f53\u5206\u5e03\u5f0f\u7f13\u5b58\u6570\u636e\u65f6\uff0c\u6570\u636e\u5c06\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"(\u4e00\u81f4\u6027) \u8de8\u591a\u4e2a \u670d\u52a1\u5668\u7684\u8bf7\u6c42"),Object(i.b)("li",{parentName:"ul"},"\u5b58\u6d3b\u5728\u670d\u52a1\u5668\u91cd\u542f\u548c\u5e94\u7528\u90e8\u7f72\u4e4b\u95f4"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u4f7f\u7528\u672c\u5730\u5185\u5b58")),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u7f13\u5b58\u914d\u7f6e\u662f\u7279\u5b9a\u4e8e\u5b9e\u73b0\u7684\u3002 \u672c\u6587\u4ecb\u7ecd\u5982\u4f55\u914d\u7f6e ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Redis")," \u5206\u5e03\u5f0f\u7f13\u5b58\u3002 \u7b2c\u4e09\u65b9\u5b9e\u73b0\u4e5f\u53ef\u7528\uff0c\u4f8b\u5982 GitHub \u4e0a\u7684 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/Alachisoft/NCache"}),"NCache")," (NCache) \u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u5b9e\u73b0\uff0c\u5e94\u7528\u90fd\u4f1a\u4f7f\u7528\u63a5\u53e3\u4e0e\u7f13\u5b58\u4ea4\u4e92 ",Object(i.b)("inlineCode",{parentName:"strong"},"IDistributedCache")," \u3002")),Object(i.b)("h3",{id:"1441-\u4f7f\u7528\u6761\u4ef6"},"14.4.1 \u4f7f\u7528\u6761\u4ef6"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"SQL Server")," \u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u5219\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"li"},"Microsoft.Extensions.Caching.SqlServer")," \u5305"),Object(i.b)("li",{parentName:"ul"},"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"Redis")," \u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u5219\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"li"},"Microsoft.Extensions.Caching.StackExchangeRedis")," \u5305"),Object(i.b)("li",{parentName:"ul"},"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"NCache")," \u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u5219\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"li"},"NCache.Microsoft.Extensions.Caching.OpenSource")," \u5305")),Object(i.b)("h3",{id:"1442-idistributedcache"},"14.4.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"IDistributedCache")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u63a5\u53e3\u63d0\u4f9b\u4ee5\u4e0b\u65b9\u6cd5\u6765\u5904\u7406\u5206\u5e03\u5f0f\u7f13\u5b58\u5b9e\u73b0\u4e2d\u7684\u9879\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"GetGetAsync"),"\uff1a\u63a5\u53d7\u5b57\u7b26\u4e32\u952e\uff0c\u5e76\u68c0\u7d22\u7f13\u5b58\u9879\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"li"},"byte[]")," \u6570\u7ec4\uff08\u5982\u679c\u5728\u7f13\u5b58\u4e2d\u627e\u5230\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SetSetAsync"),"\uff1a\u4f7f\u7528\u5b57\u7b26\u4e32\u952e\u5c06\u9879 (\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"li"},"byte[]")," \u6570\u7ec4) \u6dfb\u52a0\u5230\u7f13\u5b58\u4e2d"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Refresh/RefreshAsync")," \uff1a\u6839\u636e\u9879\u7684\u952e\u5237\u65b0\u7f13\u5b58\u4e2d\u7684\u9879\uff0c\u91cd\u7f6e\u5176\u6ed1\u52a8\u8fc7\u671f\u8d85\u65f6\uff08\u5982\u679c\u6709\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"RemoveRemoveAsync"),"\uff1a\u6839\u636e\u7f13\u5b58\u9879\u7684\u5b57\u7b26\u4e32\u952e\u5220\u9664\u7f13\u5b58\u9879")),Object(i.b)("h3",{id:"1443-\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58"},"14.4.3 \u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58"),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\uff08",Object(i.b)("inlineCode",{parentName:"p"},"AddDistributedMemoryCache"),"\uff09\u662f\u4e00\u4e2a\u6846\u67b6\u63d0\u4f9b\u7684\u5b9e\u73b0 ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \uff0c\u5b83\u5c06\u9879\u5b58\u50a8\u5728\u5185\u5b58\u4e2d\u3002 ",Object(i.b)("strong",{parentName:"p"},"\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u4e0d\u662f\u5b9e\u9645\u7684\u5206\u5e03\u5f0f\u7f13\u5b58\uff0c\u7f13\u5b58\u9879\u7531\u5e94\u7528\u7a0b\u5e8f\u5b9e\u4f8b\u5b58\u50a8\u5728\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u7684\u670d\u52a1\u5668\u4e0a\u3002")),Object(i.b)("p",null,"\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u4f18\u70b9\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u7528\u4e8e\u5f00\u53d1\u548c\u6d4b\u8bd5\u65b9\u6848\u3002"),Object(i.b)("li",{parentName:"ul"},"\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4f7f\u7528\u5355\u4e00\u670d\u52a1\u5668\u5e76\u4e14\u5185\u5b58\u6d88\u8017\u4e0d\u662f\u95ee\u9898\u3002 \u5b9e\u73b0\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u4f1a\u62bd\u8c61\u5316\u7f13\u5b58\u7684\u6570\u636e\u5b58\u50a8\u3002 \u5982\u679c\u9700\u8981\u591a\u4e2a\u8282\u70b9\u6216\u5bb9\u9519\uff0c\u53ef\u4ee5\u5728\u5c06\u6765\u5b9e\u73b0\u771f\u6b63\u7684\u5206\u5e03\u5f0f\u7f13\u5b58\u89e3\u51b3\u65b9\u6848\u3002")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5206\u5e03\u5f0f\u5185\u5b58\u7f13\u5b58\u670d\u52a1\u5df2\u7ecf\u9ed8\u8ba4\u6ce8\u518c\uff0c\u65e0\u9700\u624b\u52a8\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"services.AddDistributedMemoryCache();")," \u6ce8\u518c\u3002"))),Object(i.b)("h3",{id:"1444-\u5206\u5e03\u5f0f-sql-server-\u7f13\u5b58"},"14.4.4 \u5206\u5e03\u5f0f SQL Server \u7f13\u5b58"),Object(i.b)("p",null,"\u5206\u5e03\u5f0f ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u7f13\u5b58\u5b9e\u73b0 (",Object(i.b)("inlineCode",{parentName:"p"},"AddDistributedSqlServerCache"),") \u5141\u8bb8\u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u6570\u636e\u5e93\u4f5c\u4e3a\u5176\u540e\u5907\u5b58\u50a8\u3002"),Object(i.b)("p",null,"\u82e5\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u5b9e\u4f8b\u4e2d\u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u7f13\u5b58\u7684\u9879\u8868\uff0c\u53ef\u4ee5\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"sql-cache")," \u5de5\u5177\u3002 \u8be5\u5de5\u5177\u5c06\u521b\u5efa\u4e00\u4e2a\u8868\uff0c\u5176\u4e2d\u5305\u542b\u6307\u5b9a\u7684\u540d\u79f0\u548c\u67b6\u6784\u3002"),Object(i.b)("p",null,"\u901a\u8fc7\u8fd0\u884c\u547d\u4ee4 ",Object(i.b)("inlineCode",{parentName:"p"},"sql-cache create")," \u521b\u5efa\u4e00\u4e2a\u8868\uff0c\u63d0\u4f9b ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u5b9e\u4f8b (Data Source) \u3001\u6570\u636e\u5e93 (Initial Catalog) \u3001\u67b6\u6784 (\u4f8b\u5982) dbo \u548c\u8868\u540d\u79f0\u3002\u4f8b\u5982 ",Object(i.b)("inlineCode",{parentName:"p"},"TestCache"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),'dotnet sql-cache create "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=DistCache;Integrated Security=True;" dbo TestCache\n')),Object(i.b)("p",null,"\u521b\u5efa\u6210\u529f\u540e\uff0c\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDistributedSqlServerCache(options =>\n{\n options.ConnectionString =\n _config["DistCache_ConnectionString"];\n options.SchemaName = "dbo";\n options.TableName = "TestCache";\n});\n')),Object(i.b)("h3",{id:"1445-\u5206\u5e03\u5f0f-redis-\u7f13\u5b58"},"14.4.5 \u5206\u5e03\u5f0f ",Object(i.b)("inlineCode",{parentName:"h3"},"Redis")," \u7f13\u5b58"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Redis")," \u662f\u5185\u5b58\u4e2d\u6570\u636e\u5b58\u50a8\u7684\u5f00\u6e90\u6570\u636e\u5b58\u50a8\uff0c\u901a\u5e38\u7528\u4f5c\u5206\u5e03\u5f0f\u7f13\u5b58\u3002\u5728\u4f7f\u7528\u65f6\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"services.AddStackExchangeRedisCache()")," \u4e2d\u6ce8\u518c\u5373\u53ef\u3002"),Object(i.b)("p",null,"\u8fd9\u91cc\u4e0d\u7ec6\u8bb2 ",Object(i.b)("inlineCode",{parentName:"p"},"Redis")," \u76f8\u5173\u5185\u5bb9\uff0c\u540e\u7eed\u7ae0\u8282\u4f1a\u4f7f\u7528\u57fa\u672c\u4f8b\u5b50\u6f14\u793a\u3002"),Object(i.b)("h3",{id:"1446-\u5206\u5e03\u5f0f-ncache-\u7f13\u5b58"},"14.4.6 \u5206\u5e03\u5f0f ",Object(i.b)("inlineCode",{parentName:"h3"},"NCache")," \u7f13\u5b58"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"NCache")," \u662f\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},".NET")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},".Net Core")," \u4e2d\u4ee5\u672c\u673a\u65b9\u5f0f\u5f00\u53d1\u7684\u5f00\u6e90\u5185\u5b58\u4e2d\u5206\u5e03\u5f0f\u7f13\u5b58\u3002 ",Object(i.b)("inlineCode",{parentName:"p"},"NCache")," \u5728\u672c\u5730\u5de5\u4f5c\u5e76\u914d\u7f6e\u4e3a\u5206\u5e03\u5f0f\u7f13\u5b58\u7fa4\u96c6\uff0c\u9002\u7528\u4e8e\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Azure")," \u6216\u5176\u4ed6\u6258\u7ba1\u5e73\u53f0\u4e0a\u8fd0\u884c\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u3002\n\u82e5\u8981\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e ",Object(i.b)("inlineCode",{parentName:"p"},"NCache"),"\uff0c\u8bf7\u53c2\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://www.alachisoft.com/resources/docs/ncache-oss/getting-started-guide-windows/"}),"\u9002\u7528\u4e8e Windows \u7684 NCache \u5165\u95e8\u6307\u5357"),"\u3002"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"NCache")," \u57fa\u672c\u914d\u7f6e\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"li"},"Alachisoft.NCache.OpenSource.SDK")," \u5305"),Object(i.b)("li",{parentName:"ul"},"\u5728 ",Object(i.b)("a",Object(a.a)({parentName:"li"},{href:"https://www.alachisoft.com/resources/docs/ncache-oss/admin-guide/client-config.html"}),"ncconf")," \u4e2d\u914d\u7f6e\u7f13\u5b58\u7fa4\u96c6"),Object(i.b)("li",{parentName:"ul"},"\u6ce8\u518c ",Object(i.b)("inlineCode",{parentName:"li"},"NCache")," \u670d\u52a1")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddNCacheDistributedCache(configuration =>\n{\n configuration.CacheName = "demoClusteredCache";\n configuration.EnableLogs = true;\n configuration.ExceptionsEnabled = true;\n});\n')),Object(i.b)("h2",{id:"145-\u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528"},"14.5 \u5206\u5e03\u5f0f\u7f13\u5b58\u4f7f\u7528"),Object(i.b)("p",null,"\u82e5\u8981\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u63a5\u53e3\uff0c\u8bf7 ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u901a\u8fc7\u6784\u9020\u51fd\u6570\u4f9d\u8d56\u5173\u7cfb\u6ce8\u5165\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,16,30-33}","{5,16,30-33}":!0}),'public class IndexModel : PageModel\n{\n private readonly IDistributedCache _cache;\n\n public IndexModel(IDistributedCache cache)\n {\n _cache = cache;\n }\n\n public string CachedTimeUTC { get; set; }\n\n public async Task OnGetAsync()\n {\n CachedTimeUTC = "Cached Time Expired";\n // \u83b7\u53d6\u5206\u5e03\u5f0f\u7f13\u5b58\n var encodedCachedTimeUTC = await _cache.GetAsync("cachedTimeUTC");\n\n if (encodedCachedTimeUTC != null)\n {\n CachedTimeUTC = Encoding.UTF8.GetString(encodedCachedTimeUTC);\n }\n }\n\n public async Task OnPostResetCachedTime()\n {\n var currentTimeUTC = DateTime.UtcNow.ToString();\n byte[] encodedCurrentTimeUTC = Encoding.UTF8.GetBytes(currentTimeUTC);\n\n // \u8bbe\u7f6e\u5206\u5e03\u5f0f\u7f13\u5b58\n var options = new DistributedCacheEntryOptions()\n .SetSlidingExpiration(TimeSpan.FromSeconds(20));\n\n await _cache.SetAsync("cachedTimeUTC", encodedCurrentTimeUTC, options);\n\n return RedirectToPage();\n }\n}\n')),Object(i.b)("h2",{id:"146-\u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae"},"14.6 \u5206\u5e03\u5f0f\u7f13\u5b58\u5efa\u8bae"),Object(i.b)("p",null,"\u786e\u5b9a ",Object(i.b)("inlineCode",{parentName:"p"},"IDistributedCache")," \u6700\u9002\u5408\u4f60\u7684\u5e94\u7528\u7684\u5b9e\u73b0\u65f6\uff0c\u8bf7\u8003\u8651\u4ee5\u4e0b\u4e8b\u9879\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u73b0\u6709\u57fa\u7840\u7ed3\u6784"),Object(i.b)("li",{parentName:"ul"},"\u6027\u80fd\u8981\u6c42"),Object(i.b)("li",{parentName:"ul"},"\u6210\u672c"),Object(i.b)("li",{parentName:"ul"},"\u56e2\u961f\u7ecf\u9a8c")),Object(i.b)("p",null,"\u7f13\u5b58\u89e3\u51b3\u65b9\u6848\u901a\u5e38\u4f9d\u8d56\u4e8e\u5185\u5b58\u4e2d\u7684\u5b58\u50a8\u4ee5\u5feb\u901f\u68c0\u7d22\u7f13\u5b58\u7684\u6570\u636e\uff0c\u4f46\u662f\uff0c\u5185\u5b58\u662f\u6709\u9650\u7684\u8d44\u6e90\uff0c\u5e76\u4e14\u5f88\u6602\u8d35\u3002 \u4ec5\u5c06\u5e38\u7528\u6570\u636e\u5b58\u50a8\u5728\u7f13\u5b58\u4e2d\u3002"),Object(i.b)("p",null,"\u901a\u5e38\uff0c",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Redis")," \u7f13\u5b58\u63d0\u4f9b\u6bd4 ",Object(i.b)("inlineCode",{parentName:"strong"},"SQL Server")," \u7f13\u5b58\u66f4\u9ad8\u7684\u541e\u5410\u91cf\u548c\u66f4\u4f4e\u7684\u5ef6\u8fdf\u3002")," \u4f46\u662f\uff0c\u901a\u5e38\u9700\u8981\u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5\u6765\u786e\u5b9a\u7f13\u5b58\u7b56\u7565\u7684\u6027\u80fd\u7279\u5f81\u3002"),Object(i.b)("p",null,"\u5f53 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u7528\u4f5c\u5206\u5e03\u5f0f\u7f13\u5b58\u540e\u5907\u5b58\u50a8\u65f6\uff0c\u5bf9\u7f13\u5b58\u4f7f\u7528\u540c\u4e00\u6570\u636e\u5e93\uff0c\u5e76\u4e14\u5e94\u7528\u7684\u666e\u901a\u6570\u636e\u5b58\u50a8\u548c\u68c0\u7d22\u4f1a\u5bf9\u8fd9\u4e24\u79cd\u60c5\u51b5\u7684\u6027\u80fd\u4ea7\u751f\u8d1f\u9762\u5f71\u54cd\u3002 \u5efa\u8bae\u4f7f\u7528\u5206\u5e03\u5f0f\u7f13\u5b58\u540e\u5907\u5b58\u50a8\u7684\u4e13\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"SQL Server")," \u5b9e\u4f8b\u3002"),Object(i.b)("h2",{id:"147-\u53cd\u9988\u4e0e\u5efa\u8bae"},"14.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u5206\u5e03\u5f0f\u7f13\u5b58")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/performance/caching/distributed?view=aspnetcore-5.0"}),"ASP.NET Core - \u5206\u5e03\u5f0f\u7f13\u5b58")," \u7ae0\u8282\u3002"))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/2b04a543.027675a5.js b/docs/2b04a543.4008081d.js similarity index 96% rename from docs/2b04a543.027675a5.js rename to docs/2b04a543.4008081d.js index ebfef04be37..a690f272a34 100644 --- a/docs/2b04a543.027675a5.js +++ b/docs/2b04a543.4008081d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},u=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},p=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),u=l(n),p=r,m=u["".concat(i,".").concat(p)]||u[p]||d[p]||c;return n?a.a.createElement(m,b(b({ref:t},s),{},{components:n})):a.a.createElement(m,b({ref:t},s))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=p;var b={};for(var o in t)hasOwnProperty.call(t,o)&&(b[o]=t[o]);b.originalType=e,b.mdxType="string"==typeof e?e:r,i[1]=b;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},95:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var r=n(3),a=n(7),c=(n(0),n(192)),i=n(190),b=n(193),o={id:"event-bus",title:"22. \u4e8b\u4ef6\u603b\u7ebf",sidebar_label:"22. \u4e8b\u4ef6\u603b\u7ebf"},s={unversionedId:"event-bus",id:"event-bus",isDocsHomePage:!1,title:"22. \u4e8b\u4ef6\u603b\u7ebf",description:"22.1 \u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf",source:"@site/docs\\event-bus.mdx",slug:"/event-bus",permalink:"/docs/event-bus",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/event-bus.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"22. \u4e8b\u4ef6\u603b\u7ebf",sidebar:"docs",previous:{title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",permalink:"/docs/local-language"},next:{title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",permalink:"/docs/process-service"}},l=[{value:"22.1 \u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf",id:"221-\u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf",children:[]},{value:"22.2 MessageCenter \u6d88\u606f\u4e2d\u5fc3",id:"222-messagecenter-\u6d88\u606f\u4e2d\u5fc3",children:[{value:"22.2.1 \u6ce8\u518c \u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1",id:"2221-\u6ce8\u518c-\u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1",children:[]},{value:"22.2.2 \u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f",id:"2222-\u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f",children:[]},{value:"22.2.3 \u53d1\u5e03\u6d88\u606f",id:"2223-\u53d1\u5e03\u6d88\u606f",children:[]},{value:"22.2.4 \u76f4\u63a5\u8ba2\u9605\u6d88\u606f",id:"2224-\u76f4\u63a5\u8ba2\u9605\u6d88\u606f",children:[]}]},{value:"22.3 MediatR \u5e93",id:"223-mediatr-\u5e93",children:[{value:"22.3.1 MediatR \u4f7f\u7528\u6587\u6863",id:"2231-mediatr-\u4f7f\u7528\u6587\u6863",children:[]}]},{value:"22.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"224-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:l};function d(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"221-\u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf"},"22.1 \u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf"),Object(c.b)("p",null,"\u4e8b\u4ef6\u603b\u7ebf\u662f\u5bf9\u53d1\u5e03-\u8ba2\u9605\u6a21\u5f0f\u7684\u4e00\u79cd\u5b9e\u73b0\u3002\u5b83\u662f\u4e00\u79cd\u96c6\u4e2d\u5f0f\u4e8b\u4ef6\u5904\u7406\u673a\u5236\uff0c\u5141\u8bb8\u4e0d\u540c\u7684\u7ec4\u4ef6\u4e4b\u95f4\u8fdb\u884c\u5f7c\u6b64\u901a\u4fe1\u800c\u53c8\u4e0d\u9700\u8981\u76f8\u4e92\u4f9d\u8d56\uff0c\u8fbe\u5230\u4e00\u79cd\u89e3\u8026\u7684\u76ee\u7684\u3002"),Object(c.b)("p",null,"\u6211\u4eec\u6765\u770b\u770b\u4e8b\u4ef6\u603b\u7ebf\u7684\u5904\u7406\u6d41\u7a0b\uff1a"),Object(c.b)("img",{src:Object(i.a)("img/event1.png")}),Object(c.b)("h2",{id:"222-messagecenter-\u6d88\u606f\u4e2d\u5fc3"},"22.2 ",Object(c.b)("inlineCode",{parentName:"h2"},"MessageCenter")," \u6d88\u606f\u4e2d\u5fc3"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5b9e\u73b0\u4e86\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u4e8b\u4ef6\u603b\u7ebf\u5b9e\u73b0\u673a\u5236\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter"),"\uff08\u6d88\u606f\u4e2d\u5fc3\uff09\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u91c7\u7528\u5b57\u7b26\u4e32\u6d88\u606f\u673a\u5236\u8fdb\u884c\u5e7f\u64ad\uff0c \u53ef\u4ee5\u5728\u7edd\u5927\u591a\u6570\u4e2d\u5c0f\u578b\u9879\u76ee\u4e2d\u53d1\u6325\u4f5c\u7528\uff0c\u7f3a\u70b9\u662f\u6d88\u606f\u5904\u7406\u662f\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u5b8c\u6210\u5e76\u4e14\u6d88\u606f\u4e0d\u652f\u6301\u5206\u5e03\u5f0f\u5b58\u50a8\u3002"),Object(c.b)("p",null,"\u53e6\u5916\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u652f\u6301\u5355\u64ad\u3001\u591a\u64ad\u53d1\u5e03\u53ca\u591a\u8ba2\u9605\u3002\u5982\u56fe\u6240\u793a\uff1a"),Object(c.b)("img",{src:Object(i.a)("img/event2.png")}),Object(c.b)("h3",{id:"2221-\u6ce8\u518c-\u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1"},"22.2.1 \u6ce8\u518c ",Object(c.b)("inlineCode",{parentName:"h3"},"\u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1")),Object(c.b)("p",null,"\u5982\u679c\u60f3\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\uff0c\u53ea\u9700\u8981\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u670d\u52a1\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddSimpleEventBus();\n}\n")),Object(c.b)("h3",{id:"2222-\u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f"},"22.2.2 \u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u662f\u6839\u636e ",Object(c.b)("inlineCode",{parentName:"p"},"MesseageId")," \u6d88\u606f Id \u6765\u89e6\u53d1\u5bf9\u5e94\u7684\u5904\u7406\u7a0b\u5e8f\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u5b9a\u4e49 ",Object(c.b)("inlineCode",{parentName:"p"},"\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f\u7c7b"),"\uff0c\u8be5\u7c7b\u9700\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"ISubscribeHandler")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,4-5,11-13}","{1,4-5,11-13}":!0}),'public class UserChangeSubscribeHandler : ISubscribeHandler\n{\n // \u5b9a\u4e49\u4e00\u6761\u6d88\u606f\n [SubscribeMessage("create:user")]\n public void CreateUser(string eventId, object payload)\n {\n Console.WriteLine("\u6211\u662f"+eventId);\n }\n\n // \u591a\u6761\u6d88\u606f\u5171\u7528\u540c\u4e00\u4e2a\u5904\u7406\u7a0b\u5e8f\n [SubscribeMessage("delete:user")]\n [SubscribeMessage("remove:user")]\n public void RemoveUser(string eventId, object payload)\n {\n Console.WriteLine("\u6211\u662f"+eventId);\n }\n}\n')),Object(c.b)("h3",{id:"2223-\u53d1\u5e03\u6d88\u606f"},"22.2.3 \u53d1\u5e03\u6d88\u606f"),Object(c.b)("p",null,"\u5b9a\u4e49\u597d\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5728\u7a0b\u5e8f\u4efb\u4f55\u5730\u65b9\u8fdb\u884c\u5e7f\u64ad\u6d88\u606f\uff0c\u4e8b\u4ef6\u603b\u7ebf\u4f1a\u81ea\u52a8\u6839\u636e\u6d88\u606f Id \u89e6\u53d1\u5bf9\u5e94\u7684\u5904\u7406\u7a0b\u5e8f\u65b9\u6cd5\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Send("create:user", new User {}); // => \u6253\u5370\uff1a\u6211\u662fcreate:user\n\nMessageCenter.Send("delete:user", new User {}); // => \u6253\u5370\uff1a\u6211\u662fdelete:user\nMessageCenter.Send("remove:user", new User {}); // => \u6253\u5370\uff1a\u6211\u662fremove:user\n')),Object(c.b)("h3",{id:"2224-\u76f4\u63a5\u8ba2\u9605\u6d88\u606f"},"22.2.4 \u76f4\u63a5\u8ba2\u9605\u6d88\u606f"),Object(c.b)("p",null,"\u5728\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"ISubscribeHandler")," \u7684\u6d3e\u751f\u7c7b\u8fdb\u884c\u76f8\u5173\u914d\u7f6e\u624d\u80fd\u5b9e\u73b0\u8ba2\u9605\u5904\u7406\u3002"),Object(c.b)("p",null,"\u5728\u67d0\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u53ea\u9700\u8981\u8ba2\u9605\u4e00\u6b21\u5373\u53ef\u3002\u6240\u4ee5\uff0c\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u4e3a\u4e86\u66f4\u7b80\u4fbf\u7684\u8ba2\u9605\u6d88\u606f\uff0c\u4e5f\u63d0\u4f9b\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter.Subscribe")," \u9759\u6001\u65b9\u6cd5\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Subscribe("create:user", (i,p) => {\n // do something\u3002\u3002\u3002\n});\n')),Object(c.b)("h2",{id:"223-mediatr-\u5e93"},"22.3 ",Object(c.b)("inlineCode",{parentName:"h2"},"MediatR")," \u5e93"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9ed8\u8ba4\u53ea\u5b9e\u73b0\u4e86\u8f7b\u91cf\u7ea7\u7684\u4e8b\u4ef6\u603b\u7ebf\u673a\u5236\uff0c\u53ef\u80fd\u8fd8\u8fdc\u8fdc\u672a\u8fbe\u5230\u5927\u578b\u9879\u76ee\u548c\u9ad8\u5e76\u53d1\u6570\u636e\u7684\u5904\u7406\u9700\u6c42\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\uff0c\u63a8\u8350\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"MediatR")," \u8fd9\u4e2a\u7b2c\u4e09\u65b9\u5e93\u8fdb\u884c\u5904\u7406\uff0cGithub \u5730\u5740\uff1a",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/jbogard/MediatR"}),"https://github.com/jbogard/MediatR")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"MediatR")," \u662f\u975e\u5e38\u4f18\u79c0\u7684\u4e8b\u4ef6\u603b\u7ebf\u5e93\uff0c\u652f\u6301\u5355\u64ad\u3001\u591a\u64ad\u3001\u6d88\u606f\u901a\u77e5\u63a8\u9001\u3001\u667a\u80fd\u8c03\u5ea6\u7b49\u64cd\u4f5c\uff0c\u975e\u5e38\u5c0f\u5de7\u3002"),Object(c.b)("h3",{id:"2231-mediatr-\u4f7f\u7528\u6587\u6863"},"22.3.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"MediatR")," \u4f7f\u7528\u6587\u6863"),Object(c.b)("p",null,Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/jbogard/MediatR/wiki"}),"https://github.com/jbogard/MediatR/wiki")),Object(c.b)("h2",{id:"224-\u53cd\u9988\u4e0e\u5efa\u8bae"},"22.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[22],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},u=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},p=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),u=l(n),p=r,m=u["".concat(i,".").concat(p)]||u[p]||d[p]||c;return n?a.a.createElement(m,b(b({ref:t},s),{},{components:n})):a.a.createElement(m,b({ref:t},s))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=p;var b={};for(var o in t)hasOwnProperty.call(t,o)&&(b[o]=t[o]);b.originalType=e,b.mdxType="string"==typeof e?e:r,i[1]=b;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},95:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var r=n(3),a=n(7),c=(n(0),n(196)),i=n(194),b=n(197),o={id:"event-bus",title:"22. \u4e8b\u4ef6\u603b\u7ebf",sidebar_label:"22. \u4e8b\u4ef6\u603b\u7ebf"},s={unversionedId:"event-bus",id:"event-bus",isDocsHomePage:!1,title:"22. \u4e8b\u4ef6\u603b\u7ebf",description:"22.1 \u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf",source:"@site/docs\\event-bus.mdx",slug:"/event-bus",permalink:"/docs/event-bus",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/event-bus.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"22. \u4e8b\u4ef6\u603b\u7ebf",sidebar:"docs",previous:{title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",permalink:"/docs/local-language"},next:{title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",permalink:"/docs/process-service"}},l=[{value:"22.1 \u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf",id:"221-\u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf",children:[]},{value:"22.2 MessageCenter \u6d88\u606f\u4e2d\u5fc3",id:"222-messagecenter-\u6d88\u606f\u4e2d\u5fc3",children:[{value:"22.2.1 \u6ce8\u518c \u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1",id:"2221-\u6ce8\u518c-\u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1",children:[]},{value:"22.2.2 \u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f",id:"2222-\u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f",children:[]},{value:"22.2.3 \u53d1\u5e03\u6d88\u606f",id:"2223-\u53d1\u5e03\u6d88\u606f",children:[]},{value:"22.2.4 \u76f4\u63a5\u8ba2\u9605\u6d88\u606f",id:"2224-\u76f4\u63a5\u8ba2\u9605\u6d88\u606f",children:[]}]},{value:"22.3 MediatR \u5e93",id:"223-mediatr-\u5e93",children:[{value:"22.3.1 MediatR \u4f7f\u7528\u6587\u6863",id:"2231-mediatr-\u4f7f\u7528\u6587\u6863",children:[]}]},{value:"22.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"224-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:l};function d(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"221-\u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf"},"22.1 \u4ec0\u4e48\u662f\u4e8b\u4ef6\u603b\u7ebf"),Object(c.b)("p",null,"\u4e8b\u4ef6\u603b\u7ebf\u662f\u5bf9\u53d1\u5e03-\u8ba2\u9605\u6a21\u5f0f\u7684\u4e00\u79cd\u5b9e\u73b0\u3002\u5b83\u662f\u4e00\u79cd\u96c6\u4e2d\u5f0f\u4e8b\u4ef6\u5904\u7406\u673a\u5236\uff0c\u5141\u8bb8\u4e0d\u540c\u7684\u7ec4\u4ef6\u4e4b\u95f4\u8fdb\u884c\u5f7c\u6b64\u901a\u4fe1\u800c\u53c8\u4e0d\u9700\u8981\u76f8\u4e92\u4f9d\u8d56\uff0c\u8fbe\u5230\u4e00\u79cd\u89e3\u8026\u7684\u76ee\u7684\u3002"),Object(c.b)("p",null,"\u6211\u4eec\u6765\u770b\u770b\u4e8b\u4ef6\u603b\u7ebf\u7684\u5904\u7406\u6d41\u7a0b\uff1a"),Object(c.b)("img",{src:Object(i.a)("img/event1.png")}),Object(c.b)("h2",{id:"222-messagecenter-\u6d88\u606f\u4e2d\u5fc3"},"22.2 ",Object(c.b)("inlineCode",{parentName:"h2"},"MessageCenter")," \u6d88\u606f\u4e2d\u5fc3"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5b9e\u73b0\u4e86\u4e00\u79cd\u8f7b\u91cf\u7ea7\u7684\u4e8b\u4ef6\u603b\u7ebf\u5b9e\u73b0\u673a\u5236\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter"),"\uff08\u6d88\u606f\u4e2d\u5fc3\uff09\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u91c7\u7528\u5b57\u7b26\u4e32\u6d88\u606f\u673a\u5236\u8fdb\u884c\u5e7f\u64ad\uff0c \u53ef\u4ee5\u5728\u7edd\u5927\u591a\u6570\u4e2d\u5c0f\u578b\u9879\u76ee\u4e2d\u53d1\u6325\u4f5c\u7528\uff0c\u7f3a\u70b9\u662f\u6d88\u606f\u5904\u7406\u662f\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u5b8c\u6210\u5e76\u4e14\u6d88\u606f\u4e0d\u652f\u6301\u5206\u5e03\u5f0f\u5b58\u50a8\u3002"),Object(c.b)("p",null,"\u53e6\u5916\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u652f\u6301\u5355\u64ad\u3001\u591a\u64ad\u53d1\u5e03\u53ca\u591a\u8ba2\u9605\u3002\u5982\u56fe\u6240\u793a\uff1a"),Object(c.b)("img",{src:Object(i.a)("img/event2.png")}),Object(c.b)("h3",{id:"2221-\u6ce8\u518c-\u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1"},"22.2.1 \u6ce8\u518c ",Object(c.b)("inlineCode",{parentName:"h3"},"\u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\u670d\u52a1")),Object(c.b)("p",null,"\u5982\u679c\u60f3\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u8f7b\u91cf\u7ea7\u4e8b\u4ef6\u603b\u7ebf\uff0c\u53ea\u9700\u8981\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u670d\u52a1\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddSimpleEventBus();\n}\n")),Object(c.b)("h3",{id:"2222-\u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f"},"22.2.2 \u5b9a\u4e49\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter")," \u662f\u6839\u636e ",Object(c.b)("inlineCode",{parentName:"p"},"MesseageId")," \u6d88\u606f Id \u6765\u89e6\u53d1\u5bf9\u5e94\u7684\u5904\u7406\u7a0b\u5e8f\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u5b9a\u4e49 ",Object(c.b)("inlineCode",{parentName:"p"},"\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f\u7c7b"),"\uff0c\u8be5\u7c7b\u9700\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"ISubscribeHandler")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,4-5,11-13}","{1,4-5,11-13}":!0}),'public class UserChangeSubscribeHandler : ISubscribeHandler\n{\n // \u5b9a\u4e49\u4e00\u6761\u6d88\u606f\n [SubscribeMessage("create:user")]\n public void CreateUser(string eventId, object payload)\n {\n Console.WriteLine("\u6211\u662f"+eventId);\n }\n\n // \u591a\u6761\u6d88\u606f\u5171\u7528\u540c\u4e00\u4e2a\u5904\u7406\u7a0b\u5e8f\n [SubscribeMessage("delete:user")]\n [SubscribeMessage("remove:user")]\n public void RemoveUser(string eventId, object payload)\n {\n Console.WriteLine("\u6211\u662f"+eventId);\n }\n}\n')),Object(c.b)("h3",{id:"2223-\u53d1\u5e03\u6d88\u606f"},"22.2.3 \u53d1\u5e03\u6d88\u606f"),Object(c.b)("p",null,"\u5b9a\u4e49\u597d\u8ba2\u9605\u5904\u7406\u7a0b\u5e8f\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5728\u7a0b\u5e8f\u4efb\u4f55\u5730\u65b9\u8fdb\u884c\u5e7f\u64ad\u6d88\u606f\uff0c\u4e8b\u4ef6\u603b\u7ebf\u4f1a\u81ea\u52a8\u6839\u636e\u6d88\u606f Id \u89e6\u53d1\u5bf9\u5e94\u7684\u5904\u7406\u7a0b\u5e8f\u65b9\u6cd5\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Send("create:user", new User {}); // => \u6253\u5370\uff1a\u6211\u662fcreate:user\n\nMessageCenter.Send("delete:user", new User {}); // => \u6253\u5370\uff1a\u6211\u662fdelete:user\nMessageCenter.Send("remove:user", new User {}); // => \u6253\u5370\uff1a\u6211\u662fremove:user\n')),Object(c.b)("h3",{id:"2224-\u76f4\u63a5\u8ba2\u9605\u6d88\u606f"},"22.2.4 \u76f4\u63a5\u8ba2\u9605\u6d88\u606f"),Object(c.b)("p",null,"\u5728\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"ISubscribeHandler")," \u7684\u6d3e\u751f\u7c7b\u8fdb\u884c\u76f8\u5173\u914d\u7f6e\u624d\u80fd\u5b9e\u73b0\u8ba2\u9605\u5904\u7406\u3002"),Object(c.b)("p",null,"\u5728\u67d0\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u53ea\u9700\u8981\u8ba2\u9605\u4e00\u6b21\u5373\u53ef\u3002\u6240\u4ee5\uff0c\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u4e3a\u4e86\u66f4\u7b80\u4fbf\u7684\u8ba2\u9605\u6d88\u606f\uff0c\u4e5f\u63d0\u4f9b\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"MessageCenter.Subscribe")," \u9759\u6001\u65b9\u6cd5\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Subscribe("create:user", (i,p) => {\n // do something\u3002\u3002\u3002\n});\n')),Object(c.b)("h2",{id:"223-mediatr-\u5e93"},"22.3 ",Object(c.b)("inlineCode",{parentName:"h2"},"MediatR")," \u5e93"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9ed8\u8ba4\u53ea\u5b9e\u73b0\u4e86\u8f7b\u91cf\u7ea7\u7684\u4e8b\u4ef6\u603b\u7ebf\u673a\u5236\uff0c\u53ef\u80fd\u8fd8\u8fdc\u8fdc\u672a\u8fbe\u5230\u5927\u578b\u9879\u76ee\u548c\u9ad8\u5e76\u53d1\u6570\u636e\u7684\u5904\u7406\u9700\u6c42\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\uff0c\u63a8\u8350\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"MediatR")," \u8fd9\u4e2a\u7b2c\u4e09\u65b9\u5e93\u8fdb\u884c\u5904\u7406\uff0cGithub \u5730\u5740\uff1a",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/jbogard/MediatR"}),"https://github.com/jbogard/MediatR")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"MediatR")," \u662f\u975e\u5e38\u4f18\u79c0\u7684\u4e8b\u4ef6\u603b\u7ebf\u5e93\uff0c\u652f\u6301\u5355\u64ad\u3001\u591a\u64ad\u3001\u6d88\u606f\u901a\u77e5\u63a8\u9001\u3001\u667a\u80fd\u8c03\u5ea6\u7b49\u64cd\u4f5c\uff0c\u975e\u5e38\u5c0f\u5de7\u3002"),Object(c.b)("h3",{id:"2231-mediatr-\u4f7f\u7528\u6587\u6863"},"22.3.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"MediatR")," \u4f7f\u7528\u6587\u6863"),Object(c.b)("p",null,Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/jbogard/MediatR/wiki"}),"https://github.com/jbogard/MediatR/wiki")),Object(c.b)("h2",{id:"224-\u53cd\u9988\u4e0e\u5efa\u8bae"},"22.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/2b1a66c2.494fbd7c.js b/docs/2b1a66c2.8b2e0558.js similarity index 95% rename from docs/2b1a66c2.494fbd7c.js rename to docs/2b1a66c2.8b2e0558.js index 648f609283f..d250c782c4b 100644 --- a/docs/2b1a66c2.494fbd7c.js +++ b/docs/2b1a66c2.8b2e0558.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var r=n(21),c=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(c.b)(n))return n;if(r)return t+n;const a=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+a:a}(t,e,n,r)}}function a(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return O}));var r=n(0),c=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var d=c.a.createContext({}),l=function(e){var t=c.a.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=l(e.components);return c.a.createElement(d.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},p=c.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,a=e.parentName,d=b(e,["components","mdxType","originalType","parentName"]),s=l(n),p=r,O=s["".concat(a,".").concat(p)]||s[p]||u[p]||i;return n?c.a.createElement(O,o(o({ref:t},d),{},{components:n})):c.a.createElement(O,o({ref:t},d))}));function O(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=p;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:r,a[1]=o;for(var d=2;dt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},96:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return d})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return u}));var r=n(3),c=n(7),i=(n(0),n(192)),a=n(190),o=n(193),b={id:"deploy-iis",title:"27.1 \u5728 IIS \u90e8\u7f72",sidebar_label:"27.1 \u5728 IIS \u90e8\u7f72"},d={unversionedId:"deploy-iis",id:"deploy-iis",isDocsHomePage:!1,title:"27.1 \u5728 IIS \u90e8\u7f72",description:"27.1.1 \u53d1\u5e03\u7f51\u7ad9",source:"@site/docs\\deploy-iis.mdx",slug:"/deploy-iis",permalink:"/docs/deploy-iis",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/deploy-iis.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.1 \u5728 IIS \u90e8\u7f72",sidebar:"docs",previous:{title:"26. Grpc \u670d\u52a1",permalink:"/docs/grpc"},next:{title:"27.2 \u5728 Docker \u90e8\u7f72",permalink:"/docs/deploy-docker"}},l=[{value:"27.1.1 \u53d1\u5e03\u7f51\u7ad9",id:"2711-\u53d1\u5e03\u7f51\u7ad9",children:[{value:"27.1.1.1 \u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03",id:"27111-\u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03",children:[]},{value:"27.1.1.2 \u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939",id:"27112-\u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939",children:[]},{value:"27.1.1.3 \u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84",id:"27113-\u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84",children:[]},{value:"27.1.1.4 \u70b9\u51fb\u53d1\u5e03",id:"27114-\u70b9\u51fb\u53d1\u5e03",children:[]}]},{value:"27.1.2 \u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e",id:"2712-\u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e",children:[{value:"27.1.2.1 \u7b2c\u4e00\u6b65",id:"27121-\u7b2c\u4e00\u6b65",children:[]},{value:"27.1.2.2 \u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09",id:"27122-\u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09",children:[]},{value:"27.1.2.3 \u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09",id:"27123-\u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09",children:[]},{value:"27.1.2.4 \u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09",id:"27124-\u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09",children:[]}]},{value:"27.1.3 \u90e8\u7f72\u5230 IIS",id:"2713-\u90e8\u7f72\u5230-iis",children:[{value:"27.1.3.1 \u6dfb\u52a0\u65b0\u7f51\u7ad9",id:"27131-\u6dfb\u52a0\u65b0\u7f51\u7ad9",children:[]},{value:"27.1.3.2 \u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f",id:"27132-\u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f",children:[]},{value:"27.1.3.3 \u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60",id:"27133-\u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60",children:[]},{value:"27.1.3.4 \u8bbe\u7f6e\u4e3a \u975e\u6258\u7ba1",id:"27134-\u8bbe\u7f6e\u4e3a-\u975e\u6258\u7ba1",children:[]},{value:"27.1.3.5 \u91cd\u542f\u7f51\u7ad9",id:"27135-\u91cd\u542f\u7f51\u7ad9",children:[]}]},{value:"27.1.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2714-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function u(e){var t=e.components,n=Object(c.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"2711-\u53d1\u5e03\u7f51\u7ad9"},"27.1.1 \u53d1\u5e03\u7f51\u7ad9"),Object(i.b)("h3",{id:"27111-\u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03"},"27.1.1.1 \u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03"),Object(i.b)("img",{src:Object(a.a)("img/dp1.png")}),Object(i.b)("h3",{id:"27112-\u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939"},"27.1.1.2 \u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939"),Object(i.b)("img",{src:Object(a.a)("img/dy2.png")}),Object(i.b)("h3",{id:"27113-\u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84"},"27.1.1.3 \u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84"),Object(i.b)("img",{src:Object(a.a)("img/dp3.png")}),Object(i.b)("h3",{id:"27114-\u70b9\u51fb\u53d1\u5e03"},"27.1.1.4 \u70b9\u51fb\u53d1\u5e03"),Object(i.b)("img",{src:Object(a.a)("img/dp4.png")}),Object(i.b)("h2",{id:"2712-\u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e"},"27.1.2 \u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e"),Object(i.b)("h3",{id:"27121-\u7b2c\u4e00\u6b65"},"27.1.2.1 \u7b2c\u4e00\u6b65"),Object(i.b)("p",null,"\u5b89\u88c5.NET Core \u8fd0\u884c\u65f6\u6346\u7ed1\u5305\uff1a",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer"}),"\u70b9\u51fb\u4e0b\u8f7d")),Object(i.b)("h3",{id:"27122-\u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09"},"27.1.2.2 \u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"net stop was /y\n")),Object(i.b)("h3",{id:"27123-\u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09"},"27.1.2.3 \u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"net start w3svc\n")),Object(i.b)("h3",{id:"27124-\u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09"},"27.1.2.4 \u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"set ASPNETCORE_ENVIRONMENT=Production\n")),Object(i.b)("h2",{id:"2713-\u90e8\u7f72\u5230-iis"},"27.1.3 \u90e8\u7f72\u5230 IIS"),Object(i.b)("h3",{id:"27131-\u6dfb\u52a0\u65b0\u7f51\u7ad9"},"27.1.3.1 \u6dfb\u52a0\u65b0\u7f51\u7ad9"),Object(i.b)("img",{src:Object(a.a)("img/ds1.png")}),Object(i.b)("h3",{id:"27132-\u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f"},"27.1.3.2 \u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f"),Object(i.b)("img",{src:Object(a.a)("img/ds2.png")}),Object(i.b)("h3",{id:"27133-\u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60"},"27.1.3.3 \u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60"),Object(i.b)("img",{src:Object(a.a)("img/ds3.png")}),Object(i.b)("h3",{id:"27134-\u8bbe\u7f6e\u4e3a-\u975e\u6258\u7ba1"},"27.1.3.4 \u8bbe\u7f6e\u4e3a ",Object(i.b)("inlineCode",{parentName:"h3"},"\u975e\u6258\u7ba1")),Object(i.b)("img",{src:Object(a.a)("img/ds4.png")}),Object(i.b)("h3",{id:"27135-\u91cd\u542f\u7f51\u7ad9"},"27.1.3.5 \u91cd\u542f\u7f51\u7ad9"),Object(i.b)("p",null,"\u53ea\u9700\u91cd\u542f\u7f51\u7ad9\u6216\u5e94\u7528\u7a0b\u5e8f\u6c60\u5373\u53ef\u3002"),Object(i.b)("h2",{id:"2714-\u53cd\u9988\u4e0e\u5efa\u8bae"},"27.1.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[23],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var r=n(21),c=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(c.b)(n))return n;if(r)return t+n;const a=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+a:a}(t,e,n,r)}}function a(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return O}));var r=n(0),c=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var d=c.a.createContext({}),l=function(e){var t=c.a.useContext(d),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},s=function(e){var t=l(e.components);return c.a.createElement(d.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},p=c.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,a=e.parentName,d=b(e,["components","mdxType","originalType","parentName"]),s=l(n),p=r,O=s["".concat(a,".").concat(p)]||s[p]||u[p]||i;return n?c.a.createElement(O,o(o({ref:t},d),{},{components:n})):c.a.createElement(O,o({ref:t},d))}));function O(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=p;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:r,a[1]=o;for(var d=2;dt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},96:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return d})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return u}));var r=n(3),c=n(7),i=(n(0),n(196)),a=n(194),o=n(197),b={id:"deploy-iis",title:"27.1 \u5728 IIS \u90e8\u7f72",sidebar_label:"27.1 \u5728 IIS \u90e8\u7f72"},d={unversionedId:"deploy-iis",id:"deploy-iis",isDocsHomePage:!1,title:"27.1 \u5728 IIS \u90e8\u7f72",description:"27.1.1 \u53d1\u5e03\u7f51\u7ad9",source:"@site/docs\\deploy-iis.mdx",slug:"/deploy-iis",permalink:"/docs/deploy-iis",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/deploy-iis.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.1 \u5728 IIS \u90e8\u7f72",sidebar:"docs",previous:{title:"26. Grpc \u670d\u52a1",permalink:"/docs/grpc"},next:{title:"27.2 \u5728 Docker \u90e8\u7f72",permalink:"/docs/deploy-docker"}},l=[{value:"27.1.1 \u53d1\u5e03\u7f51\u7ad9",id:"2711-\u53d1\u5e03\u7f51\u7ad9",children:[{value:"27.1.1.1 \u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03",id:"27111-\u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03",children:[]},{value:"27.1.1.2 \u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939",id:"27112-\u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939",children:[]},{value:"27.1.1.3 \u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84",id:"27113-\u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84",children:[]},{value:"27.1.1.4 \u70b9\u51fb\u53d1\u5e03",id:"27114-\u70b9\u51fb\u53d1\u5e03",children:[]}]},{value:"27.1.2 \u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e",id:"2712-\u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e",children:[{value:"27.1.2.1 \u7b2c\u4e00\u6b65",id:"27121-\u7b2c\u4e00\u6b65",children:[]},{value:"27.1.2.2 \u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09",id:"27122-\u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09",children:[]},{value:"27.1.2.3 \u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09",id:"27123-\u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09",children:[]},{value:"27.1.2.4 \u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09",id:"27124-\u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09",children:[]}]},{value:"27.1.3 \u90e8\u7f72\u5230 IIS",id:"2713-\u90e8\u7f72\u5230-iis",children:[{value:"27.1.3.1 \u6dfb\u52a0\u65b0\u7f51\u7ad9",id:"27131-\u6dfb\u52a0\u65b0\u7f51\u7ad9",children:[]},{value:"27.1.3.2 \u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f",id:"27132-\u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f",children:[]},{value:"27.1.3.3 \u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60",id:"27133-\u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60",children:[]},{value:"27.1.3.4 \u8bbe\u7f6e\u4e3a \u975e\u6258\u7ba1",id:"27134-\u8bbe\u7f6e\u4e3a-\u975e\u6258\u7ba1",children:[]},{value:"27.1.3.5 \u91cd\u542f\u7f51\u7ad9",id:"27135-\u91cd\u542f\u7f51\u7ad9",children:[]}]},{value:"27.1.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2714-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function u(e){var t=e.components,n=Object(c.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"2711-\u53d1\u5e03\u7f51\u7ad9"},"27.1.1 \u53d1\u5e03\u7f51\u7ad9"),Object(i.b)("h3",{id:"27111-\u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03"},"27.1.1.1 \u9009\u62e9\u542f\u52a8\u9879\u53d1\u5e03"),Object(i.b)("img",{src:Object(a.a)("img/dp1.png")}),Object(i.b)("h3",{id:"27112-\u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939"},"27.1.1.2 \u9009\u62e9\u53d1\u5e03\u5230\u6587\u4ef6\u5939"),Object(i.b)("img",{src:Object(a.a)("img/dy2.png")}),Object(i.b)("h3",{id:"27113-\u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84"},"27.1.1.3 \u914d\u7f6e\u53d1\u5e03\u540e\u8def\u5f84"),Object(i.b)("img",{src:Object(a.a)("img/dp3.png")}),Object(i.b)("h3",{id:"27114-\u70b9\u51fb\u53d1\u5e03"},"27.1.1.4 \u70b9\u51fb\u53d1\u5e03"),Object(i.b)("img",{src:Object(a.a)("img/dp4.png")}),Object(i.b)("h2",{id:"2712-\u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e"},"27.1.2 \u670d\u52a1\u5668\u73af\u5883\u914d\u7f6e"),Object(i.b)("h3",{id:"27121-\u7b2c\u4e00\u6b65"},"27.1.2.1 \u7b2c\u4e00\u6b65"),Object(i.b)("p",null,"\u5b89\u88c5.NET Core \u8fd0\u884c\u65f6\u6346\u7ed1\u5305\uff1a",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://dotnet.microsoft.com/permalink/dotnetcore-current-windows-runtime-bundle-installer"}),"\u70b9\u51fb\u4e0b\u8f7d")),Object(i.b)("h3",{id:"27122-\u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09"},"27.1.2.2 \u7b2c\u4e8c\u6b65\uff08\u547d\u4ee4\uff09"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"net stop was /y\n")),Object(i.b)("h3",{id:"27123-\u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09"},"27.1.2.3 \u7b2c\u4e09\u6b65\uff08\u547d\u4ee4\uff09"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"net start w3svc\n")),Object(i.b)("h3",{id:"27124-\u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09"},"27.1.2.4 \u7b2c\u56db\u6b65\uff08\u547d\u4ee4\uff09"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-bash"}),"set ASPNETCORE_ENVIRONMENT=Production\n")),Object(i.b)("h2",{id:"2713-\u90e8\u7f72\u5230-iis"},"27.1.3 \u90e8\u7f72\u5230 IIS"),Object(i.b)("h3",{id:"27131-\u6dfb\u52a0\u65b0\u7f51\u7ad9"},"27.1.3.1 \u6dfb\u52a0\u65b0\u7f51\u7ad9"),Object(i.b)("img",{src:Object(a.a)("img/ds1.png")}),Object(i.b)("h3",{id:"27132-\u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f"},"27.1.3.2 \u914d\u7f6e\u7f51\u7ad9\u4fe1\u606f"),Object(i.b)("img",{src:Object(a.a)("img/ds2.png")}),Object(i.b)("h3",{id:"27133-\u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60"},"27.1.3.3 \u914d\u7f6e\u5e94\u7528\u7a0b\u5e8f\u6c60"),Object(i.b)("img",{src:Object(a.a)("img/ds3.png")}),Object(i.b)("h3",{id:"27134-\u8bbe\u7f6e\u4e3a-\u975e\u6258\u7ba1"},"27.1.3.4 \u8bbe\u7f6e\u4e3a ",Object(i.b)("inlineCode",{parentName:"h3"},"\u975e\u6258\u7ba1")),Object(i.b)("img",{src:Object(a.a)("img/ds4.png")}),Object(i.b)("h3",{id:"27135-\u91cd\u542f\u7f51\u7ad9"},"27.1.3.5 \u91cd\u542f\u7f51\u7ad9"),Object(i.b)("p",null,"\u53ea\u9700\u91cd\u542f\u7f51\u7ad9\u6216\u5e94\u7528\u7a0b\u5e8f\u6c60\u5373\u53ef\u3002"),Object(i.b)("h2",{id:"2714-\u53cd\u9988\u4e0e\u5efa\u8bae"},"27.1.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/309e652c.be95eff7.js b/docs/309e652c.39b16633.js similarity index 97% rename from docs/309e652c.be95eff7.js rename to docs/309e652c.39b16633.js index ac12bd1377c..c334f656fdf 100644 --- a/docs/309e652c.be95eff7.js +++ b/docs/309e652c.39b16633.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{190:function(e,t,a){"use strict";a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return b}));var n=a(21),r=a(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(r.b)(a))return a;if(n)return t+a;const b=a.startsWith(t)?a:t+a.replace(/^\//,"");return c?e+b:b}(t,e,a,n)}}function b(e,t={}){const{withBaseUrl:a}=c();return a(e,t)}},191:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return r}))},192:function(e,t,a){"use strict";a.d(t,"a",(function(){return m})),a.d(t,"b",(function(){return d}));var n=a(0),r=a.n(n);function c(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function b(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},m=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},O=r.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,c=e.originalType,b=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),m=p(a),O=n,d=m["".concat(b,".").concat(O)]||m[O]||s[O]||c;return a?r.a.createElement(d,i(i({ref:t},l),{},{components:a})):r.a.createElement(d,i({ref:t},l))}));function d(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=a.length,b=new Array(c);b[0]=O;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i.mdxType="string"==typeof e?e:n,b[1]=i;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},97:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return o})),a.d(t,"toc",(function(){return l})),a.d(t,"default",(function(){return m}));var n=a(3),r=a(7),c=(a(0),a(192)),b=a(193),i={id:"template",title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",sidebar_label:"2.2 \u5b98\u65b9\u811a\u624b\u67b6"},o={unversionedId:"template",id:"template",isDocsHomePage:!1,title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",description:"\u811a\u624b\u67b6\u4e0d\u662f\u5b89\u88c5\u5728\u9879\u76ee\u4e2d\u7684\uff01 \u800c\u662f\u901a\u8fc7 CMD \u6216 PowerShell \u5b89\u88c5\u5230\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u3002",source:"@site/docs\\template.mdx",slug:"/template",permalink:"/docs/template",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/template.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",sidebar:"docs",previous:{title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",permalink:"/docs/get-start"},next:{title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",permalink:"/docs/reference"}},l=[{value:"2.2.1 \u811a\u624b\u67b6",id:"221-\u811a\u624b\u67b6",children:[]},{value:"2.2.2 \u5b89\u88c5\u811a\u624b\u67b6",id:"222-\u5b89\u88c5\u811a\u624b\u67b6",children:[]},{value:"2.2.3 \u4f7f\u7528\u811a\u624b\u67b6",id:"223-\u4f7f\u7528\u811a\u624b\u67b6",children:[]},{value:"2.2.4 \u811a\u624b\u67b6\u66f4\u65b0",id:"224-\u811a\u624b\u67b6\u66f4\u65b0",children:[]},{value:"2.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"225-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function m(e){var t=e.components,a=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,a,{components:t,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("strong",{parentName:"p"},"\u811a\u624b\u67b6\u4e0d\u662f\u5b89\u88c5\u5728\u9879\u76ee\u4e2d\u7684\uff01")," \u800c\u662f\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"CMD")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"PowerShell")," \u5b89\u88c5\u5230\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u3002"))),Object(c.b)("h2",{id:"221-\u811a\u624b\u67b6"},"2.2.1 \u811a\u624b\u67b6"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5b98\u65b9\u63d0\u4f9b\u4e86\u591a\u79cd ",Object(c.b)("inlineCode",{parentName:"p"},"Web")," \u5e94\u7528\u7c7b\u578b\u7684\u811a\u624b\u67b6\uff0c\u65b9\u4fbf\u5927\u5bb6\u5feb\u901f\u521b\u5efa\u591a\u5c42\u67b6\u6784\u9879\u76ee\u3002\u76ee\u524d\u652f\u6301\u4ee5\u4e0b\u5e94\u7528\u811a\u624b\u67b6\uff1a"),Object(c.b)("table",null,Object(c.b)("thead",{parentName:"table"},Object(c.b)("tr",{parentName:"thead"},Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:"center"}),"\u6a21\u677f\u7c7b\u578b"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u540d\u79f0"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u7248\u672c"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u5173\u952e\u8bcd"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u63cf\u8ff0"))),Object(c.b)("tbody",{parentName:"table"},Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Mvc/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Mvc"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Mvc/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Mvc.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionmvc")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mvc \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Api/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Api"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Api/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Api.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionapi")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"WebApi \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.App/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.App"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.App/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.App.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionapp")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mvc/WebApi \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Razor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Razor"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Razor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Razor.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionrazor")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"RazorPages \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.RazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.RazorWithWebApi"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.RazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.RazorWithWebApi.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionrazorapi")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"RazorPages/WebApi \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Blazor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Blazor"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Blazor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Blazor.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionblazor")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Blazor \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.BlazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.BlazorWithWebApi"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.BlazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.BlazorWithWebApi.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionblazorapi")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Blazor/WebApi \u6a21\u677f")))),Object(c.b)("h2",{id:"222-\u5b89\u88c5\u811a\u624b\u67b6"},"2.2.2 \u5b89\u88c5\u811a\u624b\u67b6"),Object(c.b)("p",null,"\u6253\u5f00 ",Object(c.b)("inlineCode",{parentName:"p"},"CMD")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"Powershell")," \u6267\u884c\u6a21\u677f\u5b89\u88c5\u547d\u4ee4\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-bash"}),"dotnet new --install Furion.Template.Mvc::1.11.0\n")),Object(c.b)("h2",{id:"223-\u4f7f\u7528\u811a\u624b\u67b6"},"2.2.3 \u4f7f\u7528\u811a\u624b\u67b6"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-bash"}),"dotnet new furionmvc -n \u9879\u76ee\u540d\u79f0\n")),Object(c.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u751f\u6210\u9879\u76ee\u4ee3\u7801\u4e86\uff0c",Object(c.b)("strong",{parentName:"p"},"\u751f\u6210\u4e4b\u540e\u63a8\u8350\u5c06\u6240\u6709\u7684 ",Object(c.b)("inlineCode",{parentName:"strong"},"nuget")," \u5305\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002")),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u63d0\u9192")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"furionmvc")," \u5bf9\u5e94\u7684\u662f\u4e0a\u9762\u5217\u8868\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"\u5173\u952e\u5b57"),"\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"dotnet new --list")," \u67e5\u770b\u3002"),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a\u53ef\u4ee5\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"dotnet new \u5173\u952e\u5b57 --help")," \u67e5\u770b\u66f4\u591a\u53c2\u6570\u3002"))),Object(c.b)("h2",{id:"224-\u811a\u624b\u67b6\u66f4\u65b0"},"2.2.4 \u811a\u624b\u67b6\u66f4\u65b0"),Object(c.b)("p",null,"\u53ea\u9700\u8981\u91cd\u65b0\u5b89\u88c5\u6700\u65b0\u7248\u66ff\u6362\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-bash"}),"dotnet new --install Furion.Template.Mvc::1.x.x\n")),Object(c.b)("p",null,"\u4e0d\u5e26\u7248\u672c\u53f7\u603b\u662f\u5b89\u88c5\u6700\u65b0\u7684\u7248\u672c\u3002"),Object(c.b)("h2",{id:"225-\u53cd\u9988\u4e0e\u5efa\u8bae"},"2.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u6a21\u677f\u77e5\u8bc6")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-new"}),"dotnet-new \u6a21\u677f")," \u7ae0\u8282\u3002"))))}m.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{194:function(e,t,a){"use strict";a.d(t,"b",(function(){return c})),a.d(t,"a",(function(){return b}));var n=a(21),r=a(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(r.b)(a))return a;if(n)return t+a;const b=a.startsWith(t)?a:t+a.replace(/^\//,"");return c?e+b:b}(t,e,a,n)}}function b(e,t={}){const{withBaseUrl:a}=c();return a(e,t)}},195:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return r}))},196:function(e,t,a){"use strict";a.d(t,"a",(function(){return m})),a.d(t,"b",(function(){return d}));var n=a(0),r=a.n(n);function c(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function b(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},m=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},O=r.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,c=e.originalType,b=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),m=p(a),O=n,d=m["".concat(b,".").concat(O)]||m[O]||s[O]||c;return a?r.a.createElement(d,i(i({ref:t},l),{},{components:a})):r.a.createElement(d,i({ref:t},l))}));function d(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=a.length,b=new Array(c);b[0]=O;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i.mdxType="string"==typeof e?e:n,b[1]=i;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},97:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return o})),a.d(t,"toc",(function(){return l})),a.d(t,"default",(function(){return m}));var n=a(3),r=a(7),c=(a(0),a(196)),b=a(197),i={id:"template",title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",sidebar_label:"2.2 \u5b98\u65b9\u811a\u624b\u67b6"},o={unversionedId:"template",id:"template",isDocsHomePage:!1,title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",description:"\u811a\u624b\u67b6\u4e0d\u662f\u5b89\u88c5\u5728\u9879\u76ee\u4e2d\u7684\uff01 \u800c\u662f\u901a\u8fc7 CMD \u6216 PowerShell \u5b89\u88c5\u5230\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u3002",source:"@site/docs\\template.mdx",slug:"/template",permalink:"/docs/template",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/template.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",sidebar:"docs",previous:{title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",permalink:"/docs/get-start"},next:{title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",permalink:"/docs/reference"}},l=[{value:"2.2.1 \u811a\u624b\u67b6",id:"221-\u811a\u624b\u67b6",children:[]},{value:"2.2.2 \u5b89\u88c5\u811a\u624b\u67b6",id:"222-\u5b89\u88c5\u811a\u624b\u67b6",children:[]},{value:"2.2.3 \u4f7f\u7528\u811a\u624b\u67b6",id:"223-\u4f7f\u7528\u811a\u624b\u67b6",children:[]},{value:"2.2.4 \u811a\u624b\u67b6\u66f4\u65b0",id:"224-\u811a\u624b\u67b6\u66f4\u65b0",children:[]},{value:"2.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"225-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function m(e){var t=e.components,a=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,a,{components:t,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("strong",{parentName:"p"},"\u811a\u624b\u67b6\u4e0d\u662f\u5b89\u88c5\u5728\u9879\u76ee\u4e2d\u7684\uff01")," \u800c\u662f\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"CMD")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"PowerShell")," \u5b89\u88c5\u5230\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u3002"))),Object(c.b)("h2",{id:"221-\u811a\u624b\u67b6"},"2.2.1 \u811a\u624b\u67b6"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5b98\u65b9\u63d0\u4f9b\u4e86\u591a\u79cd ",Object(c.b)("inlineCode",{parentName:"p"},"Web")," \u5e94\u7528\u7c7b\u578b\u7684\u811a\u624b\u67b6\uff0c\u65b9\u4fbf\u5927\u5bb6\u5feb\u901f\u521b\u5efa\u591a\u5c42\u67b6\u6784\u9879\u76ee\u3002\u76ee\u524d\u652f\u6301\u4ee5\u4e0b\u5e94\u7528\u811a\u624b\u67b6\uff1a"),Object(c.b)("table",null,Object(c.b)("thead",{parentName:"table"},Object(c.b)("tr",{parentName:"thead"},Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:"center"}),"\u6a21\u677f\u7c7b\u578b"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u540d\u79f0"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u7248\u672c"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u5173\u952e\u8bcd"),Object(c.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u63cf\u8ff0"))),Object(c.b)("tbody",{parentName:"table"},Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Mvc/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Mvc"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Mvc/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Mvc.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionmvc")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mvc \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Api/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Api"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Api/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Api.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionapi")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"WebApi \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.App/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.App"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.App/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.App.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionapp")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Mvc/WebApi \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Razor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Razor"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Razor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Razor.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionrazor")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"RazorPages \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.RazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.RazorWithWebApi"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.RazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.RazorWithWebApi.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionrazorapi")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"RazorPages/WebApi \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Blazor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.Blazor"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.Blazor/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.Blazor.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionblazor")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Blazor \u6a21\u677f")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:"center"}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.BlazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://shields.io/badge/-Nuget-yellow?cacheSeconds=604800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion.Template.BlazorWithWebApi"),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(n.a)({parentName:"td"},{href:"https://www.nuget.org/packages/Furion.Template.BlazorWithWebApi/"}),Object(c.b)("img",Object(n.a)({parentName:"a"},{src:"https://img.shields.io/nuget/v/Furion.Template.BlazorWithWebApi.svg?cacheSeconds=10800",alt:"nuget"})))),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc49 ",Object(c.b)("strong",{parentName:"td"},"furionblazorapi")),Object(c.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Blazor/WebApi \u6a21\u677f")))),Object(c.b)("h2",{id:"222-\u5b89\u88c5\u811a\u624b\u67b6"},"2.2.2 \u5b89\u88c5\u811a\u624b\u67b6"),Object(c.b)("p",null,"\u6253\u5f00 ",Object(c.b)("inlineCode",{parentName:"p"},"CMD")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"Powershell")," \u6267\u884c\u6a21\u677f\u5b89\u88c5\u547d\u4ee4\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-bash"}),"dotnet new --install Furion.Template.Mvc::1.11.0\n")),Object(c.b)("h2",{id:"223-\u4f7f\u7528\u811a\u624b\u67b6"},"2.2.3 \u4f7f\u7528\u811a\u624b\u67b6"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-bash"}),"dotnet new furionmvc -n \u9879\u76ee\u540d\u79f0\n")),Object(c.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u751f\u6210\u9879\u76ee\u4ee3\u7801\u4e86\uff0c",Object(c.b)("strong",{parentName:"p"},"\u751f\u6210\u4e4b\u540e\u63a8\u8350\u5c06\u6240\u6709\u7684 ",Object(c.b)("inlineCode",{parentName:"strong"},"nuget")," \u5305\u66f4\u65b0\u5230\u6700\u65b0\u7248\u672c\u3002")),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u63d0\u9192")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"furionmvc")," \u5bf9\u5e94\u7684\u662f\u4e0a\u9762\u5217\u8868\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"\u5173\u952e\u5b57"),"\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"dotnet new --list")," \u67e5\u770b\u3002"),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a\u53ef\u4ee5\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"dotnet new \u5173\u952e\u5b57 --help")," \u67e5\u770b\u66f4\u591a\u53c2\u6570\u3002"))),Object(c.b)("h2",{id:"224-\u811a\u624b\u67b6\u66f4\u65b0"},"2.2.4 \u811a\u624b\u67b6\u66f4\u65b0"),Object(c.b)("p",null,"\u53ea\u9700\u8981\u91cd\u65b0\u5b89\u88c5\u6700\u65b0\u7248\u66ff\u6362\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(n.a)({parentName:"pre"},{className:"language-bash"}),"dotnet new --install Furion.Template.Mvc::1.x.x\n")),Object(c.b)("p",null,"\u4e0d\u5e26\u7248\u672c\u53f7\u603b\u662f\u5b89\u88c5\u6700\u65b0\u7684\u7248\u672c\u3002"),Object(c.b)("h2",{id:"225-\u53cd\u9988\u4e0e\u5efa\u8bae"},"2.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u6a21\u677f\u77e5\u8bc6")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/dotnet/core/tools/dotnet-new"}),"dotnet-new \u6a21\u677f")," \u7ae0\u8282\u3002"))))}m.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/34087545.3e2e5310.js b/docs/34087545.3e2e5310.js new file mode 100644 index 00000000000..71b800f31da --- /dev/null +++ b/docs/34087545.3e2e5310.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[25],{194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return l}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+l:l}(t,e,n,r)}}function l(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return f})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var c=o.a.createContext({}),p=function(e){var t=o.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},f=function(e){var t=p(e.components);return o.a.createElement(c.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),f=p(n),d=r,b=f["".concat(l,".").concat(d)]||f[d]||s[d]||a;return n?o.a.createElement(b,i(i({ref:t},c),{},{components:n})):o.a.createElement(b,i({ref:t},c))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,l=new Array(a);l[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,l[1]=i;for(var c=2;cfunction(e,n,t,{forcePrependBaseUrl:r=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(r)return n+t;const s=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+s:s}(n,e,t,r)}}function s(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},191:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return m}));var r=t(0),i=t.n(r);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},u=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},b={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),u=p(t),d=r,m=u["".concat(s,".").concat(d)]||u[d]||b[d]||o;return t?i.a.createElement(m,a(a({ref:n},l),{},{components:t})):i.a.createElement(m,a({ref:n},l))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,s=new Array(o);s[0]=d;var a={};for(var c in n)hasOwnProperty.call(n,c)&&(a[c]=n[c]);a.originalType=e,a.mdxType="string"==typeof e?e:r,s[1]=a;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},98:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return a})),t.d(n,"metadata",(function(){return c})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return u}));var r=t(3),i=t(7),o=(t(0),t(192)),s=t(193),a={id:"source",title:"1.3 \u6e90\u7801\u7ed3\u6784",sidebar_label:"1.3 \u6e90\u7801\u7ed3\u6784"},c={unversionedId:"source",id:"source",isDocsHomePage:!1,title:"1.3 \u6e90\u7801\u7ed3\u6784",description:"1.3.1 \u6e90\u7801\u67b6\u6784",source:"@site/docs\\source.mdx",slug:"/source",permalink:"/docs/source",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/source.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1.3 \u6e90\u7801\u7ed3\u6784",sidebar:"docs",previous:{title:"1.2 \u5173\u4e8e\u4f5c\u8005",permalink:"/docs/author"},next:{title:"1.4 \u9879\u76ee\u5408\u4f5c",permalink:"/docs/cooperate"}},l=[{value:"1.3.1 \u6e90\u7801\u67b6\u6784",id:"131-\u6e90\u7801\u67b6\u6784",children:[]},{value:"1.3.2 Furion.Tests \u6d4b\u8bd5\u5c42",id:"132-furiontests-\u6d4b\u8bd5\u5c42",children:[]},{value:"1.3.3 Solution Items \u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42",id:"133-solution-items-\u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42",children:[]},{value:"1.3.4 Furion \u6838\u5fc3\u5c42",id:"134-furion-\u6838\u5fc3\u5c42",children:[]},{value:"1.3.5 Furion.Application \u4e1a\u52a1\u5e94\u7528\u5c42",id:"135-furionapplication-\u4e1a\u52a1\u5e94\u7528\u5c42",children:[]},{value:"1.3.6 Furion.Core \u4ed3\u50a8\u5b9e\u4f53\u5c42",id:"136-furioncore-\u4ed3\u50a8\u5b9e\u4f53\u5c42",children:[]},{value:"1.3.7 Furion.Database.Migrations \u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42",id:"137-furiondatabasemigrations-\u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42",children:[]},{value:"1.3.8 Furion.EntityFramework.Core \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42",id:"138-furionentityframeworkcore-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42",children:[]},{value:"1.3.9 Furion.Web.Core \u5e94\u7528\u6838\u5fc3\u5c42",id:"139-furionwebcore-\u5e94\u7528\u6838\u5fc3\u5c42",children:[]},{value:"1.3.10 Furion.Web.Entry \u5e94\u7528\u5165\u53e3\u5c42",id:"1310-furionwebentry-\u5e94\u7528\u5165\u53e3\u5c42",children:[]}],p={toc:l};function u(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(s.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"131-\u6e90\u7801\u67b6\u6784"},"1.3.1 \u6e90\u7801\u67b6\u6784"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u521b\u5efa\u91c7\u7528\u591a\u5c42\u5206\u5c42\u8bbe\u8ba1\uff0c\u4e3b\u8981\u8bbe\u8ba1\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"\u81ea\u52a8\u62bd\u8c61\u5de5\u5382")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"DDD \u9886\u57df\u9a71\u52a8\u8bbe\u8ba1")," \u76f8\u7ed3\u5408\u3002"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9879\u76ee\u7ed3\u6784\u5982\u4e0b\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Tests"),"\uff1a\u6d4b\u8bd5\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Solution Items"),"\uff1a\u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion"),"\uff1a\u6846\u67b6\u6838\u5fc3\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Application"),"\uff1a\u4e1a\u52a1\u5e94\u7528\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Core"),"\uff1a\u6838\u5fc3\u5c42\uff08\u5b9e\u4f53\uff0c\u5c42\u6b21\uff0c\u5176\u4ed6\u6838\u5fc3\u4ee3\u7801\uff09"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Database.Migrations"),"\uff1a\u67b6\u6784\u7ef4\u62a4\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.EntityFramework.Core"),"\uff1aEF Core \u914d\u7f6e\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Web.Core"),"\uff1aWeb \u6838\u5fc3\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Web.Entry"),"\uff1aWeb \u5165\u53e3\u5c42/\u542f\u52a8\u5c42")),Object(o.b)("h2",{id:"132-furiontests-\u6d4b\u8bd5\u5c42"},"1.3.2 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Tests")," \u6d4b\u8bd5\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Tests")," \u662f\u9879\u76ee\u7684\u6d4b\u8bd5\u5c42\uff0c\u76ee\u524d\u8fd8\u672a\u6574\u7406\u5b8c\u6210\u3002"),Object(o.b)("h2",{id:"133-solution-items-\u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42"},"1.3.3 ",Object(o.b)("inlineCode",{parentName:"h2"},"Solution Items")," \u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{}),"Solution Items\n\u2514.editorconfig\n")),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Solution Items")," \u662f\u7528\u6765\u914d\u7f6e\u89e3\u51b3\u65b9\u6848\u4e2d\u4e00\u4e9b\u5168\u5c40\u914d\u7f6e\u7684\uff0c\u5982\u6bcf\u4e2a\u6587\u4ef6\u7684\u9876\u90e8\u7248\u6743\u4fe1\u606f\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// -----------------------------------------------------------------------------\n// \u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002\n// Copyright \xa9 2020 Furion, Baiqian Co.,Ltd.\n//\n// \u6846\u67b6\u540d\u79f0\uff1aFurion\n// \u6846\u67b6\u4f5c\u8005\uff1a\u767e\u5c0f\u50e7\n// \u6846\u67b6\u7248\u672c\uff1a1.0.0\n// \u6e90\u7801\u5730\u5740\uff1aGitee\uff1ahttps://gitee.com/monksoul/Furion\n// Github\uff1ahttps://github.com/monksoul/Furion\n// \u5f00\u6e90\u534f\u8bae\uff1aApache-2.0\uff08http://www.apache.org/licenses/LICENSE-2.0\uff09\n// -----------------------------------------------------------------------------\n")),Object(o.b)("p",null,"\u76f8\u5173\u914d\u7f6e\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},".editorconfig")," \u6700\u540e\u9762\u4e00\u884c\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{127}","{127}":!0}),'# Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\\MONK\\Furion\\framework codebase based on best match to current usage at 2020/9/2\n# You can modify the rules from these initially generated values to suit your own policies\n# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference\n[*.cs]\n\n\n#Core editorconfig formatting - indentation\n\n#use soft tabs (spaces) for indentation\nindent_style = space\n\n#Formatting - new line options\n\n#place else statements on a new line\ncsharp_new_line_before_else = true\n#require members of anonymous types to be on separate lines\ncsharp_new_line_before_members_in_anonymous_types = true\n#require members of object intializers to be on separate lines\ncsharp_new_line_before_members_in_object_initializers = true\n#require braces to be on a new line for accessors, methods, control_blocks, types, lambdas, object_collection_array_initializers, anonymous_types, and properties (also known as "Allman" style)\ncsharp_new_line_before_open_brace = accessors, methods, control_blocks, types, lambdas, object_collection_array_initializers, anonymous_types, properties\n\n#Formatting - organize using options\n\n#do not place System.* using directives before other using directives\ndotnet_sort_system_directives_first = false\n\n#Formatting - spacing options\n\n#require a space before the colon for bases or interfaces in a type declaration\ncsharp_space_after_colon_in_inheritance_clause = true\n#require a space after a keyword in a control flow statement such as a for loop\ncsharp_space_after_keywords_in_control_flow_statements = true\n#require a space before the colon for bases or interfaces in a type declaration\ncsharp_space_before_colon_in_inheritance_clause = true\n#remove space within empty argument list parentheses\ncsharp_space_between_method_call_empty_parameter_list_parentheses = false\n#remove space between method call name and opening parenthesis\ncsharp_space_between_method_call_name_and_opening_parenthesis = false\n#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call\ncsharp_space_between_method_call_parameter_list_parentheses = false\n#remove space within empty parameter list parentheses for a method declaration\ncsharp_space_between_method_declaration_empty_parameter_list_parentheses = false\n#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.\ncsharp_space_between_method_declaration_parameter_list_parentheses = false\n\n#Formatting - wrapping options\n\n#leave code block on single line\ncsharp_preserve_single_line_blocks = true\n#leave statements and member declarations on the same line\ncsharp_preserve_single_line_statements = true\n\n#Style - Code block preferences\n\n#prefer no curly braces if allowed\ncsharp_prefer_braces = false:suggestion\n\n#Style - expression bodied member options\n\n#prefer expression-bodied members for accessors\ncsharp_style_expression_bodied_accessors = true:suggestion\n#prefer block bodies for constructors\ncsharp_style_expression_bodied_constructors = false:suggestion\n#prefer block bodies for methods\ncsharp_style_expression_bodied_methods = false:suggestion\n#prefer expression-bodied members for properties\ncsharp_style_expression_bodied_properties = true:suggestion\n\n#Style - expression level options\n\n#prefer out variables to be declared inline in the argument list of a method call when possible\ncsharp_style_inlined_variable_declaration = true:suggestion\n#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them\ndotnet_style_predefined_type_for_member_access = true:suggestion\n\n#Style - Expression-level preferences\n\n#prefer default over default(T)\ncsharp_prefer_simple_default_expression = true:suggestion\n#prefer objects to be initialized using object initializers when possible\ndotnet_style_object_initializer = true:suggestion\n#prefer inferred anonymous type member names\ndotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion\n#prefer inferred tuple element names\ndotnet_style_prefer_inferred_tuple_names = true:suggestion\n\n#Style - implicit and explicit types\n\n#prefer var over explicit type in all cases, unless overridden by another code style rule\ncsharp_style_var_elsewhere = true:suggestion\n#prefer var is used to declare variables with built-in system types such as int\ncsharp_style_var_for_built_in_types = true:suggestion\n#prefer var when the type is already mentioned on the right-hand side of a declaration expression\ncsharp_style_var_when_type_is_apparent = true:suggestion\n\n#Style - language keyword and framework type options\n\n#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them\ndotnet_style_predefined_type_for_locals_parameters_members = true:suggestion\n\n#Style - Miscellaneous preferences\n\n#prefer local functions over anonymous functions\ncsharp_style_pattern_local_over_anonymous_function = true:suggestion\n\n#Style - modifier options\n\n#prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods.\ndotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion\n\n#Style - Modifier preferences\n\n#when this rule is set to a list of modifiers, prefer the specified ordering.\ncsharp_preferred_modifier_order = public,private,internal,protected,virtual,static,async,abstract,readonly,sealed,override:suggestion\n\n#Style - qualification options\n\n#prefer fields not to be prefaced with this. or Me. in Visual Basic\ndotnet_style_qualification_for_field = false:suggestion\n#prefer methods not to be prefaced with this. or Me. in Visual Basic\ndotnet_style_qualification_for_method = false:suggestion\n#prefer properties not to be prefaced with this. or Me. in Visual Basic\ndotnet_style_qualification_for_property = false:suggestion\n\n# Add file header\nfile_header_template = -----------------------------------------------------------------------------\\nFur \u662f .NET 5 \u5e73\u53f0\u4e0b\u4f01\u4e1a\u5e94\u7528\u5f00\u53d1\u6700\u4f73\u5b9e\u8df5\u6846\u67b6\u3002\\nCopyright \xa9 2020 Furion, Baiqian Co.,Ltd.\\n\\n\u6846\u67b6\u540d\u79f0\uff1aFurion\\n\u6846\u67b6\u4f5c\u8005\uff1a\u767e\u5c0f\u50e7\\n\u6846\u67b6\u7248\u672c\uff1a1.0.0\\n\u6e90\u7801\u5730\u5740\uff1aGitee\uff1ahttps://gitee.com/monksoul/Furion \\n Github\uff1ahttps://github.com/monksoul/Furion \\n\u5f00\u6e90\u534f\u8bae\uff1aApache-2.0\uff08http://www.apache.org/licenses/LICENSE-2.0\uff09\\n-----------------------------------------------------------------------------\n')),Object(o.b)("h2",{id:"134-furion-\u6838\u5fc3\u5c42"},"1.3.4 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion")," \u6838\u5fc3\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6838\u5fc3\u5c42\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u7684\u4e2d\u5fc3\uff0c\u4e5f\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u80fd\u591f\u652f\u6491\u8d77\u6765\u7684\u5fc5\u5907\u5c42\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{}),"Furion\n\u251c\u2500Furion.csproj\n\u251c\u2500Furion.csproj.user\n\u251c\u2500FurStartup.cs\n\u251c\u2500ViewEngine\n| \u251c\u2500IViewEngine.cs\n| \u251c\u2500ViewEngine.cs\n| \u251c\u2500Templates\n| | \u251c\u2500IViewEngineCompiledTemplate.cs\n| | \u251c\u2500IViewEngineTemplate.cs\n| | \u251c\u2500ViewEngineCompiledTemplate.cs\n| | \u2514ViewEngineTemplate.cs\n| \u251c\u2500Options\n| | \u2514ViewEngineCompilationOptions.cs\n| \u251c\u2500Models\n| | \u2514AnonymousTypeWrapper.cs\n| \u251c\u2500Exceptions\n| | \u251c\u2500ViewEngineCompilationException.cs\n| | \u2514ViewEngineException.cs\n| \u251c\u2500Compilations\n| | \u251c\u2500IViewEngineCompilationOptionsBuilder.cs\n| | \u2514ViewEngineCompilationOptionsBuilder.cs\n\u251c\u2500UnifyResult\n| \u251c\u2500Providers\n| | \u251c\u2500IUnifyResultProvider.cs\n| | \u2514RESTfulResultProvider.cs\n| \u251c\u2500Models\n| | \u2514RESTfulResult.cs\n| \u251c\u2500Filters\n| | \u2514SuccessUnifyResultFilter.cs\n| \u251c\u2500Extensions\n| | \u2514UnifyResultServiceCollectionExtensions.cs\n\u251c\u2500SpecificationDocument\n| \u251c\u2500Options\n| | \u2514SpecificationDocumentSettingsOptions.cs\n| \u251c\u2500Models\n| | \u251c\u2500GroupOrder.cs\n| | \u251c\u2500SpecificationOpenApiInfo.cs\n| | \u251c\u2500SpecificationOpenApiSecurityRequirementItem.cs\n| | \u2514SpecificationOpenApiSecurityScheme.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500SpecificationDocumentApplicationBuilderExtensions.cs\n| | \u2514SpecificationDocumentServiceCollectionExtensions.cs\n| \u251c\u2500Builders\n| | \u2514SpecificationDocumentBuilder.cs\n| \u251c\u2500Assets\n| | \u2514index-mini-profiler.html\n\u251c\u2500ObjectMapper\n| \u251c\u2500Extensions\n| | \u2514ObjectMapperServiceCollectionExtensions.cs\n| \u251c\u2500Dependencies\n| | \u2514IObjectMapper.cs\n\u251c\u2500LinqBuilder\n| \u251c\u2500Visitors\n| | \u2514ParameterReplaceExpressionVisitor.cs\n| \u251c\u2500Extensions\n| | \u2514LinqExtensions.cs\n| \u251c\u2500Builders\n| | \u2514LinqExpression.cs\n\u251c\u2500FriendlyException\n| \u251c\u2500Oops.cs\n| \u251c\u2500Providers\n| | \u2514IErrorCodeTypeProvider.cs\n| \u251c\u2500Options\n| | \u2514ErrorCodeMessageSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514MethodIfException.cs\n| \u251c\u2500Filters\n| | \u2514FriendlyExceptionFilter.cs\n| \u251c\u2500Extensions\n| | \u2514FriendlyExceptionServiceCollectionExtensions.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500ErrorCodeItemMetadataAttribute.cs\n| | \u251c\u2500ErrorCodeTypeAttribute.cs\n| | \u2514IfExceptionAttribute.cs\n\u251c\u2500DynamicApiController\n| \u251c\u2500Penetrates.cs\n| \u251c\u2500Providers\n| | \u2514DynamicApiControllerFeatureProvider.cs\n| \u251c\u2500Options\n| | \u2514DynamicApiControllerSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514ParameterRouteTemplate.cs\n| \u251c\u2500Extensions\n| | \u2514DynamicApiControllerServiceCollectionExtensions.cs\n| \u251c\u2500Enums\n| | \u2514ApiSeats.cs\n| \u251c\u2500Dependencies\n| | \u2514IDynamicApiController.cs\n| \u251c\u2500Conventions\n| | \u2514DynamicApiControllerApplicationModelConvention.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500ApiDescriptionSettingsAttribute.cs\n| | \u251c\u2500ApiSeatAttribute.cs\n| | \u2514DynamicApiControllerAttribute.cs\n\u251c\u2500DependencyInjection\n| \u251c\u2500Options\n| | \u2514DependencyInjectionSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514ExternalService.cs\n| \u251c\u2500Extensions\n| | \u2514DependencyInjectionServiceCollectionExtensions.cs\n| \u251c\u2500Enums\n| | \u251c\u2500InjectionActions.cs\n| | \u251c\u2500InjectionPatterns.cs\n| | \u2514RegisterType.cs\n| \u251c\u2500Dependencies\n| | \u251c\u2500IPrivateDependency.cs\n| | \u251c\u2500IScoped.cs\n| | \u251c\u2500ISingleton.cs\n| | \u251c\u2500ITransient.cs\n| | \u251c\u2500Proxies\n| | | \u2514IDispatchProxy.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500InjectionAttribute.cs\n| | \u2514SkipScanAttribute.cs\n\u251c\u2500DataValidation\n| \u251c\u2500Validators\n| | \u2514DataValidator.cs\n| \u251c\u2500Providers\n| | \u2514IValidationMessageTypeProvider.cs\n| \u251c\u2500Options\n| | \u2514ValidationTypeMessageSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514DataValidationResult.cs\n| \u251c\u2500Filters\n| | \u2514DataValidationFilter.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500DataValidationExtensions.cs\n| | \u2514DataValidationServiceCollectionExtensions.cs\n| \u251c\u2500Enums\n| | \u251c\u2500ValidationPattern.cs\n| | \u2514ValidationTypes.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500DataValidationAttribute.cs\n| | \u251c\u2500NonValidationAttribute.cs\n| | \u251c\u2500ValidationItemMetadataAttribute.cs\n| | \u251c\u2500ValidationMessageAttribute.cs\n| | \u251c\u2500ValidationMessageTypeAttribute.cs\n| | \u2514ValidationTypeAttribute.cs\n\u251c\u2500DataEncryption\n| \u251c\u2500AESEncryption.cs\n| \u251c\u2500DESCEncryption.cs\n| \u2514MD5Encryption.cs\n\u251c\u2500DatabaseAccessor\n| \u251c\u2500UnitOfWork\n| | \u251c\u2500Filters\n| | | \u2514UnitOfWorkFilter.cs\n| | \u251c\u2500Attributes\n| | | \u251c\u2500NonTransactAttribute.cs\n| | | \u2514UnitOfWorkAttribute.cs\n| \u251c\u2500Repositories\n| | \u251c\u2500EFCoreRepository.cs\n| | \u251c\u2500IMSRepository.cs\n| | \u251c\u2500IRepository.cs\n| | \u251c\u2500ISqlRepository.cs\n| | \u251c\u2500MSRepository.cs\n| | \u251c\u2500SqlRepository.cs\n| | \u251c\u2500Implantations\n| | | \u251c\u2500DeletableRepository.cs\n| | | \u251c\u2500InsertableRepository.cs\n| | | \u251c\u2500OperableRepository.cs\n| | | \u251c\u2500ReadableRepository.cs\n| | | \u251c\u2500SqlExecutableRepository.cs\n| | | \u251c\u2500SqlReaderRepository.cs\n| | | \u251c\u2500UpdateableRepository.cs\n| | | \u2514WritableRepository.cs\n| | \u251c\u2500Dependencies\n| | | \u251c\u2500IDeletableRepository.cs\n| | | \u251c\u2500IInsertableRepository.cs\n| | | \u251c\u2500IOperableRepository.cs\n| | | \u251c\u2500IReadableRepository.cs\n| | | \u251c\u2500IRepositoryDependency.cs\n| | | \u251c\u2500ISqlExecutableRepository.cs\n| | | \u251c\u2500ISqlReaderRepository.cs\n| | | \u251c\u2500IUpdateableRepository.cs\n| | | \u2514IWritableRepository.cs\n| \u251c\u2500Pools\n| | \u251c\u2500DbContextPool.cs\n| | \u2514IDbContextPool.cs\n| \u251c\u2500MultiTenants\n| | \u251c\u2500Locators\n| | | \u2514MultiTenantDbContextLocator.cs\n| | \u251c\u2500Enums\n| | | \u2514MultiTenantOptions.cs\n| | \u251c\u2500Entities\n| | | \u2514Tenant.cs\n| | \u251c\u2500Dependencies\n| | | \u251c\u2500IMultiTenantOnDatabase.cs\n| | | \u251c\u2500IMultiTenantOnSchema.cs\n| | | \u251c\u2500IMultiTenantOnTable.cs\n| | | \u2514IPrivateMultiTenant.cs\n| \u251c\u2500Models\n| | \u251c\u2500DbProvider.cs\n| | \u251c\u2500PagedList.cs\n| | \u251c\u2500ProcedureOutputResult.cs\n| | \u251c\u2500ProcedureOutputValue.cs\n| | \u251c\u2500SqlTemplate.cs\n| | \u2514SqlTemplateParameter.cs\n| \u251c\u2500Locators\n| | \u251c\u2500IDbContextLocator.cs\n| | \u2514MasterDbContextLocator.cs\n| \u251c\u2500Interceptors\n| | \u251c\u2500DbContextSaveChangesInterceptor.cs\n| | \u251c\u2500SqlCommandProfilerInterceptor.cs\n| | \u2514SqlConnectionProfilerInterceptor.cs\n| \u251c\u2500Helpers\n| | \u2514DbHelpers.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500DatabaseAccessorServiceCollectionExtensions.cs\n| | \u251c\u2500PagedQueryableExtensions.cs\n| | \u251c\u2500Repositories\n| | | \u251c\u2500IEntityExtensions.cs\n| | | \u251c\u2500IEntityWithDbContextLocatorExtensions.cs\n| | | \u2514SqlExtensions.cs\n| | \u251c\u2500DatabaseProvider\n| | | \u251c\u2500DatabaseProviderServiceCollectionExtensions.cs\n| | | \u2514Penetrates.cs\n| | \u251c\u2500DatabaseFacade\n| | | \u251c\u2500DbDataConvertExtensions.cs\n| | | \u251c\u2500DbObjectExtensions.cs\n| | | \u2514SqlAdoNetExtensions.cs\n| \u251c\u2500Enums\n| | \u251c\u2500DbFunctionType.cs\n| | \u251c\u2500EFCoreErrorCodes.cs\n| | \u2514ManualOptions.cs\n| \u251c\u2500Entities\n| | \u251c\u2500Dependencies\n| | | \u251c\u2500Entity.cs\n| | | \u251c\u2500EntityBase.cs\n| | | \u251c\u2500EntityNotKey.cs\n| | | \u251c\u2500IEntity.cs\n| | | \u2514IEntityNotKey.cs\n| | \u251c\u2500Configures\n| | | \u251c\u2500IEntitySeedData.cs\n| | | \u251c\u2500IEntityTypeBuilder.cs\n| | | \u251c\u2500IModelBuilderFilter.cs\n| | | \u2514IPrivateModelBuilder.cs\n| | \u251c\u2500Attributes\n| | | \u251c\u2500FakeDeleteAttribute.cs\n| | | \u251c\u2500NonAutomaticAttribute.cs\n| | | \u2514QueryableFunctionAttribute.cs\n| \u251c\u2500DynamicModels\n| | \u251c\u2500DynamicModelCacheKeyFactory.cs\n| | \u2514IEntityMutableTable.cs\n| \u251c\u2500Contexts\n| | \u251c\u2500AppDbContext.cs\n| | \u251c\u2500Builders\n| | | \u251c\u2500AppDbContextBuilder.cs\n| | | \u251c\u2500Models\n| | | | \u2514DbContextCorrelationType.cs\n| | \u251c\u2500Attributes\n| | | \u2514AppDbContextAttribute.cs\n| \u251c\u2500Attributes\n| | \u2514DbParameterAttribute.cs\n| \u251c\u2500Advances\n| | \u251c\u2500Proxies\n| | | \u2514SqlDispatchProxy.cs\n| | \u251c\u2500Models\n| | | \u2514SqlProxyMethod.cs\n| | \u251c\u2500Dependencies\n| | | \u2514ISqlDispatchProxy.cs\n| | \u251c\u2500Attributes\n| | | \u251c\u2500SqlExecuteAttribute.cs\n| | | \u251c\u2500SqlFunctionAttribute.cs\n| | | \u251c\u2500SqlProcedureAttribute.cs\n| | | \u251c\u2500Basics\n| | | | \u251c\u2500SqlObjectProxyAttribute.cs\n| | | | \u251c\u2500SqlProxyAttribute.cs\n| | | | \u2514SqlSentenceProxyAttribute.cs\n\u251c\u2500CorsAccessor\n| \u251c\u2500Options\n| | \u2514CorsAccessorSettingsOptions.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500CorsAccessorApplicationBuilderExtensions.cs\n| | \u2514CorsAccessorServiceCollectionExtensions.cs\n\u251c\u2500ConfigurableOptions\n| \u251c\u2500Options\n| | \u2514IConfigurableOptions.cs\n| \u251c\u2500Extensions\n| | \u2514ConfigurableOptionsServiceCollectionExtensions.cs\n| \u251c\u2500Attributes\n| | \u2514OptionsSettingsAttribute.cs\n\u251c\u2500Authorization\n| \u251c\u2500Penetrates.cs\n| \u251c\u2500Requirements\n| | \u2514AuthorizePolicyRequirement.cs\n| \u251c\u2500Providers\n| | \u2514AuthorizePolicyProvider.cs\n| \u251c\u2500Options\n| | \u2514JWTSettingsOptions.cs\n| \u251c\u2500Handlers\n| | \u2514AuthorizePolicyHandler.cs\n| \u251c\u2500Extensions\n| | \u2514PolicyAuthorizationServiceCollectionExtensions.cs\n| \u251c\u2500Attributes\n| | \u2514AuthorizePolicyAttribute.cs\n\u251c\u2500App\n| \u251c\u2500App.cs\n| \u251c\u2500Startups\n| | \u251c\u2500AppStartup.cs\n| | \u2514HostingStartup.cs\n| \u251c\u2500Options\n| | \u2514AppSettingsOptions.cs\n| \u251c\u2500Filters\n| | \u2514StartupFilter.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500AppApplicationBuilderExtensions.cs\n| | \u251c\u2500AppServiceCollectionExtensions.cs\n| | \u251c\u2500WebHostBuilderExtensions.cs\n| | \u251c\u2500Types\n| | | \u2514ObjectExtensions.cs\n| \u251c\u2500Attributes\n| | \u2514AppStartupAttribute.cs\n")),Object(o.b)("h2",{id:"135-furionapplication-\u4e1a\u52a1\u5e94\u7528\u5c42"},"1.3.5 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Application")," \u4e1a\u52a1\u5e94\u7528\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Application")," \u4e1a\u52a1\u5e94\u7528\u5c42\u662f\u6700\u5e38\u7528\u7684\u5c42\uff0c\u51e0\u4e4e\u6240\u6709\u7684\u4e1a\u52a1\u4ee3\u7801\u90fd\u5728\u8fd9\u4e2a\u5c42\u4e2d\u7f16\u5199\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Application\n\u251c\u2500Furion.Application.Core.csproj\n\u251c\u2500Furion.Application.Core.xml\n\u2514FurApplicationStartup.cs\n")),Object(o.b)("h2",{id:"136-furioncore-\u4ed3\u50a8\u5b9e\u4f53\u5c42"},"1.3.6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Core")," \u4ed3\u50a8\u5b9e\u4f53\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u4e3b\u8981\u662f\u5b58\u50a8\u81ea\u5b9a\u4e49\u4ed3\u50a8\u548c\u5b9a\u4e49\u5b9e\u4f53\u7684\u5c42\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Core\n\u251c\u2500Furion.Core.csproj\n\u2514FurCoreStartup.cs\n")),Object(o.b)("h2",{id:"137-furiondatabasemigrations-\u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42"},"1.3.7 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Database.Migrations")," \u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")," \u4e3b\u8981\u662f\u7528\u6765\u5b58\u653e ",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u751f\u6210\u7684\u7ef4\u62a4\u6587\u4ef6\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Database.Migrations\n\u2514Furion.Database.Migrations.csproj\n")),Object(o.b)("h2",{id:"138-furionentityframeworkcore-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42"},"1.3.8 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.EntityFramework.Core")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u4e3b\u8981\u662f\u7528\u6765\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u548c\u5176\u4ed6\u6570\u636e\u5e93\u76f8\u5173\u914d\u7f6e\u4fe1\u606f\u7684\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.EntityFramework.Core\n\u2514Furion.EntityFramework.Core.csproj\n")),Object(o.b)("h2",{id:"139-furionwebcore-\u5e94\u7528\u6838\u5fc3\u5c42"},"1.3.9 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Web.Core")," \u5e94\u7528\u6838\u5fc3\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Web.Core")," \u4e3b\u8981\u662f\u7528\u6765\u914d\u7f6e Web \u5165\u53e3\u4e00\u4e9b\u4ee3\u7801\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"Filter"),"\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Middlewares")," \u7b49\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Web.Core\n\u251c\u2500Furion.Web.Core.xml\n\u2514FurWebCoreStartup.cs\n")),Object(o.b)("h2",{id:"1310-furionwebentry-\u5e94\u7528\u5165\u53e3\u5c42"},"1.3.10 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Web.Entry")," \u5e94\u7528\u5165\u53e3\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Web.Entry")," \u662f\u6211\u4eec\u7684\u5e94\u7528\u5c42\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"Web")," \u9879\u76ee\u5c42\uff0c\u53d1\u5e03\u5c42\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Web.Entry\n\u251c\u2500appsettings.Development.json\n\u251c\u2500appsettings.json\n\u251c\u2500Furion.Web.Entry.csproj\n\u251c\u2500Furion.Web.Entry.csproj.user\n\u251c\u2500Furion.Web.Entry.xml\n\u251c\u2500Program.cs\n\u251c\u2500Startup.cs\n\u251c\u2500wwwroot\n| \u2514README.md\n\u251c\u2500Properties\n| \u2514launchSettings.json\n\u251c\u2500Controllers\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{194:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return s}));var r=t(21),i=t(195);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(r)return n+t;const s=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+s:s}(n,e,t,r)}}function s(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},195:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return m}));var r=t(0),i=t.n(r);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function a(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):a(a({},n),e)),t},u=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},b={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,s=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),u=p(t),d=r,m=u["".concat(s,".").concat(d)]||u[d]||b[d]||o;return t?i.a.createElement(m,a(a({ref:n},l),{},{components:t})):i.a.createElement(m,a({ref:n},l))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,s=new Array(o);s[0]=d;var a={};for(var c in n)hasOwnProperty.call(n,c)&&(a[c]=n[c]);a.originalType=e,a.mdxType="string"==typeof e?e:r,s[1]=a;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},99:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return a})),t.d(n,"metadata",(function(){return c})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return u}));var r=t(3),i=t(7),o=(t(0),t(196)),s=t(197),a={id:"source",title:"1.3 \u6e90\u7801\u7ed3\u6784",sidebar_label:"1.3 \u6e90\u7801\u7ed3\u6784"},c={unversionedId:"source",id:"source",isDocsHomePage:!1,title:"1.3 \u6e90\u7801\u7ed3\u6784",description:"1.3.1 \u6e90\u7801\u67b6\u6784",source:"@site/docs\\source.mdx",slug:"/source",permalink:"/docs/source",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/source.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1.3 \u6e90\u7801\u7ed3\u6784",sidebar:"docs",previous:{title:"1.2 \u5173\u4e8e\u4f5c\u8005",permalink:"/docs/author"},next:{title:"1.4 \u9879\u76ee\u5408\u4f5c",permalink:"/docs/cooperate"}},l=[{value:"1.3.1 \u6e90\u7801\u67b6\u6784",id:"131-\u6e90\u7801\u67b6\u6784",children:[]},{value:"1.3.2 Furion.Tests \u6d4b\u8bd5\u5c42",id:"132-furiontests-\u6d4b\u8bd5\u5c42",children:[]},{value:"1.3.3 Solution Items \u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42",id:"133-solution-items-\u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42",children:[]},{value:"1.3.4 Furion \u6838\u5fc3\u5c42",id:"134-furion-\u6838\u5fc3\u5c42",children:[]},{value:"1.3.5 Furion.Application \u4e1a\u52a1\u5e94\u7528\u5c42",id:"135-furionapplication-\u4e1a\u52a1\u5e94\u7528\u5c42",children:[]},{value:"1.3.6 Furion.Core \u4ed3\u50a8\u5b9e\u4f53\u5c42",id:"136-furioncore-\u4ed3\u50a8\u5b9e\u4f53\u5c42",children:[]},{value:"1.3.7 Furion.Database.Migrations \u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42",id:"137-furiondatabasemigrations-\u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42",children:[]},{value:"1.3.8 Furion.EntityFramework.Core \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42",id:"138-furionentityframeworkcore-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42",children:[]},{value:"1.3.9 Furion.Web.Core \u5e94\u7528\u6838\u5fc3\u5c42",id:"139-furionwebcore-\u5e94\u7528\u6838\u5fc3\u5c42",children:[]},{value:"1.3.10 Furion.Web.Entry \u5e94\u7528\u5165\u53e3\u5c42",id:"1310-furionwebentry-\u5e94\u7528\u5165\u53e3\u5c42",children:[]}],p={toc:l};function u(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(s.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"131-\u6e90\u7801\u67b6\u6784"},"1.3.1 \u6e90\u7801\u67b6\u6784"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u521b\u5efa\u91c7\u7528\u591a\u5c42\u5206\u5c42\u8bbe\u8ba1\uff0c\u4e3b\u8981\u8bbe\u8ba1\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"\u81ea\u52a8\u62bd\u8c61\u5de5\u5382")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"DDD \u9886\u57df\u9a71\u52a8\u8bbe\u8ba1")," \u76f8\u7ed3\u5408\u3002"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9879\u76ee\u7ed3\u6784\u5982\u4e0b\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Tests"),"\uff1a\u6d4b\u8bd5\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Solution Items"),"\uff1a\u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion"),"\uff1a\u6846\u67b6\u6838\u5fc3\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Application"),"\uff1a\u4e1a\u52a1\u5e94\u7528\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Core"),"\uff1a\u6838\u5fc3\u5c42\uff08\u5b9e\u4f53\uff0c\u5c42\u6b21\uff0c\u5176\u4ed6\u6838\u5fc3\u4ee3\u7801\uff09"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Database.Migrations"),"\uff1a\u67b6\u6784\u7ef4\u62a4\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.EntityFramework.Core"),"\uff1aEF Core \u914d\u7f6e\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Web.Core"),"\uff1aWeb \u6838\u5fc3\u5c42"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Furion.Web.Entry"),"\uff1aWeb \u5165\u53e3\u5c42/\u542f\u52a8\u5c42")),Object(o.b)("h2",{id:"132-furiontests-\u6d4b\u8bd5\u5c42"},"1.3.2 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Tests")," \u6d4b\u8bd5\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Tests")," \u662f\u9879\u76ee\u7684\u6d4b\u8bd5\u5c42\uff0c\u76ee\u524d\u8fd8\u672a\u6574\u7406\u5b8c\u6210\u3002"),Object(o.b)("h2",{id:"133-solution-items-\u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42"},"1.3.3 ",Object(o.b)("inlineCode",{parentName:"h2"},"Solution Items")," \u89e3\u51b3\u65b9\u6848\u914d\u7f6e\u5c42"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{}),"Solution Items\n\u2514.editorconfig\n")),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Solution Items")," \u662f\u7528\u6765\u914d\u7f6e\u89e3\u51b3\u65b9\u6848\u4e2d\u4e00\u4e9b\u5168\u5c40\u914d\u7f6e\u7684\uff0c\u5982\u6bcf\u4e2a\u6587\u4ef6\u7684\u9876\u90e8\u7248\u6743\u4fe1\u606f\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// -----------------------------------------------------------------------------\n// \u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002\n// Copyright \xa9 2020 Furion, Baiqian Co.,Ltd.\n//\n// \u6846\u67b6\u540d\u79f0\uff1aFurion\n// \u6846\u67b6\u4f5c\u8005\uff1a\u767e\u5c0f\u50e7\n// \u6846\u67b6\u7248\u672c\uff1a1.0.0\n// \u6e90\u7801\u5730\u5740\uff1aGitee\uff1ahttps://gitee.com/monksoul/Furion\n// Github\uff1ahttps://github.com/monksoul/Furion\n// \u5f00\u6e90\u534f\u8bae\uff1aApache-2.0\uff08http://www.apache.org/licenses/LICENSE-2.0\uff09\n// -----------------------------------------------------------------------------\n")),Object(o.b)("p",null,"\u76f8\u5173\u914d\u7f6e\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},".editorconfig")," \u6700\u540e\u9762\u4e00\u884c\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{127}","{127}":!0}),'# Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\\MONK\\Furion\\framework codebase based on best match to current usage at 2020/9/2\n# You can modify the rules from these initially generated values to suit your own policies\n# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference\n[*.cs]\n\n\n#Core editorconfig formatting - indentation\n\n#use soft tabs (spaces) for indentation\nindent_style = space\n\n#Formatting - new line options\n\n#place else statements on a new line\ncsharp_new_line_before_else = true\n#require members of anonymous types to be on separate lines\ncsharp_new_line_before_members_in_anonymous_types = true\n#require members of object intializers to be on separate lines\ncsharp_new_line_before_members_in_object_initializers = true\n#require braces to be on a new line for accessors, methods, control_blocks, types, lambdas, object_collection_array_initializers, anonymous_types, and properties (also known as "Allman" style)\ncsharp_new_line_before_open_brace = accessors, methods, control_blocks, types, lambdas, object_collection_array_initializers, anonymous_types, properties\n\n#Formatting - organize using options\n\n#do not place System.* using directives before other using directives\ndotnet_sort_system_directives_first = false\n\n#Formatting - spacing options\n\n#require a space before the colon for bases or interfaces in a type declaration\ncsharp_space_after_colon_in_inheritance_clause = true\n#require a space after a keyword in a control flow statement such as a for loop\ncsharp_space_after_keywords_in_control_flow_statements = true\n#require a space before the colon for bases or interfaces in a type declaration\ncsharp_space_before_colon_in_inheritance_clause = true\n#remove space within empty argument list parentheses\ncsharp_space_between_method_call_empty_parameter_list_parentheses = false\n#remove space between method call name and opening parenthesis\ncsharp_space_between_method_call_name_and_opening_parenthesis = false\n#do not place space characters after the opening parenthesis and before the closing parenthesis of a method call\ncsharp_space_between_method_call_parameter_list_parentheses = false\n#remove space within empty parameter list parentheses for a method declaration\ncsharp_space_between_method_declaration_empty_parameter_list_parentheses = false\n#place a space character after the opening parenthesis and before the closing parenthesis of a method declaration parameter list.\ncsharp_space_between_method_declaration_parameter_list_parentheses = false\n\n#Formatting - wrapping options\n\n#leave code block on single line\ncsharp_preserve_single_line_blocks = true\n#leave statements and member declarations on the same line\ncsharp_preserve_single_line_statements = true\n\n#Style - Code block preferences\n\n#prefer no curly braces if allowed\ncsharp_prefer_braces = false:suggestion\n\n#Style - expression bodied member options\n\n#prefer expression-bodied members for accessors\ncsharp_style_expression_bodied_accessors = true:suggestion\n#prefer block bodies for constructors\ncsharp_style_expression_bodied_constructors = false:suggestion\n#prefer block bodies for methods\ncsharp_style_expression_bodied_methods = false:suggestion\n#prefer expression-bodied members for properties\ncsharp_style_expression_bodied_properties = true:suggestion\n\n#Style - expression level options\n\n#prefer out variables to be declared inline in the argument list of a method call when possible\ncsharp_style_inlined_variable_declaration = true:suggestion\n#prefer the language keyword for member access expressions, instead of the type name, for types that have a keyword to represent them\ndotnet_style_predefined_type_for_member_access = true:suggestion\n\n#Style - Expression-level preferences\n\n#prefer default over default(T)\ncsharp_prefer_simple_default_expression = true:suggestion\n#prefer objects to be initialized using object initializers when possible\ndotnet_style_object_initializer = true:suggestion\n#prefer inferred anonymous type member names\ndotnet_style_prefer_inferred_anonymous_type_member_names = false:suggestion\n#prefer inferred tuple element names\ndotnet_style_prefer_inferred_tuple_names = true:suggestion\n\n#Style - implicit and explicit types\n\n#prefer var over explicit type in all cases, unless overridden by another code style rule\ncsharp_style_var_elsewhere = true:suggestion\n#prefer var is used to declare variables with built-in system types such as int\ncsharp_style_var_for_built_in_types = true:suggestion\n#prefer var when the type is already mentioned on the right-hand side of a declaration expression\ncsharp_style_var_when_type_is_apparent = true:suggestion\n\n#Style - language keyword and framework type options\n\n#prefer the language keyword for local variables, method parameters, and class members, instead of the type name, for types that have a keyword to represent them\ndotnet_style_predefined_type_for_locals_parameters_members = true:suggestion\n\n#Style - Miscellaneous preferences\n\n#prefer local functions over anonymous functions\ncsharp_style_pattern_local_over_anonymous_function = true:suggestion\n\n#Style - modifier options\n\n#prefer accessibility modifiers to be declared except for public interface members. This will currently not differ from always and will act as future proofing for if C# adds default interface methods.\ndotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion\n\n#Style - Modifier preferences\n\n#when this rule is set to a list of modifiers, prefer the specified ordering.\ncsharp_preferred_modifier_order = public,private,internal,protected,virtual,static,async,abstract,readonly,sealed,override:suggestion\n\n#Style - qualification options\n\n#prefer fields not to be prefaced with this. or Me. in Visual Basic\ndotnet_style_qualification_for_field = false:suggestion\n#prefer methods not to be prefaced with this. or Me. in Visual Basic\ndotnet_style_qualification_for_method = false:suggestion\n#prefer properties not to be prefaced with this. or Me. in Visual Basic\ndotnet_style_qualification_for_property = false:suggestion\n\n# Add file header\nfile_header_template = -----------------------------------------------------------------------------\\nFur \u662f .NET 5 \u5e73\u53f0\u4e0b\u4f01\u4e1a\u5e94\u7528\u5f00\u53d1\u6700\u4f73\u5b9e\u8df5\u6846\u67b6\u3002\\nCopyright \xa9 2020 Furion, Baiqian Co.,Ltd.\\n\\n\u6846\u67b6\u540d\u79f0\uff1aFurion\\n\u6846\u67b6\u4f5c\u8005\uff1a\u767e\u5c0f\u50e7\\n\u6846\u67b6\u7248\u672c\uff1a1.0.0\\n\u6e90\u7801\u5730\u5740\uff1aGitee\uff1ahttps://gitee.com/monksoul/Furion \\n Github\uff1ahttps://github.com/monksoul/Furion \\n\u5f00\u6e90\u534f\u8bae\uff1aApache-2.0\uff08http://www.apache.org/licenses/LICENSE-2.0\uff09\\n-----------------------------------------------------------------------------\n')),Object(o.b)("h2",{id:"134-furion-\u6838\u5fc3\u5c42"},"1.3.4 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion")," \u6838\u5fc3\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6838\u5fc3\u5c42\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u7684\u4e2d\u5fc3\uff0c\u4e5f\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u80fd\u591f\u652f\u6491\u8d77\u6765\u7684\u5fc5\u5907\u5c42\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{}),"Furion\n\u251c\u2500Furion.csproj\n\u251c\u2500Furion.csproj.user\n\u251c\u2500FurStartup.cs\n\u251c\u2500ViewEngine\n| \u251c\u2500IViewEngine.cs\n| \u251c\u2500ViewEngine.cs\n| \u251c\u2500Templates\n| | \u251c\u2500IViewEngineCompiledTemplate.cs\n| | \u251c\u2500IViewEngineTemplate.cs\n| | \u251c\u2500ViewEngineCompiledTemplate.cs\n| | \u2514ViewEngineTemplate.cs\n| \u251c\u2500Options\n| | \u2514ViewEngineCompilationOptions.cs\n| \u251c\u2500Models\n| | \u2514AnonymousTypeWrapper.cs\n| \u251c\u2500Exceptions\n| | \u251c\u2500ViewEngineCompilationException.cs\n| | \u2514ViewEngineException.cs\n| \u251c\u2500Compilations\n| | \u251c\u2500IViewEngineCompilationOptionsBuilder.cs\n| | \u2514ViewEngineCompilationOptionsBuilder.cs\n\u251c\u2500UnifyResult\n| \u251c\u2500Providers\n| | \u251c\u2500IUnifyResultProvider.cs\n| | \u2514RESTfulResultProvider.cs\n| \u251c\u2500Models\n| | \u2514RESTfulResult.cs\n| \u251c\u2500Filters\n| | \u2514SuccessUnifyResultFilter.cs\n| \u251c\u2500Extensions\n| | \u2514UnifyResultServiceCollectionExtensions.cs\n\u251c\u2500SpecificationDocument\n| \u251c\u2500Options\n| | \u2514SpecificationDocumentSettingsOptions.cs\n| \u251c\u2500Models\n| | \u251c\u2500GroupOrder.cs\n| | \u251c\u2500SpecificationOpenApiInfo.cs\n| | \u251c\u2500SpecificationOpenApiSecurityRequirementItem.cs\n| | \u2514SpecificationOpenApiSecurityScheme.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500SpecificationDocumentApplicationBuilderExtensions.cs\n| | \u2514SpecificationDocumentServiceCollectionExtensions.cs\n| \u251c\u2500Builders\n| | \u2514SpecificationDocumentBuilder.cs\n| \u251c\u2500Assets\n| | \u2514index-mini-profiler.html\n\u251c\u2500ObjectMapper\n| \u251c\u2500Extensions\n| | \u2514ObjectMapperServiceCollectionExtensions.cs\n| \u251c\u2500Dependencies\n| | \u2514IObjectMapper.cs\n\u251c\u2500LinqBuilder\n| \u251c\u2500Visitors\n| | \u2514ParameterReplaceExpressionVisitor.cs\n| \u251c\u2500Extensions\n| | \u2514LinqExtensions.cs\n| \u251c\u2500Builders\n| | \u2514LinqExpression.cs\n\u251c\u2500FriendlyException\n| \u251c\u2500Oops.cs\n| \u251c\u2500Providers\n| | \u2514IErrorCodeTypeProvider.cs\n| \u251c\u2500Options\n| | \u2514ErrorCodeMessageSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514MethodIfException.cs\n| \u251c\u2500Filters\n| | \u2514FriendlyExceptionFilter.cs\n| \u251c\u2500Extensions\n| | \u2514FriendlyExceptionServiceCollectionExtensions.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500ErrorCodeItemMetadataAttribute.cs\n| | \u251c\u2500ErrorCodeTypeAttribute.cs\n| | \u2514IfExceptionAttribute.cs\n\u251c\u2500DynamicApiController\n| \u251c\u2500Penetrates.cs\n| \u251c\u2500Providers\n| | \u2514DynamicApiControllerFeatureProvider.cs\n| \u251c\u2500Options\n| | \u2514DynamicApiControllerSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514ParameterRouteTemplate.cs\n| \u251c\u2500Extensions\n| | \u2514DynamicApiControllerServiceCollectionExtensions.cs\n| \u251c\u2500Enums\n| | \u2514ApiSeats.cs\n| \u251c\u2500Dependencies\n| | \u2514IDynamicApiController.cs\n| \u251c\u2500Conventions\n| | \u2514DynamicApiControllerApplicationModelConvention.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500ApiDescriptionSettingsAttribute.cs\n| | \u251c\u2500ApiSeatAttribute.cs\n| | \u2514DynamicApiControllerAttribute.cs\n\u251c\u2500DependencyInjection\n| \u251c\u2500Options\n| | \u2514DependencyInjectionSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514ExternalService.cs\n| \u251c\u2500Extensions\n| | \u2514DependencyInjectionServiceCollectionExtensions.cs\n| \u251c\u2500Enums\n| | \u251c\u2500InjectionActions.cs\n| | \u251c\u2500InjectionPatterns.cs\n| | \u2514RegisterType.cs\n| \u251c\u2500Dependencies\n| | \u251c\u2500IPrivateDependency.cs\n| | \u251c\u2500IScoped.cs\n| | \u251c\u2500ISingleton.cs\n| | \u251c\u2500ITransient.cs\n| | \u251c\u2500Proxies\n| | | \u2514IDispatchProxy.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500InjectionAttribute.cs\n| | \u2514SkipScanAttribute.cs\n\u251c\u2500DataValidation\n| \u251c\u2500Validators\n| | \u2514DataValidator.cs\n| \u251c\u2500Providers\n| | \u2514IValidationMessageTypeProvider.cs\n| \u251c\u2500Options\n| | \u2514ValidationTypeMessageSettingsOptions.cs\n| \u251c\u2500Models\n| | \u2514DataValidationResult.cs\n| \u251c\u2500Filters\n| | \u2514DataValidationFilter.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500DataValidationExtensions.cs\n| | \u2514DataValidationServiceCollectionExtensions.cs\n| \u251c\u2500Enums\n| | \u251c\u2500ValidationPattern.cs\n| | \u2514ValidationTypes.cs\n| \u251c\u2500Attributes\n| | \u251c\u2500DataValidationAttribute.cs\n| | \u251c\u2500NonValidationAttribute.cs\n| | \u251c\u2500ValidationItemMetadataAttribute.cs\n| | \u251c\u2500ValidationMessageAttribute.cs\n| | \u251c\u2500ValidationMessageTypeAttribute.cs\n| | \u2514ValidationTypeAttribute.cs\n\u251c\u2500DataEncryption\n| \u251c\u2500AESEncryption.cs\n| \u251c\u2500DESCEncryption.cs\n| \u2514MD5Encryption.cs\n\u251c\u2500DatabaseAccessor\n| \u251c\u2500UnitOfWork\n| | \u251c\u2500Filters\n| | | \u2514UnitOfWorkFilter.cs\n| | \u251c\u2500Attributes\n| | | \u251c\u2500NonTransactAttribute.cs\n| | | \u2514UnitOfWorkAttribute.cs\n| \u251c\u2500Repositories\n| | \u251c\u2500EFCoreRepository.cs\n| | \u251c\u2500IMSRepository.cs\n| | \u251c\u2500IRepository.cs\n| | \u251c\u2500ISqlRepository.cs\n| | \u251c\u2500MSRepository.cs\n| | \u251c\u2500SqlRepository.cs\n| | \u251c\u2500Implantations\n| | | \u251c\u2500DeletableRepository.cs\n| | | \u251c\u2500InsertableRepository.cs\n| | | \u251c\u2500OperableRepository.cs\n| | | \u251c\u2500ReadableRepository.cs\n| | | \u251c\u2500SqlExecutableRepository.cs\n| | | \u251c\u2500SqlReaderRepository.cs\n| | | \u251c\u2500UpdateableRepository.cs\n| | | \u2514WritableRepository.cs\n| | \u251c\u2500Dependencies\n| | | \u251c\u2500IDeletableRepository.cs\n| | | \u251c\u2500IInsertableRepository.cs\n| | | \u251c\u2500IOperableRepository.cs\n| | | \u251c\u2500IReadableRepository.cs\n| | | \u251c\u2500IRepositoryDependency.cs\n| | | \u251c\u2500ISqlExecutableRepository.cs\n| | | \u251c\u2500ISqlReaderRepository.cs\n| | | \u251c\u2500IUpdateableRepository.cs\n| | | \u2514IWritableRepository.cs\n| \u251c\u2500Pools\n| | \u251c\u2500DbContextPool.cs\n| | \u2514IDbContextPool.cs\n| \u251c\u2500MultiTenants\n| | \u251c\u2500Locators\n| | | \u2514MultiTenantDbContextLocator.cs\n| | \u251c\u2500Enums\n| | | \u2514MultiTenantOptions.cs\n| | \u251c\u2500Entities\n| | | \u2514Tenant.cs\n| | \u251c\u2500Dependencies\n| | | \u251c\u2500IMultiTenantOnDatabase.cs\n| | | \u251c\u2500IMultiTenantOnSchema.cs\n| | | \u251c\u2500IMultiTenantOnTable.cs\n| | | \u2514IPrivateMultiTenant.cs\n| \u251c\u2500Models\n| | \u251c\u2500DbProvider.cs\n| | \u251c\u2500PagedList.cs\n| | \u251c\u2500ProcedureOutputResult.cs\n| | \u251c\u2500ProcedureOutputValue.cs\n| | \u251c\u2500SqlTemplate.cs\n| | \u2514SqlTemplateParameter.cs\n| \u251c\u2500Locators\n| | \u251c\u2500IDbContextLocator.cs\n| | \u2514MasterDbContextLocator.cs\n| \u251c\u2500Interceptors\n| | \u251c\u2500DbContextSaveChangesInterceptor.cs\n| | \u251c\u2500SqlCommandProfilerInterceptor.cs\n| | \u2514SqlConnectionProfilerInterceptor.cs\n| \u251c\u2500Helpers\n| | \u2514DbHelpers.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500DatabaseAccessorServiceCollectionExtensions.cs\n| | \u251c\u2500PagedQueryableExtensions.cs\n| | \u251c\u2500Repositories\n| | | \u251c\u2500IEntityExtensions.cs\n| | | \u251c\u2500IEntityWithDbContextLocatorExtensions.cs\n| | | \u2514SqlExtensions.cs\n| | \u251c\u2500DatabaseProvider\n| | | \u251c\u2500DatabaseProviderServiceCollectionExtensions.cs\n| | | \u2514Penetrates.cs\n| | \u251c\u2500DatabaseFacade\n| | | \u251c\u2500DbDataConvertExtensions.cs\n| | | \u251c\u2500DbObjectExtensions.cs\n| | | \u2514SqlAdoNetExtensions.cs\n| \u251c\u2500Enums\n| | \u251c\u2500DbFunctionType.cs\n| | \u251c\u2500EFCoreErrorCodes.cs\n| | \u2514ManualOptions.cs\n| \u251c\u2500Entities\n| | \u251c\u2500Dependencies\n| | | \u251c\u2500Entity.cs\n| | | \u251c\u2500EntityBase.cs\n| | | \u251c\u2500EntityNotKey.cs\n| | | \u251c\u2500IEntity.cs\n| | | \u2514IEntityNotKey.cs\n| | \u251c\u2500Configures\n| | | \u251c\u2500IEntitySeedData.cs\n| | | \u251c\u2500IEntityTypeBuilder.cs\n| | | \u251c\u2500IModelBuilderFilter.cs\n| | | \u2514IPrivateModelBuilder.cs\n| | \u251c\u2500Attributes\n| | | \u251c\u2500FakeDeleteAttribute.cs\n| | | \u251c\u2500NonAutomaticAttribute.cs\n| | | \u2514QueryableFunctionAttribute.cs\n| \u251c\u2500DynamicModels\n| | \u251c\u2500DynamicModelCacheKeyFactory.cs\n| | \u2514IEntityMutableTable.cs\n| \u251c\u2500Contexts\n| | \u251c\u2500AppDbContext.cs\n| | \u251c\u2500Builders\n| | | \u251c\u2500AppDbContextBuilder.cs\n| | | \u251c\u2500Models\n| | | | \u2514DbContextCorrelationType.cs\n| | \u251c\u2500Attributes\n| | | \u2514AppDbContextAttribute.cs\n| \u251c\u2500Attributes\n| | \u2514DbParameterAttribute.cs\n| \u251c\u2500Advances\n| | \u251c\u2500Proxies\n| | | \u2514SqlDispatchProxy.cs\n| | \u251c\u2500Models\n| | | \u2514SqlProxyMethod.cs\n| | \u251c\u2500Dependencies\n| | | \u2514ISqlDispatchProxy.cs\n| | \u251c\u2500Attributes\n| | | \u251c\u2500SqlExecuteAttribute.cs\n| | | \u251c\u2500SqlFunctionAttribute.cs\n| | | \u251c\u2500SqlProcedureAttribute.cs\n| | | \u251c\u2500Basics\n| | | | \u251c\u2500SqlObjectProxyAttribute.cs\n| | | | \u251c\u2500SqlProxyAttribute.cs\n| | | | \u2514SqlSentenceProxyAttribute.cs\n\u251c\u2500CorsAccessor\n| \u251c\u2500Options\n| | \u2514CorsAccessorSettingsOptions.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500CorsAccessorApplicationBuilderExtensions.cs\n| | \u2514CorsAccessorServiceCollectionExtensions.cs\n\u251c\u2500ConfigurableOptions\n| \u251c\u2500Options\n| | \u2514IConfigurableOptions.cs\n| \u251c\u2500Extensions\n| | \u2514ConfigurableOptionsServiceCollectionExtensions.cs\n| \u251c\u2500Attributes\n| | \u2514OptionsSettingsAttribute.cs\n\u251c\u2500Authorization\n| \u251c\u2500Penetrates.cs\n| \u251c\u2500Requirements\n| | \u2514AuthorizePolicyRequirement.cs\n| \u251c\u2500Providers\n| | \u2514AuthorizePolicyProvider.cs\n| \u251c\u2500Options\n| | \u2514JWTSettingsOptions.cs\n| \u251c\u2500Handlers\n| | \u2514AuthorizePolicyHandler.cs\n| \u251c\u2500Extensions\n| | \u2514PolicyAuthorizationServiceCollectionExtensions.cs\n| \u251c\u2500Attributes\n| | \u2514AuthorizePolicyAttribute.cs\n\u251c\u2500App\n| \u251c\u2500App.cs\n| \u251c\u2500Startups\n| | \u251c\u2500AppStartup.cs\n| | \u2514HostingStartup.cs\n| \u251c\u2500Options\n| | \u2514AppSettingsOptions.cs\n| \u251c\u2500Filters\n| | \u2514StartupFilter.cs\n| \u251c\u2500Extensions\n| | \u251c\u2500AppApplicationBuilderExtensions.cs\n| | \u251c\u2500AppServiceCollectionExtensions.cs\n| | \u251c\u2500WebHostBuilderExtensions.cs\n| | \u251c\u2500Types\n| | | \u2514ObjectExtensions.cs\n| \u251c\u2500Attributes\n| | \u2514AppStartupAttribute.cs\n")),Object(o.b)("h2",{id:"135-furionapplication-\u4e1a\u52a1\u5e94\u7528\u5c42"},"1.3.5 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Application")," \u4e1a\u52a1\u5e94\u7528\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Application")," \u4e1a\u52a1\u5e94\u7528\u5c42\u662f\u6700\u5e38\u7528\u7684\u5c42\uff0c\u51e0\u4e4e\u6240\u6709\u7684\u4e1a\u52a1\u4ee3\u7801\u90fd\u5728\u8fd9\u4e2a\u5c42\u4e2d\u7f16\u5199\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Application\n\u251c\u2500Furion.Application.Core.csproj\n\u251c\u2500Furion.Application.Core.xml\n\u2514FurApplicationStartup.cs\n")),Object(o.b)("h2",{id:"136-furioncore-\u4ed3\u50a8\u5b9e\u4f53\u5c42"},"1.3.6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Core")," \u4ed3\u50a8\u5b9e\u4f53\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u4e3b\u8981\u662f\u5b58\u50a8\u81ea\u5b9a\u4e49\u4ed3\u50a8\u548c\u5b9a\u4e49\u5b9e\u4f53\u7684\u5c42\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Core\n\u251c\u2500Furion.Core.csproj\n\u2514FurCoreStartup.cs\n")),Object(o.b)("h2",{id:"137-furiondatabasemigrations-\u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42"},"1.3.7 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Database.Migrations")," \u6570\u636e\u5e93\u67b6\u6784\u7ef4\u62a4\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")," \u4e3b\u8981\u662f\u7528\u6765\u5b58\u653e ",Object(o.b)("inlineCode",{parentName:"p"},"Database First")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"Code First")," \u751f\u6210\u7684\u7ef4\u62a4\u6587\u4ef6\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Database.Migrations\n\u2514Furion.Database.Migrations.csproj\n")),Object(o.b)("h2",{id:"138-furionentityframeworkcore-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42"},"1.3.8 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.EntityFramework.Core")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u4e3b\u8981\u662f\u7528\u6765\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u548c\u5176\u4ed6\u6570\u636e\u5e93\u76f8\u5173\u914d\u7f6e\u4fe1\u606f\u7684\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.EntityFramework.Core\n\u2514Furion.EntityFramework.Core.csproj\n")),Object(o.b)("h2",{id:"139-furionwebcore-\u5e94\u7528\u6838\u5fc3\u5c42"},"1.3.9 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Web.Core")," \u5e94\u7528\u6838\u5fc3\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Web.Core")," \u4e3b\u8981\u662f\u7528\u6765\u914d\u7f6e Web \u5165\u53e3\u4e00\u4e9b\u4ee3\u7801\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"Filter"),"\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Middlewares")," \u7b49\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Web.Core\n\u251c\u2500Furion.Web.Core.xml\n\u2514FurWebCoreStartup.cs\n")),Object(o.b)("h2",{id:"1310-furionwebentry-\u5e94\u7528\u5165\u53e3\u5c42"},"1.3.10 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion.Web.Entry")," \u5e94\u7528\u5165\u53e3\u5c42"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion.Web.Entry")," \u662f\u6211\u4eec\u7684\u5e94\u7528\u5c42\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"Web")," \u9879\u76ee\u5c42\uff0c\u53d1\u5e03\u5c42\u3002"),Object(o.b)("p",null,"\u6e90\u7801\u7ed3\u6784\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"Furion.Web.Entry\n\u251c\u2500appsettings.Development.json\n\u251c\u2500appsettings.json\n\u251c\u2500Furion.Web.Entry.csproj\n\u251c\u2500Furion.Web.Entry.csproj.user\n\u251c\u2500Furion.Web.Entry.xml\n\u251c\u2500Program.cs\n\u251c\u2500Startup.cs\n\u251c\u2500wwwroot\n| \u2514README.md\n\u251c\u2500Properties\n| \u2514launchSettings.json\n\u251c\u2500Controllers\n")))}u.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/36793c62.24093943.js b/docs/36793c62.24093943.js deleted file mode 100644 index cd7af99d449..00000000000 --- a/docs/36793c62.24093943.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{190:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c}));var a=n(21),i=n(191);function r(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return r?e+c:c}(t,e,n,a)}}function c(e,t={}){const{withBaseUrl:n}=r();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var a=n(0),i=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=i.a.createContext({}),o=function(e){var t=i.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=o(e.components);return i.a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},u=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=o(n),u=a,m=s["".concat(c,".").concat(u)]||s[u]||d[u]||r;return n?i.a.createElement(m,b(b({ref:t},p),{},{components:n})):i.a.createElement(m,b({ref:t},p))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,c=new Array(r);c[0]=u;var b={};for(var l in t)hasOwnProperty.call(t,l)&&(b[l]=t[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,c[1]=b;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},99:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return s}));var a=n(3),i=n(7),r=(n(0),n(192)),c=n(193),b={id:"http",title:"19. \u8fdc\u7a0b\u8bf7\u6c42",sidebar_label:"19. \u8fdc\u7a0b\u8bf7\u6c42"},l={unversionedId:"http",id:"http",isDocsHomePage:!1,title:"19. \u8fdc\u7a0b\u8bf7\u6c42",description:"19.1 \u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42",source:"@site/docs\\http.mdx",slug:"/http",permalink:"/docs/http",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/http.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"19. \u8fdc\u7a0b\u8bf7\u6c42",sidebar:"docs",previous:{title:"18. \u65e5\u5fd7\u8bb0\u5f55",permalink:"/docs/logging"},next:{title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",permalink:"/docs/encryption"}},p=[{value:"19.1 \u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42",id:"191-\u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42",children:[]},{value:"19.2 \u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528",id:"192-\u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528",children:[]},{value:"19.3 \u57fa\u7840\u4f7f\u7528",id:"193-\u57fa\u7840\u4f7f\u7528",children:[{value:"19.3.1 \u6ce8\u518c\u670d\u52a1",id:"1931-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"19.3.2 \u4f7f\u7528\u65b9\u5f0f",id:"1932-\u4f7f\u7528\u65b9\u5f0f",children:[]}]},{value:"19.4 \u4f7f\u7528\u793a\u4f8b",id:"194-\u4f7f\u7528\u793a\u4f8b",children:[{value:"19.4.1 \u5b57\u7b26\u4e32\u65b9\u5f0f",id:"1941-\u5b57\u7b26\u4e32\u65b9\u5f0f",children:[]},{value:"19.4.2 \u4ee3\u7406\u65b9\u5f0f",id:"1942-\u4ee3\u7406\u65b9\u5f0f",children:[]}]},{value:"19.5 \u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528",id:"195-\u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528",children:[{value:"19.5.1 \u53c2\u6570\u5904\u7406",id:"1951-\u53c2\u6570\u5904\u7406",children:[]},{value:"19.5.2 \u53c2\u6570\u9a8c\u8bc1",id:"1952-\u53c2\u6570\u9a8c\u8bc1",children:[]},{value:"19.5.3 \u8fd4\u56de\u503c\u5904\u7406",id:"1953-\u8fd4\u56de\u503c\u5904\u7406",children:[]},{value:"19.5.4 \u8bf7\u6c42/\u54cd\u5e94\u62e6\u622a",id:"1954-\u8bf7\u6c42\u54cd\u5e94\u62e6\u622a",children:[]},{value:"19.5.5 Body \u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898",id:"1955-body-\u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898",children:[]},{value:"19.5.6 Body \u5185\u5bb9\u914d\u7f6e",id:"1956-body-\u5185\u5bb9\u914d\u7f6e",children:[]},{value:"19.5.7 \u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e",id:"1957-\u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e",children:[]}]},{value:"19.6 \u4ee3\u7406\u5185\u7f6e\u7279\u6027",id:"196-\u4ee3\u7406\u5185\u7f6e\u7279\u6027",children:[{value:"19.6.1 \u63a5\u53e3\u7279\u6027",id:"1961-\u63a5\u53e3\u7279\u6027",children:[]},{value:"19.6.2 \u65b9\u6cd5\u7279\u6027",id:"1962-\u65b9\u6cd5\u7279\u6027",children:[]},{value:"19.6.3 \u65b9\u6cd5\u53c2\u6570\u7279\u6027",id:"1963-\u65b9\u6cd5\u53c2\u6570\u7279\u6027",children:[]}]},{value:"19.7 \u5173\u4e8e\u540c\u6b65\u8bf7\u6c42",id:"197-\u5173\u4e8e\u540c\u6b65\u8bf7\u6c42",children:[]},{value:"19.8 \u5f02\u5e38\u5904\u7406",id:"198-\u5f02\u5e38\u5904\u7406",children:[]},{value:"19.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"199-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],o={toc:p};function s(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},o,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"191-\u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42"},"19.1 \u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42"),Object(r.b)("p",null,"\u5728\u4e92\u8054\u7f51\u5927\u6570\u636e\u7684\u9a71\u52a8\u4e0b\uff0c\u5e73\u53f0\u6216\u7cfb\u7edf\u514d\u4e0d\u4e86\u9700\u8981\u548c\u7b2c\u4e09\u65b9\u8fdb\u884c\u6570\u636e\u4ea4\u4e92\uff0c\u800c\u7b2c\u4e09\u65b9\u5f80\u5f80\u63d0\u4f9b\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"RESTful API")," \u7ed3\u679c\u89c4\u8303\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"Http")," \u8bf7\u6c42\u7b2c\u4e09\u65b9\u63a5\u53e3\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u4ea4\u4e92\u3002"),Object(r.b)("p",null,"\u4e5f\u5c31\u662f\u672c\u7ae0\u8282\u6240\u8bf4\u7684\u8fdc\u7a0b\u8bf7\u6c42\u3002"),Object(r.b)("h2",{id:"192-\u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528"},"19.2 \u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u8de8\u7cfb\u7edf\u3001\u8de8\u8bbe\u5907\u901a\u4fe1"),Object(r.b)("li",{parentName:"ul"},"\u5b9e\u73b0\u591a\u4e2a\u7cfb\u7edf\u6570\u636e\u4f20\u8f93\u4ea4\u4e92"),Object(r.b)("li",{parentName:"ul"},"\u8de8\u7f16\u7a0b\u8bed\u8a00\u534f\u540c\u5f00\u53d1")),Object(r.b)("h2",{id:"193-\u57fa\u7840\u4f7f\u7528"},"19.3 \u57fa\u7840\u4f7f\u7528"),Object(r.b)("h3",{id:"1931-\u6ce8\u518c\u670d\u52a1"},"19.3.1 \u6ce8\u518c\u670d\u52a1"),Object(r.b)("p",null,"\u4f7f\u7528\u4e4b\u524d\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u6ce8\u518c ",Object(r.b)("inlineCode",{parentName:"p"},"\u8fdc\u7a0b\u8bf7\u6c42\u670d\u52a1")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddRemoteRequest();\n}\n")),Object(r.b)("h3",{id:"1932-\u4f7f\u7528\u65b9\u5f0f"},"19.3.2 \u4f7f\u7528\u65b9\u5f0f"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IHttpDispatchProxy")," \u4ee3\u7406\u65b9\u5f0f")),Object(r.b)("p",null,"\u5b9a\u4e49\u4ee3\u7406\u8bf7\u6c42\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"\u63a5\u53e3")," \u5e76\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"p"},"IHttpDispatchProxy")," \u63a5\u53e3"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2}","{2}":!0}),'[Host("http://47.100.247.61/", 5000)]\npublic interface IHttp : IHttpDispatchProxy\n{\n [Get("api/sysdata/categories")]\n Task>> GetCategoryAsync();\n}\n')),Object(r.b)("p",null,"\u901a\u8fc7\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(r.b)("inlineCode",{parentName:"p"},"\u63a5\u53e3")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9,16}","{9,16}":!0}),"using Furion.DynamicApiController;\nusing Furion.RemoteRequest;\n\nnamespace Furion.Application\n{\n public class RemoteRequestService : IDynamicApiController\n {\n private readonly IHttp _http;\n public RemoteRequestService(IHttp http)\n {\n _http = http;\n }\n\n public async Task GetData()\n {\n var data = await _http.GetCategoryAsync();\n }\n }\n}\n")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u5b57\u7b26\u4e32\u65b9\u5f0f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync();\n')),Object(r.b)("h2",{id:"194-\u4f7f\u7528\u793a\u4f8b"},"19.4 \u4f7f\u7528\u793a\u4f8b"),Object(r.b)("h3",{id:"1941-\u5b57\u7b26\u4e32\u65b9\u5f0f"},"19.4.1 \u5b57\u7b26\u4e32\u65b9\u5f0f"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[METHOD]Async/[METHOD]AsAsync")," \u65b9\u5f0f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ============ GET \u8bf7\u6c42 ============\n\n// \u8fd4\u56de HttpResponseMessage \u5bf9\u8c61\nvar response = await "https://www.furion.pro/data".GetAsync();\n\n// \u8fd4\u56de\u7279\u5b9a\u7c7b\u578b\u5bf9\u8c61\nvar data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync();\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nvar data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync(headers: new Dictionary{\n {"ipaddress", "127.0.0.1"}\n});\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync(interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n\n// ============ HEAD \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n\n// ============ POST \u8bf7\u6c42 ============\n\n// \u8fd4\u56de HttpResponseMessage \u5bf9\u8c61\nvar response = await "https://www.furion.pro/data".PostAsync(new { parm1="", parm2="" });\n\n// \u8fd4\u56de\u7279\u5b9a\u7c7b\u578b\u5bf9\u8c61\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" });\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, headers: new Dictionary{\n {"ipaddress", "127.0.0.1"}\n});\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n\n// ============ PUT \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n\n// ============ PATCH \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n\n// ============ DELETE \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SendAsync/SendAsAsync")," \u65b9\u5f0f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8fd4\u56de HttpResponseMessage \u5bf9\u8c61\nvar response = await "https://www.furion.pro/data".SendAsync(HttpMethod.Get);\n\n// \u8fd4\u56de\u7279\u5b9a\u7c7b\u578b\u5bf9\u8c61\nvar data = await "http://47.100.247.61/api/sysdata/categories".SendAsAsync(HttpMethod.Get);\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nvar data = await "http://47.100.247.61/api/sysdata/categories".SendAsAsync(HttpMethod.Get, headers: new Dictionary{\n {"ipaddress", "127.0.0.1"}\n});\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".SendAsAsync(HttpMethod.Post, interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n')),Object(r.b)("h3",{id:"1942-\u4ee3\u7406\u65b9\u5f0f"},"19.4.2 \u4ee3\u7406\u65b9\u5f0f"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"li"},"\u7279\u6027")," \u65b9\u5f0f\u914d\u7f6e")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1-3,6,9,12,16,22}","{1-3,6,9,12,16,22}":!0}),'[Host("http://47.100.247.61/", 5000)] // \u914d\u7f6e\u4e3b\u673a\u7aef\u53e3\n[Header("Authorization", "Bearer \u4f60\u7684token")] // \u914d\u7f6e\u8bf7\u6c42\u5934\n[Header("ipaddress", "127.0.0.1")] // \u914d\u7f6e\u591a\u4e2a\u8bf7\u6c42\u5934\npublic interface IHttp : IHttpDispatchProxy\n{\n [Get("api/sysdata/categories")]\n Task>> GetCategory();\n\n [Get("api/sysdata/{categoryid}/data")]\n Task>> GetData2(int categoryid);\n\n [Post("api/user/modify")]\n Task> PostVoid(object value);\n\n // \u8bf7\u6c42\u62e6\u622a\u5668\n static HttpRequestMessage RequestInterceptor(HttpRequestMessage httpRequest, MethodInfo method, object[] args)\n {\n return httpRequest;\n }\n\n // \u54cd\u5e94\u62e6\u622a\u5668\n static HttpResponseMessage ResponseInterceptor(HttpResponseMessage httpResponse, MethodInfo method, object[] args)\n {\n return httpResponse;\n }\n}\n')),Object(r.b)("h2",{id:"195-\u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528"},"19.5 \u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528"),Object(r.b)("h3",{id:"1951-\u53c2\u6570\u5904\u7406"},"19.5.1 \u53c2\u6570\u5904\u7406"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u666e\u901a")," \u53c2\u6570")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/{id}?name={name}")]\nTask GetData(int id, string name);\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u6570\u7ec4")," \u53c2\u6570\u89e3\u6784")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/?{...ids}")]\nvoid DeleteIds(int[] ids);\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5bf9\u8c61")," \u53c2\u6570\u89e3\u6784")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/?{...user}")]\nvoid DeleteIds([Query]UserDto user);\n')),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7c7b\u5bf9\u8c61\u89e3\u6784\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6267\u884c ",Object(r.b)("inlineCode",{parentName:"p"},"Get/Head")," \u8bf7\u6c42\u65f6\u4e0d\u4f1a\u5904\u7406 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7c7b\u5bf9\u8c61")," \u7c7b\u578b\u53c2\u6570\uff0c\u4f46\u662f\u5982\u679c\u8d34\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"[Query]")," \u53c2\u6570\u540e\uff0c\u4f1a\u81ea\u52a8\u5c06\u5bf9\u8c61\u89e3\u6790\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"url")," \u5730\u5740\u683c\u5f0f\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"p"},"?name=\u767e\u5c0f\u50e7&age=27"),"\u3002"))),Object(r.b)("h3",{id:"1952-\u53c2\u6570\u9a8c\u8bc1"},"19.5.2 \u53c2\u6570\u9a8c\u8bc1"),Object(r.b)("p",null,"\u4ee3\u7406\u62e6\u622a\u7684\u65b9\u5f0f\u4e5f\u652f\u6301\u53c2\u6570 ",Object(r.b)("inlineCode",{parentName:"p"},"\u9a8c\u8bc1\u7279\u6027")," \u4f7f\u7528\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/{id}?name={name}")]\nTask GetData([Required, Range(1, 1000)] int id, [MaxLength(32)] string name);\n')),Object(r.b)("p",null,"\u53e6\u5916\u4e5f\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7c7b\u5bf9\u8c61")," \u65b9\u5f0f\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class User\n{\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MinLength(4)] // \u6700\u5c0f\u957f\u5ea6\u9a8c\u8bc1\n public string Account { get; set; }\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MaxLength(32)] // \u6700\u5927\u957f\u5ea6\u9a8c\u8bc1\n public string Password { get; set; }\n}\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Post("https://www.furion.pro/getdata/{id}?name={name}")]\nTask GetData(User user);\n')),Object(r.b)("h3",{id:"1953-\u8fd4\u56de\u503c\u5904\u7406"},"19.5.3 \u8fd4\u56de\u503c\u5904\u7406"),Object(r.b)("p",null,"\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u8c13\u8bcd\u7279\u6027\u90fd\u63d0\u4f9b\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"ResponseType")," \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u7528\u6765\u914d\u7f6e\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u9ed8\u8ba4\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Object")," \u7c7b\u578b\u3002",Object(r.b)("inlineCode",{parentName:"p"},"ResponseType")," \u5c5e\u6027\u53ef\u9009\u914d\u7f6e\u5982\u4e0b\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ResponseType")," \u54cd\u5e94\u7c7b\u578b\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Object"),"\uff1a\u5bf9\u8c61\u7c7b\u578b\uff0c\u9ed8\u8ba4\u503c\uff0c\u4e5f\u5c31\u662f\u81ea\u52a8\u5e8f\u5217\u5316\u6210\u4ee3\u7406\u7684\u65b9\u6cd5\u8fd4\u56de\u503c\u7c7b\u578b"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Text"),"\uff1a\u5b57\u7b26\u4e32\u7c7b\u578b"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Stream"),"\uff1a\u6d41\u7c7b\u578b\uff0c",Object(r.b)("strong",{parentName:"li"},"\u8fd4\u56de\u8be5\u7c7b\u578b\u65f6\uff0c\u9700\u5728\u5904\u7406\u5b8c\u4e4b\u540e\u91ca\u653e\u6d41")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ByteArray"),"\uff1a\u5b57\u8282\u6570\u7ec4\u7c7b\u578b")))),Object(r.b)("p",null,"\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8fd4\u56de\u5bf9\u8c61 T \u7c7b\u578b\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Object)]\nTask GetData();\n\n// \u8fd4\u56de\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 ResponseType.Object\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Text)]\nTask GetData();\n\n// \u8fd4\u56de\u6d41\u7c7b\u578b\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Stream)]\nTask GetData();\n\n// \u8fd4\u56de\u5b57\u8282\u6570\u7ec4\u7c7b\u578b\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.ByteArray)]\nTask GetData();\n')),Object(r.b)("h3",{id:"1954-\u8bf7\u6c42\u54cd\u5e94\u62e6\u622a"},"19.5.4 \u8bf7\u6c42/\u54cd\u5e94\u62e6\u622a"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u91cd\u590d\u5229\u7528\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"C# 8.0+")," \u7684\u7279\u6027\uff0c\u5b9e\u73b0\u4e86\u63a5\u53e3\u4e2d\u53ef\u5b9a\u4e49\u9759\u6001\u65b9\u6cd5\u548c\u5b9e\u73b0\u7684\u673a\u5236\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,15}","{7,15}":!0}),'public interface IHttp : IHttpDispatchProxy\n{\n [Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Object)]\n Task GetData();\n\n // \u8bf7\u6c42\u62e6\u622a\u5668\n static HttpRequestMessage RequestInterceptor(HttpRequestMessage httpRequest, MethodInfo method, object[] args)\n {\n // \u6bd4\u5982\u8fd9\u91cc\u5199\u65e5\u5fd7\n\n return httpRequest;\n }\n\n // \u54cd\u5e94\u62e6\u622a\u5668\n static HttpResponseMessage ResponseInterceptor(HttpResponseMessage httpResponse, MethodInfo method, object[] args)\n {\n // \u6bd4\u5982\u8fd9\u91cc\u5199\u65e5\u5fd7\n\n return httpResponse;\n }\n\n // HttpClient \u62e6\u622a\u5668\n static HttpClient HttpClientInterceptor(HttpClient httpClient, MethodInfo method, object[] args)\n {\n // \u6bd4\u5982\u8fd9\u91cc\u8bbe\u7f6e\u4ee3\u7406\n\n return httpClient;\n }\n}\n')),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b57\u7b26\u4e32\u65b9\u5f0f\u62e6\u622a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5b57\u7b26\u4e32\u65b9\u5f0f\u53ea\u63d0\u4f9b\u4e86\u8bf7\u6c42\u62e6\u622a\uff0c\u4e0d\u63d0\u4f9b\u54cd\u5e94\u62e6\u622a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n')))),Object(r.b)("h3",{id:"1955-body-\u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898"},"19.5.5 ",Object(r.b)("inlineCode",{parentName:"h3"},"Body")," \u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898"),Object(r.b)("p",null,"\u7531\u4e8e\u4e00\u4e9b\u7b2c\u4e09\u65b9\u63a5\u53e3\u4e0d\u89c4\u8303\u6216\u5bf9\u53c2\u6570\u5927\u5c0f\u5199\u654f\u611f\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u914d\u7f6e\u7279\u6027\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"PropertyNamingPolicy")," \u5c5e\u6027\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Post("https://www.furion.pro/getdata", PropertyNamingPolicy = JsonNamingPolicyOptions.Null)]\nTask GetData();\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"JsonNamingPolicyOptions")," \u53ef\u9009\u503c\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"CamelCase"),"\uff1a\u9ed8\u8ba4\uff0c\u9996\u5b57\u6bcd\u5c0f\u5199\u5c5e\u6027\u540d"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Null"),"\uff1a\u4fdd\u6301\u539f\u6709\u5c5e\u6027\u540d\u79f0\u5b9a\u4e49\u89c4\u5219")))),Object(r.b)("h3",{id:"1956-body-\u5185\u5bb9\u914d\u7f6e"},"19.5.6 ",Object(r.b)("inlineCode",{parentName:"h3"},"Body")," \u5185\u5bb9\u914d\u7f6e"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"Body")," \u53c2\u6570\u914d\u7f6e\u7684\u8bf7\u6c42\u90fd\u4f1a\u5e8f\u5217\u5316\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"Json")," \u5185\u5bb9\u914d\u7f6e\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"HttpContentType")," \u5c5e\u6027\u6307\u5b9a\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Post("https://www.furion.pro/getdata", HttpContentType = HttpContentTypeOptions.JsonStringContent)]\nTask GetData();\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"HttpContentTypeOptions")," \u53ef\u9009\u503c\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"StringContent"),"\uff1a\u5b57\u7b26\u4e32\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"JsonStringContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Json")," \u5b57\u7b26\u4e32\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"XmlStringContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Xml")," \u5b57\u7b26\u4e32\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"MultipartFormDataContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"multipart/form-data")," \u7c7b\u578b\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"FormUrlEncodedContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"x-www-form-urlencoded")," \u7c7b\u578b\u5185\u5bb9")))),Object(r.b)("h3",{id:"1957-\u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e"},"19.5.7 \u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e\uff0c\u53ef\u4ee5\u4e3a\u591a\u4e2a\u5ba2\u6237\u7aef\u8bf7\u6c42\u914d\u7f6e\u9ed8\u8ba4\u8bf7\u6c42\u4fe1\u606f\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,12}","{4,12}":!0}),'services.AddRemoteRequest(options=>\n{\n // \u914d\u7f6e Github \u57fa\u672c\u4fe1\u606f\n options.AddHttpClient("github", c =>\n {\n c.BaseAddress = new Uri("https://api.github.com/");\n c.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json");\n c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");\n });\n\n // \u914d\u7f6e Facebook \u57fa\u672c\u4fe1\u606f\n options.AddHttpClient("facebook", c =>\n {\n c.BaseAddress = new Uri("https://api.facebook.com/");\n c.DefaultRequestHeaders.Add("Accept", "application/vnd.facebook.v3+json");\n c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");\n });\n})\n')),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u914d\u7f6e\u4e86\u547d\u540d\u5ba2\u6237\u7aef\u540e\uff0c\u6bcf\u6b21\u8bf7\u6c42\u90fd\u4f1a\u81ea\u52a8\u52a0\u4e0a\u8fd9\u4e9b\u914d\u7f6e\u3002")),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"\u4ee3\u7406\u8bf7\u6c42")," \u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("api/getdata"), Client("github")]\nTask GetData();\n\n[Put("api/getdata"), Client("facebook")]\nTask GetData();\n')),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"\u5b57\u7b26\u4e32\u62d3\u5c55")," \u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, clientName = "github");\n')),Object(r.b)("h2",{id:"196-\u4ee3\u7406\u5185\u7f6e\u7279\u6027"},"19.6 \u4ee3\u7406\u5185\u7f6e\u7279\u6027"),Object(r.b)("h3",{id:"1961-\u63a5\u53e3\u7279\u6027"},"19.6.1 \u63a5\u53e3\u7279\u6027"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u4e3b\u673a")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Host]"),"\uff1a\u914d\u7f6e\u4e3b\u673a\u5730\u5740\u548c\u7aef\u53e3"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u5934")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Header]"),"\uff1a\u914d\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\uff0c\u652f\u6301\u591a\u4e2a"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5ba2\u6237\u7aef")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Client]"),"\uff1a\u914d\u7f6e\u5ba2\u6237\u7aef")))),Object(r.b)("p",null,"\u63a5\u53e3\u7684\u7279\u6027\u4f1a\u5f71\u54cd\u6240\u6709\u7684\u6210\u5458\u65b9\u6cd5\uff0c\u4e5f\u5c31\u662f\u4f1a\u5e94\u7528\u5230\u6bcf\u4e00\u4e2a\u65b9\u6cd5\u4e2d\uff0c\u5f53\u7136\u65b9\u6cd5\u53ef\u53ef\u4ee5\u91cd\u5199\u6216\u5ffd\u7565\u3002"),Object(r.b)("h3",{id:"1962-\u65b9\u6cd5\u7279\u6027"},"19.6.2 \u65b9\u6cd5\u7279\u6027"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u8c13\u8bcd")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Get]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Get")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Post]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Post")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Put]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Put")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Delete]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Delete")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Patch]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Patch")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Head]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Head")," \u8bf7\u6c42\u65b9\u5f0f"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u4e3b\u673a")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Host]"),"\uff1a\u914d\u7f6e\u4e3b\u673a\u5730\u5740\u548c\u7aef\u53e3"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u5934")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Header]"),"\uff1a\u914d\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\uff0c\u652f\u6301\u591a\u4e2a"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5ba2\u6237\u7aef")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Client]"),"\uff1a\u914d\u7f6e\u5ba2\u6237\u7aef"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5185\u5bb9\u7c7b\u578b")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[MediaTypeHeader]"),"\uff1a\u914d\u7f6e\u5185\u5bb9\u7c7b\u578b")))),Object(r.b)("h3",{id:"1963-\u65b9\u6cd5\u53c2\u6570\u7279\u6027"},"19.6.3 \u65b9\u6cd5\u53c2\u6570\u7279\u6027"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Query]"),"\uff1a\u81ea\u52a8\u5c06\u53c2\u6570\u66ff\u6362\u5730\u5740\u4e2d\u7684\u5360\u4f4d\u7b26\uff0c\u5360\u4f4d\u7b26\u683c\u5f0f ",Object(r.b)("inlineCode",{parentName:"li"},"{\u53c2\u6570\u540d}"),"\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"https://www.furion.pro/user/{id}"),"\uff0c\u9ed8\u8ba4\u57fa\u5143\u7c7b\u578b\u6216\u57fa\u5143\u7c7b\u578b\u6570\u7ec4\u5e94\u7528\u8be5\u7279\u6027"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Body]"),"\uff1a\u81ea\u52a8\u5c06\u53c2\u6570\u6dfb\u52a0\u5230\u8bf7\u6c42\u62a5\u6587\u4f53\u4e2d\uff0c\u9ed8\u8ba4\u975e\u57fa\u5143\u7c7b\u578b\u4f1a\u5f15\u7528\u8be5\u7279\u6027\u3002")),Object(r.b)("h2",{id:"197-\u5173\u4e8e\u540c\u6b65\u8bf7\u6c42"},"19.7 \u5173\u4e8e\u540c\u6b65\u8bf7\u6c42"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5185\u90e8\u9ed8\u8ba4\u4e0d\u63d0\u4f9b\u540c\u6b65\u8bf7\u6c42\u64cd\u4f5c\uff0c\u5efa\u8bae\u603b\u662f\u4f7f\u7528\u5f02\u6b65\u7684\u65b9\u5f0f\u8bf7\u6c42\u3002\u5982\u5728\u4e0d\u80fd\u4f7f\u7528\u5f02\u6b65\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u81ea\u884c\u8f6c\u6362\u4e3a\u540c\u6b65\u6267\u884c\u3002"),Object(r.b)("h2",{id:"198-\u5f02\u5e38\u5904\u7406"},"19.8 \u5f02\u5e38\u5904\u7406"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u63a5\u53e3\u8bf7\u6c42\u5f02\u5e38\u4f1a\u629b\u51fa\u8bf7\u6c42\u5f02\u5e38\uff0c\u6709\u65f6\u8fd9\u4e0d\u662f\u6211\u4eec\u60f3\u8981\u7684\u7ed3\u679c\uff0c\u6211\u4eec\u5e0c\u671b\u5982\u679c\u63a5\u53e3\u8bf7\u6c42\u5f02\u5e38\uff0c\u90a3\u4e48\u76f4\u63a5\u8fd4\u56de\u9ed8\u8ba4\u503c\u5373\u53ef\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u53ea\u9700\u8981\u5728\u63a5\u53e3\u6216\u65b9\u6cd5\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[Safety]")," \u7279\u6027\u5373\u53ef\u3002"),Object(r.b)("h2",{id:"199-\u53cd\u9988\u4e0e\u5efa\u8bae"},"19.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(r.b)("hr",null),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(r.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/http-requests?view=aspnetcore-5.0"}),"ASP.NET Core - HTTP \u8bf7\u6c42")," \u7ae0\u8282"))))}s.isMDXComponent=!0}}]); \ No newline at end of file diff --git a/docs/36793c62.823e8c99.js b/docs/36793c62.823e8c99.js new file mode 100644 index 00000000000..92c12ee7ce3 --- /dev/null +++ b/docs/36793c62.823e8c99.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{100:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return s}));var a=n(3),i=n(7),r=(n(0),n(196)),c=n(197),b={id:"http",title:"19. \u8fdc\u7a0b\u8bf7\u6c42",sidebar_label:"19. \u8fdc\u7a0b\u8bf7\u6c42"},l={unversionedId:"http",id:"http",isDocsHomePage:!1,title:"19. \u8fdc\u7a0b\u8bf7\u6c42",description:"19.1 \u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42",source:"@site/docs\\http.mdx",slug:"/http",permalink:"/docs/http",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/http.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"19. \u8fdc\u7a0b\u8bf7\u6c42",sidebar:"docs",previous:{title:"18. \u65e5\u5fd7\u8bb0\u5f55",permalink:"/docs/logging"},next:{title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",permalink:"/docs/encryption"}},p=[{value:"19.1 \u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42",id:"191-\u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42",children:[]},{value:"19.2 \u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528",id:"192-\u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528",children:[]},{value:"19.3 \u57fa\u7840\u4f7f\u7528",id:"193-\u57fa\u7840\u4f7f\u7528",children:[{value:"19.3.1 \u6ce8\u518c\u670d\u52a1",id:"1931-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"19.3.2 \u4f7f\u7528\u65b9\u5f0f",id:"1932-\u4f7f\u7528\u65b9\u5f0f",children:[]}]},{value:"19.4 \u4f7f\u7528\u793a\u4f8b",id:"194-\u4f7f\u7528\u793a\u4f8b",children:[{value:"19.4.1 \u5b57\u7b26\u4e32\u65b9\u5f0f",id:"1941-\u5b57\u7b26\u4e32\u65b9\u5f0f",children:[]},{value:"19.4.2 \u4ee3\u7406\u65b9\u5f0f",id:"1942-\u4ee3\u7406\u65b9\u5f0f",children:[]}]},{value:"19.5 \u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528",id:"195-\u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528",children:[{value:"19.5.1 \u53c2\u6570\u5904\u7406",id:"1951-\u53c2\u6570\u5904\u7406",children:[]},{value:"19.5.2 \u53c2\u6570\u9a8c\u8bc1",id:"1952-\u53c2\u6570\u9a8c\u8bc1",children:[]},{value:"19.5.3 \u8fd4\u56de\u503c\u5904\u7406",id:"1953-\u8fd4\u56de\u503c\u5904\u7406",children:[]},{value:"19.5.4 \u8bf7\u6c42/\u54cd\u5e94\u62e6\u622a",id:"1954-\u8bf7\u6c42\u54cd\u5e94\u62e6\u622a",children:[]},{value:"19.5.5 Body \u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898",id:"1955-body-\u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898",children:[]},{value:"19.5.6 Body \u5185\u5bb9\u914d\u7f6e",id:"1956-body-\u5185\u5bb9\u914d\u7f6e",children:[]},{value:"19.5.7 \u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e",id:"1957-\u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e",children:[]}]},{value:"19.6 \u4ee3\u7406\u5185\u7f6e\u7279\u6027",id:"196-\u4ee3\u7406\u5185\u7f6e\u7279\u6027",children:[{value:"19.6.1 \u63a5\u53e3\u7279\u6027",id:"1961-\u63a5\u53e3\u7279\u6027",children:[]},{value:"19.6.2 \u65b9\u6cd5\u7279\u6027",id:"1962-\u65b9\u6cd5\u7279\u6027",children:[]},{value:"19.6.3 \u65b9\u6cd5\u53c2\u6570\u7279\u6027",id:"1963-\u65b9\u6cd5\u53c2\u6570\u7279\u6027",children:[]}]},{value:"19.7 \u5173\u4e8e\u540c\u6b65\u8bf7\u6c42",id:"197-\u5173\u4e8e\u540c\u6b65\u8bf7\u6c42",children:[]},{value:"19.8 \u5f02\u5e38\u5904\u7406",id:"198-\u5f02\u5e38\u5904\u7406",children:[]},{value:"19.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"199-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],o={toc:p};function s(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},o,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"191-\u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42"},"19.1 \u5173\u4e8e\u8fdc\u7a0b\u8bf7\u6c42"),Object(r.b)("p",null,"\u5728\u4e92\u8054\u7f51\u5927\u6570\u636e\u7684\u9a71\u52a8\u4e0b\uff0c\u5e73\u53f0\u6216\u7cfb\u7edf\u514d\u4e0d\u4e86\u9700\u8981\u548c\u7b2c\u4e09\u65b9\u8fdb\u884c\u6570\u636e\u4ea4\u4e92\uff0c\u800c\u7b2c\u4e09\u65b9\u5f80\u5f80\u63d0\u4f9b\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"RESTful API")," \u7ed3\u679c\u89c4\u8303\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"Http")," \u8bf7\u6c42\u7b2c\u4e09\u65b9\u63a5\u53e3\u8fdb\u884c\u6570\u636e\u4f20\u8f93\u4ea4\u4e92\u3002"),Object(r.b)("p",null,"\u4e5f\u5c31\u662f\u672c\u7ae0\u8282\u6240\u8bf4\u7684\u8fdc\u7a0b\u8bf7\u6c42\u3002"),Object(r.b)("h2",{id:"192-\u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528"},"19.2 \u8fdc\u7a0b\u8bf7\u6c42\u7684\u4f5c\u7528"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u8de8\u7cfb\u7edf\u3001\u8de8\u8bbe\u5907\u901a\u4fe1"),Object(r.b)("li",{parentName:"ul"},"\u5b9e\u73b0\u591a\u4e2a\u7cfb\u7edf\u6570\u636e\u4f20\u8f93\u4ea4\u4e92"),Object(r.b)("li",{parentName:"ul"},"\u8de8\u7f16\u7a0b\u8bed\u8a00\u534f\u540c\u5f00\u53d1")),Object(r.b)("h2",{id:"193-\u57fa\u7840\u4f7f\u7528"},"19.3 \u57fa\u7840\u4f7f\u7528"),Object(r.b)("h3",{id:"1931-\u6ce8\u518c\u670d\u52a1"},"19.3.1 \u6ce8\u518c\u670d\u52a1"),Object(r.b)("p",null,"\u4f7f\u7528\u4e4b\u524d\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u6ce8\u518c ",Object(r.b)("inlineCode",{parentName:"p"},"\u8fdc\u7a0b\u8bf7\u6c42\u670d\u52a1")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddRemoteRequest();\n}\n")),Object(r.b)("h3",{id:"1932-\u4f7f\u7528\u65b9\u5f0f"},"19.3.2 \u4f7f\u7528\u65b9\u5f0f"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IHttpDispatchProxy")," \u4ee3\u7406\u65b9\u5f0f")),Object(r.b)("p",null,"\u5b9a\u4e49\u4ee3\u7406\u8bf7\u6c42\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"\u63a5\u53e3")," \u5e76\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"p"},"IHttpDispatchProxy")," \u63a5\u53e3"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2}","{2}":!0}),'[Host("http://47.100.247.61/", 5000)]\npublic interface IHttp : IHttpDispatchProxy\n{\n [Get("api/sysdata/categories")]\n Task>> GetCategoryAsync();\n}\n')),Object(r.b)("p",null,"\u901a\u8fc7\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(r.b)("inlineCode",{parentName:"p"},"\u63a5\u53e3")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9,16}","{9,16}":!0}),"using Furion.DynamicApiController;\nusing Furion.RemoteRequest;\n\nnamespace Furion.Application\n{\n public class RemoteRequestService : IDynamicApiController\n {\n private readonly IHttp _http;\n public RemoteRequestService(IHttp http)\n {\n _http = http;\n }\n\n public async Task GetData()\n {\n var data = await _http.GetCategoryAsync();\n }\n }\n}\n")),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u5b57\u7b26\u4e32\u65b9\u5f0f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync();\n')),Object(r.b)("h2",{id:"194-\u4f7f\u7528\u793a\u4f8b"},"19.4 \u4f7f\u7528\u793a\u4f8b"),Object(r.b)("h3",{id:"1941-\u5b57\u7b26\u4e32\u65b9\u5f0f"},"19.4.1 \u5b57\u7b26\u4e32\u65b9\u5f0f"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[METHOD]Async/[METHOD]AsAsync")," \u65b9\u5f0f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ============ GET \u8bf7\u6c42 ============\n\n// \u8fd4\u56de HttpResponseMessage \u5bf9\u8c61\nvar response = await "https://www.furion.pro/data".GetAsync();\n\n// \u8fd4\u56de\u7279\u5b9a\u7c7b\u578b\u5bf9\u8c61\nvar data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync();\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nvar data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync(headers: new Dictionary{\n {"ipaddress", "127.0.0.1"}\n});\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync(interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n\n// ============ HEAD \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n\n// ============ POST \u8bf7\u6c42 ============\n\n// \u8fd4\u56de HttpResponseMessage \u5bf9\u8c61\nvar response = await "https://www.furion.pro/data".PostAsync(new { parm1="", parm2="" });\n\n// \u8fd4\u56de\u7279\u5b9a\u7c7b\u578b\u5bf9\u8c61\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" });\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, headers: new Dictionary{\n {"ipaddress", "127.0.0.1"}\n});\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n\n// ============ PUT \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n\n// ============ PATCH \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n\n// ============ DELETE \u8bf7\u6c42 ============\n\n// \u540c\u4e0a\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SendAsync/SendAsAsync")," \u65b9\u5f0f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8fd4\u56de HttpResponseMessage \u5bf9\u8c61\nvar response = await "https://www.furion.pro/data".SendAsync(HttpMethod.Get);\n\n// \u8fd4\u56de\u7279\u5b9a\u7c7b\u578b\u5bf9\u8c61\nvar data = await "http://47.100.247.61/api/sysdata/categories".SendAsAsync(HttpMethod.Get);\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nvar data = await "http://47.100.247.61/api/sysdata/categories".SendAsAsync(HttpMethod.Get, headers: new Dictionary{\n {"ipaddress", "127.0.0.1"}\n});\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".SendAsAsync(HttpMethod.Post, interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n')),Object(r.b)("h3",{id:"1942-\u4ee3\u7406\u65b9\u5f0f"},"19.4.2 \u4ee3\u7406\u65b9\u5f0f"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"li"},"\u7279\u6027")," \u65b9\u5f0f\u914d\u7f6e")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1-3,6,9,12,16,22}","{1-3,6,9,12,16,22}":!0}),'[Host("http://47.100.247.61/", 5000)] // \u914d\u7f6e\u4e3b\u673a\u7aef\u53e3\n[Header("Authorization", "Bearer \u4f60\u7684token")] // \u914d\u7f6e\u8bf7\u6c42\u5934\n[Header("ipaddress", "127.0.0.1")] // \u914d\u7f6e\u591a\u4e2a\u8bf7\u6c42\u5934\npublic interface IHttp : IHttpDispatchProxy\n{\n [Get("api/sysdata/categories")]\n Task>> GetCategory();\n\n [Get("api/sysdata/{categoryid}/data")]\n Task>> GetData2(int categoryid);\n\n [Post("api/user/modify")]\n Task> PostVoid(object value);\n\n // \u8bf7\u6c42\u62e6\u622a\u5668\n static HttpRequestMessage RequestInterceptor(HttpRequestMessage httpRequest, MethodInfo method, object[] args)\n {\n return httpRequest;\n }\n\n // \u54cd\u5e94\u62e6\u622a\u5668\n static HttpResponseMessage ResponseInterceptor(HttpResponseMessage httpResponse, MethodInfo method, object[] args)\n {\n return httpResponse;\n }\n}\n')),Object(r.b)("h2",{id:"195-\u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528"},"19.5 \u4ee3\u7406\u9ad8\u7ea7\u5e94\u7528"),Object(r.b)("h3",{id:"1951-\u53c2\u6570\u5904\u7406"},"19.5.1 \u53c2\u6570\u5904\u7406"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u666e\u901a")," \u53c2\u6570")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/{id}?name={name}")]\nTask GetData(int id, string name);\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u6570\u7ec4")," \u53c2\u6570\u89e3\u6784")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/?{...ids}")]\nvoid DeleteIds(int[] ids);\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5bf9\u8c61")," \u53c2\u6570\u89e3\u6784")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/?{...user}")]\nvoid DeleteIds([Query]UserDto user);\n')),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7c7b\u5bf9\u8c61\u89e3\u6784\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6267\u884c ",Object(r.b)("inlineCode",{parentName:"p"},"Get/Head")," \u8bf7\u6c42\u65f6\u4e0d\u4f1a\u5904\u7406 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7c7b\u5bf9\u8c61")," \u7c7b\u578b\u53c2\u6570\uff0c\u4f46\u662f\u5982\u679c\u8d34\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"[Query]")," \u53c2\u6570\u540e\uff0c\u4f1a\u81ea\u52a8\u5c06\u5bf9\u8c61\u89e3\u6790\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"url")," \u5730\u5740\u683c\u5f0f\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"p"},"?name=\u767e\u5c0f\u50e7&age=27"),"\u3002"))),Object(r.b)("h3",{id:"1952-\u53c2\u6570\u9a8c\u8bc1"},"19.5.2 \u53c2\u6570\u9a8c\u8bc1"),Object(r.b)("p",null,"\u4ee3\u7406\u62e6\u622a\u7684\u65b9\u5f0f\u4e5f\u652f\u6301\u53c2\u6570 ",Object(r.b)("inlineCode",{parentName:"p"},"\u9a8c\u8bc1\u7279\u6027")," \u4f7f\u7528\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("https://www.furion.pro/getdata/{id}?name={name}")]\nTask GetData([Required, Range(1, 1000)] int id, [MaxLength(32)] string name);\n')),Object(r.b)("p",null,"\u53e6\u5916\u4e5f\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7c7b\u5bf9\u8c61")," \u65b9\u5f0f\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class User\n{\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MinLength(4)] // \u6700\u5c0f\u957f\u5ea6\u9a8c\u8bc1\n public string Account { get; set; }\n\n [Required] // \u5fc5\u586b\u9a8c\u8bc1\n [MaxLength(32)] // \u6700\u5927\u957f\u5ea6\u9a8c\u8bc1\n public string Password { get; set; }\n}\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Post("https://www.furion.pro/getdata/{id}?name={name}")]\nTask GetData(User user);\n')),Object(r.b)("h3",{id:"1953-\u8fd4\u56de\u503c\u5904\u7406"},"19.5.3 \u8fd4\u56de\u503c\u5904\u7406"),Object(r.b)("p",null,"\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u8c13\u8bcd\u7279\u6027\u90fd\u63d0\u4f9b\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"ResponseType")," \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u7528\u6765\u914d\u7f6e\u8fd4\u56de\u503c\u7c7b\u578b\uff0c\u9ed8\u8ba4\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Object")," \u7c7b\u578b\u3002",Object(r.b)("inlineCode",{parentName:"p"},"ResponseType")," \u5c5e\u6027\u53ef\u9009\u914d\u7f6e\u5982\u4e0b\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ResponseType")," \u54cd\u5e94\u7c7b\u578b\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Object"),"\uff1a\u5bf9\u8c61\u7c7b\u578b\uff0c\u9ed8\u8ba4\u503c\uff0c\u4e5f\u5c31\u662f\u81ea\u52a8\u5e8f\u5217\u5316\u6210\u4ee3\u7406\u7684\u65b9\u6cd5\u8fd4\u56de\u503c\u7c7b\u578b"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Text"),"\uff1a\u5b57\u7b26\u4e32\u7c7b\u578b"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Stream"),"\uff1a\u6d41\u7c7b\u578b\uff0c",Object(r.b)("strong",{parentName:"li"},"\u8fd4\u56de\u8be5\u7c7b\u578b\u65f6\uff0c\u9700\u5728\u5904\u7406\u5b8c\u4e4b\u540e\u91ca\u653e\u6d41")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ByteArray"),"\uff1a\u5b57\u8282\u6570\u7ec4\u7c7b\u578b")))),Object(r.b)("p",null,"\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8fd4\u56de\u5bf9\u8c61 T \u7c7b\u578b\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Object)]\nTask GetData();\n\n// \u8fd4\u56de\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 ResponseType.Object\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Text)]\nTask GetData();\n\n// \u8fd4\u56de\u6d41\u7c7b\u578b\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Stream)]\nTask GetData();\n\n// \u8fd4\u56de\u5b57\u8282\u6570\u7ec4\u7c7b\u578b\n[Get("https://www.furion.pro/getdata", ResponseType = ResponseType.ByteArray)]\nTask GetData();\n')),Object(r.b)("h3",{id:"1954-\u8bf7\u6c42\u54cd\u5e94\u62e6\u622a"},"19.5.4 \u8bf7\u6c42/\u54cd\u5e94\u62e6\u622a"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u91cd\u590d\u5229\u7528\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"C# 8.0+")," \u7684\u7279\u6027\uff0c\u5b9e\u73b0\u4e86\u63a5\u53e3\u4e2d\u53ef\u5b9a\u4e49\u9759\u6001\u65b9\u6cd5\u548c\u5b9e\u73b0\u7684\u673a\u5236\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,15}","{7,15}":!0}),'public interface IHttp : IHttpDispatchProxy\n{\n [Get("https://www.furion.pro/getdata", ResponseType = ResponseType.Object)]\n Task GetData();\n\n // \u8bf7\u6c42\u62e6\u622a\u5668\n static HttpRequestMessage RequestInterceptor(HttpRequestMessage httpRequest, MethodInfo method, object[] args)\n {\n // \u6bd4\u5982\u8fd9\u91cc\u5199\u65e5\u5fd7\n\n return httpRequest;\n }\n\n // \u54cd\u5e94\u62e6\u622a\u5668\n static HttpResponseMessage ResponseInterceptor(HttpResponseMessage httpResponse, MethodInfo method, object[] args)\n {\n // \u6bd4\u5982\u8fd9\u91cc\u5199\u65e5\u5fd7\n\n return httpResponse;\n }\n\n // HttpClient \u62e6\u622a\u5668\n static HttpClient HttpClientInterceptor(HttpClient httpClient, MethodInfo method, object[] args)\n {\n // \u6bd4\u5982\u8fd9\u91cc\u8bbe\u7f6e\u4ee3\u7406\n\n return httpClient;\n }\n}\n')),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b57\u7b26\u4e32\u65b9\u5f0f\u62e6\u622a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5b57\u7b26\u4e32\u65b9\u5f0f\u53ea\u63d0\u4f9b\u4e86\u8bf7\u6c42\u62e6\u622a\uff0c\u4e0d\u63d0\u4f9b\u54cd\u5e94\u62e6\u622a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, interceptor: request=>{\n request.Headers.Add("Authorization","Bearer token\u5b57\u7b26\u4e32");\n});\n')))),Object(r.b)("h3",{id:"1955-body-\u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898"},"19.5.5 ",Object(r.b)("inlineCode",{parentName:"h3"},"Body")," \u53c2\u6570\u5e8f\u5217\u5316\u95ee\u9898"),Object(r.b)("p",null,"\u7531\u4e8e\u4e00\u4e9b\u7b2c\u4e09\u65b9\u63a5\u53e3\u4e0d\u89c4\u8303\u6216\u5bf9\u53c2\u6570\u5927\u5c0f\u5199\u654f\u611f\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u914d\u7f6e\u7279\u6027\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"PropertyNamingPolicy")," \u5c5e\u6027\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Post("https://www.furion.pro/getdata", PropertyNamingPolicy = JsonNamingPolicyOptions.Null)]\nTask GetData();\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"JsonNamingPolicyOptions")," \u53ef\u9009\u503c\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"CamelCase"),"\uff1a\u9ed8\u8ba4\uff0c\u9996\u5b57\u6bcd\u5c0f\u5199\u5c5e\u6027\u540d"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Null"),"\uff1a\u4fdd\u6301\u539f\u6709\u5c5e\u6027\u540d\u79f0\u5b9a\u4e49\u89c4\u5219")))),Object(r.b)("h3",{id:"1956-body-\u5185\u5bb9\u914d\u7f6e"},"19.5.6 ",Object(r.b)("inlineCode",{parentName:"h3"},"Body")," \u5185\u5bb9\u914d\u7f6e"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"Body")," \u53c2\u6570\u914d\u7f6e\u7684\u8bf7\u6c42\u90fd\u4f1a\u5e8f\u5217\u5316\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"Json")," \u5185\u5bb9\u914d\u7f6e\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"HttpContentType")," \u5c5e\u6027\u6307\u5b9a\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Post("https://www.furion.pro/getdata", HttpContentType = HttpContentTypeOptions.JsonStringContent)]\nTask GetData();\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"HttpContentTypeOptions")," \u53ef\u9009\u503c\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"StringContent"),"\uff1a\u5b57\u7b26\u4e32\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"JsonStringContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Json")," \u5b57\u7b26\u4e32\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"XmlStringContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Xml")," \u5b57\u7b26\u4e32\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"MultipartFormDataContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"multipart/form-data")," \u7c7b\u578b\u5185\u5bb9"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"FormUrlEncodedContent"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"x-www-form-urlencoded")," \u7c7b\u578b\u5185\u5bb9")))),Object(r.b)("h3",{id:"1957-\u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e"},"19.5.7 \u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u591a\u4e2a\u8bf7\u6c42\u5ba2\u6237\u7aef\u914d\u7f6e\uff0c\u53ef\u4ee5\u4e3a\u591a\u4e2a\u5ba2\u6237\u7aef\u8bf7\u6c42\u914d\u7f6e\u9ed8\u8ba4\u8bf7\u6c42\u4fe1\u606f\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,12}","{4,12}":!0}),'services.AddRemoteRequest(options=>\n{\n // \u914d\u7f6e Github \u57fa\u672c\u4fe1\u606f\n options.AddHttpClient("github", c =>\n {\n c.BaseAddress = new Uri("https://api.github.com/");\n c.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json");\n c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");\n });\n\n // \u914d\u7f6e Facebook \u57fa\u672c\u4fe1\u606f\n options.AddHttpClient("facebook", c =>\n {\n c.BaseAddress = new Uri("https://api.facebook.com/");\n c.DefaultRequestHeaders.Add("Accept", "application/vnd.facebook.v3+json");\n c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");\n });\n})\n')),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u914d\u7f6e\u4e86\u547d\u540d\u5ba2\u6237\u7aef\u540e\uff0c\u6bcf\u6b21\u8bf7\u6c42\u90fd\u4f1a\u81ea\u52a8\u52a0\u4e0a\u8fd9\u4e9b\u914d\u7f6e\u3002")),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"\u4ee3\u7406\u8bf7\u6c42")," \u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[Get("api/getdata"), Client("github")]\nTask GetData();\n\n[Put("api/getdata"), Client("facebook")]\nTask GetData();\n')),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"\u5b57\u7b26\u4e32\u62d3\u5c55")," \u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u8bbe\u7f6e\u8bf7\u6c42\u62e6\u622a\nvar data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync(new { parm1="", parm2="" }, clientName = "github");\n')),Object(r.b)("h2",{id:"196-\u4ee3\u7406\u5185\u7f6e\u7279\u6027"},"19.6 \u4ee3\u7406\u5185\u7f6e\u7279\u6027"),Object(r.b)("h3",{id:"1961-\u63a5\u53e3\u7279\u6027"},"19.6.1 \u63a5\u53e3\u7279\u6027"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u4e3b\u673a")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Host]"),"\uff1a\u914d\u7f6e\u4e3b\u673a\u5730\u5740\u548c\u7aef\u53e3"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u5934")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Header]"),"\uff1a\u914d\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\uff0c\u652f\u6301\u591a\u4e2a"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5ba2\u6237\u7aef")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Client]"),"\uff1a\u914d\u7f6e\u5ba2\u6237\u7aef")))),Object(r.b)("p",null,"\u63a5\u53e3\u7684\u7279\u6027\u4f1a\u5f71\u54cd\u6240\u6709\u7684\u6210\u5458\u65b9\u6cd5\uff0c\u4e5f\u5c31\u662f\u4f1a\u5e94\u7528\u5230\u6bcf\u4e00\u4e2a\u65b9\u6cd5\u4e2d\uff0c\u5f53\u7136\u65b9\u6cd5\u53ef\u53ef\u4ee5\u91cd\u5199\u6216\u5ffd\u7565\u3002"),Object(r.b)("h3",{id:"1962-\u65b9\u6cd5\u7279\u6027"},"19.6.2 \u65b9\u6cd5\u7279\u6027"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u8c13\u8bcd")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Get]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Get")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Post]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Post")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Put]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Put")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Delete]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Delete")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Patch]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Patch")," \u8bf7\u6c42\u65b9\u5f0f"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Head]"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Head")," \u8bf7\u6c42\u65b9\u5f0f"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u4e3b\u673a")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Host]"),"\uff1a\u914d\u7f6e\u4e3b\u673a\u5730\u5740\u548c\u7aef\u53e3"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u5934")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Header]"),"\uff1a\u914d\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\uff0c\u652f\u6301\u591a\u4e2a"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5ba2\u6237\u7aef")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Client]"),"\uff1a\u914d\u7f6e\u5ba2\u6237\u7aef"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5185\u5bb9\u7c7b\u578b")," \u7279\u6027",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[MediaTypeHeader]"),"\uff1a\u914d\u7f6e\u5185\u5bb9\u7c7b\u578b")))),Object(r.b)("h3",{id:"1963-\u65b9\u6cd5\u53c2\u6570\u7279\u6027"},"19.6.3 \u65b9\u6cd5\u53c2\u6570\u7279\u6027"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Query]"),"\uff1a\u81ea\u52a8\u5c06\u53c2\u6570\u66ff\u6362\u5730\u5740\u4e2d\u7684\u5360\u4f4d\u7b26\uff0c\u5360\u4f4d\u7b26\u683c\u5f0f ",Object(r.b)("inlineCode",{parentName:"li"},"{\u53c2\u6570\u540d}"),"\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"https://www.furion.pro/user/{id}"),"\uff0c\u9ed8\u8ba4\u57fa\u5143\u7c7b\u578b\u6216\u57fa\u5143\u7c7b\u578b\u6570\u7ec4\u5e94\u7528\u8be5\u7279\u6027"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"[Body]"),"\uff1a\u81ea\u52a8\u5c06\u53c2\u6570\u6dfb\u52a0\u5230\u8bf7\u6c42\u62a5\u6587\u4f53\u4e2d\uff0c\u9ed8\u8ba4\u975e\u57fa\u5143\u7c7b\u578b\u4f1a\u5f15\u7528\u8be5\u7279\u6027\u3002")),Object(r.b)("h2",{id:"197-\u5173\u4e8e\u540c\u6b65\u8bf7\u6c42"},"19.7 \u5173\u4e8e\u540c\u6b65\u8bf7\u6c42"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5185\u90e8\u9ed8\u8ba4\u4e0d\u63d0\u4f9b\u540c\u6b65\u8bf7\u6c42\u64cd\u4f5c\uff0c\u5efa\u8bae\u603b\u662f\u4f7f\u7528\u5f02\u6b65\u7684\u65b9\u5f0f\u8bf7\u6c42\u3002\u5982\u5728\u4e0d\u80fd\u4f7f\u7528\u5f02\u6b65\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u81ea\u884c\u8f6c\u6362\u4e3a\u540c\u6b65\u6267\u884c\u3002"),Object(r.b)("h2",{id:"198-\u5f02\u5e38\u5904\u7406"},"19.8 \u5f02\u5e38\u5904\u7406"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5982\u679c\u63a5\u53e3\u8bf7\u6c42\u5f02\u5e38\u4f1a\u629b\u51fa\u8bf7\u6c42\u5f02\u5e38\uff0c\u6709\u65f6\u8fd9\u4e0d\u662f\u6211\u4eec\u60f3\u8981\u7684\u7ed3\u679c\uff0c\u6211\u4eec\u5e0c\u671b\u5982\u679c\u63a5\u53e3\u8bf7\u6c42\u5f02\u5e38\uff0c\u90a3\u4e48\u76f4\u63a5\u8fd4\u56de\u9ed8\u8ba4\u503c\u5373\u53ef\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u53ea\u9700\u8981\u5728\u63a5\u53e3\u6216\u65b9\u6cd5\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[Safety]")," \u7279\u6027\u5373\u53ef\u3002"),Object(r.b)("h2",{id:"199-\u53cd\u9988\u4e0e\u5efa\u8bae"},"19.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(r.b)("hr",null),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(r.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/http-requests?view=aspnetcore-5.0"}),"ASP.NET Core - HTTP \u8bf7\u6c42")," \u7ae0\u8282"))))}s.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c}));var a=n(21),i=n(195);function r(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return r?e+c:c}(t,e,n,a)}}function c(e,t={}){const{withBaseUrl:n}=r();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var a=n(0),i=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=i.a.createContext({}),o=function(e){var t=i.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=o(e.components);return i.a.createElement(p.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},u=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),s=o(n),u=a,m=s["".concat(c,".").concat(u)]||s[u]||d[u]||r;return n?i.a.createElement(m,b(b({ref:t},p),{},{components:n})):i.a.createElement(m,b({ref:t},p))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,c=new Array(r);c[0]=u;var b={};for(var l in t)hasOwnProperty.call(t,l)&&(b[l]=t[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,c[1]=b;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/3a6dbab2.2f934390.js b/docs/3a6dbab2.2f934390.js new file mode 100644 index 00000000000..1a2c97c934d --- /dev/null +++ b/docs/3a6dbab2.2f934390.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{101:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(3),o=n(7),i=(n(0),n(196)),a=n(197),c={id:"unittest",title:"29.1 \u5355\u5143\u6d4b\u8bd5",sidebar_label:"29.1 \u5355\u5143\u6d4b\u8bd5"},u={unversionedId:"unittest",id:"unittest",isDocsHomePage:!1,title:"29.1 \u5355\u5143\u6d4b\u8bd5",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/bianxieceshi/danyuanceshi",source:"@site/docs\\unittest.mdx",slug:"/unittest",permalink:"/docs/unittest",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/unittest.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"29.1 \u5355\u5143\u6d4b\u8bd5",sidebar:"docs",previous:{title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",permalink:"/docs/devops"},next:{title:"29.2 \u6027\u80fd\u6d4b\u8bd5",permalink:"/docs/performance"}},s=[],p={toc:s};function l(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(a.a,{mdxType:"JoinGroup"}),Object(i.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/bianxieceshi/danyuanceshi"}),"https://monksoul.gitbook.io/hoa/bianxieceshi/danyuanceshi")),Object(i.b)("p",null,"\u53e6\u5916\u8fd9\u91cc\u63a8\u8350 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/dotnet-campus/CUnit"}),"https://github.com/dotnet-campus/CUnit")," \u5355\u5143\u6d4b\u8bd5\u5305\u3002"))}l.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var r=n(21),o=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const a=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+a:a}(t,e,n,r)}}function a(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,a=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(n),b=r,d=l["".concat(a,".").concat(b)]||l[b]||f[b]||i;return n?o.a.createElement(d,c(c({ref:t},s),{},{components:n})):o.a.createElement(d,c({ref:t},s))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=b;var c={};for(var u in t)hasOwnProperty.call(t,u)&&(c[u]=t[u]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/3a6dbab2.d17ed0fa.js b/docs/3a6dbab2.d17ed0fa.js deleted file mode 100644 index c86e4cb0700..00000000000 --- a/docs/3a6dbab2.d17ed0fa.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[27],{100:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),i=(n(0),n(192)),a=n(193),c={id:"unittest",title:"29.1 \u5355\u5143\u6d4b\u8bd5",sidebar_label:"29.1 \u5355\u5143\u6d4b\u8bd5"},u={unversionedId:"unittest",id:"unittest",isDocsHomePage:!1,title:"29.1 \u5355\u5143\u6d4b\u8bd5",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/bianxieceshi/danyuanceshi",source:"@site/docs\\unittest.mdx",slug:"/unittest",permalink:"/docs/unittest",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/unittest.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"29.1 \u5355\u5143\u6d4b\u8bd5",sidebar:"docs",previous:{title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",permalink:"/docs/devops"},next:{title:"29.2 \u6027\u80fd\u6d4b\u8bd5",permalink:"/docs/performance"}},s=[],l={toc:s};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(a.a,{mdxType:"JoinGroup"}),Object(i.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/bianxieceshi/danyuanceshi"}),"https://monksoul.gitbook.io/hoa/bianxieceshi/danyuanceshi")))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return a}));var r=n(21),o=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const a=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+a:a}(t,e,n,r)}}function a(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,a=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(n),d=r,b=p["".concat(a,".").concat(d)]||p[d]||f[d]||i;return n?o.a.createElement(b,c(c({ref:t},s),{},{components:n})):o.a.createElement(b,c({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,a=new Array(i);a[0]=d;var c={};for(var u in t)hasOwnProperty.call(t,u)&&(c[u]=t[u]);c.originalType=e,c.mdxType="string"==typeof e?e:r,a[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/3ab56fdf.1c126b97.js b/docs/3ab56fdf.1c126b97.js deleted file mode 100644 index ee07d563089..00000000000 --- a/docs/3ab56fdf.1c126b97.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{101:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return l})),a.d(t,"metadata",(function(){return i})),a.d(t,"toc",(function(){return p})),a.d(t,"default",(function(){return j}));var n=a(3),b=a(7),r=(a(0),a(192)),c=a(190),l={slug:"welcome",title:"Furion \u4ecb\u7ecd",author:"dotNET China",author_title:"\u4e3a\u4e2d\u56fd .NET \u5f00\u53d1\u8005\u63d0\u4f9b\u4f18\u8d28\u7684\u8d44\u8baf\u548c\u6280\u672f\u5206\u4eab\u3002",author_url:"https://furion.pro",author_image_url:"https://i.loli.net/2021/01/19/M8q5a3OTZWUKicl.png",tags:["furion","furos",".net",".netcore",".net5"]},i={permalink:"/blog/welcome",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/blog/2020-08-19-welcome.mdx",source:"@site/blog\\2020-08-19-welcome.mdx",description:"function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:r=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return r?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=r();return a(e,t)}},191:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function b(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return b}))},192:function(e,t,a){"use strict";a.d(t,"a",(function(){return j})),a.d(t,"b",(function(){return g}));var n=a(0),b=a.n(n);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(b[a]=e[a]);return b}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(b[a]=e[a])}return b}var p=b.a.createContext({}),O=function(e){var t=b.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},j=function(e){var t=O(e.components);return b.a.createElement(p.Provider,{value:t},e.children)},o={inlineCode:"code",wrapper:function(e){var t=e.children;return b.a.createElement(b.a.Fragment,{},t)}},m=b.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),j=O(a),m=n,g=j["".concat(c,".").concat(m)]||j[m]||o[m]||r;return a?b.a.createElement(g,l(l({ref:t},p),{},{components:a})):b.a.createElement(g,l({ref:t},p))}));function g(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,c=new Array(r);c[0]=m;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var p=2;pfunction(e,t,a,{forcePrependBaseUrl:n=!1,absolute:r=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return r?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=r();return a(e,t)}},195:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function b(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return b}))},196:function(e,t,a){"use strict";a.d(t,"a",(function(){return j})),a.d(t,"b",(function(){return g}));var n=a(0),b=a.n(n);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(b[a]=e[a]);return b}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(b[a]=e[a])}return b}var p=b.a.createContext({}),O=function(e){var t=b.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},j=function(e){var t=O(e.components);return b.a.createElement(p.Provider,{value:t},e.children)},o={inlineCode:"code",wrapper:function(e){var t=e.children;return b.a.createElement(b.a.Fragment,{},t)}},m=b.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),j=O(a),m=n,g=j["".concat(c,".").concat(m)]||j[m]||o[m]||r;return a?b.a.createElement(g,l(l({ref:t},p),{},{components:a})):b.a.createElement(g,l({ref:t},p))}));function g(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,c=new Array(r);c[0]=m;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var p=2;pAppDbContext",id:"912-appdbcontext",children:[]},{value:"9.1.3 AppDbContext \u548c DbContext \u533a\u522b",id:"913-appdbcontext-\u548c-dbcontext-\u533a\u522b",children:[]},{value:"9.1.4 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"914-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[{value:"9.1.4.1 \u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"9141-\u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.1.4.2 \u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"9142-\u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]}]},{value:"9.1.5 \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32",id:"915-\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32",children:[{value:"9.1.5.1 \u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e",id:"9151-\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e",children:[]},{value:"9.1.5.2 [AppDbContext] \u65b9\u5f0f\u914d\u7f6e",id:"9152-appdbcontext-\u65b9\u5f0f\u914d\u7f6e",children:[]},{value:"9.1.5.3 OnConfiguring \u65b9\u5f0f\u914d\u7f6e",id:"9153-onconfiguring-\u65b9\u5f0f\u914d\u7f6e",children:[]}]},{value:"9.1.6 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e",id:"916-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e",children:[]},{value:"9.1.7 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c",id:"917-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c",children:[]},{value:"9.1.8 \u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61",id:"918-\u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61",children:[]},{value:"9.1.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"919-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:p};function d(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)(r.a,{mdxType:"JoinGroup"}),Object(o.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u8fde\u63a5\u5b57\u7b26\u4e32\u914d\u7f6e\u6ce8\u610f\u4e8b\u9879")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5982\u679c\u8fde\u63a5\u5b57\u7b26\u4e32\u662f\u914d\u7f6e\u5728\u81ea\u5b9a\u4e49\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\u4e2d\uff0c\u90a3\u4e48\u5fc5\u987b\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Visual Studio")," \u4e2d\u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u53f3\u952e\u5c5e\u6027\uff0c\u8bbe\u7f6e ",Object(o.b)("inlineCode",{parentName:"p"},"\u590d\u5236")," \u8f93\u51fa\u76ee\u5f55\u4e3a ",Object(o.b)("inlineCode",{parentName:"p"},"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"),"\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"\u5185\u5bb9"),"\u3002"),Object(o.b)("p",{parentName:"div"},"\u5426\u5219\u5c31\u4f1a\u63d0\u793a\u627e\u4e0d\u5230\u914d\u7f6e\u6216\u8fde\u63a5\u5b57\u7b26\u4e32\u7684\u9519\u8bef\u3002"))),Object(o.b)("h2",{id:"911-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u662f\u8d1f\u8d23\u548c\u6570\u636e\u5e93\u4ea4\u4e92\u7684\u5bf9\u8c61\uff0c\u63d0\u4f9b\u7a0b\u5e8f\u5bf9\u6570\u636e\u5e93\u5b58\u53d6\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u65b9\u6cd5\u3002"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u96c6\u6210\u4e86\u5fae\u8f6f\u4eb2\u513f\u5b50\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"EntityFramework Core")," \uff0c\u4e5f\u5c31\u662f\u901a\u5e38\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6307\u7684\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext")," \u7c7b\u6216\u5b83\u7684\u5b9e\u73b0\u7c7b\u3002"),Object(o.b)("h2",{id:"912-appdbcontext"},"9.1.2 ",Object(o.b)("inlineCode",{parentName:"h2"},"AppDbContext")),Object(o.b)("p",null,"\u5728\u6211\u4eec\u5b9e\u9645\u9879\u76ee\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"EFCore")," \u63d0\u4f9b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext")," \u64cd\u4f5c\u5bf9\u8c61\u64cd\u4f5c\u6570\u636e\u5e93\u6709\u4e9b\u7e41\u7410\u548c\u590d\u6742\uff0c\u4e14\u9ed8\u8ba4\u4e0d\u5177\u5907\u8bfb\u5199\u5206\u79bb\u3001\u591a\u5e93\u7b49\u64cd\u4f5c\u529f\u80fd\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u8be5\u4e0a\u4e0b\u6587\u7ee7\u627f\u81ea ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext"),"\u3002"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u540e\u7eed\u7ae0\u8282\uff0c\u7686\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"EFCore")," \u4ee3\u66ff ",Object(o.b)("inlineCode",{parentName:"p"},"EntityFramework Core"),"\u3002"))),Object(o.b)("h2",{id:"913-appdbcontext-\u548c-dbcontext-\u533a\u522b"},"9.1.3 ",Object(o.b)("inlineCode",{parentName:"h2"},"AppDbContext")," \u548c ",Object(o.b)("inlineCode",{parentName:"h2"},"DbContext")," \u533a\u522b"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u7ee7\u627f\u81ea ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext"),"\uff0c\u5177\u5907 ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext")," \u6240\u6709\u529f\u80fd\u3002"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u6cdb\u578b\u7248\u672c\uff0c\u5982\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u81ea\u52a8\u914d\u7f6e\u5b9e\u4f53\u4fe1\u606f\uff0c\u65e0\u9700\u5728 ",Object(o.b)("inlineCode",{parentName:"li"},"OnModelCreating")," \u4e2d\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u5185\u7f6e\u591a\u79df\u6237\u652f\u6301"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u5168\u5c40\u6a21\u578b\u914d\u7f6e\u62e6\u622a\u5668"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u6570\u636e\u63d0\u4ea4\u66f4\u6539\u591a\u4e2a\u4e8b\u4ef6"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u63d0\u4f9b\u66f4\u52a0\u5f3a\u5927\u7684\u6a21\u578b\u64cd\u4f5c\u80fd\u529b\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\uff0c\u8bfb\u5199\u5206\u79bb\u7b49"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u80fd\u591f\u5f97\u5230 ",Object(o.b)("inlineCode",{parentName:"li"},"Furion")," \u6846\u67b6\u66f4\u591a\u7684\u529f\u80fd\u652f\u6301")),Object(o.b)("h2",{id:"914-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.4 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e86\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b9a\u4e49\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u64cd\u4f5c\u9ed8\u8ba4\u6570\u636e\u5e93"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u64cd\u4f5c N \u4e2a\u6570\u636e\u5e93")),Object(o.b)("p",null,"\u5176\u4e2d ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u9ed8\u8ba4\u7ee7\u627f\u81ea ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext"),"\u3002"),Object(o.b)("p",null,"\u4e0b\u9762\u662f\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u521b\u5efa\u7684\u591a\u4e2a\u4f8b\u5b50\uff1a"),Object(o.b)("h3",{id:"9141-\u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.4.1 \u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,12}","{1,6,12}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("\u8fde\u63a5\u5b57\u7b26\u4e32\u6216appsetting.json \u952e")]\n public class FurDbContext : AppDbContext // \u7ee7\u627f AppDbContext<> \u7c7b\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("h3",{id:"9142-\u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.4.2 \u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,12}","{1,6,12}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("\u8fde\u63a5\u5b57\u7b26\u4e32\u6216appsetting.json \u952e")]\n public class FurOtherDbContext : AppDbContext // \u7ee7\u627f AppDbContext<> \u7c7b\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurOtherDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6240\u6709\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u90fd\u5e94\u8be5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u9879\u76ee\u4e2d\u521b\u5efa\u3002\u53e6\u5916\u5982\u679c\u7cfb\u7edf\u7528\u5230\u4e86\u591a\u4e2a\u6570\u636e\u5e93\uff0c\u90a3\u4e48\u4ece\u7b2c\u4e8c\u4e2a\u5f00\u59cb\u5fc5\u987b\u6307\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002\u5173\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"TDbContextLocator")," \u5c06\u5728\u4e0b\u4e00\u7ae0\u8282 \u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"dbcontext-locator"}),"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\u300b\u9610\u8ff0\u3002"))),Object(o.b)("h2",{id:"915-\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32"},"9.1.5 \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u591a\u79cd\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\u914d\u7f6e\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e\uff1a",Object(o.b)("inlineCode",{parentName:"li"},'AddSqlServerPool("\u8fde\u63a5\u5b57\u7b26\u4e32")')," \u65b9\u5f0f"),Object(o.b)("li",{parentName:"ul"},"\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"li"},'[AppDbContext("\u8fde\u63a5\u5b57\u7b26\u4e32/Key")]')," \u7279\u6027\u65b9\u5f0f\uff08\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext \u5b9e\u73b0\u7c7b\u6709\u6548"),"\uff09",Object(o.b)("strong",{parentName:"li"},"\u63a8\u8350")),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7\u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"li"},"OnConfiguring(DbContextOptionsBuilder optionsBuilder)")," \u914d\u7f6e")),Object(o.b)("h3",{id:"9151-\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e"},"9.1.5.1 \u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{12-19} title="Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"',"{12-19}":!0,title:'"Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"'}),'using Furion.DependencyInjection;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n // \u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u652f\u6301N\u4e2a\u6570\u636e\u5e93\n services.AddDatabaseAccessor(options =>\n {\n // \u914d\u7f6e\u9ed8\u8ba4\u6570\u636e\u5e93\n options.AddDbPool(DbProvider.SqlServer, connectionString:"\u8fde\u63a5\u5b57\u7b26\u4e32");\n\n // \u914d\u7f6e\u591a\u4e2a\u6570\u636e\u5e93\uff0c\u591a\u4e2a\u6570\u636e\u5e93\u5fc5\u987b\u6307\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\n options.AddDbPool(DbProvider.Sqlite, connectionString:"\u8fde\u63a5\u5b57\u7b26\u4e32");\n });\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u65b0\u7248 MySQL \u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"MySQL")," \u5728\u65b0\u7248\u672c\u5305\u4e2d\u6ce8\u518c\u6709\u6240\u4fee\u6539\uff0c\u6240\u4ee5\u6ce8\u518c\u65b9\u5f0f\u4e3a\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDatabaseAccessor(options =>\n{\n options.AddDbPool($"{DbProvider.MySql}@8.0.22");\n});\n')))),Object(o.b)("h3",{id:"9152-appdbcontext-\u65b9\u5f0f\u914d\u7f6e"},"9.1.5.2 ",Object(o.b)("inlineCode",{parentName:"h3"},"[AppDbContext]")," \u65b9\u5f0f\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6}","{1,6}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("DbConnectionString")] // \u652f\u6301 `appsetting.json` \u540d\u6216 \u8fde\u63a5\u5b57\u7b26\u4e32\n public class FurDbContext : AppDbContext\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u63d0\u793a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u63a8\u8350\u4f7f\u7528\u6b64\u65b9\u5f0f\u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\u3002"))),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"[AppDbContext]"))," \u5185\u7f6e\u5c5e\u6027\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"ConnectionString"),"\uff1a\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u6216\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u8def\u5f84\uff08\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e\u67e5\u627e\uff09\uff0c\u6216 ",Object(o.b)("inlineCode",{parentName:"li"},"appsetting.json")," \u7684 ",Object(o.b)("inlineCode",{parentName:"li"},"ConnectionStrings")," \u914d\u7f6e\u5b57\u7b26\u4e32"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"TablePrefix"),"\uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u8868\u7edf\u4e00\u524d\u7f00"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"TableSuffix"),"\uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u8868\u7edf\u4e00\u540e\u7f00"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"ProviderName"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u7c7b\u578b\uff0c\u4f20\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"DbProvider.Xxx")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Mode"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6a21\u5f0f\uff0c",Object(o.b)("inlineCode",{parentName:"li"},"DbContextMode")," \u679a\u4e3e\u7c7b\u578b\uff0c\u53d6\u503c\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Cached"),"\uff1a\u7f13\u5b58\u6a21\u578b\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u9ed8\u8ba4\u503c"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Dynamic"),"\uff1a\u52a8\u6001\u6a21\u578b\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")))),Object(o.b)("h3",{id:"9153-onconfiguring-\u65b9\u5f0f\u914d\u7f6e"},"9.1.5.3 ",Object(o.b)("inlineCode",{parentName:"h3"},"OnConfiguring")," \u65b9\u5f0f\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16-20}","{16-20}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n public class FurDbContext : AppDbContext\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n {\n base.OnConfiguring(optionsBuilder);\n\n optionsBuilder.UseSqlServer("\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32");\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8fd9\u4e09\u79cd\u65b9\u5f0f\u53ef\u4ee5\u540c\u65f6\u4f7f\u7528\uff0c\u4f46\u662f\u6709\u4f18\u5148\u7ea7\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"[AppDbContext]")," -> ",Object(o.b)("inlineCode",{parentName:"p"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e")," -> ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring"),"\uff08\u4f4e\u5230\u9ad8\uff09"),Object(o.b)("p",{parentName:"div"},"\u4e5f\u5c31\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring")," \u914d\u7f6e\u4f1a\u8986\u76d6 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e")," \u914d\u7f6e\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e")," \u914d\u7f6e\u4f1a\u8986\u76d6 ",Object(o.b)("inlineCode",{parentName:"p"},"[AppDbContext]")," \u914d\u7f6e\u6240\u914d\u7f6e\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002"))),Object(o.b)("h2",{id:"916-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e"},"9.1.6 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e"),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u9700\u5b9a\u4e49\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u4e2d\uff0c\u4e14\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u90fd\u5fc5\u987b\u62e5\u6709\u552f\u4e00\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"DbContextLocator")," \u5b9a\u4f4d\u5668"))),Object(o.b)("h2",{id:"917-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c"},"9.1.7 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c"),Object(o.b)("p",null,"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u597d\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\u540e\uff0c\u9700\u8981\u6ce8\u518c\u8be5\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u5e76\u6307\u5b9a\u6570\u636e\u5e93\u7c7b\u578b\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11-13} title="Furion\\framework\\Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"',"{11-13}":!0,title:'"Furion\\framework\\Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"'}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("p",null,"\u5982\u679c\u6709\u591a\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\uff0c",Object(o.b)("strong",{parentName:"p"},"\u90a3\u4e48\u4ece\u7b2c\u4e8c\u4e2a\u8d77\uff0c\u5c31\u9700\u8981\u7ed1\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"options.AddDbPool(DbProvider.Sqlite); // \u7b2c\u4e00\u4e2a\u6570\u636e\u5e93\n\noptions.AddDbPool(DbProvider.SqlServer); // \u7b2c\u4e8c\u4e2a\u6570\u636e\u5e93\n\noptions.AddDbPool(DbProvider.SqlServer); // \u7b2c\u4e09\u4e2a\u6570\u636e\u5e93\n")),Object(o.b)("h2",{id:"918-\u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61"},"9.1.8 \u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u662f\u5b9a\u4e49\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u9879\u76ee\u5c42\uff0c\u5e76\u4e14\u8be5\u5c42\u4e0d\u88ab ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Application")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u7b49\u5c42\u5f15\u7528\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\u5c31\u4e0d\u80fd\u76f4\u63a5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Application")," \u9879\u76ee\u5c42\u76f4\u63a5\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u5b9a\u4e49\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u3002"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd\u65b9\u5f0f\u5904\u7406\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"respository.Context")," \uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61\uff0c\u8fd4\u56de\u662f ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext")," \u62bd\u8c61\u7c7b\u578b"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"respository.DynamicContext"),"\uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61\uff0c\u8fd4\u56de\u7684\u662f ",Object(o.b)("inlineCode",{parentName:"li"},"dynamic")," \u7c7b\u578b")),Object(o.b)("p",null,"\u5982\u679c\u4f60\u53ea\u662f\u60f3\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684\u529f\u80fd\uff0c\u76f4\u63a5\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"respository.Context")," \u5373\u53ef\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"respository.Context.SaveChanges();\n")),Object(o.b)("p",null,"\u5982\u679c\u4f60\u60f3\u80fd\u591f\u83b7\u53d6\u5177\u4f53\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u7c7b\u578b\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"MyDbContext"),"\uff0c\u90a3\u4e48\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"respository.DynamicContext")," \u5c31\u53ef\u4ee5\u83b7\u53d6\u5230\u5177\u4f53\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"MyDbContext")," \u7c7b\u578b\u3002\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var persons = respository.DynamicContext.Persons.Find(1);\nvar users = respository.DynamicContext.Users;\n")),Object(o.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c ",Object(o.b)("inlineCode",{parentName:"p"},"MyDbContext")," \u5b9a\u4e49\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u4e86\u3002"),Object(o.b)("h2",{id:"919-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.1.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(o.b)("hr",null),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/miscellaneous/configuring-dbcontext"}),"EF Core - \u914d\u7f6e DbContext")," \u7ae0\u8282\u3002"))))}d.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}));var a=n(21),i=n(191);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const r=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+r:r}(t,e,n,a)}}function r(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return O}));var a=n(0),i=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=i.a.createContext({}),l=function(e){var t=i.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},d=function(e){var t=l(e.components);return i.a.createElement(p.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),d=l(n),m=a,O=d["".concat(r,".").concat(m)]||d[m]||s[m]||o;return n?i.a.createElement(O,b(b({ref:t},p),{},{components:n})):i.a.createElement(O,b({ref:t},p))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,r=new Array(o);r[0]=m;var b={};for(var c in t)hasOwnProperty.call(t,c)&&(b[c]=t[c]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{103:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return c})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return d}));var a=n(3),i=n(7),o=(n(0),n(196)),r=n(197),b={id:"dbcontext",title:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",sidebar_label:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},c={unversionedId:"dbcontext",id:"dbcontext",isDocsHomePage:!1,title:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",description:"\u5982\u679c\u8fde\u63a5\u5b57\u7b26\u4e32\u662f\u914d\u7f6e\u5728\u81ea\u5b9a\u4e49\u7684 .json \u6587\u4ef6\u4e2d\uff0c\u90a3\u4e48\u5fc5\u987b\u5728 Visual Studio \u4e2d\u914d\u7f6e .json \u53f3\u952e\u5c5e\u6027\uff0c\u8bbe\u7f6e \u590d\u5236 \u8f93\u51fa\u76ee\u5f55\u4e3a \u5982\u679c\u8f83\u65b0\u5219\u590d\u5236\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a\u5185\u5bb9\u3002",source:"@site/docs\\dbcontext.mdx",slug:"/dbcontext",permalink:"/docs/dbcontext",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",sidebar:"docs",previous:{title:"8. \u6570\u636e\u6821\u9a8c",permalink:"/docs/data-validation"},next:{title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",permalink:"/docs/dbcontext-locator"}},p=[{value:"9.1.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"911-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.1.2 AppDbContext",id:"912-appdbcontext",children:[]},{value:"9.1.3 AppDbContext \u548c DbContext \u533a\u522b",id:"913-appdbcontext-\u548c-dbcontext-\u533a\u522b",children:[]},{value:"9.1.4 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"914-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[{value:"9.1.4.1 \u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"9141-\u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.1.4.2 \u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"9142-\u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]}]},{value:"9.1.5 \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32",id:"915-\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32",children:[{value:"9.1.5.1 \u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e",id:"9151-\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e",children:[]},{value:"9.1.5.2 [AppDbContext] \u65b9\u5f0f\u914d\u7f6e",id:"9152-appdbcontext-\u65b9\u5f0f\u914d\u7f6e",children:[]},{value:"9.1.5.3 OnConfiguring \u65b9\u5f0f\u914d\u7f6e",id:"9153-onconfiguring-\u65b9\u5f0f\u914d\u7f6e",children:[]}]},{value:"9.1.6 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e",id:"916-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e",children:[]},{value:"9.1.7 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c",id:"917-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c",children:[]},{value:"9.1.8 \u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61",id:"918-\u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61",children:[]},{value:"9.1.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"919-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:p};function d(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)(r.a,{mdxType:"JoinGroup"}),Object(o.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u8fde\u63a5\u5b57\u7b26\u4e32\u914d\u7f6e\u6ce8\u610f\u4e8b\u9879")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5982\u679c\u8fde\u63a5\u5b57\u7b26\u4e32\u662f\u914d\u7f6e\u5728\u81ea\u5b9a\u4e49\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\u4e2d\uff0c\u90a3\u4e48\u5fc5\u987b\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Visual Studio")," \u4e2d\u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u53f3\u952e\u5c5e\u6027\uff0c\u8bbe\u7f6e ",Object(o.b)("inlineCode",{parentName:"p"},"\u590d\u5236")," \u8f93\u51fa\u76ee\u5f55\u4e3a ",Object(o.b)("inlineCode",{parentName:"p"},"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"),"\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"\u5185\u5bb9"),"\u3002"),Object(o.b)("p",{parentName:"div"},"\u5426\u5219\u5c31\u4f1a\u63d0\u793a\u627e\u4e0d\u5230\u914d\u7f6e\u6216\u8fde\u63a5\u5b57\u7b26\u4e32\u7684\u9519\u8bef\u3002"))),Object(o.b)("h2",{id:"911-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u662f\u8d1f\u8d23\u548c\u6570\u636e\u5e93\u4ea4\u4e92\u7684\u5bf9\u8c61\uff0c\u63d0\u4f9b\u7a0b\u5e8f\u5bf9\u6570\u636e\u5e93\u5b58\u53d6\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u65b9\u6cd5\u3002"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u96c6\u6210\u4e86\u5fae\u8f6f\u4eb2\u513f\u5b50\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"EntityFramework Core")," \uff0c\u4e5f\u5c31\u662f\u901a\u5e38\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6307\u7684\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext")," \u7c7b\u6216\u5b83\u7684\u5b9e\u73b0\u7c7b\u3002"),Object(o.b)("h2",{id:"912-appdbcontext"},"9.1.2 ",Object(o.b)("inlineCode",{parentName:"h2"},"AppDbContext")),Object(o.b)("p",null,"\u5728\u6211\u4eec\u5b9e\u9645\u9879\u76ee\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"EFCore")," \u63d0\u4f9b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext")," \u64cd\u4f5c\u5bf9\u8c61\u64cd\u4f5c\u6570\u636e\u5e93\u6709\u4e9b\u7e41\u7410\u548c\u590d\u6742\uff0c\u4e14\u9ed8\u8ba4\u4e0d\u5177\u5907\u8bfb\u5199\u5206\u79bb\u3001\u591a\u5e93\u7b49\u64cd\u4f5c\u529f\u80fd\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u8be5\u4e0a\u4e0b\u6587\u7ee7\u627f\u81ea ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext"),"\u3002"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u540e\u7eed\u7ae0\u8282\uff0c\u7686\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"EFCore")," \u4ee3\u66ff ",Object(o.b)("inlineCode",{parentName:"p"},"EntityFramework Core"),"\u3002"))),Object(o.b)("h2",{id:"913-appdbcontext-\u548c-dbcontext-\u533a\u522b"},"9.1.3 ",Object(o.b)("inlineCode",{parentName:"h2"},"AppDbContext")," \u548c ",Object(o.b)("inlineCode",{parentName:"h2"},"DbContext")," \u533a\u522b"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u7ee7\u627f\u81ea ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext"),"\uff0c\u5177\u5907 ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext")," \u6240\u6709\u529f\u80fd\u3002"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u6cdb\u578b\u7248\u672c\uff0c\u5982\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u81ea\u52a8\u914d\u7f6e\u5b9e\u4f53\u4fe1\u606f\uff0c\u65e0\u9700\u5728 ",Object(o.b)("inlineCode",{parentName:"li"},"OnModelCreating")," \u4e2d\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u5185\u7f6e\u591a\u79df\u6237\u652f\u6301"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u5168\u5c40\u6a21\u578b\u914d\u7f6e\u62e6\u622a\u5668"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u652f\u6301\u6570\u636e\u63d0\u4ea4\u66f4\u6539\u591a\u4e2a\u4e8b\u4ef6"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u63d0\u4f9b\u66f4\u52a0\u5f3a\u5927\u7684\u6a21\u578b\u64cd\u4f5c\u80fd\u529b\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\uff0c\u8bfb\u5199\u5206\u79bb\u7b49"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u80fd\u591f\u5f97\u5230 ",Object(o.b)("inlineCode",{parentName:"li"},"Furion")," \u6846\u67b6\u66f4\u591a\u7684\u529f\u80fd\u652f\u6301")),Object(o.b)("h2",{id:"914-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.4 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e86\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b9a\u4e49\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u64cd\u4f5c\u9ed8\u8ba4\u6570\u636e\u5e93"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext")," \u64cd\u4f5c N \u4e2a\u6570\u636e\u5e93")),Object(o.b)("p",null,"\u5176\u4e2d ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u9ed8\u8ba4\u7ee7\u627f\u81ea ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext"),"\u3002"),Object(o.b)("p",null,"\u4e0b\u9762\u662f\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u521b\u5efa\u7684\u591a\u4e2a\u4f8b\u5b50\uff1a"),Object(o.b)("h3",{id:"9141-\u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.4.1 \u521b\u5efa\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,12}","{1,6,12}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("\u8fde\u63a5\u5b57\u7b26\u4e32\u6216appsetting.json \u952e")]\n public class FurDbContext : AppDbContext // \u7ee7\u627f AppDbContext<> \u7c7b\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("h3",{id:"9142-\u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.1.4.2 \u521b\u5efa\u5176\u4ed6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,12}","{1,6,12}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("\u8fde\u63a5\u5b57\u7b26\u4e32\u6216appsetting.json \u952e")]\n public class FurOtherDbContext : AppDbContext // \u7ee7\u627f AppDbContext<> \u7c7b\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurOtherDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6240\u6709\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u90fd\u5e94\u8be5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u9879\u76ee\u4e2d\u521b\u5efa\u3002\u53e6\u5916\u5982\u679c\u7cfb\u7edf\u7528\u5230\u4e86\u591a\u4e2a\u6570\u636e\u5e93\uff0c\u90a3\u4e48\u4ece\u7b2c\u4e8c\u4e2a\u5f00\u59cb\u5fc5\u987b\u6307\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002\u5173\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"TDbContextLocator")," \u5c06\u5728\u4e0b\u4e00\u7ae0\u8282 \u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"dbcontext-locator"}),"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\u300b\u9610\u8ff0\u3002"))),Object(o.b)("h2",{id:"915-\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32"},"9.1.5 \u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u591a\u79cd\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\u914d\u7f6e\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e\uff1a",Object(o.b)("inlineCode",{parentName:"li"},'AddSqlServerPool("\u8fde\u63a5\u5b57\u7b26\u4e32")')," \u65b9\u5f0f"),Object(o.b)("li",{parentName:"ul"},"\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"li"},'[AppDbContext("\u8fde\u63a5\u5b57\u7b26\u4e32/Key")]')," \u7279\u6027\u65b9\u5f0f\uff08\u53ea\u5728 ",Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext \u5b9e\u73b0\u7c7b\u6709\u6548"),"\uff09",Object(o.b)("strong",{parentName:"li"},"\u63a8\u8350")),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7\u91cd\u5199 ",Object(o.b)("inlineCode",{parentName:"li"},"OnConfiguring(DbContextOptionsBuilder optionsBuilder)")," \u914d\u7f6e")),Object(o.b)("h3",{id:"9151-\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e"},"9.1.5.1 \u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{12-19} title="Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"',"{12-19}":!0,title:'"Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"'}),'using Furion.DependencyInjection;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n // \u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u652f\u6301N\u4e2a\u6570\u636e\u5e93\n services.AddDatabaseAccessor(options =>\n {\n // \u914d\u7f6e\u9ed8\u8ba4\u6570\u636e\u5e93\n options.AddDbPool(DbProvider.SqlServer, connectionString:"\u8fde\u63a5\u5b57\u7b26\u4e32");\n\n // \u914d\u7f6e\u591a\u4e2a\u6570\u636e\u5e93\uff0c\u591a\u4e2a\u6570\u636e\u5e93\u5fc5\u987b\u6307\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\n options.AddDbPool(DbProvider.Sqlite, connectionString:"\u8fde\u63a5\u5b57\u7b26\u4e32");\n });\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u65b0\u7248 MySQL \u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"MySQL")," \u5728\u65b0\u7248\u672c\u5305\u4e2d\u6ce8\u518c\u6709\u6240\u4fee\u6539\uff0c\u6240\u4ee5\u6ce8\u518c\u65b9\u5f0f\u4e3a\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDatabaseAccessor(options =>\n{\n options.AddDbPool($"{DbProvider.MySql}@8.0.22");\n});\n')))),Object(o.b)("h3",{id:"9152-appdbcontext-\u65b9\u5f0f\u914d\u7f6e"},"9.1.5.2 ",Object(o.b)("inlineCode",{parentName:"h3"},"[AppDbContext]")," \u65b9\u5f0f\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6}","{1,6}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("DbConnectionString")] // \u652f\u6301 `appsetting.json` \u540d\u6216 \u8fde\u63a5\u5b57\u7b26\u4e32\n public class FurDbContext : AppDbContext\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u63d0\u793a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u63a8\u8350\u4f7f\u7528\u6b64\u65b9\u5f0f\u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\u3002"))),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"[AppDbContext]"))," \u5185\u7f6e\u5c5e\u6027\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"ConnectionString"),"\uff1a\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u6216\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u8def\u5f84\uff08\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e\u67e5\u627e\uff09\uff0c\u6216 ",Object(o.b)("inlineCode",{parentName:"li"},"appsetting.json")," \u7684 ",Object(o.b)("inlineCode",{parentName:"li"},"ConnectionStrings")," \u914d\u7f6e\u5b57\u7b26\u4e32"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"TablePrefix"),"\uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u8868\u7edf\u4e00\u524d\u7f00"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"TableSuffix"),"\uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u8868\u7edf\u4e00\u540e\u7f00"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"ProviderName"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u7c7b\u578b\uff0c\u4f20\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"DbProvider.Xxx")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Mode"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6a21\u5f0f\uff0c",Object(o.b)("inlineCode",{parentName:"li"},"DbContextMode")," \u679a\u4e3e\u7c7b\u578b\uff0c\u53d6\u503c\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Cached"),"\uff1a\u7f13\u5b58\u6a21\u578b\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u9ed8\u8ba4\u503c"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Dynamic"),"\uff1a\u52a8\u6001\u6a21\u578b\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")))),Object(o.b)("h3",{id:"9153-onconfiguring-\u65b9\u5f0f\u914d\u7f6e"},"9.1.5.3 ",Object(o.b)("inlineCode",{parentName:"h3"},"OnConfiguring")," \u65b9\u5f0f\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16-20}","{16-20}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n public class FurDbContext : AppDbContext\n {\n /// \n /// \u7ee7\u627f\u7236\u7c7b\u6784\u9020\u51fd\u6570\n /// \n /// \n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)\n {\n base.OnConfiguring(optionsBuilder);\n\n optionsBuilder.UseSqlServer("\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32");\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8fd9\u4e09\u79cd\u65b9\u5f0f\u53ef\u4ee5\u540c\u65f6\u4f7f\u7528\uff0c\u4f46\u662f\u6709\u4f18\u5148\u7ea7\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"[AppDbContext]")," -> ",Object(o.b)("inlineCode",{parentName:"p"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e")," -> ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring"),"\uff08\u4f4e\u5230\u9ad8\uff09"),Object(o.b)("p",{parentName:"div"},"\u4e5f\u5c31\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"OnConfiguring")," \u914d\u7f6e\u4f1a\u8986\u76d6 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e")," \u914d\u7f6e\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"\u5728\u6ce8\u518c\u6570\u636e\u5e93\u670d\u52a1\u65f6\u914d\u7f6e")," \u914d\u7f6e\u4f1a\u8986\u76d6 ",Object(o.b)("inlineCode",{parentName:"p"},"[AppDbContext]")," \u914d\u7f6e\u6240\u914d\u7f6e\u7684\u8fde\u63a5\u5b57\u7b26\u4e32\u3002"))),Object(o.b)("h2",{id:"916-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e"},"9.1.6 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\u4f4d\u7f6e"),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u9700\u5b9a\u4e49\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u4e2d\uff0c\u4e14\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u90fd\u5fc5\u987b\u62e5\u6709\u552f\u4e00\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"DbContextLocator")," \u5b9a\u4f4d\u5668"))),Object(o.b)("h2",{id:"917-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c"},"9.1.7 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u6ce8\u518c"),Object(o.b)("p",null,"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u914d\u7f6e\u597d\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\u540e\uff0c\u9700\u8981\u6ce8\u518c\u8be5\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u5e76\u6307\u5b9a\u6570\u636e\u5e93\u7c7b\u578b\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11-13} title="Furion\\framework\\Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"',"{11-13}":!0,title:'"Furion\\framework\\Furion.EntityFramework.Core\\FurEntityFrameworkCoreStartup.cs"'}),"using Furion.DatabaseAccessor;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n options.AddDbPool(DbProvider.Sqlite);\n });\n }\n }\n}\n")),Object(o.b)("p",null,"\u5982\u679c\u6709\u591a\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\uff0c",Object(o.b)("strong",{parentName:"p"},"\u90a3\u4e48\u4ece\u7b2c\u4e8c\u4e2a\u8d77\uff0c\u5c31\u9700\u8981\u7ed1\u5b9a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"options.AddDbPool(DbProvider.Sqlite); // \u7b2c\u4e00\u4e2a\u6570\u636e\u5e93\n\noptions.AddDbPool(DbProvider.SqlServer); // \u7b2c\u4e8c\u4e2a\u6570\u636e\u5e93\n\noptions.AddDbPool(DbProvider.SqlServer); // \u7b2c\u4e09\u4e2a\u6570\u636e\u5e93\n")),Object(o.b)("h2",{id:"918-\u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61"},"9.1.8 \u52a8\u6001\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u662f\u5b9a\u4e49\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u9879\u76ee\u5c42\uff0c\u5e76\u4e14\u8be5\u5c42\u4e0d\u88ab ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Application")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u7b49\u5c42\u5f15\u7528\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\u5c31\u4e0d\u80fd\u76f4\u63a5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Application")," \u9879\u76ee\u5c42\u76f4\u63a5\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u5b9a\u4e49\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u3002"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd\u65b9\u5f0f\u5904\u7406\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"respository.Context")," \uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61\uff0c\u8fd4\u56de\u662f ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext")," \u62bd\u8c61\u7c7b\u578b"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"respository.DynamicContext"),"\uff1a\u5f53\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5bf9\u8c61\uff0c\u8fd4\u56de\u7684\u662f ",Object(o.b)("inlineCode",{parentName:"li"},"dynamic")," \u7c7b\u578b")),Object(o.b)("p",null,"\u5982\u679c\u4f60\u53ea\u662f\u60f3\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684\u529f\u80fd\uff0c\u76f4\u63a5\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"respository.Context")," \u5373\u53ef\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"respository.Context.SaveChanges();\n")),Object(o.b)("p",null,"\u5982\u679c\u4f60\u60f3\u80fd\u591f\u83b7\u53d6\u5177\u4f53\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u7c7b\u578b\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"MyDbContext"),"\uff0c\u90a3\u4e48\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"respository.DynamicContext")," \u5c31\u53ef\u4ee5\u83b7\u53d6\u5230\u5177\u4f53\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"MyDbContext")," \u7c7b\u578b\u3002\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var persons = respository.DynamicContext.Persons.Find(1);\nvar users = respository.DynamicContext.Users;\n")),Object(o.b)("p",null,"\u8fd9\u6837\u5c31\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c ",Object(o.b)("inlineCode",{parentName:"p"},"MyDbContext")," \u5b9a\u4e49\u7684\u5c5e\u6027\u548c\u65b9\u6cd5\u4e86\u3002"),Object(o.b)("h2",{id:"919-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.1.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(o.b)("hr",null),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/miscellaneous/configuring-dbcontext"}),"EF Core - \u914d\u7f6e DbContext")," \u7ae0\u8282\u3002"))))}d.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return r}));var a=n(21),i=n(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const r=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+r:r}(t,e,n,a)}}function r(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return O}));var a=n(0),i=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var p=i.a.createContext({}),l=function(e){var t=i.a.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},d=function(e){var t=l(e.components);return i.a.createElement(p.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},m=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,p=c(e,["components","mdxType","originalType","parentName"]),d=l(n),m=a,O=d["".concat(r,".").concat(m)]||d[m]||s[m]||o;return n?i.a.createElement(O,b(b({ref:t},p),{},{components:n})):i.a.createElement(O,b({ref:t},p))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,r=new Array(o);r[0]=m;var b={};for(var c in t)hasOwnProperty.call(t,c)&&(b[c]=t[c]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/404.html b/docs/404.html index 99b0a8d4832..81bfacc5a7f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,16 +6,16 @@ -Page Not Found | Furion - - - +Page Not Found | Furion + + +
-

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- - - +

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

+ + + \ No newline at end of file diff --git a/docs/408ae89d.0624d5fa.js b/docs/408ae89d.1c4d21a2.js similarity index 96% rename from docs/408ae89d.0624d5fa.js rename to docs/408ae89d.1c4d21a2.js index 10ce70a09ce..2e5438b6795 100644 --- a/docs/408ae89d.0624d5fa.js +++ b/docs/408ae89d.1c4d21a2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{103:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return u}));var r=t(3),a=t(7),i=(t(0),t(192)),c=t(193),o={id:"dbcontext-view",title:"9.12 \u89c6\u56fe\u64cd\u4f5c",sidebar_label:"9.12 \u89c6\u56fe\u64cd\u4f5c"},s={unversionedId:"dbcontext-view",id:"dbcontext-view",isDocsHomePage:!1,title:"9.12 \u89c6\u56fe\u64cd\u4f5c",description:"9.12.1 \u5173\u4e8e\u89c6\u56fe",source:"@site/docs\\dbcontext-view.mdx",slug:"/dbcontext-view",permalink:"/docs/dbcontext-view",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-view.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.12 \u89c6\u56fe\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-hight-query"},next:{title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",permalink:"/docs/dbcontext-proc"}},b=[{value:"9.12.1 \u5173\u4e8e\u89c6\u56fe",id:"9121-\u5173\u4e8e\u89c6\u56fe",children:[]},{value:"9.12.2 \u89c6\u56fe\u7684\u4f7f\u7528",id:"9122-\u89c6\u56fe\u7684\u4f7f\u7528",children:[{value:"9.12.2.1 \u521b\u5efa\u89c6\u56fe SQL",id:"91221-\u521b\u5efa\u89c6\u56fe-sql",children:[]},{value:"9.12.2.2 \u89c6\u56fe\u6a21\u578b",id:"91222-\u89c6\u56fe\u6a21\u578b",children:[]}]},{value:"9.12.3 \u89c6\u56fe\u4f7f\u7528",id:"9123-\u89c6\u56fe\u4f7f\u7528",children:[]},{value:"9.12.4 \u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f \u2714",id:"9124-\u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f-",children:[]},{value:"9.12.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9125-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:b};function u(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9121-\u5173\u4e8e\u89c6\u56fe"},"9.12.1 \u5173\u4e8e\u89c6\u56fe"),Object(i.b)("p",null,"\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"),Object(i.b)("h2",{id:"9122-\u89c6\u56fe\u7684\u4f7f\u7528"},"9.12.2 \u89c6\u56fe\u7684\u4f7f\u7528"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"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 ",Object(i.b)("inlineCode",{parentName:"p"},"EntityNotKey")," \u57fa\u7c7b\u5373\u53ef\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(i.b)("h3",{id:"91221-\u521b\u5efa\u89c6\u56fe-sql"},"9.12.2.1 \u521b\u5efa\u89c6\u56fe ",Object(i.b)("inlineCode",{parentName:"h3"},"SQL")),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-sql"}),"CREATE VIEW V_Person AS\nSELECT Id,Name,Age,Address FROM person\n")),Object(i.b)("h3",{id:"91222-\u89c6\u56fe\u6a21\u578b"},"9.12.2.2 \u89c6\u56fe\u6a21\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,10}","{5,10}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class V_Person : EntityNotKey\n {\n /// \n /// \u914d\u7f6e\u89c6\u56fe\u540d\n /// \n public V_Person() : base("V_Person")\n {\n }\n\n /// \n /// \u4e3b\u952eId\n /// \n public int Id { get; set; }\n\n /// \n /// \u59d3\u540d\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u89c6\u56fe\u540d\u79f0")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u89c6\u56fe\u5b9e\u4f53\u53ea\u9700\u8981\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"EntityNotKey")," \u57fa\u7c7b\u5e76\u7f16\u5199\u65e0\u53c2\u6784\u9020\u51fd\u6570\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},'base("\u89c6\u56fe\u540d\u79f0")')," \u5373\u53ef\u3002"))),Object(i.b)("h2",{id:"9123-\u89c6\u56fe\u4f7f\u7528"},"9.12.3 \u89c6\u56fe\u4f7f\u7528"),Object(i.b)("p",null,"\u89c6\u56fe\u9664\u4e86\u4e0d\u80fd\u64cd\u4f5c\uff08\u5199\uff09\u4ee5\u5916\uff0c\u5176\u4ed6\u64cd\u4f5c\u548c\u8868\u64cd\u4f5c\u65e0\u5f02\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var vEntities = v_repository.Where(u => u.Id >10).ToList();\n")),Object(i.b)("h2",{id:"9124-\u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f-"},"9.12.4 \u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f \u2714"),Object(i.b)("p",null,"\u7531\u4e8e\u89c6\u56fe\u662f\u865a\u62df\u8868\uff0c\u4e0d\u5e94\u8be5\u5bf9\u5176\u8fdb\u884c\u5199\u64cd\u4f5c\uff0c\u6240\u4ee5\u5e94\u8be5\u91c7\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"\u53ea\u8bfb\u4ed3\u50a8\u521d\u59cb\u5316\u89c6\u56fe"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{11,13,16}","{11,13,16}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Furion.Application.Persons\n{\n public class FurionService : IDynamicApiController\n {\n private readonly IReadableRepository _readableRepository;\n\n public FurionService(IRepository repository)\n {\n // \u521d\u59cb\u5316\u53ea\u8bfb\u4ed3\u50a8\n _readableRepository = repository.Constraint>();\n }\n\n /// \n /// \u8bfb\u53d6\u89c6\u56fe\n /// \n /// \n public async Task> GetVPerson()\n {\n var list = await _readableRepository.AsAsyncEnumerable();\n return list;\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},".Constraint")," \u65b9\u6cd5\u53ef\u4ee5\u5c06\u4ed3\u50a8\u7ea6\u675f\u4e3a\u7279\u5b9a\u4ed3\u50a8\uff0c\u5982\u53ea\u8bfb\u4ed3\u50a8\uff0c\u53ef\u8bfb\u53ef\u5199\u4ed3\u50a8\uff0c\u53ea\u65b0\u589e\u4ed3\u50a8\u7b49\u3002"))),Object(i.b)("h2",{id:"9125-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.12.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return c}));var r=t(21),a=t(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(r)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+c:c}(n,e,t,r)}}function c(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},191:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return a}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return m}));var r=t(0),a=t.n(r);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var b=a.a.createContext({}),l=function(e){var n=a.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},u=function(e){var n=l(e.components);return a.a.createElement(b.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},p=a.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),u=l(t),p=r,m=u["".concat(c,".").concat(p)]||u[p]||d[p]||i;return t?a.a.createElement(m,o(o({ref:n},b),{},{components:t})):a.a.createElement(m,o({ref:n},b))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var i=t.length,c=new Array(i);c[0]=p;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o.mdxType="string"==typeof e?e:r,c[1]=o;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{104:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return u}));var r=t(3),a=t(7),i=(t(0),t(196)),c=t(197),o={id:"dbcontext-view",title:"9.12 \u89c6\u56fe\u64cd\u4f5c",sidebar_label:"9.12 \u89c6\u56fe\u64cd\u4f5c"},s={unversionedId:"dbcontext-view",id:"dbcontext-view",isDocsHomePage:!1,title:"9.12 \u89c6\u56fe\u64cd\u4f5c",description:"9.12.1 \u5173\u4e8e\u89c6\u56fe",source:"@site/docs\\dbcontext-view.mdx",slug:"/dbcontext-view",permalink:"/docs/dbcontext-view",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-view.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.12 \u89c6\u56fe\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-hight-query"},next:{title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",permalink:"/docs/dbcontext-proc"}},b=[{value:"9.12.1 \u5173\u4e8e\u89c6\u56fe",id:"9121-\u5173\u4e8e\u89c6\u56fe",children:[]},{value:"9.12.2 \u89c6\u56fe\u7684\u4f7f\u7528",id:"9122-\u89c6\u56fe\u7684\u4f7f\u7528",children:[{value:"9.12.2.1 \u521b\u5efa\u89c6\u56fe SQL",id:"91221-\u521b\u5efa\u89c6\u56fe-sql",children:[]},{value:"9.12.2.2 \u89c6\u56fe\u6a21\u578b",id:"91222-\u89c6\u56fe\u6a21\u578b",children:[]}]},{value:"9.12.3 \u89c6\u56fe\u4f7f\u7528",id:"9123-\u89c6\u56fe\u4f7f\u7528",children:[]},{value:"9.12.4 \u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f \u2714",id:"9124-\u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f-",children:[]},{value:"9.12.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9125-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:b};function u(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9121-\u5173\u4e8e\u89c6\u56fe"},"9.12.1 \u5173\u4e8e\u89c6\u56fe"),Object(i.b)("p",null,"\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"),Object(i.b)("h2",{id:"9122-\u89c6\u56fe\u7684\u4f7f\u7528"},"9.12.2 \u89c6\u56fe\u7684\u4f7f\u7528"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"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 ",Object(i.b)("inlineCode",{parentName:"p"},"EntityNotKey")," \u57fa\u7c7b\u5373\u53ef\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(i.b)("h3",{id:"91221-\u521b\u5efa\u89c6\u56fe-sql"},"9.12.2.1 \u521b\u5efa\u89c6\u56fe ",Object(i.b)("inlineCode",{parentName:"h3"},"SQL")),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-sql"}),"CREATE VIEW V_Person AS\nSELECT Id,Name,Age,Address FROM person\n")),Object(i.b)("h3",{id:"91222-\u89c6\u56fe\u6a21\u578b"},"9.12.2.2 \u89c6\u56fe\u6a21\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,10}","{5,10}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class V_Person : EntityNotKey\n {\n /// \n /// \u914d\u7f6e\u89c6\u56fe\u540d\n /// \n public V_Person() : base("V_Person")\n {\n }\n\n /// \n /// \u4e3b\u952eId\n /// \n public int Id { get; set; }\n\n /// \n /// \u59d3\u540d\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u89c6\u56fe\u540d\u79f0")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u89c6\u56fe\u5b9e\u4f53\u53ea\u9700\u8981\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"EntityNotKey")," \u57fa\u7c7b\u5e76\u7f16\u5199\u65e0\u53c2\u6784\u9020\u51fd\u6570\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},'base("\u89c6\u56fe\u540d\u79f0")')," \u5373\u53ef\u3002"))),Object(i.b)("h2",{id:"9123-\u89c6\u56fe\u4f7f\u7528"},"9.12.3 \u89c6\u56fe\u4f7f\u7528"),Object(i.b)("p",null,"\u89c6\u56fe\u9664\u4e86\u4e0d\u80fd\u64cd\u4f5c\uff08\u5199\uff09\u4ee5\u5916\uff0c\u5176\u4ed6\u64cd\u4f5c\u548c\u8868\u64cd\u4f5c\u65e0\u5f02\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var vEntities = v_repository.Where(u => u.Id >10).ToList();\n")),Object(i.b)("h2",{id:"9124-\u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f-"},"9.12.4 \u89c6\u56fe\u6700\u4f73\u8bfb\u53d6\u65b9\u5f0f \u2714"),Object(i.b)("p",null,"\u7531\u4e8e\u89c6\u56fe\u662f\u865a\u62df\u8868\uff0c\u4e0d\u5e94\u8be5\u5bf9\u5176\u8fdb\u884c\u5199\u64cd\u4f5c\uff0c\u6240\u4ee5\u5e94\u8be5\u91c7\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"\u53ea\u8bfb\u4ed3\u50a8\u521d\u59cb\u5316\u89c6\u56fe"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{11,13,16}","{11,13,16}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Furion.Application.Persons\n{\n public class FurionService : IDynamicApiController\n {\n private readonly IReadableRepository _readableRepository;\n\n public FurionService(IRepository repository)\n {\n // \u521d\u59cb\u5316\u53ea\u8bfb\u4ed3\u50a8\n _readableRepository = repository.Constraint>();\n }\n\n /// \n /// \u8bfb\u53d6\u89c6\u56fe\n /// \n /// \n public async Task> GetVPerson()\n {\n var list = await _readableRepository.AsAsyncEnumerable();\n return list;\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},".Constraint")," \u65b9\u6cd5\u53ef\u4ee5\u5c06\u4ed3\u50a8\u7ea6\u675f\u4e3a\u7279\u5b9a\u4ed3\u50a8\uff0c\u5982\u53ea\u8bfb\u4ed3\u50a8\uff0c\u53ef\u8bfb\u53ef\u5199\u4ed3\u50a8\uff0c\u53ea\u65b0\u589e\u4ed3\u50a8\u7b49\u3002"))),Object(i.b)("h2",{id:"9125-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.12.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return c}));var r=t(21),a=t(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(r)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+c:c}(n,e,t,r)}}function c(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},195:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return a}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return m}));var r=t(0),a=t.n(r);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function o(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var b=a.a.createContext({}),l=function(e){var n=a.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},u=function(e){var n=l(e.components);return a.a.createElement(b.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},p=a.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),u=l(t),p=r,m=u["".concat(c,".").concat(p)]||u[p]||d[p]||i;return t?a.a.createElement(m,o(o({ref:n},b),{},{components:t})):a.a.createElement(m,o({ref:n},b))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var i=t.length,c=new Array(i);c[0]=p;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o.mdxType="string"==typeof e?e:r,c[1]=o;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/418ad2fe.7a136031.js b/docs/418ad2fe.d1f63967.js similarity index 94% rename from docs/418ad2fe.7a136031.js rename to docs/418ad2fe.d1f63967.js index c5783d31ad3..e8f93e8dbe0 100644 --- a/docs/418ad2fe.7a136031.js +++ b/docs/418ad2fe.d1f63967.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{104:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return l})),r.d(t,"metadata",(function(){return b})),r.d(t,"toc",(function(){return i})),r.d(t,"default",(function(){return s}));var n=r(3),a=r(7),o=(r(0),r(192)),c=r(193),l={id:"db",title:"2. Db \u9759\u6001\u7c7b",sidebar_label:"2. Db \u9759\u6001\u7c7b"},b={unversionedId:"global/db",id:"global/db",isDocsHomePage:!1,title:"2. Db \u9759\u6001\u7c7b",description:"2.1 \u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8",source:"@site/docs\\global\\db.mdx",slug:"/global/db",permalink:"/docs/global/db",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/db.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2. Db \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"1. App \u9759\u6001\u7c7b",permalink:"/docs/global/app"},next:{title:"3. DataValidator \u9759\u6001\u7c7b",permalink:"/docs/global/datavalidator"}},i=[{value:"2.1 \u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8",id:"21-\u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8",children:[]},{value:"2.2 \u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8",id:"22-\u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8",children:[]},{value:"2.3 \u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8",id:"23-\u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8",children:[]},{value:"2.4 \u83b7\u53d6 Sql \u4ed3\u50a8",id:"24-\u83b7\u53d6-sql-\u4ed3\u50a8",children:[]},{value:"2.5 \u83b7\u53d6 Sql \u5b9a\u4f4d\u5668\u4ed3\u50a8",id:"25-\u83b7\u53d6-sql-\u5b9a\u4f4d\u5668\u4ed3\u50a8",children:[]},{value:"2.6 \u83b7\u53d6 Sql \u4ee3\u7406\u5bf9\u8c61",id:"26-\u83b7\u53d6-sql-\u4ee3\u7406\u5bf9\u8c61",children:[]},{value:"2.7 \u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"27-\u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"2.7 \u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"27-\u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"2.8 \u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"28-\u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"2.9 \u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"29-\u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]}],u={toc:i};function s(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)(c.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"21-\u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8"},"2.1 \u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var repository = Db.GetRepository();\n")),Object(o.b)("h2",{id:"22-\u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8"},"2.2 \u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var entityRepository = Db.GetRepository();\n")),Object(o.b)("h2",{id:"23-\u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8"},"2.3 \u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var locatorRepository = Db.GetRepository();\n")),Object(o.b)("h2",{id:"24-\u83b7\u53d6-sql-\u4ed3\u50a8"},"2.4 \u83b7\u53d6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var sqlRepository = Db.GetSqlRepository();\n")),Object(o.b)("h2",{id:"25-\u83b7\u53d6-sql-\u5b9a\u4f4d\u5668\u4ed3\u50a8"},"2.5 \u83b7\u53d6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Sql")," \u5b9a\u4f4d\u5668\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var sqlLocatorRepository = Db.GetSqlRepository();\n")),Object(o.b)("h2",{id:"26-\u83b7\u53d6-sql-\u4ee3\u7406\u5bf9\u8c61"},"2.6 \u83b7\u53d6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ee3\u7406\u5bf9\u8c61"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var sqlProxy= Db.GetSqlProxy();\n")),Object(o.b)("h2",{id:"27-\u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.7 \u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var dbContext = Db.GetDbContext();\n")),Object(o.b)("h2",{id:"27-\u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.7 \u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var locatorDbContext = Db.GetDbContext();\nvar locatorDbContext2 = Db.GetDbContext(typeof(TDbContextLocator));\n")),Object(o.b)("h2",{id:"28-\u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.8 \u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var dbContext = Db.GetNewDbContext();\n")),Object(o.b)("h2",{id:"29-\u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.9 \u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var locatorDbContext = Db.GetNewDbContext();\nvar locatorDbContext2 = Db.GetNewDbContext(typeof(TDbContextLocator));\n")))}s.isMDXComponent=!0},190:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return c}));var n=r(21),a=r(191);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:o=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(a.b)(r))return r;if(n)return t+r;const c=r.startsWith(t)?r:t+r.replace(/^\//,"");return o?e+c:c}(t,e,r,n)}}function c(e,t={}){const{withBaseUrl:r}=o();return r(e,t)}},191:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return a}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return O}));var n=r(0),a=r.n(n);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var i=a.a.createContext({}),u=function(e){var t=a.a.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},s=function(e){var t=u(e.components);return a.a.createElement(i.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,c=e.parentName,i=b(e,["components","mdxType","originalType","parentName"]),s=u(r),d=n,O=s["".concat(c,".").concat(d)]||s[d]||p[d]||o;return r?a.a.createElement(O,l(l({ref:t},i),{},{components:r})):a.a.createElement(O,l({ref:t},i))}));function O(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,c=new Array(o);c[0]=d;var l={};for(var b in t)hasOwnProperty.call(t,b)&&(l[b]=t[b]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var i=2;it(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{105:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return l})),r.d(t,"metadata",(function(){return b})),r.d(t,"toc",(function(){return i})),r.d(t,"default",(function(){return s}));var n=r(3),a=r(7),o=(r(0),r(196)),c=r(197),l={id:"db",title:"2. Db \u9759\u6001\u7c7b",sidebar_label:"2. Db \u9759\u6001\u7c7b"},b={unversionedId:"global/db",id:"global/db",isDocsHomePage:!1,title:"2. Db \u9759\u6001\u7c7b",description:"2.1 \u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8",source:"@site/docs\\global\\db.mdx",slug:"/global/db",permalink:"/docs/global/db",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/db.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2. Db \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"1. App \u9759\u6001\u7c7b",permalink:"/docs/global/app"},next:{title:"3. DataValidator \u9759\u6001\u7c7b",permalink:"/docs/global/datavalidator"}},i=[{value:"2.1 \u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8",id:"21-\u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8",children:[]},{value:"2.2 \u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8",id:"22-\u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8",children:[]},{value:"2.3 \u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8",id:"23-\u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8",children:[]},{value:"2.4 \u83b7\u53d6 Sql \u4ed3\u50a8",id:"24-\u83b7\u53d6-sql-\u4ed3\u50a8",children:[]},{value:"2.5 \u83b7\u53d6 Sql \u5b9a\u4f4d\u5668\u4ed3\u50a8",id:"25-\u83b7\u53d6-sql-\u5b9a\u4f4d\u5668\u4ed3\u50a8",children:[]},{value:"2.6 \u83b7\u53d6 Sql \u4ee3\u7406\u5bf9\u8c61",id:"26-\u83b7\u53d6-sql-\u4ee3\u7406\u5bf9\u8c61",children:[]},{value:"2.7 \u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"27-\u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"2.7 \u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"27-\u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"2.8 \u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"28-\u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"2.9 \u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"29-\u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]}],u={toc:i};function s(e){var t=e.components,r=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)(c.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"21-\u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8"},"2.1 \u83b7\u53d6\u975e\u6cdb\u578b\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var repository = Db.GetRepository();\n")),Object(o.b)("h2",{id:"22-\u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8"},"2.2 \u83b7\u53d6\u6cdb\u578b\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var entityRepository = Db.GetRepository();\n")),Object(o.b)("h2",{id:"23-\u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8"},"2.3 \u83b7\u53d6\u5e26\u5b9a\u4f4d\u5668\u6cdb\u578b\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var locatorRepository = Db.GetRepository();\n")),Object(o.b)("h2",{id:"24-\u83b7\u53d6-sql-\u4ed3\u50a8"},"2.4 \u83b7\u53d6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var sqlRepository = Db.GetSqlRepository();\n")),Object(o.b)("h2",{id:"25-\u83b7\u53d6-sql-\u5b9a\u4f4d\u5668\u4ed3\u50a8"},"2.5 \u83b7\u53d6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Sql")," \u5b9a\u4f4d\u5668\u4ed3\u50a8"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var sqlLocatorRepository = Db.GetSqlRepository();\n")),Object(o.b)("h2",{id:"26-\u83b7\u53d6-sql-\u4ee3\u7406\u5bf9\u8c61"},"2.6 \u83b7\u53d6 ",Object(o.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ee3\u7406\u5bf9\u8c61"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var sqlProxy= Db.GetSqlProxy();\n")),Object(o.b)("h2",{id:"27-\u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.7 \u83b7\u53d6\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var dbContext = Db.GetDbContext();\n")),Object(o.b)("h2",{id:"27-\u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.7 \u83b7\u53d6\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var locatorDbContext = Db.GetDbContext();\nvar locatorDbContext2 = Db.GetDbContext(typeof(TDbContextLocator));\n")),Object(o.b)("h2",{id:"28-\u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.8 \u521b\u5efa\u65b0\u7684\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var dbContext = Db.GetNewDbContext();\n")),Object(o.b)("h2",{id:"29-\u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"2.9 \u521b\u5efa\u65b0\u7684\u5b9a\u4f4d\u5668\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var locatorDbContext = Db.GetNewDbContext();\nvar locatorDbContext2 = Db.GetNewDbContext(typeof(TDbContextLocator));\n")))}s.isMDXComponent=!0},194:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return c}));var n=r(21),a=r(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:o=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(a.b)(r))return r;if(n)return t+r;const c=r.startsWith(t)?r:t+r.replace(/^\//,"");return o?e+c:c}(t,e,r,n)}}function c(e,t={}){const{withBaseUrl:r}=o();return r(e,t)}},195:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return a}))},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return O}));var n=r(0),a=r.n(n);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var i=a.a.createContext({}),u=function(e){var t=a.a.useContext(i),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},s=function(e){var t=u(e.components);return a.a.createElement(i.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,c=e.parentName,i=b(e,["components","mdxType","originalType","parentName"]),s=u(r),d=n,O=s["".concat(c,".").concat(d)]||s[d]||p[d]||o;return r?a.a.createElement(O,l(l({ref:t},i),{},{components:r})):a.a.createElement(O,l({ref:t},i))}));function O(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,c=new Array(o);c[0]=d;var l={};for(var b in t)hasOwnProperty.call(t,b)&&(l[b]=t[b]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var i=2;it(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/4930ce4d.a91ce270.js b/docs/4930ce4d.4acb0b69.js similarity index 96% rename from docs/4930ce4d.a91ce270.js rename to docs/4930ce4d.4acb0b69.js index af718da238d..247a0400450 100644 --- a/docs/4930ce4d.a91ce270.js +++ b/docs/4930ce4d.4acb0b69.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{105:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),i=(n(0),n(192)),o=n(193),c={id:"dbcontext-filter",title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",sidebar_label:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668"},s={unversionedId:"dbcontext-filter",id:"dbcontext-filter",isDocsHomePage:!1,title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",description:"9.23.1 \u67e5\u8be2\u7b5b\u9009\u5668",source:"@site/docs\\dbcontext-filter.mdx",slug:"/dbcontext-filter",permalink:"/docs/dbcontext-filter",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-filter.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",sidebar:"docs",previous:{title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",permalink:"/docs/dbcontext-audit"},next:{title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",permalink:"/docs/dbcontext-Interceptor"}},l=[{value:"9.23.1 \u67e5\u8be2\u7b5b\u9009\u5668",id:"9231-\u67e5\u8be2\u7b5b\u9009\u5668",children:[]},{value:"9.23.2 \u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e",id:"9232-\u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e",children:[{value:"9.23.2.1 \u5355\u8868\u7b5b\u9009\u5668",id:"92321-\u5355\u8868\u7b5b\u9009\u5668",children:[]},{value:"9.23.2.2 \u5168\u5c40\u7b5b\u9009\u5668",id:"92322-\u5168\u5c40\u7b5b\u9009\u5668",children:[]}]},{value:"9.23.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9233-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:l};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9231-\u67e5\u8be2\u7b5b\u9009\u5668"},"9.23.1 \u67e5\u8be2\u7b5b\u9009\u5668"),Object(i.b)("p",null,"\u901a\u5e38\uff0c\u6211\u4eec\u7cfb\u7edf\u4e2d\u6709\u4e00\u4e9b\u7ef4\u62a4\u5b57\u6bb5\uff0c\u5982 ",Object(i.b)("inlineCode",{parentName:"p"},"IsDeleted")," \u5b57\u6bb5\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u7528\u6765\u6807\u8bc6\u7528\u6237\u5df2\u7ecf\u5220\u9664\u7684\u6570\u636e\uff0c\u90a3\u4e48\u6211\u4eec\u9700\u8981\u6bcf\u6b21\u67e5\u8be2\u6570\u636e\u7684\u65f6\u5019\u5e26\u4e0a\u8fd9\u4e2a\u5b57\u6bb5\uff0c\u907f\u514d\u67e5\u8be2\u51fa\u4e0d\u8be5\u51fa\u73b0\u7684\u6570\u636e\u3002"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668\uff0c\u80fd\u591f\u5e94\u7528\u5230\u6bcf\u4e00\u6b21\u67e5\u8be2\u4e2d\u3002"),Object(i.b)("h2",{id:"9232-\u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e"},"9.23.2 \u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e"),Object(i.b)("h3",{id:"92321-\u5355\u8868\u7b5b\u9009\u5668"},"9.23.2.1 \u5355\u8868\u7b5b\u9009\u5668"),Object(i.b)("p",null,"\u5355\u8868\u7b5b\u9009\u5668\u5c31\u662f\u53ea\u9488\u5bf9\u7279\u5b9a\u5b9e\u4f53\u8fdb\u884c\u7b5b\u9009\u64cd\u4f5c\uff0c\u4f7f\u7528\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"IEntityTypeBuilder")," \u63a5\u53e3\u5e76\u5b9e\u73b0\u5373\u53ef\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,24}","{8,24}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.Core\n{\n public class Person : Entity, IEntityTypeBuilder\n {\n public Person()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n public string Name { get; set; }\n\n public int Age { get; set; }\n\n public string Address { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasQueryFilter(u => !u.IsDeleted);\n }\n }\n}\n")),Object(i.b)("h3",{id:"92322-\u5168\u5c40\u7b5b\u9009\u5668"},"9.23.2.2 \u5168\u5c40\u7b5b\u9009\u5668"),Object(i.b)("p",null,"\u5168\u5c40\u7b5b\u9009\u5668\u53ef\u4ee5\u914d\u7f6e\u6240\u6709\u5b9e\u4f53\u5e94\u7528\u7b5b\u9009\u5668\u4e2d\uff0c\u65e0\u9700\u4e00\u4e2a\u4e00\u4e2a\u53bb\u914d\u7f6e\u3002\u4f7f\u7528\u65b9\u6cd5\u7a0d\u5fae\u6709\u4e9b\u590d\u6742\uff0c\u9700\u8981\u52a8\u6001\u6784\u5efa ",Object(i.b)("inlineCode",{parentName:"p"},"Lambda")," \u8868\u8fbe\u5f0f\u3002"),Object(i.b)("p",null,"\u5b9e\u73b0\u5168\u5c40\u7b5b\u9009\u5668\u4f9d\u8d56\u4e8e ",Object(i.b)("inlineCode",{parentName:"p"},"IModelBuilderFilter")," \u63a5\u53e3\uff0c\u8be5\u63a5\u53e3\u63d0\u4f9b\u4e24\u4e2a\u65b9\u6cd5\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OnCreating"),"\uff1a\u5b9e\u4f53\u6784\u5efa\u4e4b\u524d"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OnCreated"),"\uff1a\u5b9e\u4f53\u6784\u5efa\u4e4b\u540e")),Object(i.b)("p",null,"\u901a\u8fc7\u5b9e\u73b0\u8fd9\u4e24\u4e2a\u65b9\u6cd5\u5373\u53ef\u914d\u7f6e\u5168\u5c40\u8fc7\u6ee4\u5668\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{10,18-19,21,24}","{10,18-19,21,24}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Linq.Expressions;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public void OnCreated(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n var expression = BuilderIsDeleteLambdaExpression(entityBuilder);\n if (expression == null) return;\n\n entityBuilder.HasQueryFilter(expression);\n }\n\n public void OnCreating(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n }\n\n /// \n /// \u6784\u5efa u => EF.Property(u, "IsDeleted") == false \u8868\u8fbe\u5f0f\n /// \n /// \n /// \n private LambdaExpression BuilderIsDeleteLambdaExpression(EntityTypeBuilder entityBuilder)\n {\n // \u83b7\u53d6\u5b9e\u4f53\u6784\u5efa\u5668\u5143\u6570\u636e\n var metadata = entityBuilder.Metadata;\n if (metadata.FindProperty(nameof(Entity.IsDeleted)) == null) return default;\n\n // \u521b\u5efa\u8868\u8fbe\u5f0f\u5143\u7d20\n var parameter = Expression.Parameter(metadata.ClrType, "u");\n var properyName = Expression.Constant(nameof(Entity.IsDeleted));\n var propertyValue = Expression.Constant(false);\n\n // \u6784\u5efa\u8868\u8fbe\u5f0f u => EF.Property(u, "IsDeleted") == false\n var expressionBody = Expression.Equal(Expression.Call(typeof(EF), nameof(EF.Property), new[] { typeof(bool) }, parameter, properyName), propertyValue);\n var expression = Expression.Lambda(expressionBody, parameter);\n return expression;\n }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u5efa\u8bae")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u5bf9\u52a8\u6001\u6784\u5efa ",Object(i.b)("inlineCode",{parentName:"p"},"LambdaExpression")," \u4e0d\u719f\u6089\u7684\u670b\u53cb\uff0c\u53ef\u4ee5\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"System.Linq.Dynamic.Core")," \u5305 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/zzzprojects/System.Linq.Dynamic.Core"}),"https://github.com/zzzprojects/System.Linq.Dynamic.Core")))),Object(i.b)("h2",{id:"9233-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.23.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(21),a=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=a.a.createContext({}),u=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,m=b["".concat(o,".").concat(d)]||b[d]||p[d]||i;return n?a.a.createElement(m,c(c({ref:t},l),{},{components:n})):a.a.createElement(m,c({ref:t},l))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{106:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),i=(n(0),n(196)),o=n(197),c={id:"dbcontext-filter",title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",sidebar_label:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668"},s={unversionedId:"dbcontext-filter",id:"dbcontext-filter",isDocsHomePage:!1,title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",description:"9.23.1 \u67e5\u8be2\u7b5b\u9009\u5668",source:"@site/docs\\dbcontext-filter.mdx",slug:"/dbcontext-filter",permalink:"/docs/dbcontext-filter",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-filter.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",sidebar:"docs",previous:{title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",permalink:"/docs/dbcontext-audit"},next:{title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",permalink:"/docs/dbcontext-Interceptor"}},l=[{value:"9.23.1 \u67e5\u8be2\u7b5b\u9009\u5668",id:"9231-\u67e5\u8be2\u7b5b\u9009\u5668",children:[]},{value:"9.23.2 \u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e",id:"9232-\u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e",children:[{value:"9.23.2.1 \u5355\u8868\u7b5b\u9009\u5668",id:"92321-\u5355\u8868\u7b5b\u9009\u5668",children:[]},{value:"9.23.2.2 \u5168\u5c40\u7b5b\u9009\u5668",id:"92322-\u5168\u5c40\u7b5b\u9009\u5668",children:[]}]},{value:"9.23.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9233-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:l};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9231-\u67e5\u8be2\u7b5b\u9009\u5668"},"9.23.1 \u67e5\u8be2\u7b5b\u9009\u5668"),Object(i.b)("p",null,"\u901a\u5e38\uff0c\u6211\u4eec\u7cfb\u7edf\u4e2d\u6709\u4e00\u4e9b\u7ef4\u62a4\u5b57\u6bb5\uff0c\u5982 ",Object(i.b)("inlineCode",{parentName:"p"},"IsDeleted")," \u5b57\u6bb5\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u7528\u6765\u6807\u8bc6\u7528\u6237\u5df2\u7ecf\u5220\u9664\u7684\u6570\u636e\uff0c\u90a3\u4e48\u6211\u4eec\u9700\u8981\u6bcf\u6b21\u67e5\u8be2\u6570\u636e\u7684\u65f6\u5019\u5e26\u4e0a\u8fd9\u4e2a\u5b57\u6bb5\uff0c\u907f\u514d\u67e5\u8be2\u51fa\u4e0d\u8be5\u51fa\u73b0\u7684\u6570\u636e\u3002"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668\uff0c\u80fd\u591f\u5e94\u7528\u5230\u6bcf\u4e00\u6b21\u67e5\u8be2\u4e2d\u3002"),Object(i.b)("h2",{id:"9232-\u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e"},"9.23.2 \u591a\u79cd\u7b5b\u9009\u5668\u914d\u7f6e"),Object(i.b)("h3",{id:"92321-\u5355\u8868\u7b5b\u9009\u5668"},"9.23.2.1 \u5355\u8868\u7b5b\u9009\u5668"),Object(i.b)("p",null,"\u5355\u8868\u7b5b\u9009\u5668\u5c31\u662f\u53ea\u9488\u5bf9\u7279\u5b9a\u5b9e\u4f53\u8fdb\u884c\u7b5b\u9009\u64cd\u4f5c\uff0c\u4f7f\u7528\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"IEntityTypeBuilder")," \u63a5\u53e3\u5e76\u5b9e\u73b0\u5373\u53ef\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,24}","{8,24}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.Core\n{\n public class Person : Entity, IEntityTypeBuilder\n {\n public Person()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n public string Name { get; set; }\n\n public int Age { get; set; }\n\n public string Address { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasQueryFilter(u => !u.IsDeleted);\n }\n }\n}\n")),Object(i.b)("h3",{id:"92322-\u5168\u5c40\u7b5b\u9009\u5668"},"9.23.2.2 \u5168\u5c40\u7b5b\u9009\u5668"),Object(i.b)("p",null,"\u5168\u5c40\u7b5b\u9009\u5668\u53ef\u4ee5\u914d\u7f6e\u6240\u6709\u5b9e\u4f53\u5e94\u7528\u7b5b\u9009\u5668\u4e2d\uff0c\u65e0\u9700\u4e00\u4e2a\u4e00\u4e2a\u53bb\u914d\u7f6e\u3002\u4f7f\u7528\u65b9\u6cd5\u7a0d\u5fae\u6709\u4e9b\u590d\u6742\uff0c\u9700\u8981\u52a8\u6001\u6784\u5efa ",Object(i.b)("inlineCode",{parentName:"p"},"Lambda")," \u8868\u8fbe\u5f0f\u3002"),Object(i.b)("p",null,"\u5b9e\u73b0\u5168\u5c40\u7b5b\u9009\u5668\u4f9d\u8d56\u4e8e ",Object(i.b)("inlineCode",{parentName:"p"},"IModelBuilderFilter")," \u63a5\u53e3\uff0c\u8be5\u63a5\u53e3\u63d0\u4f9b\u4e24\u4e2a\u65b9\u6cd5\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OnCreating"),"\uff1a\u5b9e\u4f53\u6784\u5efa\u4e4b\u524d"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OnCreated"),"\uff1a\u5b9e\u4f53\u6784\u5efa\u4e4b\u540e")),Object(i.b)("p",null,"\u901a\u8fc7\u5b9e\u73b0\u8fd9\u4e24\u4e2a\u65b9\u6cd5\u5373\u53ef\u914d\u7f6e\u5168\u5c40\u8fc7\u6ee4\u5668\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{10,18-19,21,24}","{10,18-19,21,24}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Linq.Expressions;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext, IModelBuilderFilter\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n public void OnCreated(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n var expression = BuilderIsDeleteLambdaExpression(entityBuilder);\n if (expression == null) return;\n\n entityBuilder.HasQueryFilter(expression);\n }\n\n public void OnCreating(ModelBuilder modelBuilder, EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n }\n\n /// \n /// \u6784\u5efa u => EF.Property(u, "IsDeleted") == false \u8868\u8fbe\u5f0f\n /// \n /// \n /// \n private LambdaExpression BuilderIsDeleteLambdaExpression(EntityTypeBuilder entityBuilder)\n {\n // \u83b7\u53d6\u5b9e\u4f53\u6784\u5efa\u5668\u5143\u6570\u636e\n var metadata = entityBuilder.Metadata;\n if (metadata.FindProperty(nameof(Entity.IsDeleted)) == null) return default;\n\n // \u521b\u5efa\u8868\u8fbe\u5f0f\u5143\u7d20\n var parameter = Expression.Parameter(metadata.ClrType, "u");\n var properyName = Expression.Constant(nameof(Entity.IsDeleted));\n var propertyValue = Expression.Constant(false);\n\n // \u6784\u5efa\u8868\u8fbe\u5f0f u => EF.Property(u, "IsDeleted") == false\n var expressionBody = Expression.Equal(Expression.Call(typeof(EF), nameof(EF.Property), new[] { typeof(bool) }, parameter, properyName), propertyValue);\n var expression = Expression.Lambda(expressionBody, parameter);\n return expression;\n }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u5efa\u8bae")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u5bf9\u52a8\u6001\u6784\u5efa ",Object(i.b)("inlineCode",{parentName:"p"},"LambdaExpression")," \u4e0d\u719f\u6089\u7684\u670b\u53cb\uff0c\u53ef\u4ee5\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"System.Linq.Dynamic.Core")," \u5305 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/zzzprojects/System.Linq.Dynamic.Core"}),"https://github.com/zzzprojects/System.Linq.Dynamic.Core")))),Object(i.b)("h2",{id:"9233-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.23.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(21),a=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=a.a.createContext({}),u=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,m=b["".concat(o,".").concat(d)]||b[d]||p[d]||i;return n?a.a.createElement(m,c(c({ref:t},l),{},{components:n})):a.a.createElement(m,c({ref:t},l))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=d;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/4bfcf3ee.db716419.js b/docs/4bfcf3ee.b74cb0cc.js similarity index 97% rename from docs/4bfcf3ee.db716419.js rename to docs/4bfcf3ee.b74cb0cc.js index 96326f4b4d7..1c5d4db376b 100644 --- a/docs/4bfcf3ee.db716419.js +++ b/docs/4bfcf3ee.b74cb0cc.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{106:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return u})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return d}));var a=t(3),r=t(7),i=(t(0),t(192)),s=(t(190),t(199)),o=t(200),c=t(193),l={id:"dbcontext-hight-query",title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",sidebar_label:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c"},u={unversionedId:"dbcontext-hight-query",id:"dbcontext-hight-query",isDocsHomePage:!1,title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",description:"9.11.1 \u5173\u8054\u6570\u636e\u6a21\u578b",source:"@site/docs\\dbcontext-high-query.mdx",slug:"/dbcontext-hight-query",permalink:"/docs/dbcontext-hight-query",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-high-query.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.10 \u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-query"},next:{title:"9.12 \u89c6\u56fe\u64cd\u4f5c",permalink:"/docs/dbcontext-view"}},b=[{value:"9.11.1 \u5173\u8054\u6570\u636e\u6a21\u578b",id:"9111-\u5173\u8054\u6570\u636e\u6a21\u578b",children:[]},{value:"9.11.2 \u4e00\u5bf9\u4e00\u67e5\u8be2",id:"9112-\u4e00\u5bf9\u4e00\u67e5\u8be2",children:[]},{value:"9.11.3 \u4e00\u5bf9\u591a\u67e5\u8be2",id:"9113-\u4e00\u5bf9\u591a\u67e5\u8be2",children:[]},{value:"9.11.4 \u591a\u5bf9\u591a\u67e5\u8be2",id:"9114-\u591a\u5bf9\u591a\u67e5\u8be2",children:[]},{value:"9.11.5 \u8054\u8868\u67e5\u8be2",id:"9115-\u8054\u8868\u67e5\u8be2",children:[{value:"9.11.5.1 \u5185\u8fde\u63a5 Inner Join",id:"91151-\u5185\u8fde\u63a5-inner-join",children:[]},{value:"9.11.5.2 \u5de6\u8fde\u63a5 Left Join",id:"91152-\u5de6\u8fde\u63a5-left-join",children:[]},{value:"9.11.5.3 \u53f3\u8fde\u63a5 Right Join",id:"91153-\u53f3\u8fde\u63a5-right-join",children:[]}]},{value:"9.11.6 \u5206\u7ec4\u67e5\u8be2",id:"9116-\u5206\u7ec4\u67e5\u8be2",children:[]},{value:"9.11.7 \u5408\u5e76\u7ed3\u679c\u96c6",id:"9117-\u5408\u5e76\u7ed3\u679c\u96c6",children:[]},{value:"9.11.8 \u67e5\u8be2\u6392\u5e8f",id:"9118-\u67e5\u8be2\u6392\u5e8f",children:[{value:"9.11.8.1 \u6b63\u5e8f",id:"91181-\u6b63\u5e8f",children:[]},{value:"9.11.8.2 \u5012\u5e8f",id:"91182-\u5012\u5e8f",children:[]},{value:"9.11.8.3 \u6df7\u5408\u5012\u5e8f",id:"91183-\u6df7\u5408\u5012\u5e8f",children:[]}]},{value:"9.11.9 \u9012\u5f52\u67e5\u8be2",id:"9119-\u9012\u5f52\u67e5\u8be2",children:[]},{value:"9.11.10 \u52a8\u6001 Sql \u67e5\u8be2",id:"91110-\u52a8\u6001-sql-\u67e5\u8be2",children:[{value:"9.11.10.1 \u52a8\u6001 Sql",id:"911101-\u52a8\u6001-sql",children:[]},{value:"9.11.10.2 \u52a8\u6001 Lambda",id:"911102-\u52a8\u6001-lambda",children:[]}]},{value:"9.11.11 \u65f6\u6001\u67e5\u8be2",id:"91111-\u65f6\u6001\u67e5\u8be2",children:[]},{value:"9.11.12 \u6027\u80fd\u4f18\u5316",id:"91112-\u6027\u80fd\u4f18\u5316",children:[]},{value:"9.11.13 \u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50",id:"91113-\u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50",children:[]},{value:"9.11.14 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"91114-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:b};function d(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},m,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9111-\u5173\u8054\u6570\u636e\u6a21\u578b"},"9.11.1 \u5173\u8054\u6570\u636e\u6a21\u578b"),Object(i.b)(s.a,{defaultValue:"person",values:[{label:"Person",value:"person"},{label:"PersonDetail",value:"person-detail"},{label:"Children",value:"children"},{label:"Post",value:"post"}],mdxType:"Tabs"},Object(i.b)(o.a,{value:"person",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{38,43,48}","{38,43,48}":!0}),"using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Core\n{\n public class Person : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Person()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u59d3\u540d\n /// \n [MaxLength(32)]\n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n\n /// \n /// \u4ece\u8868\n /// \n public PersonDetail PersonDetail { get; set; }\n\n /// \n /// \u4e00\u5bf9\u591a\n /// \n public ICollection Childrens { get; set; }\n\n /// \n /// \u591a\u5bf9\u591a\n /// \n public ICollection Posts { get; set; }\n }\n}\n"))),Object(i.b)(o.a,{value:"person-detail",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{25}","{25}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class PersonDetail : EntityBase\n {\n /// \n /// \u7535\u8bdd\u53f7\u7801\n /// \n public string PhoneNumber { get; set; }\n\n /// \n /// QQ \u53f7\u7801\n /// \n public string QQ { get; set; }\n\n /// \n /// \u5916\u952e\n /// \n public int PersonId { get; set; }\n\n /// \n /// \u4e3b\u8868\n /// \n public Person Person { get; set; }\n }\n}\n"))),Object(i.b)(o.a,{value:"children",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{35}","{35}":!0}),"using Furion.DatabaseAccessor;\nusing System;\n\nnamespace Furion.Core\n{\n public class Children : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Children()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u6027\u522b\n /// \n public Gender Gender { get; set; }\n\n /// \n /// \u5916\u952e\n /// \n public int PersonId { get; set; }\n\n /// \n /// \u4e3b\u8868\n /// \n public Person Person { get; set; }\n }\n}\n"))),Object(i.b)(o.a,{value:"post",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{26}","{26}":!0}),"using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Post : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Post()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// Person \u96c6\u5408\n /// \n public ICollection Persons { get; set; }\n }\n}\n")))),Object(i.b)("h2",{id:"9112-\u4e00\u5bf9\u4e00\u67e5\u8be2"},"9.11.2 \u4e00\u5bf9\u4e00\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar person = repository.Include(u => u.Detail);\n\n// \u793a\u4f8b\u4e8c\nvar person = repository.Include(u => u.Detail)\n .Include(u => u.Post);\n\n// \u793a\u4f8b\u4e09\nvar person = repository.Include(u => u.Detail)\n .ThenInclude(d => d.Review)\n .Include(u => u.Post);\n\n// \u793a\u4f8b\u56db\nvar person = repository.Include(u => u.Detail.Where(d => d.Id > 10).OrderBy(d => d.Name))\n .ThenInclude(d => d.Review)\n .Include(u => u.Post);\n\n// \u793a\u4f8b\u4e94\nvar person = repository.IncludeIf(!string.IsNullOrEmpty(keyword), u => u.Detail);\n\n// \u793a\u4f8b\u516d\nvar person = repository.IncludeIf(!string.IsNullOrEmpty(keyword), u => u.Detail)\n .IncludeIf(age > 18), u => u.Detail.Where(d => d.Id > 10).OrderBy(d => d.Name))\n .ThenInclude(d => d.Review)\n .Include(u => u.Post);\n")),Object(i.b)("h2",{id:"9113-\u4e00\u5bf9\u591a\u67e5\u8be2"},"9.11.3 \u4e00\u5bf9\u591a\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar person = repository.Include(u => u.Childrens);\n\n// \u53c2\u8003 \u4e00\u5bf9\u4e00 \u4f8b\u5b50\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u4e00")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u591a")," \u67e5\u8be2\u65b9\u6cd5\u4e00\u6837\uff0c\u552f\u4e00\u7684\u533a\u522b\u662f\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u591a")," \u91c7\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"ICollection")," \u5b9a\u4e49\u5c5e\u6027\u3002"))),Object(i.b)("h2",{id:"9114-\u591a\u5bf9\u591a\u67e5\u8be2"},"9.11.4 \u591a\u5bf9\u591a\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar person = repository.Include(u => u.Posts);\n\n// \u53c2\u8003 \u4e00\u5bf9\u4e00 \u4f8b\u5b50\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u4e00")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u591a\u5bf9\u591a")," \u67e5\u8be2\u65b9\u6cd5\u4e00\u6837\uff0c\u552f\u4e00\u7684\u533a\u522b\u662f\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"\u591a\u5bf9\u591a")," \u91c7\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"ICollection")," \u5b9a\u4e49\u5c5e\u6027\u3002"))),Object(i.b)("h2",{id:"9115-\u8054\u8868\u67e5\u8be2"},"9.11.5 \u8054\u8868\u67e5\u8be2"),Object(i.b)("h3",{id:"91151-\u5185\u8fde\u63a5-inner-join"},"9.11.5.1 \u5185\u8fde\u63a5 ",Object(i.b)("inlineCode",{parentName:"h3"},"Inner Join")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var query = from p in _personRepository.AsQueryable()\n join d in _personDetailRepository.AsQueryable() on p.Id equals d.PersonId\n select new PersonDto\n {\n PhoneNumber = p.PersonDetail.PhoneNumber,\n Address = p.Address,\n Age = p.Age,\n Name = p.Name,\n Id = p.Id,\n QQ = p.PersonDetail.QQ\n };\n")),Object(i.b)("h3",{id:"91152-\u5de6\u8fde\u63a5-left-join"},"9.11.5.2 \u5de6\u8fde\u63a5 ",Object(i.b)("inlineCode",{parentName:"h3"},"Left Join")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,3}","{2,3}":!0}),"var query = from p in _personRepository.AsQueryable()\n join d in _personDetailRepository.AsQueryable() on p.Id equals d.PersonId into results\n from d in results.DefaultIfEmpty()\n select new PersonDto\n {\n PhoneNumber = p.PersonDetail.PhoneNumber,\n Address = p.Address,\n Age = p.Age,\n Name = p.Name,\n Id = p.Id,\n QQ = p.PersonDetail.QQ\n };\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u793a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Left Join"))," \u548c ",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Inner Join"))," \u4e0d\u540c\u7684\u662f\uff0c",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Left Join"))," \u4f1a\u5148\u5c06\u7ed3\u679c ",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"into"))," \u5230\u65b0\u7684\u7ed3\u679c\u96c6\u7136\u540e\u518d\u67e5\u8be2\uff0c\u5e76\u8c03\u7528 ",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"DefaultIfEmpty()"))," \u65b9\u6cd5\u3002"))),Object(i.b)("h3",{id:"91153-\u53f3\u8fde\u63a5-right-join"},"9.11.5.3 \u53f3\u8fde\u63a5 ",Object(i.b)("inlineCode",{parentName:"h3"},"Right Join")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Right Join")," \u53ea\u9700\u8981\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"Left Join")," \u4e3b\u4ece\u8868\u4f4d\u7f6e\u66f4\u6362\u5373\u53ef\u3002"),Object(i.b)("h2",{id:"9116-\u5206\u7ec4\u67e5\u8be2"},"9.11.6 \u5206\u7ec4\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable().GroupBy(x => new { x.Column1, x.Column2 });\n\n// \u793a\u4f8b\u4e8c\nvar query = from student in repository.AsQueryable()\n group student by repository2.AsQueryable() into dateGroup\n select new ResultData()\n {\n Key = dateGroup.Key,\n Value = dateGroup.Count()\n };\n\n// \u793a\u4f8b\u4e09\nvar query = from a in repository.AsQueryable()\n join b in repository2.AsQueryable() on a.Id equals b.Aid\n join c in repository3.AsQueryable() on c.id equals b.Bid\n group emp by new { emp.Age, emp.Sex } into g\n select new {\n Peo = g.Key,\n Count = g.Count()\n };\n")),Object(i.b)("h2",{id:"9117-\u5408\u5e76\u7ed3\u679c\u96c6"},"9.11.7 \u5408\u5e76\u7ed3\u679c\u96c6"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var query = repository.AsQueryable(u => u.Id > 10)\n .Union(\n repository2.AsQueryable(u => u.Id <= 10)\n );\n")),Object(i.b)("h2",{id:"9118-\u67e5\u8be2\u6392\u5e8f"},"9.11.8 \u67e5\u8be2\u6392\u5e8f"),Object(i.b)("h3",{id:"91181-\u6b63\u5e8f"},"9.11.8.1 \u6b63\u5e8f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .OrderBy(u => u.Id);\n\n// \u793a\u4f8b\u4e8c\nvar query =repository.AsQueryable()\n .OrderBy(u => u.Id)\n .ThenBy(u => u.Name);\n")),Object(i.b)("h3",{id:"91182-\u5012\u5e8f"},"9.11.8.2 \u5012\u5e8f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .OrderByDescending(u => u.Id);\n\n// \u793a\u4f8b\u4e8c\nvar query =repository.AsQueryable()\n .OrderByDescending(u => u.Id)\n .ThenByDescending(u => u.Name);\n")),Object(i.b)("h3",{id:"91183-\u6df7\u5408\u5012\u5e8f"},"9.11.8.3 \u6df7\u5408\u5012\u5e8f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .OrderBy(u => u.Id)\n .OrderByDescending(u => u.Name)\n .ThenBy(u => u.Age);\n")),Object(i.b)("h2",{id:"9119-\u9012\u5f52\u67e5\u8be2"},"9.11.9 \u9012\u5f52\u67e5\u8be2"),Object(i.b)(s.a,{defaultValue:"city",values:[{label:"City",value:"city"},{label:"CityDto",value:"citydto"}],mdxType:"Tabs"},Object(i.b)(o.a,{value:"city",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12,36,41,49-55}","{12,36,41,49-55}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n /// \n /// \u57ce\u5e02\n /// \n public class City : Entity, IEntityTypeBuilder, IEntitySeedData\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public City()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u4e0a\u7ea7Id\n /// \n public int? ParentId { get; set; }\n\n /// \n /// \u4e0a\u7ea7\n /// \n public virtual City Parent { get; set; }\n\n /// \n /// \u5b50\u96c6\n /// \n public virtual ICollection Childrens { get; set; }\n\n /// \n /// \u914d\u7f6e\u5b9e\u4f53\u5173\u7cfb\n /// \n /// \n /// \n /// \n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder\n .HasMany(x => x.Childrens)\n .WithOne(x => x.Parent)\n .HasForeignKey(x => x.ParentId)\n .OnDelete(DeleteBehavior.ClientSetNull); // \u5fc5\u987b\u8bbe\u7f6e\u8fd9\u4e00\u884c\n }\n\n /// \n /// \u79cd\u5b50\u6570\u636e\n /// \n /// \n /// \n /// \n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new City { Id=1,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u4e2d\u56fd" },\n new City { Id=2,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u5e7f\u4e1c\u7701",ParentId=1 },\n new City { Id=3,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u4e2d\u5c71\u5e02",ParentId=2 },\n new City { Id=4,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u73e0\u6d77\u5e02",ParentId=2 },\n new City { Id=5,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u6d59\u6c5f\u7701",ParentId=1 },\n };\n }\n }\n}\n'))),Object(i.b)(o.a,{value:"citydto",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using System.Collections.Generic;\n\nnamespace Furion.Application.Persons\n{\n public class CityDto\n {\n /// \n /// \u9010\u6e10\n /// \n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u5b50\u96c6\n /// \n public ICollection Childrens { get; set; }\n }\n}\n")))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var cities = await repository.AsQueryable()\n .Include(u => u.Childrens)\n .Where(u => u.Id == 1)\n .ToListAsync();\n\nvar dtos = cities.Adapt>();\n")),Object(i.b)("h2",{id:"91110-\u52a8\u6001-sql-\u67e5\u8be2"},"9.11.10 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \u67e5\u8be2"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u9ed8\u8ba4\u4e0d\u652f\u6301 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \u67e5\u8be2\u529f\u80fd\uff0c\u4e0d\u8fc7\u53ef\u4ee5\u901a\u8fc7\u7b2c\u4e09\u65b9\u5b9e\u73b0\uff1a"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u9879\u76ee\u5c42\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"System.Linq.Dynamic.Core")," \u5305 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/zzzprojects/System.Linq.Dynamic.Core"}),"https://github.com/zzzprojects/System.Linq.Dynamic.Core")),Object(i.b)("h3",{id:"911101-\u52a8\u6001-sql"},"9.11.10.1 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"h3"},"Sql")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .Where("City == @0 and Orders.Count >= @1", "China", 10)\n .OrderBy("CompanyName")\n .Select("new(CompanyName as Name, Phone)");\n\n// \u793a\u4f8b\u4e8c\nvar list = repository.AsQueryable()\n .Where("Name.Contains(@0)","Furion")\n .ToList();\n\n// \u793a\u4f8b\u4e09\uff0c\u652f\u6301 ? \u8bed\u6cd5\nvar customers = repository.AsQueryable()\n .Include(c => c.Location)\n .Where(c => c.Location?.Name == "test") // \u6ce8\u610f Location?.Name\n .ToList();\n')),Object(i.b)("h3",{id:"911102-\u52a8\u6001-lambda"},"9.11.10.2 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"h3"},"Lambda")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar x = Expression.Parameter(typeof(int), "x");\nvar y = Expression.Parameter(typeof(int), "y");\nvar e = DynamicExpressionParser\n .ParseLambda(new ParameterExpression[] { x, y }, null, "(x + y) * 2");\n\n// \u793a\u4f8b\u4e8c\nvar e = DynamicExpressionParser.ParseLambda(\n typeof(Customer), typeof(bool),\n "City = @0 and Orders.Count >= @1",\n "London", 10);\n')),Object(i.b)("h2",{id:"91111-\u65f6\u6001\u67e5\u8be2"},"9.11.11 \u65f6\u6001\u67e5\u8be2"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u65f6\u6001\u67e5\u8be2\u529f\u80fd\uff0c\u53ef\u4ee5\u67e5\u8be2\u7279\u5b9a\u65f6\u95f4\u7684\u6570\u636e\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = rep.Entities\n .AsTemporalOf(DateTime.UtcNow.AddDays(-1))\n .Include(i=> i.Company)\n .FirstOrDefault(i => i.Name == "Furion");\n')),Object(i.b)("p",null,"\u53e6\u5916\u63d0\u4f9b\u4e86\u591a\u4e2a\u65f6\u6001\u67e5\u8be2\u65b9\u6cd5"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"AsTemporalAll()"),Object(i.b)("li",{parentName:"ul"},"AsTemporalAsOf(date)"),Object(i.b)("li",{parentName:"ul"},"AsTemporalFrom(startDate, endDate)"),Object(i.b)("li",{parentName:"ul"},"AsTemporalBetween(startDate, endDate)"),Object(i.b)("li",{parentName:"ul"},"AsTemporalContained(startDate, endDate)")),Object(i.b)("h2",{id:"91112-\u6027\u80fd\u4f18\u5316"},"9.11.12 \u6027\u80fd\u4f18\u5316"),Object(i.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"EF Core")," \u4f1a\u8ddf\u8e2a\u6240\u6709\u5b9e\u4f53\uff0c\u4e5f\u5c31\u662f\u4efb\u4f55\u6570\u636e\u6539\u53d8\u90fd\u4f1a\u5f15\u8d77\u6570\u636e\u68c0\u67e5\uff0c\u6240\u4ee5\u5982\u679c\u53ea\u505a\u67e5\u8be2\u64cd\u4f5c\uff0c\u5efa\u8bae\u5173\u95ed\u5b9e\u4f53\u8ddf\u8e2a\u529f\u80fd\u3002"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u9ad8\u6027\u80fd\u5b9e\u4f53\u96c6\u5408\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DetachedEntities"),"\uff1a\u8131\u8f68/\u4e0d\u8ffd\u8e2a\u5b9e\u4f53"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"AsQueryable()"),"\uff1a\u4e0d\u8ffd\u8e2a\u5b9e\u4f53"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Entities.AsNoTracking()"),"\uff1a\u624b\u52a8\u5173\u95ed\u5b9e\u4f53\u8ffd\u8e2a")),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"EF Core")," \u4e2d\uff0c\u590d\u6742\u67e5\u8be2\u603b\u662f\u4f1a\u751f\u6210\u4e00\u4e2a ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u4e5f\u5c31\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"AsSingleQuery()"),"\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"AsSplitQuery()")," \u5207\u5272\u6210\u591a\u4e2a\u67e5\u8be2\u3002"),Object(i.b)("h2",{id:"91113-\u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50"},"9.11.13 \u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Person : Entity, IEntityTypeBuilder\n {\n public string Name { get; set; }\n\n /// \n /// \u914d\u7f6e\u5b9e\u4f53\u5173\u7cfb\n /// \n /// \n /// \n /// \n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.ToSqlQuery(\n @"select * from dbo.person.2020-09-19\n union all\n select * from dbo.person.2020-09-20");\n }\n }\n}\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var posts = repository.Where(u => u.Id > 10).ToList();\n")),Object(i.b)("h2",{id:"91114-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.11.14 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return s}));var a=t(21),r=t(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const s=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+s:s}(n,e,t,a)}}function s(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return b})),t.d(n,"b",(function(){return p}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=r.a.createContext({}),u=function(e){var n=r.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},b=function(e){var n=u(e.components);return r.a.createElement(l.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},d=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),b=u(t),d=a,p=b["".concat(s,".").concat(d)]||b[d]||m[d]||i;return t?r.a.createElement(p,o(o({ref:n},l),{},{components:t})):r.a.createElement(p,o({ref:n},l))}));function p(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,s=new Array(i);s[0]=d;var o={};for(var c in n)hasOwnProperty.call(n,c)&&(o[c]=n[c]);o.originalType=e,o.mdxType="string"==typeof e?e:a,s[1]=o;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,n,t){"use strict";function a(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&j(e)}const N=e=>{j(e),null!=m&&y(m,e)},h=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(s.a)("tabs",{"tabs--block":t},d)},b.map(({value:e,label:n})=>r.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":O===e,className:Object(s.a)("tabs__item",c.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case u:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case l:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(h,e.target,e)},onFocus:()=>N(e),onClick:()=>{N(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===O)[0],{className:"margin-vert--md"}):r.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==O}))))}},200:function(e,n,t){"use strict";var a=t(3),r=t(0),i=t.n(r);n.a=function({children:e,hidden:n,className:t}){return i.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{107:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return u})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return d}));var a=t(3),r=t(7),i=(t(0),t(196)),s=(t(194),t(203)),o=t(204),c=t(197),l={id:"dbcontext-hight-query",title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",sidebar_label:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c"},u={unversionedId:"dbcontext-hight-query",id:"dbcontext-hight-query",isDocsHomePage:!1,title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",description:"9.11.1 \u5173\u8054\u6570\u636e\u6a21\u578b",source:"@site/docs\\dbcontext-high-query.mdx",slug:"/dbcontext-hight-query",permalink:"/docs/dbcontext-hight-query",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-high-query.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.10 \u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-query"},next:{title:"9.12 \u89c6\u56fe\u64cd\u4f5c",permalink:"/docs/dbcontext-view"}},b=[{value:"9.11.1 \u5173\u8054\u6570\u636e\u6a21\u578b",id:"9111-\u5173\u8054\u6570\u636e\u6a21\u578b",children:[]},{value:"9.11.2 \u4e00\u5bf9\u4e00\u67e5\u8be2",id:"9112-\u4e00\u5bf9\u4e00\u67e5\u8be2",children:[]},{value:"9.11.3 \u4e00\u5bf9\u591a\u67e5\u8be2",id:"9113-\u4e00\u5bf9\u591a\u67e5\u8be2",children:[]},{value:"9.11.4 \u591a\u5bf9\u591a\u67e5\u8be2",id:"9114-\u591a\u5bf9\u591a\u67e5\u8be2",children:[]},{value:"9.11.5 \u8054\u8868\u67e5\u8be2",id:"9115-\u8054\u8868\u67e5\u8be2",children:[{value:"9.11.5.1 \u5185\u8fde\u63a5 Inner Join",id:"91151-\u5185\u8fde\u63a5-inner-join",children:[]},{value:"9.11.5.2 \u5de6\u8fde\u63a5 Left Join",id:"91152-\u5de6\u8fde\u63a5-left-join",children:[]},{value:"9.11.5.3 \u53f3\u8fde\u63a5 Right Join",id:"91153-\u53f3\u8fde\u63a5-right-join",children:[]}]},{value:"9.11.6 \u5206\u7ec4\u67e5\u8be2",id:"9116-\u5206\u7ec4\u67e5\u8be2",children:[]},{value:"9.11.7 \u5408\u5e76\u7ed3\u679c\u96c6",id:"9117-\u5408\u5e76\u7ed3\u679c\u96c6",children:[]},{value:"9.11.8 \u67e5\u8be2\u6392\u5e8f",id:"9118-\u67e5\u8be2\u6392\u5e8f",children:[{value:"9.11.8.1 \u6b63\u5e8f",id:"91181-\u6b63\u5e8f",children:[]},{value:"9.11.8.2 \u5012\u5e8f",id:"91182-\u5012\u5e8f",children:[]},{value:"9.11.8.3 \u6df7\u5408\u5012\u5e8f",id:"91183-\u6df7\u5408\u5012\u5e8f",children:[]}]},{value:"9.11.9 \u9012\u5f52\u67e5\u8be2",id:"9119-\u9012\u5f52\u67e5\u8be2",children:[]},{value:"9.11.10 \u52a8\u6001 Sql \u67e5\u8be2",id:"91110-\u52a8\u6001-sql-\u67e5\u8be2",children:[{value:"9.11.10.1 \u52a8\u6001 Sql",id:"911101-\u52a8\u6001-sql",children:[]},{value:"9.11.10.2 \u52a8\u6001 Lambda",id:"911102-\u52a8\u6001-lambda",children:[]}]},{value:"9.11.11 \u65f6\u6001\u67e5\u8be2",id:"91111-\u65f6\u6001\u67e5\u8be2",children:[]},{value:"9.11.12 \u6027\u80fd\u4f18\u5316",id:"91112-\u6027\u80fd\u4f18\u5316",children:[]},{value:"9.11.13 \u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50",id:"91113-\u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50",children:[]},{value:"9.11.14 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"91114-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:b};function d(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},m,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9111-\u5173\u8054\u6570\u636e\u6a21\u578b"},"9.11.1 \u5173\u8054\u6570\u636e\u6a21\u578b"),Object(i.b)(s.a,{defaultValue:"person",values:[{label:"Person",value:"person"},{label:"PersonDetail",value:"person-detail"},{label:"Children",value:"children"},{label:"Post",value:"post"}],mdxType:"Tabs"},Object(i.b)(o.a,{value:"person",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{38,43,48}","{38,43,48}":!0}),"using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Core\n{\n public class Person : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Person()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u59d3\u540d\n /// \n [MaxLength(32)]\n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n\n /// \n /// \u4ece\u8868\n /// \n public PersonDetail PersonDetail { get; set; }\n\n /// \n /// \u4e00\u5bf9\u591a\n /// \n public ICollection Childrens { get; set; }\n\n /// \n /// \u591a\u5bf9\u591a\n /// \n public ICollection Posts { get; set; }\n }\n}\n"))),Object(i.b)(o.a,{value:"person-detail",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{25}","{25}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class PersonDetail : EntityBase\n {\n /// \n /// \u7535\u8bdd\u53f7\u7801\n /// \n public string PhoneNumber { get; set; }\n\n /// \n /// QQ \u53f7\u7801\n /// \n public string QQ { get; set; }\n\n /// \n /// \u5916\u952e\n /// \n public int PersonId { get; set; }\n\n /// \n /// \u4e3b\u8868\n /// \n public Person Person { get; set; }\n }\n}\n"))),Object(i.b)(o.a,{value:"children",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{35}","{35}":!0}),"using Furion.DatabaseAccessor;\nusing System;\n\nnamespace Furion.Core\n{\n public class Children : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Children()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u6027\u522b\n /// \n public Gender Gender { get; set; }\n\n /// \n /// \u5916\u952e\n /// \n public int PersonId { get; set; }\n\n /// \n /// \u4e3b\u8868\n /// \n public Person Person { get; set; }\n }\n}\n"))),Object(i.b)(o.a,{value:"post",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{26}","{26}":!0}),"using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Post : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Post()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// Person \u96c6\u5408\n /// \n public ICollection Persons { get; set; }\n }\n}\n")))),Object(i.b)("h2",{id:"9112-\u4e00\u5bf9\u4e00\u67e5\u8be2"},"9.11.2 \u4e00\u5bf9\u4e00\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar person = repository.Include(u => u.Detail);\n\n// \u793a\u4f8b\u4e8c\nvar person = repository.Include(u => u.Detail)\n .Include(u => u.Post);\n\n// \u793a\u4f8b\u4e09\nvar person = repository.Include(u => u.Detail)\n .ThenInclude(d => d.Review)\n .Include(u => u.Post);\n\n// \u793a\u4f8b\u56db\nvar person = repository.Include(u => u.Detail.Where(d => d.Id > 10).OrderBy(d => d.Name))\n .ThenInclude(d => d.Review)\n .Include(u => u.Post);\n\n// \u793a\u4f8b\u4e94\nvar person = repository.IncludeIf(!string.IsNullOrEmpty(keyword), u => u.Detail);\n\n// \u793a\u4f8b\u516d\nvar person = repository.IncludeIf(!string.IsNullOrEmpty(keyword), u => u.Detail)\n .IncludeIf(age > 18), u => u.Detail.Where(d => d.Id > 10).OrderBy(d => d.Name))\n .ThenInclude(d => d.Review)\n .Include(u => u.Post);\n")),Object(i.b)("h2",{id:"9113-\u4e00\u5bf9\u591a\u67e5\u8be2"},"9.11.3 \u4e00\u5bf9\u591a\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar person = repository.Include(u => u.Childrens);\n\n// \u53c2\u8003 \u4e00\u5bf9\u4e00 \u4f8b\u5b50\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u4e00")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u591a")," \u67e5\u8be2\u65b9\u6cd5\u4e00\u6837\uff0c\u552f\u4e00\u7684\u533a\u522b\u662f\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u591a")," \u91c7\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"ICollection")," \u5b9a\u4e49\u5c5e\u6027\u3002"))),Object(i.b)("h2",{id:"9114-\u591a\u5bf9\u591a\u67e5\u8be2"},"9.11.4 \u591a\u5bf9\u591a\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar person = repository.Include(u => u.Posts);\n\n// \u53c2\u8003 \u4e00\u5bf9\u4e00 \u4f8b\u5b50\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"\u4e00\u5bf9\u4e00")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u591a\u5bf9\u591a")," \u67e5\u8be2\u65b9\u6cd5\u4e00\u6837\uff0c\u552f\u4e00\u7684\u533a\u522b\u662f\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"\u591a\u5bf9\u591a")," \u91c7\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"ICollection")," \u5b9a\u4e49\u5c5e\u6027\u3002"))),Object(i.b)("h2",{id:"9115-\u8054\u8868\u67e5\u8be2"},"9.11.5 \u8054\u8868\u67e5\u8be2"),Object(i.b)("h3",{id:"91151-\u5185\u8fde\u63a5-inner-join"},"9.11.5.1 \u5185\u8fde\u63a5 ",Object(i.b)("inlineCode",{parentName:"h3"},"Inner Join")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var query = from p in _personRepository.AsQueryable()\n join d in _personDetailRepository.AsQueryable() on p.Id equals d.PersonId\n select new PersonDto\n {\n PhoneNumber = p.PersonDetail.PhoneNumber,\n Address = p.Address,\n Age = p.Age,\n Name = p.Name,\n Id = p.Id,\n QQ = p.PersonDetail.QQ\n };\n")),Object(i.b)("h3",{id:"91152-\u5de6\u8fde\u63a5-left-join"},"9.11.5.2 \u5de6\u8fde\u63a5 ",Object(i.b)("inlineCode",{parentName:"h3"},"Left Join")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,3}","{2,3}":!0}),"var query = from p in _personRepository.AsQueryable()\n join d in _personDetailRepository.AsQueryable() on p.Id equals d.PersonId into results\n from d in results.DefaultIfEmpty()\n select new PersonDto\n {\n PhoneNumber = p.PersonDetail.PhoneNumber,\n Address = p.Address,\n Age = p.Age,\n Name = p.Name,\n Id = p.Id,\n QQ = p.PersonDetail.QQ\n };\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u793a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Left Join"))," \u548c ",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Inner Join"))," \u4e0d\u540c\u7684\u662f\uff0c",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"Left Join"))," \u4f1a\u5148\u5c06\u7ed3\u679c ",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"into"))," \u5230\u65b0\u7684\u7ed3\u679c\u96c6\u7136\u540e\u518d\u67e5\u8be2\uff0c\u5e76\u8c03\u7528 ",Object(i.b)("strong",{parentName:"p"},Object(i.b)("inlineCode",{parentName:"strong"},"DefaultIfEmpty()"))," \u65b9\u6cd5\u3002"))),Object(i.b)("h3",{id:"91153-\u53f3\u8fde\u63a5-right-join"},"9.11.5.3 \u53f3\u8fde\u63a5 ",Object(i.b)("inlineCode",{parentName:"h3"},"Right Join")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Right Join")," \u53ea\u9700\u8981\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"Left Join")," \u4e3b\u4ece\u8868\u4f4d\u7f6e\u66f4\u6362\u5373\u53ef\u3002"),Object(i.b)("h2",{id:"9116-\u5206\u7ec4\u67e5\u8be2"},"9.11.6 \u5206\u7ec4\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable().GroupBy(x => new { x.Column1, x.Column2 });\n\n// \u793a\u4f8b\u4e8c\nvar query = from student in repository.AsQueryable()\n group student by repository2.AsQueryable() into dateGroup\n select new ResultData()\n {\n Key = dateGroup.Key,\n Value = dateGroup.Count()\n };\n\n// \u793a\u4f8b\u4e09\nvar query = from a in repository.AsQueryable()\n join b in repository2.AsQueryable() on a.Id equals b.Aid\n join c in repository3.AsQueryable() on c.id equals b.Bid\n group emp by new { emp.Age, emp.Sex } into g\n select new {\n Peo = g.Key,\n Count = g.Count()\n };\n")),Object(i.b)("h2",{id:"9117-\u5408\u5e76\u7ed3\u679c\u96c6"},"9.11.7 \u5408\u5e76\u7ed3\u679c\u96c6"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var query = repository.AsQueryable(u => u.Id > 10)\n .Union(\n repository2.AsQueryable(u => u.Id <= 10)\n );\n")),Object(i.b)("h2",{id:"9118-\u67e5\u8be2\u6392\u5e8f"},"9.11.8 \u67e5\u8be2\u6392\u5e8f"),Object(i.b)("h3",{id:"91181-\u6b63\u5e8f"},"9.11.8.1 \u6b63\u5e8f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .OrderBy(u => u.Id);\n\n// \u793a\u4f8b\u4e8c\nvar query =repository.AsQueryable()\n .OrderBy(u => u.Id)\n .ThenBy(u => u.Name);\n")),Object(i.b)("h3",{id:"91182-\u5012\u5e8f"},"9.11.8.2 \u5012\u5e8f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .OrderByDescending(u => u.Id);\n\n// \u793a\u4f8b\u4e8c\nvar query =repository.AsQueryable()\n .OrderByDescending(u => u.Id)\n .ThenByDescending(u => u.Name);\n")),Object(i.b)("h3",{id:"91183-\u6df7\u5408\u5012\u5e8f"},"9.11.8.3 \u6df7\u5408\u5012\u5e8f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .OrderBy(u => u.Id)\n .OrderByDescending(u => u.Name)\n .ThenBy(u => u.Age);\n")),Object(i.b)("h2",{id:"9119-\u9012\u5f52\u67e5\u8be2"},"9.11.9 \u9012\u5f52\u67e5\u8be2"),Object(i.b)(s.a,{defaultValue:"city",values:[{label:"City",value:"city"},{label:"CityDto",value:"citydto"}],mdxType:"Tabs"},Object(i.b)(o.a,{value:"city",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12,36,41,49-55}","{12,36,41,49-55}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n /// \n /// \u57ce\u5e02\n /// \n public class City : Entity, IEntityTypeBuilder, IEntitySeedData\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public City()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u4e0a\u7ea7Id\n /// \n public int? ParentId { get; set; }\n\n /// \n /// \u4e0a\u7ea7\n /// \n public virtual City Parent { get; set; }\n\n /// \n /// \u5b50\u96c6\n /// \n public virtual ICollection Childrens { get; set; }\n\n /// \n /// \u914d\u7f6e\u5b9e\u4f53\u5173\u7cfb\n /// \n /// \n /// \n /// \n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder\n .HasMany(x => x.Childrens)\n .WithOne(x => x.Parent)\n .HasForeignKey(x => x.ParentId)\n .OnDelete(DeleteBehavior.ClientSetNull); // \u5fc5\u987b\u8bbe\u7f6e\u8fd9\u4e00\u884c\n }\n\n /// \n /// \u79cd\u5b50\u6570\u636e\n /// \n /// \n /// \n /// \n public IEnumerable HasData(DbContext dbContext, Type dbContextLocator)\n {\n return new List\n {\n new City { Id=1,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u4e2d\u56fd" },\n new City { Id=2,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u5e7f\u4e1c\u7701",ParentId=1 },\n new City { Id=3,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u4e2d\u5c71\u5e02",ParentId=2 },\n new City { Id=4,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u73e0\u6d77\u5e02",ParentId=2 },\n new City { Id=5,CreatedTime =DateTime.Parse("2020-08-20 15:30:20"),IsDeleted=false,Name="\u6d59\u6c5f\u7701",ParentId=1 },\n };\n }\n }\n}\n'))),Object(i.b)(o.a,{value:"citydto",mdxType:"TabItem"},Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using System.Collections.Generic;\n\nnamespace Furion.Application.Persons\n{\n public class CityDto\n {\n /// \n /// \u9010\u6e10\n /// \n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u5b50\u96c6\n /// \n public ICollection Childrens { get; set; }\n }\n}\n")))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var cities = await repository.AsQueryable()\n .Include(u => u.Childrens)\n .Where(u => u.Id == 1)\n .ToListAsync();\n\nvar dtos = cities.Adapt>();\n")),Object(i.b)("h2",{id:"91110-\u52a8\u6001-sql-\u67e5\u8be2"},"9.11.10 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \u67e5\u8be2"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u9ed8\u8ba4\u4e0d\u652f\u6301 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \u67e5\u8be2\u529f\u80fd\uff0c\u4e0d\u8fc7\u53ef\u4ee5\u901a\u8fc7\u7b2c\u4e09\u65b9\u5b9e\u73b0\uff1a"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u9879\u76ee\u5c42\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"System.Linq.Dynamic.Core")," \u5305 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/zzzprojects/System.Linq.Dynamic.Core"}),"https://github.com/zzzprojects/System.Linq.Dynamic.Core")),Object(i.b)("h3",{id:"911101-\u52a8\u6001-sql"},"9.11.10.1 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"h3"},"Sql")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar query = repository.AsQueryable()\n .Where("City == @0 and Orders.Count >= @1", "China", 10)\n .OrderBy("CompanyName")\n .Select("new(CompanyName as Name, Phone)");\n\n// \u793a\u4f8b\u4e8c\nvar list = repository.AsQueryable()\n .Where("Name.Contains(@0)","Furion")\n .ToList();\n\n// \u793a\u4f8b\u4e09\uff0c\u652f\u6301 ? \u8bed\u6cd5\nvar customers = repository.AsQueryable()\n .Include(c => c.Location)\n .Where(c => c.Location?.Name == "test") // \u6ce8\u610f Location?.Name\n .ToList();\n')),Object(i.b)("h3",{id:"911102-\u52a8\u6001-lambda"},"9.11.10.2 \u52a8\u6001 ",Object(i.b)("inlineCode",{parentName:"h3"},"Lambda")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar x = Expression.Parameter(typeof(int), "x");\nvar y = Expression.Parameter(typeof(int), "y");\nvar e = DynamicExpressionParser\n .ParseLambda(new ParameterExpression[] { x, y }, null, "(x + y) * 2");\n\n// \u793a\u4f8b\u4e8c\nvar e = DynamicExpressionParser.ParseLambda(\n typeof(Customer), typeof(bool),\n "City = @0 and Orders.Count >= @1",\n "London", 10);\n')),Object(i.b)("h2",{id:"91111-\u65f6\u6001\u67e5\u8be2"},"9.11.11 \u65f6\u6001\u67e5\u8be2"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u65f6\u6001\u67e5\u8be2\u529f\u80fd\uff0c\u53ef\u4ee5\u67e5\u8be2\u7279\u5b9a\u65f6\u95f4\u7684\u6570\u636e\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = rep.Entities\n .AsTemporalOf(DateTime.UtcNow.AddDays(-1))\n .Include(i=> i.Company)\n .FirstOrDefault(i => i.Name == "Furion");\n')),Object(i.b)("p",null,"\u53e6\u5916\u63d0\u4f9b\u4e86\u591a\u4e2a\u65f6\u6001\u67e5\u8be2\u65b9\u6cd5"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"AsTemporalAll()"),Object(i.b)("li",{parentName:"ul"},"AsTemporalAsOf(date)"),Object(i.b)("li",{parentName:"ul"},"AsTemporalFrom(startDate, endDate)"),Object(i.b)("li",{parentName:"ul"},"AsTemporalBetween(startDate, endDate)"),Object(i.b)("li",{parentName:"ul"},"AsTemporalContained(startDate, endDate)")),Object(i.b)("h2",{id:"91112-\u6027\u80fd\u4f18\u5316"},"9.11.12 \u6027\u80fd\u4f18\u5316"),Object(i.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"EF Core")," \u4f1a\u8ddf\u8e2a\u6240\u6709\u5b9e\u4f53\uff0c\u4e5f\u5c31\u662f\u4efb\u4f55\u6570\u636e\u6539\u53d8\u90fd\u4f1a\u5f15\u8d77\u6570\u636e\u68c0\u67e5\uff0c\u6240\u4ee5\u5982\u679c\u53ea\u505a\u67e5\u8be2\u64cd\u4f5c\uff0c\u5efa\u8bae\u5173\u95ed\u5b9e\u4f53\u8ddf\u8e2a\u529f\u80fd\u3002"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u4ee5\u4e0b\u9ad8\u6027\u80fd\u5b9e\u4f53\u96c6\u5408\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DetachedEntities"),"\uff1a\u8131\u8f68/\u4e0d\u8ffd\u8e2a\u5b9e\u4f53"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"AsQueryable()"),"\uff1a\u4e0d\u8ffd\u8e2a\u5b9e\u4f53"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Entities.AsNoTracking()"),"\uff1a\u624b\u52a8\u5173\u95ed\u5b9e\u4f53\u8ffd\u8e2a")),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"EF Core")," \u4e2d\uff0c\u590d\u6742\u67e5\u8be2\u603b\u662f\u4f1a\u751f\u6210\u4e00\u4e2a ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u4e5f\u5c31\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"AsSingleQuery()"),"\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"AsSplitQuery()")," \u5207\u5272\u6210\u591a\u4e2a\u67e5\u8be2\u3002"),Object(i.b)("h2",{id:"91113-\u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50"},"9.11.13 \u5206\u8868\u67e5\u8be2\u5c0f\u4f8b\u5b50"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Person : Entity, IEntityTypeBuilder\n {\n public string Name { get; set; }\n\n /// \n /// \u914d\u7f6e\u5b9e\u4f53\u5173\u7cfb\n /// \n /// \n /// \n /// \n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.ToSqlQuery(\n @"select * from dbo.person.2020-09-19\n union all\n select * from dbo.person.2020-09-20");\n }\n }\n}\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var posts = repository.Where(u => u.Id > 10).ToList();\n")),Object(i.b)("h2",{id:"91114-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.11.14 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return s}));var a=t(21),r=t(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const s=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+s:s}(n,e,t,a)}}function s(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return b})),t.d(n,"b",(function(){return p}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function s(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=r.a.createContext({}),u=function(e){var n=r.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},b=function(e){var n=u(e.components);return r.a.createElement(l.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},d=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),b=u(t),d=a,p=b["".concat(s,".").concat(d)]||b[d]||m[d]||i;return t?r.a.createElement(p,o(o({ref:n},l),{},{components:t})):r.a.createElement(p,o({ref:n},l))}));function p(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,s=new Array(i);s[0]=d;var o={};for(var c in n)hasOwnProperty.call(n,c)&&(o[c]=n[c]);o.originalType=e,o.mdxType="string"==typeof e?e:a,s[1]=o;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,n,t){"use strict";function a(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&j(e)}const N=e=>{j(e),null!=m&&y(m,e)},h=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(s.a)("tabs",{"tabs--block":t},d)},b.map(({value:e,label:n})=>r.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":O===e,className:Object(s.a)("tabs__item",c.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case u:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case l:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(h,e.target,e)},onFocus:()=>N(e),onClick:()=>{N(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===O)[0],{className:"margin-vert--md"}):r.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==O}))))}},204:function(e,n,t){"use strict";var a=t(3),r=t(0),i=t.n(r);n.a=function({children:e,hidden:n,className:t}){return i.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file diff --git a/docs/4c30b939.0cdf33e5.js b/docs/4c30b939.87d0d27d.js similarity index 99% rename from docs/4c30b939.0cdf33e5.js rename to docs/4c30b939.87d0d27d.js index 9f68c61e196..4c1e881de2a 100644 --- a/docs/4c30b939.0cdf33e5.js +++ b/docs/4c30b939.87d0d27d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{107:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return p})),a.d(t,"toc",(function(){return O})),a.d(t,"default",(function(){return o}));var n=a(3),b=a(7),r=(a(0),a(192)),c=a(190),l=a(193),i={id:"introduce",title:"1.1 \u4ecb\u7ecd",sidebar_label:"1.1 \u4ecb\u7ecd",slug:"/"},p={unversionedId:"introduce",id:"introduce",isDocsHomePage:!1,title:"1.1 \u4ecb\u7ecd",description:"function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:r=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return r?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=r();return a(e,t)}},191:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function b(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return b}))},192:function(e,t,a){"use strict";a.d(t,"a",(function(){return j})),a.d(t,"b",(function(){return g}));var n=a(0),b=a.n(n);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(b[a]=e[a]);return b}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(b[a]=e[a])}return b}var p=b.a.createContext({}),O=function(e){var t=b.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},j=function(e){var t=O(e.components);return b.a.createElement(p.Provider,{value:t},e.children)},o={inlineCode:"code",wrapper:function(e){var t=e.children;return b.a.createElement(b.a.Fragment,{},t)}},m=b.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),j=O(a),m=n,g=j["".concat(c,".").concat(m)]||j[m]||o[m]||r;return a?b.a.createElement(g,l(l({ref:t},p),{},{components:a})):b.a.createElement(g,l({ref:t},p))}));function g(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,c=new Array(r);c[0]=m;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{108:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return p})),a.d(t,"toc",(function(){return O})),a.d(t,"default",(function(){return o}));var n=a(3),b=a(7),r=(a(0),a(196)),c=a(194),l=a(197),i={id:"introduce",title:"1.1 \u4ecb\u7ecd",sidebar_label:"1.1 \u4ecb\u7ecd",slug:"/"},p={unversionedId:"introduce",id:"introduce",isDocsHomePage:!1,title:"1.1 \u4ecb\u7ecd",description:"function(e,t,a,{forcePrependBaseUrl:n=!1,absolute:r=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return r?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=r();return a(e,t)}},195:function(e,t,a){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function b(e){return void 0!==e&&!n(e)}a.d(t,"b",(function(){return n})),a.d(t,"a",(function(){return b}))},196:function(e,t,a){"use strict";a.d(t,"a",(function(){return j})),a.d(t,"b",(function(){return g}));var n=a(0),b=a.n(n);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function c(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(b[a]=e[a]);return b}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(b[a]=e[a])}return b}var p=b.a.createContext({}),O=function(e){var t=b.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},j=function(e){var t=O(e.components);return b.a.createElement(p.Provider,{value:t},e.children)},o={inlineCode:"code",wrapper:function(e){var t=e.children;return b.a.createElement(b.a.Fragment,{},t)}},m=b.a.forwardRef((function(e,t){var a=e.components,n=e.mdxType,r=e.originalType,c=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),j=O(a),m=n,g=j["".concat(c,".").concat(m)]||j[m]||o[m]||r;return a?b.a.createElement(g,l(l({ref:t},p),{},{components:a})):b.a.createElement(g,l({ref:t},p))}));function g(e,t){var a=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var r=a.length,c=new Array(r);c[0]=m;var l={};for(var i in t)hasOwnProperty.call(t,i)&&(l[i]=t[i]);l.originalType=e,l.mdxType="string"==typeof e?e:n,c[1]=l;for(var p=2;pt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/4c716d98.6889d9e2.js b/docs/4c716d98.e7af6c67.js similarity index 97% rename from docs/4c716d98.6889d9e2.js rename to docs/4c716d98.e7af6c67.js index 1b958b871a7..f58345fd8d4 100644 --- a/docs/4c716d98.6889d9e2.js +++ b/docs/4c716d98.e7af6c67.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{108:function(t,e,a){"use strict";a.r(e),a.d(e,"frontMatter",(function(){return l})),a.d(e,"metadata",(function(){return O})),a.d(e,"toc",(function(){return j})),a.d(e,"default",(function(){return d}));var n=a(3),b=a(7),r=(a(0),a(192)),c=(a(190),a(193)),l={id:"donate",title:"1.5 \u8d5e\u52a9 Furion",sidebar_label:"1.5 \u8d5e\u52a9 Furion"},O={unversionedId:"donate",id:"donate",isDocsHomePage:!1,title:"1.5 \u8d5e\u52a9 Furion",description:"\u5982\u679c\u60f3\u6210\u4e3a Furion \u652f\u6301\u8005\u6216\u8d5e\u52a9\u5546\uff0c\u8bf7\u8003\u8651\uff1a",source:"@site/docs\\donate.mdx",slug:"/donate",permalink:"/docs/donate",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/donate.mdx",version:"current",lastUpdatedBy:"Monk",lastUpdatedAt:1612144029,sidebar_label:"1.5 \u8d5e\u52a9 Furion",sidebar:"docs",previous:{title:"1.4 \u9879\u76ee\u5408\u4f5c",permalink:"/docs/cooperate"},next:{title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",permalink:"/docs/get-start"}},j=[{value:"\ud83c\udf4d \u8d5e\u52a9\u5217\u8868",id:"-\u8d5e\u52a9\u5217\u8868",children:[]}],p={toc:j};function d(t){var e=t.components,a=Object(b.a)(t,["components"]);return Object(r.b)("wrapper",Object(n.a)({},p,a,{components:e,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u5982\u679c\u60f3\u6210\u4e3a ",Object(r.b)("inlineCode",{parentName:"strong"},"Furion")," \u652f\u6301\u8005\u6216\u8d5e\u52a9\u5546\uff0c\u8bf7\u8003\u8651\uff1a")),Object(r.b)("p",null,Object(r.b)("img",{src:"https://gitee.com/monksoul/Furion/raw/master/handbook/static/img/support.png",height:"300"})),Object(r.b)("h2",{id:"-\u8d5e\u52a9\u5217\u8868"},"\ud83c\udf4d \u8d5e\u52a9\u5217\u8868"),Object(r.b)("p",null,"\u6ce8\uff1a\u6392\u5e8f\u6309\u8d5e\u52a9\u987a\u5e8f\u4e66\u5199"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u8d5e\u52a9\u4eba\u6635\u79f0"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u8d5e\u52a9\u91d1\u989d\uff08\u5143\uff09"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u9644\u8bed"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd34 \u7231\u5403\u6cb9\u9ea6\u83dc"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc73\u200d\u2642\ufe0f \u9ea6\u58f3\u997c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68 Sun"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc76 d617617"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc66 Diqiguoji008"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"16.66")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u89c1\u8d24\u601d\u9f50")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc72 nodyang"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc73\u200d\u2640\ufe0f mictxd"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5439\u8fc7\u7684\u725b\u90fd\u5b9e\u73b0\u3002")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\uddd3 \u6b27\u6d41\u5168"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5e0c\u671b\u5c06\u6765\u8d85\u8d8a Spring")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68\u200d\u2695\ufe0f lionkon"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"...\u770b\u4e86\u6846\u67b6\u611f\u89c9\u62ff\u6765\u5b66\u4e60\u662f\u5f88\u4e0d\u9519\u7684...")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude24 \u597d\u4eba\uff01"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Nice \u7684\u5c0f\u50e7\uff0c\u6211\u4eec\u7684 dotnetchina \u9a6c\u4e0a\u706b\u8d77\u6765\u4e86")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude2e \u6728\u6728 Woody"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude1a Joker Hou"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u8d85\u7ea7\u4f1a\u5458\u4e00\u4e2a\u6708")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}))),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd20 ccdfz"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 199")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}))),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83c\udf1d \u5929\u592b\u674e\u603b"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u652f\u4ed8\u5b9d 6666")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion \u975e\u5e38\u6709\u610f\u601d\uff0c\u6301\u7eed\u5173\u6ce8")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude1d \u516d\u5c18\u5b50"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u7ea2\u5305 199")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u516c\u53f8\u5df2\u7ecf\u4f7f\u7528\uff0c\u5c0f\u5c0f\u656c\u610f")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd20 ccdfz"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u8d5e\u52a9\u4e00\u6839\u5185\u5b58\u6761")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd11 \u9093\u4eae\u706f"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"28.88")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude2c \u5929\u9053\u916c\u52e4"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 188")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5c0f\u5c0f\u5fc3\u610f")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd70 \u5374\u6708\u5c45\u58eb"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c\u53d1\u8d22")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd29 \u9c81\u65ed"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude2c \u6563\u5ba2\u884c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 666")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u7ec8\u4e8e\u627e\u5230\u4e00\u4e2a\u4e0d\u9519\u7684\u6846\u67b6")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude0c \u672c\u5fc3"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u9879\u76ee\u529f\u80fd\u5f88\u5f3a\u5927")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude46\u200d\u2642\ufe0f \u6bd5\u4e1a\u751f"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u8bf7\u4f60\u559d\u676f\u5496\u5561")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\uddb9\u200d\u2640\ufe0f \u732a\u9f3b\u5b50"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 668")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u597d")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udddf\u200d\u2642\ufe0f \u660e\u5e74\xb7\u4eca\u65e5"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u4f7f\u7528\u7684\u6846\u67b6\u91cc\u6700\u723d\u7684\uff0c\u6700\u7406\u60f3\u7684\uff01\u52a0\u6cb9")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68\u200d\ud83c\udf93 \u8fc7\u53bb\u7684\u8fc7\u53bb"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"50")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68\u200d\ud83d\udd27 \u4e07\u91cc\u516e"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u65b0\u516c\u53f8\u7684\u7b2c\u4e00\u4e2a\u9879\u76ee\u4ece Furion \u5f00\u59cb")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc74 Muphalem"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5f88\u70ed\u5fc3\u5f88\u4eb2\u5207\u7684\u5f00\u53d1\u8005\uff0c\u52a0\u6cb9\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc82\u200d\u2642\ufe0f \u5403\u9505\u5df4\u7684\u7801\u519c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 500")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5c31\u51b2\u4f60\u7684\u6587\u6863\u5199\u5f97\u597d\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd34 \u4e09\u91cd\u7f57\u751f\u95e8"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u7ea2\u5305 200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u4e0b\u6b21\u70e4\u9c7c\u4f60\u8bf7\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd35 \u674e\u6d9b"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u52a0\u6cb9\uff0c\u6211\u4eec\u770b\u5230\u4e86 dotnet \u7f8e\u597d\u7684\u660e\u5929 :)")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude02 !@#$%^&"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u521a\u63a5\u89e6 furion\uff0c\u6587\u6863\u771f\u68d2")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude35 \u674e\u658c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u770b\u5230\u4e00\u4e2a\u4e0d\u9519\u7684\u6846\u67b6\uff0c\u5b66\u4e60\u5b66\u4e60\uff0c\u611f\u8c22\u4f5c\u8005\u7684\u65e0\u79c1\u5949\u732e")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude1e \u901e\u5f3a"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c\u53d1\u8d22")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd12 \u987e\u9526\u677e"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u671f\u5f85\u6587\u6863\u5b8c\u6210\u65f6\u5019")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udddf\u200d\u2640\ufe0f \u54c8\u54c8"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 1000")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u70b9\u8d5e\u4f5c\u8005\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83c\udf4d Z"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c\u5b69\u5b50\u8bde\u751f\uff0c\u8c22\u8c22\u5927\u4f6c")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83c\udf72 \u6d77\u6d9b"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"50")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude23 h"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"qq82683656")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc71\u200d\u2640\ufe0f \u51b7\u5927\u5927"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u52a0\u5feb\u6587\u6863\u548c\u6559\u5b66\u8865\u5145\u54e6\uff0c\u53e6\u5916\u9700\u8981\u9489\u9489\u7fa4\uff0c\u5e73\u5e38\u4e0d\u7528 QQ")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc5c \u817e\u5764"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff0cQQ:565728589")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude86 \u6587\u8036\u8036"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5f88\u68d2")))),Object(r.b)("p",null,"\u975e\u5e38\u611f\u8c22\u60a8\u4eec\u7684\u652f\u6301\uff0c\u6b63\u662f\u56e0\u4e3a\u60a8\u4eec\uff0c\u4e2d\u56fd\u5f00\u6e90\u624d\u53ef\u4ee5\u8d8a\u8d70\u8d8a\u8fdc\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u8d8a\u8d70\u8d8a\u8fdc\u3002"))}d.isMDXComponent=!0},190:function(t,e,a){"use strict";a.d(e,"b",(function(){return r})),a.d(e,"a",(function(){return c}));var n=a(21),b=a(191);function r(){const{siteConfig:{baseUrl:t="/",url:e}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(t,e,a,{forcePrependBaseUrl:n=!1,absolute:r=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return e+a;const c=a.startsWith(e)?a:e+a.replace(/^\//,"");return r?t+c:c}(e,t,a,n)}}function c(t,e={}){const{withBaseUrl:a}=r();return a(t,e)}},191:function(t,e,a){"use strict";function n(t){return!0===/^(\w*:|\/\/)/.test(t)}function b(t){return void 0!==t&&!n(t)}a.d(e,"b",(function(){return n})),a.d(e,"a",(function(){return b}))},192:function(t,e,a){"use strict";a.d(e,"a",(function(){return d})),a.d(e,"b",(function(){return o}));var n=a(0),b=a.n(n);function r(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function l(t){for(var e=1;e=0||(b[a]=t[a]);return b}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(b[a]=t[a])}return b}var j=b.a.createContext({}),p=function(t){var e=b.a.useContext(j),a=e;return t&&(a="function"==typeof t?t(e):l(l({},e),t)),a},d=function(t){var e=p(t.components);return b.a.createElement(j.Provider,{value:e},t.children)},i={inlineCode:"code",wrapper:function(t){var e=t.children;return b.a.createElement(b.a.Fragment,{},e)}},m=b.a.forwardRef((function(t,e){var a=t.components,n=t.mdxType,r=t.originalType,c=t.parentName,j=O(t,["components","mdxType","originalType","parentName"]),d=p(a),m=n,o=d["".concat(c,".").concat(m)]||d[m]||i[m]||r;return a?b.a.createElement(o,l(l({ref:e},j),{},{components:a})):b.a.createElement(o,l({ref:e},j))}));function o(t,e){var a=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var r=a.length,c=new Array(r);c[0]=m;var l={};for(var O in e)hasOwnProperty.call(e,O)&&(l[O]=e[O]);l.originalType=t,l.mdxType="string"==typeof t?t:n,c[1]=l;for(var j=2;je(!t)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{109:function(t,e,a){"use strict";a.r(e),a.d(e,"frontMatter",(function(){return l})),a.d(e,"metadata",(function(){return O})),a.d(e,"toc",(function(){return j})),a.d(e,"default",(function(){return d}));var n=a(3),b=a(7),r=(a(0),a(196)),c=(a(194),a(197)),l={id:"donate",title:"1.5 \u8d5e\u52a9 Furion",sidebar_label:"1.5 \u8d5e\u52a9 Furion"},O={unversionedId:"donate",id:"donate",isDocsHomePage:!1,title:"1.5 \u8d5e\u52a9 Furion",description:"\u5982\u679c\u60f3\u6210\u4e3a Furion \u652f\u6301\u8005\u6216\u8d5e\u52a9\u5546\uff0c\u8bf7\u8003\u8651\uff1a",source:"@site/docs\\donate.mdx",slug:"/donate",permalink:"/docs/donate",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/donate.mdx",version:"current",lastUpdatedBy:"Monk",lastUpdatedAt:1612156927,sidebar_label:"1.5 \u8d5e\u52a9 Furion",sidebar:"docs",previous:{title:"1.4 \u9879\u76ee\u5408\u4f5c",permalink:"/docs/cooperate"},next:{title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",permalink:"/docs/get-start"}},j=[{value:"\ud83c\udf4d \u8d5e\u52a9\u5217\u8868",id:"-\u8d5e\u52a9\u5217\u8868",children:[]}],p={toc:j};function d(t){var e=t.components,a=Object(b.a)(t,["components"]);return Object(r.b)("wrapper",Object(n.a)({},p,a,{components:e,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u5982\u679c\u60f3\u6210\u4e3a ",Object(r.b)("inlineCode",{parentName:"strong"},"Furion")," \u652f\u6301\u8005\u6216\u8d5e\u52a9\u5546\uff0c\u8bf7\u8003\u8651\uff1a")),Object(r.b)("p",null,Object(r.b)("img",{src:"https://gitee.com/monksoul/Furion/raw/master/handbook/static/img/support.png",height:"300"})),Object(r.b)("h2",{id:"-\u8d5e\u52a9\u5217\u8868"},"\ud83c\udf4d \u8d5e\u52a9\u5217\u8868"),Object(r.b)("p",null,"\u6ce8\uff1a\u6392\u5e8f\u6309\u8d5e\u52a9\u987a\u5e8f\u4e66\u5199"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u8d5e\u52a9\u4eba\u6635\u79f0"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u8d5e\u52a9\u91d1\u989d\uff08\u5143\uff09"),Object(r.b)("th",Object(n.a)({parentName:"tr"},{align:null}),"\u9644\u8bed"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd34 \u7231\u5403\u6cb9\u9ea6\u83dc"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc73\u200d\u2642\ufe0f \u9ea6\u58f3\u997c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68 Sun"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc76 d617617"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc66 Diqiguoji008"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"16.66")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u89c1\u8d24\u601d\u9f50")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc72 nodyang"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc73\u200d\u2640\ufe0f mictxd"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5439\u8fc7\u7684\u725b\u90fd\u5b9e\u73b0\u3002")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\uddd3 \u6b27\u6d41\u5168"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5e0c\u671b\u5c06\u6765\u8d85\u8d8a Spring")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68\u200d\u2695\ufe0f lionkon"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"...\u770b\u4e86\u6846\u67b6\u611f\u89c9\u62ff\u6765\u5b66\u4e60\u662f\u5f88\u4e0d\u9519\u7684...")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude24 \u597d\u4eba\uff01"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Nice \u7684\u5c0f\u50e7\uff0c\u6211\u4eec\u7684 dotnetchina \u9a6c\u4e0a\u706b\u8d77\u6765\u4e86")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude2e \u6728\u6728 Woody"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude1a Joker Hou"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u8d85\u7ea7\u4f1a\u5458\u4e00\u4e2a\u6708")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}))),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd20 ccdfz"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 199")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}))),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83c\udf1d \u5929\u592b\u674e\u603b"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u652f\u4ed8\u5b9d 6666")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"Furion \u975e\u5e38\u6709\u610f\u601d\uff0c\u6301\u7eed\u5173\u6ce8")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude1d \u516d\u5c18\u5b50"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u7ea2\u5305 199")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u516c\u53f8\u5df2\u7ecf\u4f7f\u7528\uff0c\u5c0f\u5c0f\u656c\u610f")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd20 ccdfz"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u8d5e\u52a9\u4e00\u6839\u5185\u5b58\u6761")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd11 \u9093\u4eae\u706f"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"28.88")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude2c \u5929\u9053\u916c\u52e4"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 188")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5c0f\u5c0f\u5fc3\u610f")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd70 \u5374\u6708\u5c45\u58eb"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c\u53d1\u8d22")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd29 \u9c81\u65ed"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude2c \u6563\u5ba2\u884c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 666")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u7ec8\u4e8e\u627e\u5230\u4e00\u4e2a\u4e0d\u9519\u7684\u6846\u67b6")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude0c \u672c\u5fc3"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u9879\u76ee\u529f\u80fd\u5f88\u5f3a\u5927")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude46\u200d\u2642\ufe0f \u6bd5\u4e1a\u751f"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u8bf7\u4f60\u559d\u676f\u5496\u5561")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\uddb9\u200d\u2640\ufe0f \u732a\u9f3b\u5b50"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 668")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u597d")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udddf\u200d\u2642\ufe0f \u660e\u5e74\xb7\u4eca\u65e5"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u4f7f\u7528\u7684\u6846\u67b6\u91cc\u6700\u723d\u7684\uff0c\u6700\u7406\u60f3\u7684\uff01\u52a0\u6cb9")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68\u200d\ud83c\udf93 \u8fc7\u53bb\u7684\u8fc7\u53bb"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"50")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc68\u200d\ud83d\udd27 \u4e07\u91cc\u516e"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u65b0\u516c\u53f8\u7684\u7b2c\u4e00\u4e2a\u9879\u76ee\u4ece Furion \u5f00\u59cb")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc74 Muphalem"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5f88\u70ed\u5fc3\u5f88\u4eb2\u5207\u7684\u5f00\u53d1\u8005\uff0c\u52a0\u6cb9\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc82\u200d\u2642\ufe0f \u5403\u9505\u5df4\u7684\u7801\u519c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u4e8c\u7ef4\u7801 500")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5c31\u51b2\u4f60\u7684\u6587\u6863\u5199\u5f97\u597d\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd34 \u4e09\u91cd\u7f57\u751f\u95e8"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u7ea2\u5305 200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u4e0b\u6b21\u70e4\u9c7c\u4f60\u8bf7\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd35 \u674e\u6d9b"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u52a0\u6cb9\uff0c\u6211\u4eec\u770b\u5230\u4e86 dotnet \u7f8e\u597d\u7684\u660e\u5929 :)")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude02 !@#$%^&"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u521a\u63a5\u89e6 furion\uff0c\u6587\u6863\u771f\u68d2")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude35 \u674e\u658c"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u770b\u5230\u4e00\u4e2a\u4e0d\u9519\u7684\u6846\u67b6\uff0c\u5b66\u4e60\u5b66\u4e60\uff0c\u611f\u8c22\u4f5c\u8005\u7684\u65e0\u79c1\u5949\u732e")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude1e \u901e\u5f3a"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 20")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c\u53d1\u8d22")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udd12 \u987e\u9526\u677e"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"QQ \u4e13\u5c5e\u7ea2\u5305 200")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u671f\u5f85\u6587\u6863\u5b8c\u6210\u65f6\u5019")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83e\udddf\u200d\u2640\ufe0f \u54c8\u54c8"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 1000")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u70b9\u8d5e\u4f5c\u8005\uff01")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83c\udf4d Z"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c\u5b69\u5b50\u8bde\u751f\uff0c\u8c22\u8c22\u5927\u4f6c")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83c\udf72 \u6d77\u6d9b"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"50")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u606d\u559c")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude23 h"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"qq82683656")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc71\u200d\u2640\ufe0f \u51b7\u5927\u5927"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 100")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u52a0\u5feb\u6587\u6863\u548c\u6559\u5b66\u8865\u5145\u54e6\uff0c\u53e6\u5916\u9700\u8981\u9489\u9489\u7fa4\uff0c\u5e73\u5e38\u4e0d\u7528 QQ")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\udc5c \u817e\u5764"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u611f\u8c22\u60a8\u7684\u5f00\u6e90\u9879\u76ee\uff0cQQ:565728589")),Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\ud83d\ude86 \u6587\u8036\u8036"),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),Object(r.b)("strong",{parentName:"td"},"\u5fae\u4fe1\u8d5e\u8d4f\u7801 10")),Object(r.b)("td",Object(n.a)({parentName:"tr"},{align:null}),"\u5f88\u68d2")))),Object(r.b)("p",null,"\u975e\u5e38\u611f\u8c22\u60a8\u4eec\u7684\u652f\u6301\uff0c\u6b63\u662f\u56e0\u4e3a\u60a8\u4eec\uff0c\u4e2d\u56fd\u5f00\u6e90\u624d\u53ef\u4ee5\u8d8a\u8d70\u8d8a\u8fdc\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u8d8a\u8d70\u8d8a\u8fdc\u3002"))}d.isMDXComponent=!0},194:function(t,e,a){"use strict";a.d(e,"b",(function(){return r})),a.d(e,"a",(function(){return c}));var n=a(21),b=a(195);function r(){const{siteConfig:{baseUrl:t="/",url:e}={}}=Object(n.default)();return{withBaseUrl:(a,n)=>function(t,e,a,{forcePrependBaseUrl:n=!1,absolute:r=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(b.b)(a))return a;if(n)return e+a;const c=a.startsWith(e)?a:e+a.replace(/^\//,"");return r?t+c:c}(e,t,a,n)}}function c(t,e={}){const{withBaseUrl:a}=r();return a(t,e)}},195:function(t,e,a){"use strict";function n(t){return!0===/^(\w*:|\/\/)/.test(t)}function b(t){return void 0!==t&&!n(t)}a.d(e,"b",(function(){return n})),a.d(e,"a",(function(){return b}))},196:function(t,e,a){"use strict";a.d(e,"a",(function(){return d})),a.d(e,"b",(function(){return o}));var n=a(0),b=a.n(n);function r(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function l(t){for(var e=1;e=0||(b[a]=t[a]);return b}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,a)&&(b[a]=t[a])}return b}var j=b.a.createContext({}),p=function(t){var e=b.a.useContext(j),a=e;return t&&(a="function"==typeof t?t(e):l(l({},e),t)),a},d=function(t){var e=p(t.components);return b.a.createElement(j.Provider,{value:e},t.children)},i={inlineCode:"code",wrapper:function(t){var e=t.children;return b.a.createElement(b.a.Fragment,{},e)}},m=b.a.forwardRef((function(t,e){var a=t.components,n=t.mdxType,r=t.originalType,c=t.parentName,j=O(t,["components","mdxType","originalType","parentName"]),d=p(a),m=n,o=d["".concat(c,".").concat(m)]||d[m]||i[m]||r;return a?b.a.createElement(o,l(l({ref:e},j),{},{components:a})):b.a.createElement(o,l({ref:e},j))}));function o(t,e){var a=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var r=a.length,c=new Array(r);c[0]=m;var l={};for(var O in e)hasOwnProperty.call(e,O)&&(l[O]=e[O]);l.originalType=t,l.mdxType="string"==typeof t?t:n,c[1]=l;for(var j=2;je(!t)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/4dbcf072.11f35f4b.js b/docs/4dbcf072.b0ac0695.js similarity index 98% rename from docs/4dbcf072.11f35f4b.js rename to docs/4dbcf072.b0ac0695.js index 379889a24bb..7cb7772c3ce 100644 --- a/docs/4dbcf072.11f35f4b.js +++ b/docs/4dbcf072.b0ac0695.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{109:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return p}));var a=t(3),r=t(7),c=(t(0),t(192)),i=t(190),b=t(193),o={id:"dbcontext-read-write",title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",sidebar_label:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236"},s={unversionedId:"dbcontext-read-write",id:"dbcontext-read-write",isDocsHomePage:!1,title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",description:"9.27.1 \u8bfb\u5199\u5206\u79bb",source:"@site/docs\\dbcontext-read-write.mdx",slug:"/dbcontext-read-write",permalink:"/docs/dbcontext-read-write",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-read-write.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",sidebar:"docs",previous:{title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",permalink:"/docs/tran"},next:{title:"9.28 \u5206\u8868\u5206\u5e93",permalink:"/docs/split-db"}},l=[{value:"9.27.1 \u8bfb\u5199\u5206\u79bb",id:"9271-\u8bfb\u5199\u5206\u79bb",children:[{value:"9.27.1.1 \u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898",id:"92711-\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898",children:[]},{value:"9.27.1.2 \u6ce8\u610f\u4e8b\u9879",id:"92712-\u6ce8\u610f\u4e8b\u9879",children:[]}]},{value:"9.27.2 \u5982\u4f55\u5b9e\u73b0",id:"9272-\u5982\u4f55\u5b9e\u73b0",children:[{value:"9.27.2.1 \u521b\u5efa \u4e3b\u5e93 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"92721-\u521b\u5efa-\u4e3b\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.27.2.2 \u521b\u5efa \u4ece\u5e93 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"92722-\u521b\u5efa-\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.27.2.3 \u6ce8\u518c \u4e3b\u4ece\u5e93 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"92723-\u6ce8\u518c-\u4e3b\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.27.2.4 \u521b\u5efa Person \u5b9e\u4f53",id:"92724-\u521b\u5efa-person-\u5b9e\u4f53",children:[]},{value:"9.27.2.5 \u5c06 Person \u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868",id:"92725-\u5c06-person-\u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868",children:[]},{value:"9.27.2.6 \u4f7f\u7528\u4f8b\u5b50",id:"92726-\u4f7f\u7528\u4f8b\u5b50",children:[]}]},{value:"9.27.3 \u4e3b\u4ece\u590d\u5236",id:"9273-\u4e3b\u4ece\u590d\u5236",children:[]},{value:"9.27.4 \u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f",id:"9274-\u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f",children:[{value:"9.27.4.1 \u540c\u6b65\u590d\u5236",id:"92741-\u540c\u6b65\u590d\u5236",children:[]},{value:"9.27.4.2 \u5f02\u6b65\u590d\u5236",id:"92742-\u5f02\u6b65\u590d\u5236",children:[]},{value:"9.27.4.3 \u534a\u540c\u6b65\u590d\u5236",id:"92743-\u534a\u540c\u6b65\u590d\u5236",children:[]}]},{value:"9.27.5 SqlServer \u4e3b\u5e93\u914d\u7f6e",id:"9275-sqlserver-\u4e3b\u5e93\u914d\u7f6e",children:[{value:"9.27.5.1 \u6dfb\u52a0 \u672c\u5730\u53d1\u5e03",id:"92751-\u6dfb\u52a0-\u672c\u5730\u53d1\u5e03",children:[]},{value:"9.27.5.2 \u9009\u62e9 \u5206\u53d1\u670d\u52a1\u5668",id:"92752-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668",children:[]},{value:"9.27.5.3 \u542f\u7528 \u4ee3\u7406",id:"92753-\u542f\u7528-\u4ee3\u7406",children:[]},{value:"9.27.5.4 \u53d1\u5e03\u6570\u636e\u5e93",id:"92754-\u53d1\u5e03\u6570\u636e\u5e93",children:[]},{value:"9.27.5.5 \u5feb\u7167\u53d1\u5e03",id:"92755-\u5feb\u7167\u53d1\u5e03",children:[]},{value:"9.27.5.6 \u9009\u62e9\u53d1\u5e03\u9879\u76ee",id:"92756-\u9009\u62e9\u53d1\u5e03\u9879\u76ee",children:[]},{value:"9.27.5.7 \u914d\u7f6e\u5206\u53d1\u8ba1\u5212",id:"92757-\u914d\u7f6e\u5206\u53d1\u8ba1\u5212",children:[]},{value:"9.27.5.8 \u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e",id:"92758-\u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e",children:[]},{value:"9.27.5.9 \u5b8c\u6210\u914d\u7f6e",id:"92759-\u5b8c\u6210\u914d\u7f6e",children:[]}]},{value:"9.27.6 SqlServer \u4ece\u5e93\u914d\u7f6e",id:"9276-sqlserver-\u4ece\u5e93\u914d\u7f6e",children:[{value:"9.27.6.1 \u6dfb\u52a0 \u672c\u5730\u8ba2\u9605",id:"92761-\u6dfb\u52a0-\u672c\u5730\u8ba2\u9605",children:[]},{value:"9.27.6.2 \u9009\u62e9 \u5206\u53d1\u670d\u52a1\u5668",id:"92762-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668",children:[]},{value:"9.27.6.3 \u9009\u62e9 \u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e",id:"92763-\u9009\u62e9-\u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e",children:[]},{value:"9.27.6.4 \u9009\u62e9 \u8ba2\u9605\u6570\u636e\u5e93",id:"92764-\u9009\u62e9-\u8ba2\u9605\u6570\u636e\u5e93",children:[]},{value:"9.27.6.5 \u9009\u62e9 \u5206\u53d1\u5b89\u5168\u8bbe\u7f6e",id:"92765-\u9009\u62e9-\u5206\u53d1\u5b89\u5168\u8bbe\u7f6e",children:[]},{value:"9.27.6.6 \u9009\u62e9 \u540c\u6b65\u8ba1\u5212",id:"92766-\u9009\u62e9-\u540c\u6b65\u8ba1\u5212",children:[]},{value:"9.27.6.7 \u5b8c\u6210\u8ba2\u9605",id:"92767-\u5b8c\u6210\u8ba2\u9605",children:[]}]},{value:"9.27.7 \u5206\u53d1\u5b9a\u4e49\u76d1\u89c6",id:"9277-\u5206\u53d1\u5b9a\u4e49\u76d1\u89c6",children:[]},{value:"9.27.8 \u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c",id:"9278-\u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c",children:[]},{value:"9.27.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9279-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:l};function p(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9271-\u8bfb\u5199\u5206\u79bb"},"9.27.1 \u8bfb\u5199\u5206\u79bb"),Object(c.b)("p",null,"\u5176\u5b9e\u5c31\u662f\u5c06\u6570\u636e\u5e93\u5206\u4e3a\u4e86\u4e3b\u4ece\u5e93\uff0c\u4e00\u4e2a\u4e3b\u5e93\u7528\u4e8e\u5199\u6570\u636e\uff0c\u591a\u4e2a\u4ece\u5e93\u5b8c\u6210\u8bfb\u6570\u636e\u7684\u64cd\u4f5c\uff0c\u4e3b\u4ece\u5e93\u4e4b\u95f4\u901a\u8fc7\u67d0\u79cd\u673a\u5236\u8fdb\u884c\u6570\u636e\u7684\u540c\u6b65\uff0c\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u6570\u636e\u5e93\u67b6\u6784\u3002"),Object(c.b)("img",{src:Object(i.a)("img/readwrite.png"),style:{height:300}}),Object(c.b)("h3",{id:"92711-\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898"},"9.27.1.1 \u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898"),Object(c.b)("p",null,"\u5927\u591a\u6570\u4e92\u8054\u7f51\u4e1a\u52a1\uff0c\u5f80\u5f80\u8bfb\u591a\u5199\u5c11\uff0c\u8fd9\u65f6\u5019\uff0c\u6570\u636e\u5e93\u7684\u8bfb\u4f1a\u9996\u5148\u6210\u4e3a\u6570\u636e\u5e93\u7684\u74f6\u9888\uff0c\u8fd9\u65f6\uff0c\u5982\u679c\u6211\u4eec\u5e0c\u671b\u80fd\u591f\u7ebf\u6027\u7684\u63d0\u5347\u6570\u636e\u5e93\u7684\u8bfb\u6027\u80fd\uff0c\u6d88\u9664\u8bfb\u5199\u9501\u51b2\u7a81\u4ece\u800c\u63d0\u5347\u6570\u636e\u5e93\u7684\u5199\u6027\u80fd\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u4f7f\u7528\u201c\u5206\u7ec4\u67b6\u6784\u201d\uff08\u8bfb\u5199\u5206\u79bb\u67b6\u6784\uff09\u3002"),Object(c.b)("p",null,"\u7528\u4e00\u53e5\u8bdd\u6982\u62ec\uff0c\u8bfb\u5199\u5206\u79bb\u662f\u7528\u6765\u89e3\u51b3\u6570\u636e\u5e93\u7684\u8bfb\u6027\u80fd\u74f6\u9888\u7684\u3002"),Object(c.b)("h3",{id:"92712-\u6ce8\u610f\u4e8b\u9879"},"9.27.1.2 \u6ce8\u610f\u4e8b\u9879"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u8981\u8fdb\u884c\u533a\u5206\uff0c\u54ea\u4e9b\u662f\u8bfb\u8fde\u63a5\u6c60\uff0c\u54ea\u4e2a\u662f\u5199\u8fde\u63a5\u6c60\uff0c\u7814\u53d1\u7684\u96be\u5ea6\u4f1a\u589e\u52a0\uff1b"),Object(c.b)("li",{parentName:"ul"},"\u4e3a\u4e86\u4fdd\u8bc1\u9ad8\u53ef\u7528\uff0c\u8bfb\u8fde\u63a5\u6c60\u8981\u80fd\u591f\u5b9e\u73b0\u6545\u969c\u81ea\u52a8\u8f6c\u79fb\uff1b"),Object(c.b)("li",{parentName:"ul"},"\u4e3b\u4ece\u7684\u4e00\u81f4\u6027\u95ee\u9898\u9700\u8981\u8003\u8651\u3002")),Object(c.b)("h2",{id:"9272-\u5982\u4f55\u5b9e\u73b0"},"9.27.2 \u5982\u4f55\u5b9e\u73b0"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5728\u6570\u636e\u5e93\u6a21\u5757\u8bbe\u8ba1\u4e4b\u521d\uff0c\u5c31\u8003\u8651\u4e86\u8bfb\u5199\u5206\u79bb\u8fd9\u79cd\u60c5\u51b5\uff0c\u6240\u4ee5\u4ece\u5e95\u5c42\u5c31\u652f\u6301\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u53ca\u8bfb\u5199\u64cd\u4f5c\u65b9\u6cd5\u7ea6\u675f\u3002"),Object(c.b)("p",null,"\u8bfb\u5199\u5206\u79bb\u64cd\u4f5c\u4e3b\u8981\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"IMSRepository")," \u4ed3\u50a8\uff0c\u8be5\u4ed3\u50a8\u5df2\u7ecf\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u65b9\u4fbf\u7684\u64cd\u4f5c\u8c03\u7528\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u4e0d\u4f7f\u7528\u8be5\u4ed3\u50a8\u3002"),Object(c.b)("p",null,"\u4e0b\u9762\u5c31\u7ed9\u5927\u5bb6\u6f14\u793a\u5982\u4f55\u8bfb\u5199\u591a\u5e93\u8bfb\u5199\u64cd\u4f5c\u3002"),Object(c.b)("h3",{id:"92721-\u521b\u5efa-\u4e3b\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.27.2.1 \u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4e3b\u5e93")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n /// \n /// \u4e3b\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n /// \n [AppDbContext("MasterConnectionString")]\n public class MasterDbContext : AppDbContext\n {\n public MasterDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "ConnectionStrings": {\n "MasterConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;"\n }\n}\n')),Object(c.b)("h3",{id:"92722-\u521b\u5efa-\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.27.2.2 \u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4ece\u5e93")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11}","{11}":!0}),'using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n /// \n /// \u4ece\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n /// \n [AppDbContext("SlaveConnectionString")]\n public class SlaveDbContext : AppDbContext\n {\n public SlaveDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u9664\u4e86\u9ed8\u8ba4\u6570\u636e\u5e93\u65e0\u9700\u81ea\u5b9a\u4e49 ",Object(c.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\uff0c\u5176\u4ed6\u6570\u636e\u5e93\u90fd\u9700\u8981\u6709\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"SlaveDbContextLocator")))),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4ece\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n /// \n /// \u4ece\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\n /// \n public class SlaveDbContextLocator : IDbContextLocator\n {\n }\n}\n")),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "ConnectionStrings": {\n "SlaveConnectionString": "Server=localhost;Database=FurSlave;User=sa;Password=000000;MultipleActiveResultSets=True;"\n }\n}\n')),Object(c.b)("h3",{id:"92723-\u6ce8\u518c-\u4e3b\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.27.2.3 \u6ce8\u518c ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4e3b\u4ece\u5e93")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13-14}","{13-14}":!0}),"using Furion.Core;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n services.AddSqlServerPool();\n services.AddSqlServerPool();\n });\n }\n }\n}\n")),Object(c.b)("h3",{id:"92724-\u521b\u5efa-person-\u5b9e\u4f53"},"9.27.2.4 \u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"h3"},"Person")," \u5b9e\u4f53"),Object(c.b)("p",null,"\u7531\u4e8e ",Object(c.b)("inlineCode",{parentName:"p"},"\u4e3b\u4ece\u5e93")," \u5177\u6709\u76f8\u540c\u7684\u6570\u636e\u5e93\u7ed3\u6784\uff0c\u6240\u4ee5\u5b9e\u4f53\u4e5f\u5fc5\u987b\u58f0\u660e ",Object(c.b)("inlineCode",{parentName:"p"},"\u4e3b\u4ece\u5e93"),"\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Furion.DatabaseAccessor;\nusing System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.DataAnnotations.Schema;\n\nnamespace Furion.Core\n{\n public class Person : IEntity\n {\n /// \n /// \u4e3b\u952eId\n /// \n [Key]\n [DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n }\n}\n")),Object(c.b)("h3",{id:"92725-\u5c06-person-\u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868"},"9.27.2.5 \u5c06 ",Object(c.b)("inlineCode",{parentName:"h3"},"Person")," \u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868"),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u521b\u5efa\u4e3b\u5e93\u6570\u636e\u5e93\u8868\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v0.0.1 -Context MasterDbContext\n")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MasterDbContext\n")),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u521b\u5efa\u4ece\u5e93\u6570\u636e\u5e93\u8868\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v0.0.1 -Context SlaveDbContext\n")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context SlaveDbContext\n")),Object(c.b)("img",{src:Object(i.a)("img/readwrite1.png")}),Object(c.b)("img",{src:Object(i.a)("img/readwrite2.png")}),Object(c.b)("h3",{id:"92726-\u4f7f\u7528\u4f8b\u5b50"},"9.27.2.6 \u4f7f\u7528\u4f8b\u5b50"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,19,31,40}","{13,19,31,40}":!0}),'using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public class PersonService : IDynamicApiController\n {\n /// \n /// \u53ef\u8c03\u914d\u4ed3\u50a8\uff08\u8bfb\u5199\u5206\u79bb\uff09\n /// \n private readonly IMSRepository _msRepository;\n\n /// \n /// \u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\n /// \n /// \n public PersonService(IMSRepository msRepository)\n {\n _msRepository = msRepository;\n }\n\n /// \n /// \u65b0\u589e\u8d70\u4e3b\u5e93\n /// \n /// \n /// \n public void Insert(Person person)\n {\n _msRepository.Master().Insert(person);\n }\n\n /// \n /// \u67e5\u8be2\u8d70\u4ece\u5e93\n /// \n /// \n public List Get()\n {\n return _msRepository.Slave1().AsEnumerable();\n }\n }\n}\n')),Object(c.b)("h2",{id:"9273-\u4e3b\u4ece\u590d\u5236"},"9.27.3 \u4e3b\u4ece\u590d\u5236"),Object(c.b)("p",null,"\u4e3b\u4ece\u590d\u5236\uff1a\u662f\u4e00\u79cd\u6570\u636e\u5907\u4efd\u7684\u65b9\u6848\u3002"),Object(c.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u662f\u4f7f\u7528\u4e24\u4e2a\u6216\u4e24\u4e2a\u4ee5\u4e0a\u76f8\u540c\u7684\u6570\u636e\u5e93\uff0c\u5c06\u4e00\u4e2a\u6570\u636e\u5e93\u5f53\u505a\u4e3b\u6570\u636e\u5e93\uff0c\u800c\u53e6\u4e00\u4e2a\u6570\u636e\u5e93\u5f53\u505a\u4ece\u6570\u636e\u5e93\u3002",Object(c.b)("strong",{parentName:"p"},"\u5728\u4e3b\u6570\u636e\u5e93\u4e2d\u8fdb\u884c\u76f8\u5e94\u64cd\u4f5c\u65f6\uff0c\u4ece\u6570\u636e\u5e93\u8bb0\u5f55\u4e0b\u6240\u6709\u4e3b\u6570\u636e\u5e93\u7684\u64cd\u4f5c\uff0c\u4f7f\u5176\u4e8c\u8005\u4e00\u6a21\u4e00\u6837\u3002")),Object(c.b)("h2",{id:"9274-\u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f"},"9.27.4 \u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f"),Object(c.b)("h3",{id:"92741-\u540c\u6b65\u590d\u5236"},"9.27.4.1 \u540c\u6b65\u590d\u5236"),Object(c.b)("p",null,"\u6240\u8c13\u7684\u540c\u6b65\u590d\u5236\uff0c\u610f\u601d\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"Master")," \u7684\u53d8\u5316\uff0c\u5fc5\u987b\u7b49\u5f85 ",Object(c.b)("inlineCode",{parentName:"p"},"Slave-1\uff0cSlave-2\uff0c...\uff0cSlave-n")," \u5b8c\u6210\u540e\u624d\u80fd\u8fd4\u56de\u3002\n\u8fd9\u6837\uff0c\u663e\u7136\u4e0d\u53ef\u53d6\uff0c\u6bd4\u5982\uff0c\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Web")," \u524d\u7aef\u9875\u9762\u4e0a\uff0c\u7528\u6237\u589e\u52a0\u4e86\u6761\u8bb0\u5f55\uff0c\u9700\u8981\u7b49\u5f85\u5f88\u957f\u65f6\u95f4\u3002"),Object(c.b)("h3",{id:"92742-\u5f02\u6b65\u590d\u5236"},"9.27.4.2 \u5f02\u6b65\u590d\u5236"),Object(c.b)("p",null,"\u5982\u540c AJAX \u8bf7\u6c42\u4e00\u6837\u3002",Object(c.b)("inlineCode",{parentName:"p"},"Master")," \u53ea\u9700\u8981\u5b8c\u6210\u81ea\u5df1\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u5373\u53ef\u3002\u81f3\u4e8e ",Object(c.b)("inlineCode",{parentName:"p"},"Slaves")," \u662f\u5426\u6536\u5230\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u662f\u5426\u5b8c\u6210\u64cd\u4f5c\uff0c\u4e0d\u7528\u5173\u5fc3\u3002",Object(c.b)("strong",{parentName:"p"},"\uff08\u63a8\u8350\u65b9\u5f0f\uff09")),Object(c.b)("h3",{id:"92743-\u534a\u540c\u6b65\u590d\u5236"},"9.27.4.3 \u534a\u540c\u6b65\u590d\u5236"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Master")," \u53ea\u4fdd\u8bc1 ",Object(c.b)("inlineCode",{parentName:"p"},"Slaves")," \u4e2d\u7684\u4e00\u4e2a\u64cd\u4f5c\u6210\u529f\uff0c\u5c31\u8fd4\u56de\uff0c\u5176\u4ed6 ",Object(c.b)("inlineCode",{parentName:"p"},"Slave")," \u4e0d\u7ba1\u3002"),Object(c.b)("p",null,"\u4e0b\u9762\u5c06\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"SqlServer")," \u7b80\u5355\u914d\u7f6e\u4e3b\u4ece\u590d\u5236\u529f\u80fd\u3002"),Object(c.b)("h2",{id:"9275-sqlserver-\u4e3b\u5e93\u914d\u7f6e"},"9.27.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"SqlServer")," \u4e3b\u5e93\u914d\u7f6e"),Object(c.b)("h3",{id:"92751-\u6dfb\u52a0-\u672c\u5730\u53d1\u5e03"},"9.27.5.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u672c\u5730\u53d1\u5e03")),Object(c.b)("img",{src:Object(i.a)("img/dbcopy1.png")}),Object(c.b)("h3",{id:"92752-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668"},"9.27.5.2 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u670d\u52a1\u5668")),Object(c.b)("img",{src:Object(i.a)("img/dbcopy2.png")}),Object(c.b)("h3",{id:"92753-\u542f\u7528-\u4ee3\u7406"},"9.27.5.3 \u542f\u7528 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4ee3\u7406")),Object(c.b)("img",{src:Object(i.a)("img/dbcopy3.png")}),Object(c.b)("h3",{id:"92754-\u53d1\u5e03\u6570\u636e\u5e93"},"9.27.5.4 \u53d1\u5e03\u6570\u636e\u5e93"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy4.png")}),Object(c.b)("h3",{id:"92755-\u5feb\u7167\u53d1\u5e03"},"9.27.5.5 \u5feb\u7167\u53d1\u5e03"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy5.png")}),Object(c.b)("p",null,"\u5177\u4f53\u9009\u62e9\u4f55\u79cd\u53d1\u5e03\u7c7b\u578b\uff0c\u89c6\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u800c\u5b9a\u3002"),Object(c.b)("h3",{id:"92756-\u9009\u62e9\u53d1\u5e03\u9879\u76ee"},"9.27.5.6 \u9009\u62e9\u53d1\u5e03\u9879\u76ee"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy6.png")}),Object(c.b)("h3",{id:"92757-\u914d\u7f6e\u5206\u53d1\u8ba1\u5212"},"9.27.5.7 \u914d\u7f6e\u5206\u53d1\u8ba1\u5212"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy7.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbcopy8.png")}),Object(c.b)("h3",{id:"92758-\u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e"},"9.27.5.8 \u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy9.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbcopy10.png")}),Object(c.b)("h3",{id:"92759-\u5b8c\u6210\u914d\u7f6e"},"9.27.5.9 \u5b8c\u6210\u914d\u7f6e"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy11.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbcopy12.png")}),Object(c.b)("h2",{id:"9276-sqlserver-\u4ece\u5e93\u914d\u7f6e"},"9.27.6 ",Object(c.b)("inlineCode",{parentName:"h2"},"SqlServer")," \u4ece\u5e93\u914d\u7f6e"),Object(c.b)("h3",{id:"92761-\u6dfb\u52a0-\u672c\u5730\u8ba2\u9605"},"9.27.6.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u672c\u5730\u8ba2\u9605")),Object(c.b)("img",{src:Object(i.a)("img/dbrece1.png")}),Object(c.b)("h3",{id:"92762-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668"},"9.27.6.2 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u670d\u52a1\u5668")),Object(c.b)("img",{src:Object(i.a)("img/dbrece2.png")}),Object(c.b)("h3",{id:"92763-\u9009\u62e9-\u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e"},"9.27.6.3 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e")),Object(c.b)("img",{src:Object(i.a)("img/dbrece3.png")}),Object(c.b)("h3",{id:"92764-\u9009\u62e9-\u8ba2\u9605\u6570\u636e\u5e93"},"9.27.6.4 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u8ba2\u9605\u6570\u636e\u5e93")),Object(c.b)("img",{src:Object(i.a)("img/dbrece4.png")}),Object(c.b)("h3",{id:"92765-\u9009\u62e9-\u5206\u53d1\u5b89\u5168\u8bbe\u7f6e"},"9.27.6.5 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u5b89\u5168\u8bbe\u7f6e")),Object(c.b)("img",{src:Object(i.a)("img/dbrece5.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbrece6.png")}),Object(c.b)("h3",{id:"92766-\u9009\u62e9-\u540c\u6b65\u8ba1\u5212"},"9.27.6.6 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u540c\u6b65\u8ba1\u5212")),Object(c.b)("img",{src:Object(i.a)("img/dbrece7.png")}),Object(c.b)("h3",{id:"92767-\u5b8c\u6210\u8ba2\u9605"},"9.27.6.7 \u5b8c\u6210\u8ba2\u9605"),Object(c.b)("img",{src:Object(i.a)("img/dbrece8.png")}),Object(c.b)("h2",{id:"9277-\u5206\u53d1\u5b9a\u4e49\u76d1\u89c6"},"9.27.7 \u5206\u53d1\u5b9a\u4e49\u76d1\u89c6"),Object(c.b)("img",{src:Object(i.a)("img/dbrece9.png")}),Object(c.b)("h2",{id:"9278-\u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c"},"9.27.8 \u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c"),Object(c.b)("img",{src:Object(i.a)("img/dbrece10.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbrece11.png")}),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u7279\u6027")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},'\u4e3b\u4ece\u590d\u5236\u6709\u4e00\u5b9a\u8fdf\u5ef6\u6027\uff0c\u6240\u4ee5\u7cfb\u7edf\u8bbe\u8ba1\u8981\u6709\u4e00\u5b9a\u201c\u5bb9\u5fcd\u6027"\u3002'))),Object(c.b)("h2",{id:"9279-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.27.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"a",(function(){return i}));var a=t(21),r=t(191);function c(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const i=t.startsWith(n)?t:n+t.replace(/^\//,"");return c?e+i:i}(n,e,t,a)}}function i(e,n={}){const{withBaseUrl:t}=c();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return u}));var a=t(0),r=t.n(a);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=r.a.createContext({}),l=function(e){var n=r.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},d=function(e){var n=l(e.components);return r.a.createElement(s.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},m=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),d=l(t),m=a,u=d["".concat(i,".").concat(m)]||d[m]||p[m]||c;return t?r.a.createElement(u,b(b({ref:n},s),{},{components:t})):r.a.createElement(u,b({ref:n},s))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var c=t.length,i=new Array(c);i[0]=m;var b={};for(var o in n)hasOwnProperty.call(n,o)&&(b[o]=n[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,i[1]=b;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{110:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return p}));var a=t(3),r=t(7),c=(t(0),t(196)),i=t(194),b=t(197),o={id:"dbcontext-read-write",title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",sidebar_label:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236"},s={unversionedId:"dbcontext-read-write",id:"dbcontext-read-write",isDocsHomePage:!1,title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",description:"9.27.1 \u8bfb\u5199\u5206\u79bb",source:"@site/docs\\dbcontext-read-write.mdx",slug:"/dbcontext-read-write",permalink:"/docs/dbcontext-read-write",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-read-write.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",sidebar:"docs",previous:{title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",permalink:"/docs/tran"},next:{title:"9.28 \u5206\u8868\u5206\u5e93",permalink:"/docs/split-db"}},l=[{value:"9.27.1 \u8bfb\u5199\u5206\u79bb",id:"9271-\u8bfb\u5199\u5206\u79bb",children:[{value:"9.27.1.1 \u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898",id:"92711-\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898",children:[]},{value:"9.27.1.2 \u6ce8\u610f\u4e8b\u9879",id:"92712-\u6ce8\u610f\u4e8b\u9879",children:[]}]},{value:"9.27.2 \u5982\u4f55\u5b9e\u73b0",id:"9272-\u5982\u4f55\u5b9e\u73b0",children:[{value:"9.27.2.1 \u521b\u5efa \u4e3b\u5e93 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"92721-\u521b\u5efa-\u4e3b\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.27.2.2 \u521b\u5efa \u4ece\u5e93 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"92722-\u521b\u5efa-\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.27.2.3 \u6ce8\u518c \u4e3b\u4ece\u5e93 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",id:"92723-\u6ce8\u518c-\u4e3b\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587",children:[]},{value:"9.27.2.4 \u521b\u5efa Person \u5b9e\u4f53",id:"92724-\u521b\u5efa-person-\u5b9e\u4f53",children:[]},{value:"9.27.2.5 \u5c06 Person \u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868",id:"92725-\u5c06-person-\u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868",children:[]},{value:"9.27.2.6 \u4f7f\u7528\u4f8b\u5b50",id:"92726-\u4f7f\u7528\u4f8b\u5b50",children:[]}]},{value:"9.27.3 \u4e3b\u4ece\u590d\u5236",id:"9273-\u4e3b\u4ece\u590d\u5236",children:[]},{value:"9.27.4 \u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f",id:"9274-\u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f",children:[{value:"9.27.4.1 \u540c\u6b65\u590d\u5236",id:"92741-\u540c\u6b65\u590d\u5236",children:[]},{value:"9.27.4.2 \u5f02\u6b65\u590d\u5236",id:"92742-\u5f02\u6b65\u590d\u5236",children:[]},{value:"9.27.4.3 \u534a\u540c\u6b65\u590d\u5236",id:"92743-\u534a\u540c\u6b65\u590d\u5236",children:[]}]},{value:"9.27.5 SqlServer \u4e3b\u5e93\u914d\u7f6e",id:"9275-sqlserver-\u4e3b\u5e93\u914d\u7f6e",children:[{value:"9.27.5.1 \u6dfb\u52a0 \u672c\u5730\u53d1\u5e03",id:"92751-\u6dfb\u52a0-\u672c\u5730\u53d1\u5e03",children:[]},{value:"9.27.5.2 \u9009\u62e9 \u5206\u53d1\u670d\u52a1\u5668",id:"92752-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668",children:[]},{value:"9.27.5.3 \u542f\u7528 \u4ee3\u7406",id:"92753-\u542f\u7528-\u4ee3\u7406",children:[]},{value:"9.27.5.4 \u53d1\u5e03\u6570\u636e\u5e93",id:"92754-\u53d1\u5e03\u6570\u636e\u5e93",children:[]},{value:"9.27.5.5 \u5feb\u7167\u53d1\u5e03",id:"92755-\u5feb\u7167\u53d1\u5e03",children:[]},{value:"9.27.5.6 \u9009\u62e9\u53d1\u5e03\u9879\u76ee",id:"92756-\u9009\u62e9\u53d1\u5e03\u9879\u76ee",children:[]},{value:"9.27.5.7 \u914d\u7f6e\u5206\u53d1\u8ba1\u5212",id:"92757-\u914d\u7f6e\u5206\u53d1\u8ba1\u5212",children:[]},{value:"9.27.5.8 \u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e",id:"92758-\u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e",children:[]},{value:"9.27.5.9 \u5b8c\u6210\u914d\u7f6e",id:"92759-\u5b8c\u6210\u914d\u7f6e",children:[]}]},{value:"9.27.6 SqlServer \u4ece\u5e93\u914d\u7f6e",id:"9276-sqlserver-\u4ece\u5e93\u914d\u7f6e",children:[{value:"9.27.6.1 \u6dfb\u52a0 \u672c\u5730\u8ba2\u9605",id:"92761-\u6dfb\u52a0-\u672c\u5730\u8ba2\u9605",children:[]},{value:"9.27.6.2 \u9009\u62e9 \u5206\u53d1\u670d\u52a1\u5668",id:"92762-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668",children:[]},{value:"9.27.6.3 \u9009\u62e9 \u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e",id:"92763-\u9009\u62e9-\u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e",children:[]},{value:"9.27.6.4 \u9009\u62e9 \u8ba2\u9605\u6570\u636e\u5e93",id:"92764-\u9009\u62e9-\u8ba2\u9605\u6570\u636e\u5e93",children:[]},{value:"9.27.6.5 \u9009\u62e9 \u5206\u53d1\u5b89\u5168\u8bbe\u7f6e",id:"92765-\u9009\u62e9-\u5206\u53d1\u5b89\u5168\u8bbe\u7f6e",children:[]},{value:"9.27.6.6 \u9009\u62e9 \u540c\u6b65\u8ba1\u5212",id:"92766-\u9009\u62e9-\u540c\u6b65\u8ba1\u5212",children:[]},{value:"9.27.6.7 \u5b8c\u6210\u8ba2\u9605",id:"92767-\u5b8c\u6210\u8ba2\u9605",children:[]}]},{value:"9.27.7 \u5206\u53d1\u5b9a\u4e49\u76d1\u89c6",id:"9277-\u5206\u53d1\u5b9a\u4e49\u76d1\u89c6",children:[]},{value:"9.27.8 \u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c",id:"9278-\u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c",children:[]},{value:"9.27.9 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9279-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:l};function p(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9271-\u8bfb\u5199\u5206\u79bb"},"9.27.1 \u8bfb\u5199\u5206\u79bb"),Object(c.b)("p",null,"\u5176\u5b9e\u5c31\u662f\u5c06\u6570\u636e\u5e93\u5206\u4e3a\u4e86\u4e3b\u4ece\u5e93\uff0c\u4e00\u4e2a\u4e3b\u5e93\u7528\u4e8e\u5199\u6570\u636e\uff0c\u591a\u4e2a\u4ece\u5e93\u5b8c\u6210\u8bfb\u6570\u636e\u7684\u64cd\u4f5c\uff0c\u4e3b\u4ece\u5e93\u4e4b\u95f4\u901a\u8fc7\u67d0\u79cd\u673a\u5236\u8fdb\u884c\u6570\u636e\u7684\u540c\u6b65\uff0c\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u6570\u636e\u5e93\u67b6\u6784\u3002"),Object(c.b)("img",{src:Object(i.a)("img/readwrite.png"),style:{height:300}}),Object(c.b)("h3",{id:"92711-\u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898"},"9.27.1.1 \u89e3\u51b3\u4e86\u4ec0\u4e48\u95ee\u9898"),Object(c.b)("p",null,"\u5927\u591a\u6570\u4e92\u8054\u7f51\u4e1a\u52a1\uff0c\u5f80\u5f80\u8bfb\u591a\u5199\u5c11\uff0c\u8fd9\u65f6\u5019\uff0c\u6570\u636e\u5e93\u7684\u8bfb\u4f1a\u9996\u5148\u6210\u4e3a\u6570\u636e\u5e93\u7684\u74f6\u9888\uff0c\u8fd9\u65f6\uff0c\u5982\u679c\u6211\u4eec\u5e0c\u671b\u80fd\u591f\u7ebf\u6027\u7684\u63d0\u5347\u6570\u636e\u5e93\u7684\u8bfb\u6027\u80fd\uff0c\u6d88\u9664\u8bfb\u5199\u9501\u51b2\u7a81\u4ece\u800c\u63d0\u5347\u6570\u636e\u5e93\u7684\u5199\u6027\u80fd\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u4f7f\u7528\u201c\u5206\u7ec4\u67b6\u6784\u201d\uff08\u8bfb\u5199\u5206\u79bb\u67b6\u6784\uff09\u3002"),Object(c.b)("p",null,"\u7528\u4e00\u53e5\u8bdd\u6982\u62ec\uff0c\u8bfb\u5199\u5206\u79bb\u662f\u7528\u6765\u89e3\u51b3\u6570\u636e\u5e93\u7684\u8bfb\u6027\u80fd\u74f6\u9888\u7684\u3002"),Object(c.b)("h3",{id:"92712-\u6ce8\u610f\u4e8b\u9879"},"9.27.1.2 \u6ce8\u610f\u4e8b\u9879"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u6570\u636e\u5e93\u8fde\u63a5\u6c60\u8981\u8fdb\u884c\u533a\u5206\uff0c\u54ea\u4e9b\u662f\u8bfb\u8fde\u63a5\u6c60\uff0c\u54ea\u4e2a\u662f\u5199\u8fde\u63a5\u6c60\uff0c\u7814\u53d1\u7684\u96be\u5ea6\u4f1a\u589e\u52a0\uff1b"),Object(c.b)("li",{parentName:"ul"},"\u4e3a\u4e86\u4fdd\u8bc1\u9ad8\u53ef\u7528\uff0c\u8bfb\u8fde\u63a5\u6c60\u8981\u80fd\u591f\u5b9e\u73b0\u6545\u969c\u81ea\u52a8\u8f6c\u79fb\uff1b"),Object(c.b)("li",{parentName:"ul"},"\u4e3b\u4ece\u7684\u4e00\u81f4\u6027\u95ee\u9898\u9700\u8981\u8003\u8651\u3002")),Object(c.b)("h2",{id:"9272-\u5982\u4f55\u5b9e\u73b0"},"9.27.2 \u5982\u4f55\u5b9e\u73b0"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5728\u6570\u636e\u5e93\u6a21\u5757\u8bbe\u8ba1\u4e4b\u521d\uff0c\u5c31\u8003\u8651\u4e86\u8bfb\u5199\u5206\u79bb\u8fd9\u79cd\u60c5\u51b5\uff0c\u6240\u4ee5\u4ece\u5e95\u5c42\u5c31\u652f\u6301\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u53ca\u8bfb\u5199\u64cd\u4f5c\u65b9\u6cd5\u7ea6\u675f\u3002"),Object(c.b)("p",null,"\u8bfb\u5199\u5206\u79bb\u64cd\u4f5c\u4e3b\u8981\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"IMSRepository")," \u4ed3\u50a8\uff0c\u8be5\u4ed3\u50a8\u5df2\u7ecf\u4e3a\u5f00\u53d1\u8005\u63d0\u4f9b\u65b9\u4fbf\u7684\u64cd\u4f5c\u8c03\u7528\u3002\u5f53\u7136\u4e5f\u53ef\u4ee5\u4e0d\u4f7f\u7528\u8be5\u4ed3\u50a8\u3002"),Object(c.b)("p",null,"\u4e0b\u9762\u5c31\u7ed9\u5927\u5bb6\u6f14\u793a\u5982\u4f55\u8bfb\u5199\u591a\u5e93\u8bfb\u5199\u64cd\u4f5c\u3002"),Object(c.b)("h3",{id:"92721-\u521b\u5efa-\u4e3b\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.27.2.1 \u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4e3b\u5e93")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n /// \n /// \u4e3b\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n /// \n [AppDbContext("MasterConnectionString")]\n public class MasterDbContext : AppDbContext\n {\n public MasterDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "ConnectionStrings": {\n "MasterConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;"\n }\n}\n')),Object(c.b)("h3",{id:"92722-\u521b\u5efa-\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.27.2.2 \u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4ece\u5e93")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11}","{11}":!0}),'using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n /// \n /// \u4ece\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n /// \n [AppDbContext("SlaveConnectionString")]\n public class SlaveDbContext : AppDbContext\n {\n public SlaveDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u9664\u4e86\u9ed8\u8ba4\u6570\u636e\u5e93\u65e0\u9700\u81ea\u5b9a\u4e49 ",Object(c.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\uff0c\u5176\u4ed6\u6570\u636e\u5e93\u90fd\u9700\u8981\u6709\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u3002\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"SlaveDbContextLocator")))),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4ece\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n /// \n /// \u4ece\u5e93\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\n /// \n public class SlaveDbContextLocator : IDbContextLocator\n {\n }\n}\n")),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "ConnectionStrings": {\n "SlaveConnectionString": "Server=localhost;Database=FurSlave;User=sa;Password=000000;MultipleActiveResultSets=True;"\n }\n}\n')),Object(c.b)("h3",{id:"92723-\u6ce8\u518c-\u4e3b\u4ece\u5e93-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"},"9.27.2.3 \u6ce8\u518c ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4e3b\u4ece\u5e93")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13-14}","{13-14}":!0}),"using Furion.Core;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(600)]\n public sealed class FurEntityFrameworkCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDatabaseAccessor(options =>\n {\n services.AddSqlServerPool();\n services.AddSqlServerPool();\n });\n }\n }\n}\n")),Object(c.b)("h3",{id:"92724-\u521b\u5efa-person-\u5b9e\u4f53"},"9.27.2.4 \u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"h3"},"Person")," \u5b9e\u4f53"),Object(c.b)("p",null,"\u7531\u4e8e ",Object(c.b)("inlineCode",{parentName:"p"},"\u4e3b\u4ece\u5e93")," \u5177\u6709\u76f8\u540c\u7684\u6570\u636e\u5e93\u7ed3\u6784\uff0c\u6240\u4ee5\u5b9e\u4f53\u4e5f\u5fc5\u987b\u58f0\u660e ",Object(c.b)("inlineCode",{parentName:"p"},"\u4e3b\u4ece\u5e93"),"\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7}","{7}":!0}),"using Furion.DatabaseAccessor;\nusing System.ComponentModel.DataAnnotations;\nusing System.ComponentModel.DataAnnotations.Schema;\n\nnamespace Furion.Core\n{\n public class Person : IEntity\n {\n /// \n /// \u4e3b\u952eId\n /// \n [Key]\n [DatabaseGenerated(DatabaseGeneratedOption.Identity)]\n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n }\n}\n")),Object(c.b)("h3",{id:"92725-\u5c06-person-\u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868"},"9.27.2.5 \u5c06 ",Object(c.b)("inlineCode",{parentName:"h3"},"Person")," \u8f6c\u6362\u6210\u6570\u636e\u5e93\u8868"),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u521b\u5efa\u4e3b\u5e93\u6570\u636e\u5e93\u8868\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v0.0.1 -Context MasterDbContext\n")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context MasterDbContext\n")),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u521b\u5efa\u4ece\u5e93\u6570\u636e\u5e93\u8868\uff1a")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v0.0.1 -Context SlaveDbContext\n")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database -Context SlaveDbContext\n")),Object(c.b)("img",{src:Object(i.a)("img/readwrite1.png")}),Object(c.b)("img",{src:Object(i.a)("img/readwrite2.png")}),Object(c.b)("h3",{id:"92726-\u4f7f\u7528\u4f8b\u5b50"},"9.27.2.6 \u4f7f\u7528\u4f8b\u5b50"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,19,31,40}","{13,19,31,40}":!0}),'using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DynamicApiController;\nusing System.Collections.Generic;\n\nnamespace Furion.Application\n{\n public class PersonService : IDynamicApiController\n {\n /// \n /// \u53ef\u8c03\u914d\u4ed3\u50a8\uff08\u8bfb\u5199\u5206\u79bb\uff09\n /// \n private readonly IMSRepository _msRepository;\n\n /// \n /// \u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\n /// \n /// \n public PersonService(IMSRepository msRepository)\n {\n _msRepository = msRepository;\n }\n\n /// \n /// \u65b0\u589e\u8d70\u4e3b\u5e93\n /// \n /// \n /// \n public void Insert(Person person)\n {\n _msRepository.Master().Insert(person);\n }\n\n /// \n /// \u67e5\u8be2\u8d70\u4ece\u5e93\n /// \n /// \n public List Get()\n {\n return _msRepository.Slave1().AsEnumerable();\n }\n }\n}\n')),Object(c.b)("h2",{id:"9273-\u4e3b\u4ece\u590d\u5236"},"9.27.3 \u4e3b\u4ece\u590d\u5236"),Object(c.b)("p",null,"\u4e3b\u4ece\u590d\u5236\uff1a\u662f\u4e00\u79cd\u6570\u636e\u5907\u4efd\u7684\u65b9\u6848\u3002"),Object(c.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u662f\u4f7f\u7528\u4e24\u4e2a\u6216\u4e24\u4e2a\u4ee5\u4e0a\u76f8\u540c\u7684\u6570\u636e\u5e93\uff0c\u5c06\u4e00\u4e2a\u6570\u636e\u5e93\u5f53\u505a\u4e3b\u6570\u636e\u5e93\uff0c\u800c\u53e6\u4e00\u4e2a\u6570\u636e\u5e93\u5f53\u505a\u4ece\u6570\u636e\u5e93\u3002",Object(c.b)("strong",{parentName:"p"},"\u5728\u4e3b\u6570\u636e\u5e93\u4e2d\u8fdb\u884c\u76f8\u5e94\u64cd\u4f5c\u65f6\uff0c\u4ece\u6570\u636e\u5e93\u8bb0\u5f55\u4e0b\u6240\u6709\u4e3b\u6570\u636e\u5e93\u7684\u64cd\u4f5c\uff0c\u4f7f\u5176\u4e8c\u8005\u4e00\u6a21\u4e00\u6837\u3002")),Object(c.b)("h2",{id:"9274-\u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f"},"9.27.4 \u4e3b\u4ece\u590d\u5236\u51e0\u79cd\u65b9\u5f0f"),Object(c.b)("h3",{id:"92741-\u540c\u6b65\u590d\u5236"},"9.27.4.1 \u540c\u6b65\u590d\u5236"),Object(c.b)("p",null,"\u6240\u8c13\u7684\u540c\u6b65\u590d\u5236\uff0c\u610f\u601d\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"Master")," \u7684\u53d8\u5316\uff0c\u5fc5\u987b\u7b49\u5f85 ",Object(c.b)("inlineCode",{parentName:"p"},"Slave-1\uff0cSlave-2\uff0c...\uff0cSlave-n")," \u5b8c\u6210\u540e\u624d\u80fd\u8fd4\u56de\u3002\n\u8fd9\u6837\uff0c\u663e\u7136\u4e0d\u53ef\u53d6\uff0c\u6bd4\u5982\uff0c\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Web")," \u524d\u7aef\u9875\u9762\u4e0a\uff0c\u7528\u6237\u589e\u52a0\u4e86\u6761\u8bb0\u5f55\uff0c\u9700\u8981\u7b49\u5f85\u5f88\u957f\u65f6\u95f4\u3002"),Object(c.b)("h3",{id:"92742-\u5f02\u6b65\u590d\u5236"},"9.27.4.2 \u5f02\u6b65\u590d\u5236"),Object(c.b)("p",null,"\u5982\u540c AJAX \u8bf7\u6c42\u4e00\u6837\u3002",Object(c.b)("inlineCode",{parentName:"p"},"Master")," \u53ea\u9700\u8981\u5b8c\u6210\u81ea\u5df1\u7684\u6570\u636e\u5e93\u64cd\u4f5c\u5373\u53ef\u3002\u81f3\u4e8e ",Object(c.b)("inlineCode",{parentName:"p"},"Slaves")," \u662f\u5426\u6536\u5230\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u662f\u5426\u5b8c\u6210\u64cd\u4f5c\uff0c\u4e0d\u7528\u5173\u5fc3\u3002",Object(c.b)("strong",{parentName:"p"},"\uff08\u63a8\u8350\u65b9\u5f0f\uff09")),Object(c.b)("h3",{id:"92743-\u534a\u540c\u6b65\u590d\u5236"},"9.27.4.3 \u534a\u540c\u6b65\u590d\u5236"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Master")," \u53ea\u4fdd\u8bc1 ",Object(c.b)("inlineCode",{parentName:"p"},"Slaves")," \u4e2d\u7684\u4e00\u4e2a\u64cd\u4f5c\u6210\u529f\uff0c\u5c31\u8fd4\u56de\uff0c\u5176\u4ed6 ",Object(c.b)("inlineCode",{parentName:"p"},"Slave")," \u4e0d\u7ba1\u3002"),Object(c.b)("p",null,"\u4e0b\u9762\u5c06\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"SqlServer")," \u7b80\u5355\u914d\u7f6e\u4e3b\u4ece\u590d\u5236\u529f\u80fd\u3002"),Object(c.b)("h2",{id:"9275-sqlserver-\u4e3b\u5e93\u914d\u7f6e"},"9.27.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"SqlServer")," \u4e3b\u5e93\u914d\u7f6e"),Object(c.b)("h3",{id:"92751-\u6dfb\u52a0-\u672c\u5730\u53d1\u5e03"},"9.27.5.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u672c\u5730\u53d1\u5e03")),Object(c.b)("img",{src:Object(i.a)("img/dbcopy1.png")}),Object(c.b)("h3",{id:"92752-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668"},"9.27.5.2 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u670d\u52a1\u5668")),Object(c.b)("img",{src:Object(i.a)("img/dbcopy2.png")}),Object(c.b)("h3",{id:"92753-\u542f\u7528-\u4ee3\u7406"},"9.27.5.3 \u542f\u7528 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4ee3\u7406")),Object(c.b)("img",{src:Object(i.a)("img/dbcopy3.png")}),Object(c.b)("h3",{id:"92754-\u53d1\u5e03\u6570\u636e\u5e93"},"9.27.5.4 \u53d1\u5e03\u6570\u636e\u5e93"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy4.png")}),Object(c.b)("h3",{id:"92755-\u5feb\u7167\u53d1\u5e03"},"9.27.5.5 \u5feb\u7167\u53d1\u5e03"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy5.png")}),Object(c.b)("p",null,"\u5177\u4f53\u9009\u62e9\u4f55\u79cd\u53d1\u5e03\u7c7b\u578b\uff0c\u89c6\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u800c\u5b9a\u3002"),Object(c.b)("h3",{id:"92756-\u9009\u62e9\u53d1\u5e03\u9879\u76ee"},"9.27.5.6 \u9009\u62e9\u53d1\u5e03\u9879\u76ee"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy6.png")}),Object(c.b)("h3",{id:"92757-\u914d\u7f6e\u5206\u53d1\u8ba1\u5212"},"9.27.5.7 \u914d\u7f6e\u5206\u53d1\u8ba1\u5212"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy7.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbcopy8.png")}),Object(c.b)("h3",{id:"92758-\u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e"},"9.27.5.8 \u914d\u7f6e\u5b89\u5168\u8bbe\u7f6e"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy9.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbcopy10.png")}),Object(c.b)("h3",{id:"92759-\u5b8c\u6210\u914d\u7f6e"},"9.27.5.9 \u5b8c\u6210\u914d\u7f6e"),Object(c.b)("img",{src:Object(i.a)("img/dbcopy11.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbcopy12.png")}),Object(c.b)("h2",{id:"9276-sqlserver-\u4ece\u5e93\u914d\u7f6e"},"9.27.6 ",Object(c.b)("inlineCode",{parentName:"h2"},"SqlServer")," \u4ece\u5e93\u914d\u7f6e"),Object(c.b)("h3",{id:"92761-\u6dfb\u52a0-\u672c\u5730\u8ba2\u9605"},"9.27.6.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u672c\u5730\u8ba2\u9605")),Object(c.b)("img",{src:Object(i.a)("img/dbrece1.png")}),Object(c.b)("h3",{id:"92762-\u9009\u62e9-\u5206\u53d1\u670d\u52a1\u5668"},"9.27.6.2 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u670d\u52a1\u5668")),Object(c.b)("img",{src:Object(i.a)("img/dbrece2.png")}),Object(c.b)("h3",{id:"92763-\u9009\u62e9-\u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e"},"9.27.6.3 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u4ee3\u7406\u4f4d\u7f6e")),Object(c.b)("img",{src:Object(i.a)("img/dbrece3.png")}),Object(c.b)("h3",{id:"92764-\u9009\u62e9-\u8ba2\u9605\u6570\u636e\u5e93"},"9.27.6.4 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u8ba2\u9605\u6570\u636e\u5e93")),Object(c.b)("img",{src:Object(i.a)("img/dbrece4.png")}),Object(c.b)("h3",{id:"92765-\u9009\u62e9-\u5206\u53d1\u5b89\u5168\u8bbe\u7f6e"},"9.27.6.5 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5206\u53d1\u5b89\u5168\u8bbe\u7f6e")),Object(c.b)("img",{src:Object(i.a)("img/dbrece5.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbrece6.png")}),Object(c.b)("h3",{id:"92766-\u9009\u62e9-\u540c\u6b65\u8ba1\u5212"},"9.27.6.6 \u9009\u62e9 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u540c\u6b65\u8ba1\u5212")),Object(c.b)("img",{src:Object(i.a)("img/dbrece7.png")}),Object(c.b)("h3",{id:"92767-\u5b8c\u6210\u8ba2\u9605"},"9.27.6.7 \u5b8c\u6210\u8ba2\u9605"),Object(c.b)("img",{src:Object(i.a)("img/dbrece8.png")}),Object(c.b)("h2",{id:"9277-\u5206\u53d1\u5b9a\u4e49\u76d1\u89c6"},"9.27.7 \u5206\u53d1\u5b9a\u4e49\u76d1\u89c6"),Object(c.b)("img",{src:Object(i.a)("img/dbrece9.png")}),Object(c.b)("h2",{id:"9278-\u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c"},"9.27.8 \u67e5\u770b\u4e3b\u4ece\u590d\u5236\u7ed3\u679c"),Object(c.b)("img",{src:Object(i.a)("img/dbrece10.png")}),Object(c.b)("img",{src:Object(i.a)("img/dbrece11.png")}),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u7279\u6027")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},'\u4e3b\u4ece\u590d\u5236\u6709\u4e00\u5b9a\u8fdf\u5ef6\u6027\uff0c\u6240\u4ee5\u7cfb\u7edf\u8bbe\u8ba1\u8981\u6709\u4e00\u5b9a\u201c\u5bb9\u5fcd\u6027"\u3002'))),Object(c.b)("h2",{id:"9279-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.27.9 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"a",(function(){return i}));var a=t(21),r=t(195);function c(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const i=t.startsWith(n)?t:n+t.replace(/^\//,"");return c?e+i:i}(n,e,t,a)}}function i(e,n={}){const{withBaseUrl:t}=c();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return u}));var a=t(0),r=t.n(a);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=r.a.createContext({}),l=function(e){var n=r.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},d=function(e){var n=l(e.components);return r.a.createElement(s.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},m=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,s=o(e,["components","mdxType","originalType","parentName"]),d=l(t),m=a,u=d["".concat(i,".").concat(m)]||d[m]||p[m]||c;return t?r.a.createElement(u,b(b({ref:n},s),{},{components:t})):r.a.createElement(u,b({ref:n},s))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var c=t.length,i=new Array(c);i[0]=m;var b={};for(var o in n)hasOwnProperty.call(n,o)&&(b[o]=n[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,i[1]=b;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/4e3694ae.59a32235.js b/docs/4e3694ae.59a32235.js new file mode 100644 index 00000000000..c08c0e2f7ec --- /dev/null +++ b/docs/4e3694ae.59a32235.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{111:function(o){o.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"furos","name":"furos","count":3,"permalink":"/blog/tags/furos"}')}}]); \ No newline at end of file diff --git a/docs/4e3694ae.6dfabef4.js b/docs/4e3694ae.6dfabef4.js deleted file mode 100644 index d2fec673ae6..00000000000 --- a/docs/4e3694ae.6dfabef4.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{110:function(o){o.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"furos","name":"furos","count":1,"permalink":"/blog/tags/furos"}')}}]); \ No newline at end of file diff --git a/docs/5048ccdb.2a8e4156.js b/docs/5048ccdb.2a8e4156.js new file mode 100644 index 00000000000..ab7d8d2bd9a --- /dev/null +++ b/docs/5048ccdb.2a8e4156.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{114:function(t,e,n){"use strict";n.r(e),n.d(e,"frontMatter",(function(){return i})),n.d(e,"metadata",(function(){return c})),n.d(e,"toc",(function(){return l})),n.d(e,"default",(function(){return u}));var r=n(3),o=n(7),a=(n(0),n(196)),i=(n(194),{slug:"httpcontext",title:"2. HttpContext \u5e94\u7528",author:"dotNET China",author_title:"\u4e3a\u4e2d\u56fd .NET \u5f00\u53d1\u8005\u63d0\u4f9b\u4f18\u8d28\u7684\u8d44\u8baf\u548c\u6280\u672f\u5206\u4eab\u3002",author_url:"https://www.chinadot.net",author_image_url:"https://i.loli.net/2021/01/19/M8q5a3OTZWUKicl.png",tags:["furion","furos",".net",".netcore",".net5","httpcontext"]}),c={permalink:"/blog/httpcontext",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/blog/2021-02-01-httpcontext.mdx",source:"@site/blog\\2021-02-01-httpcontext.mdx",description:"HttpContext \u91cd\u5927\u8c03\u6574",date:"2021-02-01T00:00:00.000Z",tags:[{label:"furion",permalink:"/blog/tags/furion"},{label:"furos",permalink:"/blog/tags/furos"},{label:".net",permalink:"/blog/tags/net"},{label:".netcore",permalink:"/blog/tags/netcore"},{label:".net5",permalink:"/blog/tags/net-5"},{label:"httpcontext",permalink:"/blog/tags/httpcontext"}],title:"2. HttpContext \u5e94\u7528",readingTime:.775,truncated:!0,prevItem:{title:"3. \u6587\u4ef6\u4e0a\u4f20\u4e0b\u8f7d",permalink:"/blog/fileupload-download"},nextItem:{title:"1. Furion \u4ecb\u7ecd",permalink:"/blog/welcome"}},l=[{value:"HttpContext \u91cd\u5927\u8c03\u6574",id:"httpcontext-\u91cd\u5927\u8c03\u6574",children:[]},{value:"HttpContext \u591a\u79cd\u83b7\u53d6\u65b9\u5f0f",id:"httpcontext-\u591a\u79cd\u83b7\u53d6\u65b9\u5f0f",children:[]}],p={toc:l};function u(t){var e=t.components,n=Object(o.a)(t,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:e,mdxType:"MDXLayout"}),Object(a.b)("h2",{id:"httpcontext-\u91cd\u5927\u8c03\u6574"},"HttpContext \u91cd\u5927\u8c03\u6574"),Object(a.b)("p",null,"\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"ASP.NET")," \u7684\u65f6\u4ee3\uff0c\u6211\u4eec\u901a\u5e38\u901a\u8fc7 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u5168\u5c40\u9759\u6001\u7c7b\u83b7\u53d6\u8bf7\u6c42\u4e0a\u4e0b\u6587\uff0c\u4f46\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u662f\u4e00\u4e2a\u975e\u9759\u6001\u7684\u62bd\u8c61\u7c7b\uff0c\u65e0\u6cd5\u624b\u52a8\u521b\u5efa\uff0c\u4e5f\u65e0\u6cd5\u901a\u8fc7\u9759\u6001\u83b7\u53d6\u3002"),Object(a.b)("p",null,"\u867d\u7136\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\u65e0\u6cd5\u76f4\u63a5\u83b7\u53d6 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u5bf9\u8c61\u3002\u4f46\u662f\u5fae\u8f6f\u4e5f\u63d0\u4f9b\u4e86\u6ce8\u5165 ",Object(a.b)("inlineCode",{parentName:"p"},"IHttpContextAccessor")," \u65b9\u5f0f\u83b7\u53d6\u3002"),Object(a.b)("h2",{id:"httpcontext-\u591a\u79cd\u83b7\u53d6\u65b9\u5f0f"},"HttpContext \u591a\u79cd\u83b7\u53d6\u65b9\u5f0f"))}u.isMDXComponent=!0},194:function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return i}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:t="/",url:e}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(t,e,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return e+n;const i=n.startsWith(e)?n:e+n.replace(/^\//,"");return a?t+i:i}(e,t,n,r)}}function i(t,e={}){const{withBaseUrl:n}=a();return n(t,e)}},195:function(t,e,n){"use strict";function r(t){return!0===/^(\w*:|\/\/)/.test(t)}function o(t){return void 0!==t&&!r(t)}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return o}))},196:function(t,e,n){"use strict";n.d(e,"a",(function(){return b})),n.d(e,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}var p=o.a.createContext({}),u=function(t){var e=o.a.useContext(p),n=e;return t&&(n="function"==typeof t?t(e):c(c({},e),t)),n},b=function(t){var e=u(t.components);return o.a.createElement(p.Provider,{value:e},t.children)},f={inlineCode:"code",wrapper:function(t){var e=t.children;return o.a.createElement(o.a.Fragment,{},e)}},s=o.a.forwardRef((function(t,e){var n=t.components,r=t.mdxType,a=t.originalType,i=t.parentName,p=l(t,["components","mdxType","originalType","parentName"]),b=u(n),s=r,d=b["".concat(i,".").concat(s)]||b[s]||f[s]||a;return n?o.a.createElement(d,c(c({ref:e},p),{},{components:n})):o.a.createElement(d,c({ref:e},p))}));function d(t,e){var n=arguments,r=e&&e.mdxType;if("string"==typeof t||r){var a=n.length,i=new Array(a);i[0]=s;var c={};for(var l in e)hasOwnProperty.call(e,l)&&(c[l]=e[l]);c.originalType=t,c.mdxType="string"==typeof t?t:r,i[1]=c;for(var p=2;p UploadFileAsync(List files)\n{\n long size = files.Sum(f => f.Length);\n\n foreach (var formFile in files)\n {\n if (formFile.Length > 0)\n {\n var filePath = Path.GetTempFileName(); // \u53ef\u4ee5\u66ff\u4ee3\u4e3a\u4f60\u9700\u8981\u5b58\u50a8\u7684\u771f\u5b9e\u8def\u5f84\n\n using (var stream = System.IO.File.Create(filePath))\n {\n await formFile.CopyToAsync(stream);\n }\n }\n }\n\n return Ok(new { count = files.Count, size });\n}\n")))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return l}));var r=n(21),a=n(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+l:l}(t,e,n,r)}}function l(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return b}));var r=n(0),a=n.n(r);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),p=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=p(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,o=e.originalType,l=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),s=p(n),d=r,b=s["".concat(l,".").concat(d)]||s[d]||f[d]||o;return n?a.a.createElement(b,i(i({ref:t},u),{},{components:n})):a.a.createElement(b,i({ref:t},u))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=n.length,l=new Array(o);l[0]=d;var i={};for(var c in t)hasOwnProperty.call(t,c)&&(i[c]=t[c]);i.originalType=e,i.mdxType="string"==typeof e?e:r,l[1]=i;for(var u=2;uSqlSugar \u670d\u52a1",id:"10121-\u6ce8\u518c-sqlsugar-\u670d\u52a1",children:[]}]},{value:"10.1.3 \u57fa\u672c\u4f7f\u7528",id:"1013-\u57fa\u672c\u4f7f\u7528",children:[]},{value:"10.1.4 \u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b",id:"1014-\u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b",children:[]},{value:"10.1.5 SqlSugarClient \u64cd\u4f5c\u793a\u4f8b",id:"1015-sqlsugarclient-\u64cd\u4f5c\u793a\u4f8b",children:[{value:"10.1.5.1 \u57fa\u7840\u67e5\u8be2",id:"10151-\u57fa\u7840\u67e5\u8be2",children:[]},{value:"10.1.5.2 \u8054\u8868\u67e5\u8be2",id:"10152-\u8054\u8868\u67e5\u8be2",children:[]},{value:"10.1.5.3 \u5206\u9875\u67e5\u8be2",id:"10153-\u5206\u9875\u67e5\u8be2",children:[]},{value:"10.1.5.4 \u63d2\u5165",id:"10154-\u63d2\u5165",children:[]},{value:"10.1.5.5 \u66f4\u65b0",id:"10155-\u66f4\u65b0",children:[]},{value:"10.1.5.6 \u5220\u9664",id:"10156-\u5220\u9664",children:[]}]},{value:"10.1.6 Sql \u67e5\u8be2",id:"1016-sql-\u67e5\u8be2",children:[]},{value:"10.1.7 \u6253\u5370 sql \u5230 Swagger",id:"1017-\u6253\u5370-sql-\u5230-swagger",children:[]},{value:"10.1.8 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"1018-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:o};function s(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},d,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"1011-\u5173\u4e8e-sqlsugar"},"10.1.1 \u5173\u4e8e SqlSugar"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u662f .NET/C# \u5e73\u53f0\u975e\u5e38\u4f18\u79c0\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"ORM")," \u6846\u67b6\uff0c\u76ee\u524d ",Object(c.b)("inlineCode",{parentName:"p"},"Nuget")," \u603b\u4e0b\u8f7d\u7a81\u7834 700K\uff0cGithub \u5173\u6ce8\u91cf\u4e5f\u9ad8\u8fbe 3.2K\uff0c\u662f\u76ee\u524d\u5f53\u4e4b\u65e0\u6127\u7684\u56fd\u4ea7\u4f18\u79c0 ORM \u6846\u67b6\u4e4b\u4e00\u3002"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u5b98\u65b9\u5730\u5740\uff1a",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/"}),"http://www.donet5.com/")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u4e0e EF \u4f18\u52bf\uff1a \u6027\u80fd\u6bd4 EF \u66f4\u5feb\u3001\u8bed\u6cd5\u4e0a\u624b\u66f4\u5bb9\u6613"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u4e0e Dapper \u4f18\u52bf\uff1a SqlSugar \u529f\u80fd\u66f4\u52a0\u4e30\u5bcc\uff0c\u6027\u80fd\u4e1d\u6beb\u4e0d\u900a\u8272\u4e8e Dapper\uff0c\u5e76\u4e14\u6279\u91cf\u64cd\u4f5c\u6027\u80fd\u66f4\u597d"),Object(c.b)("h2",{id:"1012-\u5982\u4f55\u96c6\u6210"},"10.1.2 \u5982\u4f55\u96c6\u6210"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5df2\u7ecf\u63a8\u51fa ",Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u62d3\u5c55\u5305 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://www.nuget.org/packages/Furion.Extras.DatabaseAccessor.SqlSugar"}),"Furion.Extras.DatabaseAccessor.SqlSugar"),"\u3002"),Object(c.b)("h3",{id:"10121-\u6ce8\u518c-sqlsugar-\u670d\u52a1"},"10.1.2.1 \u6ce8\u518c ",Object(c.b)("inlineCode",{parentName:"h3"},"SqlSugar")," \u670d\u52a1"),Object(c.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"services.AddSqlSugar(config)")," \u5373\u53ef\u3002\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddSqlSugar(new ConnectionConfig\n{\n ConnectionString = "Server=.xxxxx",//\u8fde\u63a5\u7b26\u5b57\u4e32\n DbType = DbType.SqlServer,\n IsAutoCloseConnection = true,\n InitKeyType = InitKeyType.Attribute//\u4ece\u7279\u6027\u8bfb\u53d6\u4e3b\u952e\u81ea\u589e\u4fe1\u606f\n});\n')),Object(c.b)("p",null,"\u540c\u65f6\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u66f4\u591a\u914d\u7f6e\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddSqlSugar(new ConnectionConfig\n{\n ConnectionString = "Server=.xxxxx",//\u8fde\u63a5\u7b26\u5b57\u4e32\n DbType = DbType.SqlServer,\n IsAutoCloseConnection = true,\n InitKeyType = InitKeyType.Attribute//\u4ece\u7279\u6027\u8bfb\u53d6\u4e3b\u952e\u81ea\u589e\u4fe1\u606f\n},\ndb =>\n{\n //\u5904\u7406\u65e5\u5fd7\u4e8b\u52a1\n db.Aop.OnLogExecuting = (sql, pars) =>\n {\n Console.WriteLine(sql);\n Console.WriteLine(string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));\n Console.WriteLine();\n };\n});\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b89\u88c5\u62d3\u5c55\u5305\u4f4d\u7f6e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63a8\u8350\u5c06\u62d3\u5c55\u5305 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Extras.DatabaseAccessor.SqlSugar")," \u5b89\u88c5\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u4e2d\u3002"))),Object(c.b)("h2",{id:"1013-\u57fa\u672c\u4f7f\u7528"},"10.1.3 \u57fa\u672c\u4f7f\u7528"),Object(c.b)("p",null,"\u5728\u4f7f\u7528\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlSugarRepository")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6}","{6}":!0}),"private readonly ISqlSugarRepository repository; // \u4ed3\u50a8\u5bf9\u8c61\uff1a\u5c01\u88c5\u7b80\u5355\u7684CRUD\nprivate readonly ISqlSugarClient db; // \u6838\u5fc3\u5bf9\u8c61\uff1a\u62e5\u6709\u5b8c\u6574\u7684SqlSugar\u5168\u90e8\u529f\u80fd\npublic PersonService(ISqlSugarRepository sqlSugarRepository)\n{\n repository = sqlSugarRepository;\n db = repository.Context; // \u63a8\u8350\u64cd\u4f5c\n}\n")),Object(c.b)("h2",{id:"1014-\u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b"},"10.1.4 \u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ================== SqlSugarClient ================\n\n//\u67e5\u8be2\u529f\u80fd\nvar data1 =db.Queryable().First(it=>it.Id==1); //db.GetById(1); \n\nvar data2 = db.Queryable().ToList();// db.GetList();\n\nvar data3 = db.GetList(it => it.Id == 1);\n\nvar data4 = db.GetSingle(it => it.Id == 1);\n\nvar p = new PageModel() { PageIndex = 1, PageSize = 2 };\nvar data5 = db.GetPageList(it => it.Name == "xx", p);//p.PageCount\nvar data6 = db.GetPageList(it => it.Name == "xx", p, it => it.Name, OrderByType.Asc);\n\nList conModels = new List();\nconModels.Add(new ConditionalModel(){FieldName="id",ConditionalType=ConditionalType.Equal,FieldValue="1"});//id=1\nvar data7 = db.GetPageList(conModels, p, it => it.Name, OrderByType.Asc);\n\n// ================== \u7b80\u5355\u4ed3\u50a8 ================\n\n//\u63d2\u5165\nrepository.Insert(insertObj);\nrepository.InsertRange(InsertObjs);\nvar id = repository.InsertReturnIdentity(insertObj);\nrepository.AsInsertable(insertObj).ExecuteCommand();\n\n//\u5220\u9664\nrepository.Delete(insertObj);\nrepository.DeleteById(1);\nrepository.DeleteByIds(new object [] { 1, 2 }); //\u6570\u7ec4\u5e26\u662f ids\u65b9\u6cd5 \uff0c\u5c01\u88c5\u4f20 object [] \u7c7b\u578b\nrepository.Delete(it => it.Id == 1);\nrepository.AsDeleteable().Where(it => it.Id == 1).ExecuteCommand();\n\n//\u66f4\u65b0\nrepository.Update(insertObj);\nrepository.UpdateRange(InsertObjs);\nrepository.Update(it => new Order() { Name = "a", }, it => it.Id == 1);\nrepository.AsUpdateable(insertObj).UpdateColumns(it=>new { it.Name }).ExecuteCommand();\n\n//\u5f02\u6b65\u65b9\u6cd5\u7528\u6cd5\nrepository.Insert(insertObj);//\u540c\u6b65\nrepository.InsertAsync(insertObj);//\u5f02\u6b65\n\n//\u5207\u6362\u4ed3\u50a8\nvar orderRespository=db.GetSimpleClient();\norderRespository.Insert(Order);\n')),Object(c.b)("h2",{id:"1015-sqlsugarclient-\u64cd\u4f5c\u793a\u4f8b"},"10.1.5 SqlSugarClient \u64cd\u4f5c\u793a\u4f8b"),Object(c.b)("h3",{id:"10151-\u57fa\u7840\u67e5\u8be2"},"10.1.5.1 \u57fa\u7840\u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//\u67e5\u8be2\u6240\u6709\nvar getAll = db.Queryable().ToList();\n//\u67e5\u8be2\u524d10\nvar top10= db.Queryable().Take(10).ToList();\n//\u67e5\u8be2\u5355\u6761\nvar getFirst = db.Queryable().First(it=>it.Id==1);\n//with nolock\nvar getAllNoLock = db.Queryable().With(SqlWith.NoLock).ToList();\n//\u6839\u636e\u4e3b\u952e\u67e5\u8be2\nvar getByPrimaryKey = db.Queryable().InSingle(2);\n//\u67e5\u8be2\u603b\u548c\nvar sum = db.Queryable().Sum(it=>it.Id);\n//\u662f\u5426\u5b58\u5728\nvar isAny = db.Queryable().Where(it=>it.Id==-1).Any();\n//\u6a21\u7cca\u67e5\nvar list2 = db.Queryable().Where(it =>it.Name.Contains("jack")).ToList();\n')),Object(c.b)("h3",{id:"10152-\u8054\u8868\u67e5\u8be2"},"10.1.5.2 \u8054\u8868\u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var list = db.Queryable((st, sc) => new JoinQueryInfos(\n JoinType.Left,st.SchoolId==sc.Id))\n .Select((st,sc)=>new{Id=st.Id,Name=st.Name,SchoolName=sc.Name}).ToList();\n\n\u751f\u6210\u7684Sql\u5982\u4e0b:\nSELECT [st].[ID] AS [id] ,\n [st].[Name] AS [name] ,\n [sc].[Name] AS [schoolName] FROM [STudent] st\n Left JOIN School sc ON ( [st].[SchoolId] =[sc].[Id])\n")),Object(c.b)("h3",{id:"10153-\u5206\u9875\u67e5\u8be2"},"10.1.5.3 \u5206\u9875\u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"})," int pageIndex = 1;\n int pageSize = 20;\n int totalCount=0;\n var page = db.Queryable().ToPageList(pageIndex, pageSize, ref totalCount);\n")),Object(c.b)("p",null,"\u66f4\u591a\u67e5\u8be2\u7528\u6cd5 \uff1a ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1185"}),"http://www.donet5.com/Home/Doc?typeId=1185")),Object(c.b)("h3",{id:"10154-\u63d2\u5165"},"10.1.5.4 \u63d2\u5165"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//\u53ef\u4ee5\u662f \u7c7b \u6216\u8005 List<\u7c7b>\ndb.Insertable(insertObj).ExecuteCommand();\n\n//\u63d2\u5165\u8fd4\u56de\u81ea\u589e\u5217\ndb.Insertable(insertObj).ExecuteReturnIdentity();\n\n//\u53ef\u4ee5\u662f Dictionary \u6216\u8005 List\nvar dc= new Dictionary();\n dt.Add("name", "1");\n dt.Add("CreateTime", null);\ndb.Insertable(dc).AS("student").ExecuteCommand();\n\n//DataTable\u63d2\u5165\nDictionary dc= db.Utilities.DataTableToDictionary(dataTable);//\u8f6c\u6210\u5b57\u5178\u5c31\u53ef\u4ee5\u6309\u4e0a\u9762\u7684\u5b57\u5178\u66f4\u65b0\u4e86\ndb.Insertable(dc).AS("student").ExecuteReturnIdentity();\n\n//\u5b9e\u4f53\u53ef\u4ee5\u914d\u7f6e\u4e3b\u952e\u548c\u81ea\u589e\u5217\npublic class Student\n{\n [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]\n public int Id { get; set; }\n public int? SchoolId { get; set; }\n public string Name { get; set; }\n}\n')),Object(c.b)("p",null,"\u66f4\u591a\u63d2\u5165\u7528\u6cd5\uff1a ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1193"}),"http://www.donet5.com/Home/Doc?typeId=1193")),Object(c.b)("h3",{id:"10155-\u66f4\u65b0"},"10.1.5.5 \u66f4\u65b0"),Object(c.b)("p",null,"\u5b9e\u4f53\u914d\u7f6e\u53c2\u8003\u63d2\u5165\uff0c\u53ea\u9700\u8981\u914d\u7f6e\u4e3b\u952e\u5373\u53ef"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//\u6839\u636e\u4e3b\u952e\u66f4\u65b0\u5355\u6761 \u53c2\u6570 Class\nvar result= db.Updateable(updateObj).ExecuteCommand();\n//\u4e0d\u66f4\u65b0 Name \u548cTestId\nvar result=db.Updateable(updateObj).IgnoreColumns(it => new { it.CreateTime,it.TestId }).ExecuteCommand()\n//\u53ea\u66f4\u65b0 Name \u548c CreateTime\nvar result=db.Updateable(updateObj).UpdateColumns(it => new { it.Name,it.CreateTime }).ExecuteCommand();\n//\u6839\u636e\u8868\u8fbe\u5f0f\u66f4\u65b0\nvar result71 = db.Updateable()\n .SetColumns(it => it.Name == "a")\n .SetColumnsIF(p!=null ,it => it.CreateTime == p.Value)//\u5f53p\u4e0d\u7b49\u4e8enull\u66f4\u65b0createtime\u5217\n .Where(it => it.Id == 11).ExecuteCommand();\n')),Object(c.b)("p",null,"\u66f4\u591a\u66f4\u65b0\u7528\u6cd5\uff1a ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1191"}),"http://www.donet5.com/Home/Doc?typeId=1191")),Object(c.b)("h3",{id:"10156-\u5220\u9664"},"10.1.5.6 \u5220\u9664"),Object(c.b)("p",null,"\u5b9e\u4f53\u914d\u7f6e\u53c2\u8003\u63d2\u5165\uff0c\u53ea\u9700\u8981\u914d\u7f6e\u4e3b\u952e\u5373\u53ef"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"//\u6839\u636e\u5b9e\u4f53\u5220\u9664\ndb.Deleteable().Where(new Student() { Id = 1 }).ExecuteCommand();\n//\u6839\u636e\u4e3b\u952e\u5220\u9664\ndb.Deleteable().In(1).ExecuteCommand();\n//\u6839\u636e\u8868\u8fbe\u5f0f\u5220\u9664\ndb.Deleteable().Where(it => it.Id == 1).ExecuteCommand();\n")),Object(c.b)("p",null,"\u66f4\u591a\u5220\u9664\u7528\u6cd5: ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1195"}),"http://www.donet5.com/Home/Doc?typeId=1195")),Object(c.b)("h2",{id:"1016-sql-\u67e5\u8be2"},"10.1.6 Sql \u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//sql\u5206\u9875\nvar list = db.SqlQueryable("select * from student").ToPageList(1, 2,ref total);\n\n//\u539f\u751fSql\u7528\u6cd5\nvar dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new List(){\n new SugarParameter("@id",1),\n new SugarParameter("@name",2)\n});\n//\u53c2\u65702\nvar dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new{id=1,name=2});\n\n//\u5b58\u50a8\u8fc7\u7a0b\u7528\u6cd5\nvar nameP= new SugarParameter("@name", "\u5f20\u4e09");\nvar ageP= new SugarParameter("@age", null, true);//\u8bbe\u7f6e\u4e3aoutput\nvar dt = db.Ado.UseStoredProcedure().GetDataTable("sp_school",nameP,ageP);\n\n')),Object(c.b)("table",null,Object(c.b)("thead",{parentName:"table"},Object(c.b)("tr",{parentName:"thead"},Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u65b9\u6cd5\u540d"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u63cf\u8ff0"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8fd4\u56de\u503c"))),Object(c.b)("tbody",{parentName:"table"},Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"SqlQuery< T >"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u67e5\u8be2\u6240\u6709\u8fd4\u56de\u5b9e\u4f53\u96c6\u5408"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"List")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"SqlQuery"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u53ef\u4ee5\u8fd4\u56de 2 \u4e2a\u7ed3\u679c\u96c6"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Tuple")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"SqlQuerySingle"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u67e5\u8be2\u7b2c\u4e00\u6761\u8bb0\u5f55"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"T")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDataTable"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u67e5\u8be2\u6240\u6709"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DataTable")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDataReader"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8bfb\u53d6 DR \u9700\u8981\u624b\u52a8\u91ca\u653e DR"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DataReader")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDataSetAll"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u591a\u4e2a\u7ed3\u679c\u96c6"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DataSet")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"ExecuteCommand"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8fd4\u56de\u53d7\u5f71\u54cd\u884c\u6570\uff0c\u4e00\u822c\u7528\u4e8e\u589e\u5220\u6539"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"int")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetScalar"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"object")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetString"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"string")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetInt"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"int")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetLong"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"long")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDouble"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Double")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDecimal"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Decimal")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDateTime"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DateTime")))),Object(c.b)("p",null,"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://donet5.com/"}),"SqlSugar \u5b98\u7f51"),"\u3002"),Object(c.b)("h2",{id:"1017-\u6253\u5370-sql-\u5230-swagger"},"10.1.7 \u6253\u5370 ",Object(c.b)("inlineCode",{parentName:"h2"},"sql")," \u5230 ",Object(c.b)("inlineCode",{parentName:"h2"},"Swagger")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddSqlSugar(new ConnectionConfig\n{\n ConnectionString = "Server=.xxxxx",//\u8fde\u63a5\u7b26\u5b57\u4e32\n DbType = DbType.SqlServer,\n IsAutoCloseConnection = true,\n InitKeyType = InitKeyType.Attribute//\u4ece\u7279\u6027\u8bfb\u53d6\u4e3b\u952e\u81ea\u589e\u4fe1\u606f\n},\ndb =>\n{\n db.Aop.OnLogExecuting = (sql, pars) =>\n {\n App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\\r\\n" +string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));\n };\n});\n')),Object(c.b)("h2",{id:"1018-\u53cd\u9988\u4e0e\u5efa\u8bae"},"10.1.8 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return b}));var a=n(21),r=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const b=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+b:b}(t,e,n,a)}}function b(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=r.a.createContext({}),d=function(e){var t=r.a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=d(e.components);return r.a.createElement(o.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,b=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=d(n),u=a,m=s["".concat(b,".").concat(u)]||s[u]||p[u]||c;return n?r.a.createElement(m,i(i({ref:t},o),{},{components:n})):r.a.createElement(m,i({ref:t},o))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,b=new Array(c);b[0]=u;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,b[1]=i;for(var o=2;ot(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{116:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return o})),n.d(t,"default",(function(){return s}));var a=n(3),r=n(7),c=(n(0),n(196)),b=n(197),i={id:"sqlsugar",title:"10.1. SqlSugar \u96c6\u6210",sidebar_label:"10.1. SqlSugar \u96c6\u6210"},l={unversionedId:"sqlsugar",id:"sqlsugar",isDocsHomePage:!1,title:"10.1. SqlSugar \u96c6\u6210",description:"10.1.1 \u5173\u4e8e SqlSugar",source:"@site/docs\\sqlsugar.mdx",slug:"/sqlsugar",permalink:"/docs/sqlsugar",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/sqlsugar.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"10.1. SqlSugar \u96c6\u6210",sidebar:"docs",previous:{title:"9.28 \u5206\u8868\u5206\u5e93",permalink:"/docs/split-db"},next:{title:"10.2. Dapper \u96c6\u6210",permalink:"/docs/dapper"}},o=[{value:"10.1.1 \u5173\u4e8e SqlSugar",id:"1011-\u5173\u4e8e-sqlsugar",children:[]},{value:"10.1.2 \u5982\u4f55\u96c6\u6210",id:"1012-\u5982\u4f55\u96c6\u6210",children:[{value:"10.1.2.1 \u6ce8\u518c SqlSugar \u670d\u52a1",id:"10121-\u6ce8\u518c-sqlsugar-\u670d\u52a1",children:[]}]},{value:"10.1.3 \u57fa\u672c\u4f7f\u7528",id:"1013-\u57fa\u672c\u4f7f\u7528",children:[]},{value:"10.1.4 \u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b",id:"1014-\u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b",children:[]},{value:"10.1.5 SqlSugarClient \u64cd\u4f5c\u793a\u4f8b",id:"1015-sqlsugarclient-\u64cd\u4f5c\u793a\u4f8b",children:[{value:"10.1.5.1 \u57fa\u7840\u67e5\u8be2",id:"10151-\u57fa\u7840\u67e5\u8be2",children:[]},{value:"10.1.5.2 \u8054\u8868\u67e5\u8be2",id:"10152-\u8054\u8868\u67e5\u8be2",children:[]},{value:"10.1.5.3 \u5206\u9875\u67e5\u8be2",id:"10153-\u5206\u9875\u67e5\u8be2",children:[]},{value:"10.1.5.4 \u63d2\u5165",id:"10154-\u63d2\u5165",children:[]},{value:"10.1.5.5 \u66f4\u65b0",id:"10155-\u66f4\u65b0",children:[]},{value:"10.1.5.6 \u5220\u9664",id:"10156-\u5220\u9664",children:[]}]},{value:"10.1.6 Sql \u67e5\u8be2",id:"1016-sql-\u67e5\u8be2",children:[]},{value:"10.1.7 \u6253\u5370 sql \u5230 Swagger",id:"1017-\u6253\u5370-sql-\u5230-swagger",children:[]},{value:"10.1.8 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"1018-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:o};function s(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},d,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"1011-\u5173\u4e8e-sqlsugar"},"10.1.1 \u5173\u4e8e SqlSugar"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u662f .NET/C# \u5e73\u53f0\u975e\u5e38\u4f18\u79c0\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"ORM")," \u6846\u67b6\uff0c\u76ee\u524d ",Object(c.b)("inlineCode",{parentName:"p"},"Nuget")," \u603b\u4e0b\u8f7d\u7a81\u7834 700K\uff0cGithub \u5173\u6ce8\u91cf\u4e5f\u9ad8\u8fbe 3.2K\uff0c\u662f\u76ee\u524d\u5f53\u4e4b\u65e0\u6127\u7684\u56fd\u4ea7\u4f18\u79c0 ORM \u6846\u67b6\u4e4b\u4e00\u3002"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u5b98\u65b9\u5730\u5740\uff1a",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/"}),"http://www.donet5.com/")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u4e0e EF \u4f18\u52bf\uff1a \u6027\u80fd\u6bd4 EF \u66f4\u5feb\u3001\u8bed\u6cd5\u4e0a\u624b\u66f4\u5bb9\u6613"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u4e0e Dapper \u4f18\u52bf\uff1a SqlSugar \u529f\u80fd\u66f4\u52a0\u4e30\u5bcc\uff0c\u6027\u80fd\u4e1d\u6beb\u4e0d\u900a\u8272\u4e8e Dapper\uff0c\u5e76\u4e14\u6279\u91cf\u64cd\u4f5c\u6027\u80fd\u66f4\u597d"),Object(c.b)("h2",{id:"1012-\u5982\u4f55\u96c6\u6210"},"10.1.2 \u5982\u4f55\u96c6\u6210"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5df2\u7ecf\u63a8\u51fa ",Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u62d3\u5c55\u5305 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://www.nuget.org/packages/Furion.Extras.DatabaseAccessor.SqlSugar"}),"Furion.Extras.DatabaseAccessor.SqlSugar"),"\u3002"),Object(c.b)("h3",{id:"10121-\u6ce8\u518c-sqlsugar-\u670d\u52a1"},"10.1.2.1 \u6ce8\u518c ",Object(c.b)("inlineCode",{parentName:"h3"},"SqlSugar")," \u670d\u52a1"),Object(c.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"services.AddSqlSugar(config)")," \u5373\u53ef\u3002\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddSqlSugar(new ConnectionConfig\n{\n ConnectionString = "Server=.xxxxx",//\u8fde\u63a5\u7b26\u5b57\u4e32\n DbType = DbType.SqlServer,\n IsAutoCloseConnection = true,\n InitKeyType = InitKeyType.Attribute//\u4ece\u7279\u6027\u8bfb\u53d6\u4e3b\u952e\u81ea\u589e\u4fe1\u606f\n});\n')),Object(c.b)("p",null,"\u540c\u65f6\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u66f4\u591a\u914d\u7f6e\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddSqlSugar(new ConnectionConfig\n{\n ConnectionString = "Server=.xxxxx",//\u8fde\u63a5\u7b26\u5b57\u4e32\n DbType = DbType.SqlServer,\n IsAutoCloseConnection = true,\n InitKeyType = InitKeyType.Attribute//\u4ece\u7279\u6027\u8bfb\u53d6\u4e3b\u952e\u81ea\u589e\u4fe1\u606f\n},\ndb =>\n{\n //\u5904\u7406\u65e5\u5fd7\u4e8b\u52a1\n db.Aop.OnLogExecuting = (sql, pars) =>\n {\n Console.WriteLine(sql);\n Console.WriteLine(string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));\n Console.WriteLine();\n };\n});\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b89\u88c5\u62d3\u5c55\u5305\u4f4d\u7f6e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63a8\u8350\u5c06\u62d3\u5c55\u5305 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Extras.DatabaseAccessor.SqlSugar")," \u5b89\u88c5\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u4e2d\u3002"))),Object(c.b)("h2",{id:"1013-\u57fa\u672c\u4f7f\u7528"},"10.1.3 \u57fa\u672c\u4f7f\u7528"),Object(c.b)("p",null,"\u5728\u4f7f\u7528\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlSugarRepository")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6}","{6}":!0}),"private readonly ISqlSugarRepository repository; // \u4ed3\u50a8\u5bf9\u8c61\uff1a\u5c01\u88c5\u7b80\u5355\u7684CRUD\nprivate readonly ISqlSugarClient db; // \u6838\u5fc3\u5bf9\u8c61\uff1a\u62e5\u6709\u5b8c\u6574\u7684SqlSugar\u5168\u90e8\u529f\u80fd\npublic PersonService(ISqlSugarRepository sqlSugarRepository)\n{\n repository = sqlSugarRepository;\n db = repository.Context; // \u63a8\u8350\u64cd\u4f5c\n}\n")),Object(c.b)("h2",{id:"1014-\u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b"},"10.1.4 \u6570\u636e\u5e93\u64cd\u4f5c\u793a\u4f8b"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ================== SqlSugarClient ================\n\n//\u67e5\u8be2\u529f\u80fd\nvar data1 =db.Queryable().First(it=>it.Id==1); //db.GetById(1); \n\nvar data2 = db.Queryable().ToList();// db.GetList();\n\nvar data3 = db.GetList(it => it.Id == 1);\n\nvar data4 = db.GetSingle(it => it.Id == 1);\n\nvar p = new PageModel() { PageIndex = 1, PageSize = 2 };\nvar data5 = db.GetPageList(it => it.Name == "xx", p);//p.PageCount\nvar data6 = db.GetPageList(it => it.Name == "xx", p, it => it.Name, OrderByType.Asc);\n\nList conModels = new List();\nconModels.Add(new ConditionalModel(){FieldName="id",ConditionalType=ConditionalType.Equal,FieldValue="1"});//id=1\nvar data7 = db.GetPageList(conModels, p, it => it.Name, OrderByType.Asc);\n\n// ================== \u7b80\u5355\u4ed3\u50a8 ================\n\n//\u63d2\u5165\nrepository.Insert(insertObj);\nrepository.InsertRange(InsertObjs);\nvar id = repository.InsertReturnIdentity(insertObj);\nrepository.AsInsertable(insertObj).ExecuteCommand();\n\n//\u5220\u9664\nrepository.Delete(insertObj);\nrepository.DeleteById(1);\nrepository.DeleteByIds(new object [] { 1, 2 }); //\u6570\u7ec4\u5e26\u662f ids\u65b9\u6cd5 \uff0c\u5c01\u88c5\u4f20 object [] \u7c7b\u578b\nrepository.Delete(it => it.Id == 1);\nrepository.AsDeleteable().Where(it => it.Id == 1).ExecuteCommand();\n\n//\u66f4\u65b0\nrepository.Update(insertObj);\nrepository.UpdateRange(InsertObjs);\nrepository.Update(it => new Order() { Name = "a", }, it => it.Id == 1);\nrepository.AsUpdateable(insertObj).UpdateColumns(it=>new { it.Name }).ExecuteCommand();\n\n//\u5f02\u6b65\u65b9\u6cd5\u7528\u6cd5\nrepository.Insert(insertObj);//\u540c\u6b65\nrepository.InsertAsync(insertObj);//\u5f02\u6b65\n\n//\u5207\u6362\u4ed3\u50a8\nvar orderRespository=db.GetSimpleClient();\norderRespository.Insert(Order);\n')),Object(c.b)("h2",{id:"1015-sqlsugarclient-\u64cd\u4f5c\u793a\u4f8b"},"10.1.5 SqlSugarClient \u64cd\u4f5c\u793a\u4f8b"),Object(c.b)("h3",{id:"10151-\u57fa\u7840\u67e5\u8be2"},"10.1.5.1 \u57fa\u7840\u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//\u67e5\u8be2\u6240\u6709\nvar getAll = db.Queryable().ToList();\n//\u67e5\u8be2\u524d10\nvar top10= db.Queryable().Take(10).ToList();\n//\u67e5\u8be2\u5355\u6761\nvar getFirst = db.Queryable().First(it=>it.Id==1);\n//with nolock\nvar getAllNoLock = db.Queryable().With(SqlWith.NoLock).ToList();\n//\u6839\u636e\u4e3b\u952e\u67e5\u8be2\nvar getByPrimaryKey = db.Queryable().InSingle(2);\n//\u67e5\u8be2\u603b\u548c\nvar sum = db.Queryable().Sum(it=>it.Id);\n//\u662f\u5426\u5b58\u5728\nvar isAny = db.Queryable().Where(it=>it.Id==-1).Any();\n//\u6a21\u7cca\u67e5\nvar list2 = db.Queryable().Where(it =>it.Name.Contains("jack")).ToList();\n')),Object(c.b)("h3",{id:"10152-\u8054\u8868\u67e5\u8be2"},"10.1.5.2 \u8054\u8868\u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var list = db.Queryable((st, sc) => new JoinQueryInfos(\n JoinType.Left,st.SchoolId==sc.Id))\n .Select((st,sc)=>new{Id=st.Id,Name=st.Name,SchoolName=sc.Name}).ToList();\n\n\u751f\u6210\u7684Sql\u5982\u4e0b:\nSELECT [st].[ID] AS [id] ,\n [st].[Name] AS [name] ,\n [sc].[Name] AS [schoolName] FROM [STudent] st\n Left JOIN School sc ON ( [st].[SchoolId] =[sc].[Id])\n")),Object(c.b)("h3",{id:"10153-\u5206\u9875\u67e5\u8be2"},"10.1.5.3 \u5206\u9875\u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"})," int pageIndex = 1;\n int pageSize = 20;\n int totalCount=0;\n var page = db.Queryable().ToPageList(pageIndex, pageSize, ref totalCount);\n")),Object(c.b)("p",null,"\u66f4\u591a\u67e5\u8be2\u7528\u6cd5 \uff1a ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1185"}),"http://www.donet5.com/Home/Doc?typeId=1185")),Object(c.b)("h3",{id:"10154-\u63d2\u5165"},"10.1.5.4 \u63d2\u5165"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//\u53ef\u4ee5\u662f \u7c7b \u6216\u8005 List<\u7c7b>\ndb.Insertable(insertObj).ExecuteCommand();\n\n//\u63d2\u5165\u8fd4\u56de\u81ea\u589e\u5217\ndb.Insertable(insertObj).ExecuteReturnIdentity();\n\n//\u53ef\u4ee5\u662f Dictionary \u6216\u8005 List\nvar dc= new Dictionary();\n dt.Add("name", "1");\n dt.Add("CreateTime", null);\ndb.Insertable(dc).AS("student").ExecuteCommand();\n\n//DataTable\u63d2\u5165\nDictionary dc= db.Utilities.DataTableToDictionary(dataTable);//\u8f6c\u6210\u5b57\u5178\u5c31\u53ef\u4ee5\u6309\u4e0a\u9762\u7684\u5b57\u5178\u66f4\u65b0\u4e86\ndb.Insertable(dc).AS("student").ExecuteReturnIdentity();\n\n//\u5b9e\u4f53\u53ef\u4ee5\u914d\u7f6e\u4e3b\u952e\u548c\u81ea\u589e\u5217\npublic class Student\n{\n [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]\n public int Id { get; set; }\n public int? SchoolId { get; set; }\n public string Name { get; set; }\n}\n')),Object(c.b)("p",null,"\u66f4\u591a\u63d2\u5165\u7528\u6cd5\uff1a ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1193"}),"http://www.donet5.com/Home/Doc?typeId=1193")),Object(c.b)("h3",{id:"10155-\u66f4\u65b0"},"10.1.5.5 \u66f4\u65b0"),Object(c.b)("p",null,"\u5b9e\u4f53\u914d\u7f6e\u53c2\u8003\u63d2\u5165\uff0c\u53ea\u9700\u8981\u914d\u7f6e\u4e3b\u952e\u5373\u53ef"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//\u6839\u636e\u4e3b\u952e\u66f4\u65b0\u5355\u6761 \u53c2\u6570 Class\nvar result= db.Updateable(updateObj).ExecuteCommand();\n//\u4e0d\u66f4\u65b0 Name \u548cTestId\nvar result=db.Updateable(updateObj).IgnoreColumns(it => new { it.CreateTime,it.TestId }).ExecuteCommand()\n//\u53ea\u66f4\u65b0 Name \u548c CreateTime\nvar result=db.Updateable(updateObj).UpdateColumns(it => new { it.Name,it.CreateTime }).ExecuteCommand();\n//\u6839\u636e\u8868\u8fbe\u5f0f\u66f4\u65b0\nvar result71 = db.Updateable()\n .SetColumns(it => it.Name == "a")\n .SetColumnsIF(p!=null ,it => it.CreateTime == p.Value)//\u5f53p\u4e0d\u7b49\u4e8enull\u66f4\u65b0createtime\u5217\n .Where(it => it.Id == 11).ExecuteCommand();\n')),Object(c.b)("p",null,"\u66f4\u591a\u66f4\u65b0\u7528\u6cd5\uff1a ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1191"}),"http://www.donet5.com/Home/Doc?typeId=1191")),Object(c.b)("h3",{id:"10156-\u5220\u9664"},"10.1.5.6 \u5220\u9664"),Object(c.b)("p",null,"\u5b9e\u4f53\u914d\u7f6e\u53c2\u8003\u63d2\u5165\uff0c\u53ea\u9700\u8981\u914d\u7f6e\u4e3b\u952e\u5373\u53ef"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"//\u6839\u636e\u5b9e\u4f53\u5220\u9664\ndb.Deleteable().Where(new Student() { Id = 1 }).ExecuteCommand();\n//\u6839\u636e\u4e3b\u952e\u5220\u9664\ndb.Deleteable().In(1).ExecuteCommand();\n//\u6839\u636e\u8868\u8fbe\u5f0f\u5220\u9664\ndb.Deleteable().Where(it => it.Id == 1).ExecuteCommand();\n")),Object(c.b)("p",null,"\u66f4\u591a\u5220\u9664\u7528\u6cd5: ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://www.donet5.com/Home/Doc?typeId=1195"}),"http://www.donet5.com/Home/Doc?typeId=1195")),Object(c.b)("h2",{id:"1016-sql-\u67e5\u8be2"},"10.1.6 Sql \u67e5\u8be2"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'//sql\u5206\u9875\nvar list = db.SqlQueryable("select * from student").ToPageList(1, 2,ref total);\n\n//\u539f\u751fSql\u7528\u6cd5\nvar dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new List(){\n new SugarParameter("@id",1),\n new SugarParameter("@name",2)\n});\n//\u53c2\u65702\nvar dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new{id=1,name=2});\n\n//\u5b58\u50a8\u8fc7\u7a0b\u7528\u6cd5\nvar nameP= new SugarParameter("@name", "\u5f20\u4e09");\nvar ageP= new SugarParameter("@age", null, true);//\u8bbe\u7f6e\u4e3aoutput\nvar dt = db.Ado.UseStoredProcedure().GetDataTable("sp_school",nameP,ageP);\n\n')),Object(c.b)("table",null,Object(c.b)("thead",{parentName:"table"},Object(c.b)("tr",{parentName:"thead"},Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u65b9\u6cd5\u540d"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u63cf\u8ff0"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8fd4\u56de\u503c"))),Object(c.b)("tbody",{parentName:"table"},Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"SqlQuery< T >"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u67e5\u8be2\u6240\u6709\u8fd4\u56de\u5b9e\u4f53\u96c6\u5408"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"List")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"SqlQuery"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u53ef\u4ee5\u8fd4\u56de 2 \u4e2a\u7ed3\u679c\u96c6"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Tuple")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"SqlQuerySingle"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u67e5\u8be2\u7b2c\u4e00\u6761\u8bb0\u5f55"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"T")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDataTable"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u67e5\u8be2\u6240\u6709"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DataTable")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDataReader"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8bfb\u53d6 DR \u9700\u8981\u624b\u52a8\u91ca\u653e DR"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DataReader")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDataSetAll"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u591a\u4e2a\u7ed3\u679c\u96c6"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DataSet")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"ExecuteCommand"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8fd4\u56de\u53d7\u5f71\u54cd\u884c\u6570\uff0c\u4e00\u822c\u7528\u4e8e\u589e\u5220\u6539"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"int")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetScalar"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"object")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetString"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"string")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetInt"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"int")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetLong"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"long")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDouble"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Double")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDecimal"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Decimal")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"GetDateTime"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u83b7\u53d6\u9996\u884c\u9996\u5217"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"DateTime")))),Object(c.b)("p",null,"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"SqlSugar")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"http://donet5.com/"}),"SqlSugar \u5b98\u7f51"),"\u3002"),Object(c.b)("h2",{id:"1017-\u6253\u5370-sql-\u5230-swagger"},"10.1.7 \u6253\u5370 ",Object(c.b)("inlineCode",{parentName:"h2"},"sql")," \u5230 ",Object(c.b)("inlineCode",{parentName:"h2"},"Swagger")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddSqlSugar(new ConnectionConfig\n{\n ConnectionString = "Server=.xxxxx",//\u8fde\u63a5\u7b26\u5b57\u4e32\n DbType = DbType.SqlServer,\n IsAutoCloseConnection = true,\n InitKeyType = InitKeyType.Attribute//\u4ece\u7279\u6027\u8bfb\u53d6\u4e3b\u952e\u81ea\u589e\u4fe1\u606f\n},\ndb =>\n{\n db.Aop.OnLogExecuting = (sql, pars) =>\n {\n App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\\r\\n" +string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));\n };\n});\n')),Object(c.b)("h2",{id:"1018-\u53cd\u9988\u4e0e\u5efa\u8bae"},"10.1.8 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return b}));var a=n(21),r=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const b=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+b:b}(t,e,n,a)}}function b(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var o=r.a.createContext({}),d=function(e){var t=r.a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=d(e.components);return r.a.createElement(o.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,b=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=d(n),u=a,m=s["".concat(b,".").concat(u)]||s[u]||p[u]||c;return n?r.a.createElement(m,i(i({ref:t},o),{},{components:n})):r.a.createElement(m,i({ref:t},o))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,b=new Array(c);b[0]=u;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,b[1]=i;for(var o=2;ot(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/53c7a020.b1f5bf6d.js b/docs/53c7a020.e19064fc.js similarity index 94% rename from docs/53c7a020.b1f5bf6d.js rename to docs/53c7a020.e19064fc.js index d923187d6ab..05530db702c 100644 --- a/docs/53c7a020.b1f5bf6d.js +++ b/docs/53c7a020.e19064fc.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{114:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return p})),t.d(n,"default",(function(){return u}));var i=t(3),r=t(7),a=(t(0),t(192)),c=t(193),o={id:"dependencyinjectionsettings",title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",sidebar_label:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e"},l={unversionedId:"settings/dependencyinjectionsettings",id:"settings/dependencyinjectionsettings",isDocsHomePage:!1,title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",description:"4.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\dependencyinjectionsettings.mdx",slug:"/settings/dependencyinjectionsettings",permalink:"/docs/settings/dependencyinjectionsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/dependencyinjectionsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",sidebar:"settings",previous:{title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",permalink:"/docs/settings/validationTypemessagesettings"},next:{title:"5. \u52a8\u6001API\u914d\u7f6e",permalink:"/docs/settings/dynamicapicontrollersettings"}},p=[{value:"4.1 \u5173\u4e8e\u914d\u7f6e",id:"41-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"4.2 \u914d\u7f6e\u4fe1\u606f",id:"42-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"4.3 \u914d\u7f6e\u793a\u4f8b",id:"43-\u914d\u7f6e\u793a\u4f8b",children:[]}],b={toc:p};function u(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(a.b)("wrapper",Object(i.a)({},b,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"41-\u5173\u4e8e\u914d\u7f6e"},"4.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"42-\u914d\u7f6e\u4fe1\u606f"},"4.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DependencyInjectionSettings"),"\uff1a\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u52a8\u6001\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u8282\u70b9\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"ExternalService")," \u6570\u7ec4\u7c7b\u578b",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ExternalService"),"\uff1a\u914d\u7f6e\u5355\u4e2a\u4f9d\u8d56\u6ce8\u5165\u4fe1\u606f",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Interface"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u63a5\u53e3\u4fe1\u606f\uff0c\u683c\u5f0f\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u63a5\u53e3\u5b8c\u6574\u540d\u79f0"),"\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application;Furion.Application.ITestService")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Service"),"\uff1a\u914d\u7f6e\u63a5\u53e3\u5b9e\u73b0\u4fe1\u606f\uff0c\u683c\u5f0f\u540c\u4e0a"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"RegisterType"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u6ce8\u5165\u7684\u5bf9\u8c61\u751f\u5b58\u671f\uff0c\u53d6\u503c\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"Transient"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"Scoped"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"Singleton")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Action"),"\uff1a\u6ce8\u518c\u884c\u4e3a\uff0c\u53ef\u9009\u503c\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"Add"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"TryAdd"),"\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Pattern"),"\uff1a\u6ce8\u518c\u9009\u9879\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Named"),"\uff1a\u6ce8\u518c\u522b\u540d\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u6ce8\u518c\u6392\u5e8f\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Proxy"),"\uff1a\u914d\u7f6e\u4ee3\u7406\u62e6\u622a\uff0c\uff0c\u683c\u5f0f\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u4ee3\u7406\u7c7b\u5b8c\u6574\u540d\u79f0"),"\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e"))))))))),Object(a.b)("h2",{id:"43-\u914d\u7f6e\u793a\u4f8b"},"4.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'{\n "DependencyInjectionSettings": {\n "Definitions": [\n {\n "Interface": "Furion.Application;Furion.Application.ITestService",\n "Service": "Furion.Application;Furion.Application.TestService",\n "RegisterType": "Transient",\n "Action": "Add",\n "Pattern": "SelfWithFirstInterface",\n "Named": "TestService",\n "Order": 1,\n "Proxy": "Furion.Application;Furion.Application.LogDispathProxy"\n }\n ]\n }\n}\n')))}u.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return c}));var i=t(21),r=t(191);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(i.default)();return{withBaseUrl:(t,i)=>function(e,n,t,{forcePrependBaseUrl:i=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(i)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+c:c}(n,e,t,i)}}function c(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},191:function(e,n,t){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!i(e)}t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return j}));var i=t(0),r=t.n(i);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var p=r.a.createContext({}),b=function(e){var n=r.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},u=function(e){var n=b(e.components);return r.a.createElement(p.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},d=r.a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=b(t),d=i,j=u["".concat(c,".").concat(d)]||u[d]||s[d]||a;return t?r.a.createElement(j,o(o({ref:n},p),{},{components:t})):r.a.createElement(j,o({ref:n},p))}));function j(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,c=new Array(a);c[0]=d;var o={};for(var l in n)hasOwnProperty.call(n,l)&&(o[l]=n[l]);o.originalType=e,o.mdxType="string"==typeof e?e:i,c[1]=o;for(var p=2;pn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{117:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return p})),t.d(n,"default",(function(){return u}));var i=t(3),r=t(7),a=(t(0),t(196)),c=t(197),o={id:"dependencyinjectionsettings",title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",sidebar_label:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e"},l={unversionedId:"settings/dependencyinjectionsettings",id:"settings/dependencyinjectionsettings",isDocsHomePage:!1,title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",description:"4.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\dependencyinjectionsettings.mdx",slug:"/settings/dependencyinjectionsettings",permalink:"/docs/settings/dependencyinjectionsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/dependencyinjectionsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",sidebar:"settings",previous:{title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",permalink:"/docs/settings/validationTypemessagesettings"},next:{title:"5. \u52a8\u6001API\u914d\u7f6e",permalink:"/docs/settings/dynamicapicontrollersettings"}},p=[{value:"4.1 \u5173\u4e8e\u914d\u7f6e",id:"41-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"4.2 \u914d\u7f6e\u4fe1\u606f",id:"42-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"4.3 \u914d\u7f6e\u793a\u4f8b",id:"43-\u914d\u7f6e\u793a\u4f8b",children:[]}],b={toc:p};function u(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(a.b)("wrapper",Object(i.a)({},b,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"41-\u5173\u4e8e\u914d\u7f6e"},"4.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"42-\u914d\u7f6e\u4fe1\u606f"},"4.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DependencyInjectionSettings"),"\uff1a\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u52a8\u6001\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u8282\u70b9\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"ExternalService")," \u6570\u7ec4\u7c7b\u578b",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ExternalService"),"\uff1a\u914d\u7f6e\u5355\u4e2a\u4f9d\u8d56\u6ce8\u5165\u4fe1\u606f",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Interface"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u63a5\u53e3\u4fe1\u606f\uff0c\u683c\u5f0f\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u63a5\u53e3\u5b8c\u6574\u540d\u79f0"),"\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application;Furion.Application.ITestService")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Service"),"\uff1a\u914d\u7f6e\u63a5\u53e3\u5b9e\u73b0\u4fe1\u606f\uff0c\u683c\u5f0f\u540c\u4e0a"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"RegisterType"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u6ce8\u5165\u7684\u5bf9\u8c61\u751f\u5b58\u671f\uff0c\u53d6\u503c\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"Transient"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"Scoped"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"Singleton")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Action"),"\uff1a\u6ce8\u518c\u884c\u4e3a\uff0c\u53ef\u9009\u503c\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"Add"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"TryAdd"),"\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Pattern"),"\uff1a\u6ce8\u518c\u9009\u9879\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Named"),"\uff1a\u6ce8\u518c\u522b\u540d\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u6ce8\u518c\u6392\u5e8f\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Proxy"),"\uff1a\u914d\u7f6e\u4ee3\u7406\u62e6\u622a\uff0c\uff0c\u683c\u5f0f\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u4ee3\u7406\u7c7b\u5b8c\u6574\u540d\u79f0"),"\uff0c\u53c2\u89c1 ",Object(a.b)("a",Object(i.a)({parentName:"li"},{href:"../dependency-injection#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"\u4f9d\u8d56\u6ce8\u5165-\u7279\u6027\u914d\u7f6e"))))))))),Object(a.b)("h2",{id:"43-\u914d\u7f6e\u793a\u4f8b"},"4.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'{\n "DependencyInjectionSettings": {\n "Definitions": [\n {\n "Interface": "Furion.Application;Furion.Application.ITestService",\n "Service": "Furion.Application;Furion.Application.TestService",\n "RegisterType": "Transient",\n "Action": "Add",\n "Pattern": "SelfWithFirstInterface",\n "Named": "TestService",\n "Order": 1,\n "Proxy": "Furion.Application;Furion.Application.LogDispathProxy"\n }\n ]\n }\n}\n')))}u.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return c}));var i=t(21),r=t(195);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(i.default)();return{withBaseUrl:(t,i)=>function(e,n,t,{forcePrependBaseUrl:i=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(i)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+c:c}(n,e,t,i)}}function c(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},195:function(e,n,t){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!i(e)}t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return j}));var i=t(0),r=t.n(i);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var p=r.a.createContext({}),b=function(e){var n=r.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},u=function(e){var n=b(e.components);return r.a.createElement(p.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},d=r.a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=b(t),d=i,j=u["".concat(c,".").concat(d)]||u[d]||s[d]||a;return t?r.a.createElement(j,o(o({ref:n},p),{},{components:t})):r.a.createElement(j,o({ref:n},p))}));function j(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,c=new Array(a);c[0]=d;var o={};for(var l in n)hasOwnProperty.call(n,l)&&(o[l]=n[l]);o.originalType=e,o.mdxType="string"==typeof e?e:i,c[1]=o;for(var p=2;pn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/59d16f51.2bed0de4.js b/docs/59d16f51.4f4d553f.js similarity index 95% rename from docs/59d16f51.2bed0de4.js rename to docs/59d16f51.4f4d553f.js index 653bab1e60d..34a5494a377 100644 --- a/docs/59d16f51.2bed0de4.js +++ b/docs/59d16f51.4f4d553f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{115:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),o=(n(0),n(192)),i=(n(190),n(199),n(200),n(193)),c={id:"dbcontext-multi-database",title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",sidebar_label:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c"},b={unversionedId:"dbcontext-multi-database",id:"dbcontext-multi-database",isDocsHomePage:!1,title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",description:"9.18.1 Furion \u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668",source:"@site/docs\\dbcontext-multi-database.mdx",slug:"/dbcontext-multi-database",permalink:"/docs/dbcontext-multi-database",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-multi-database.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",permalink:"/docs/dbcontext-sql-proxy"},next:{title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",permalink:"/docs/dbcontext-db-first"}},l=[{value:"9.18.1 Furion \u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668",id:"9181-furion-\u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668",children:[{value:"9.18.1.1 \u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305",id:"91811-\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305",children:[]}]},{value:"9.18.2 \u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c",id:"9182-\u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c",children:[]},{value:"9.18.3 \u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f",id:"9183-\u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f",children:[{value:"9.18.3.1 \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f",id:"91831-\u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f",children:[]},{value:"9.18.3.2 \u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f",id:"91832-\u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f",children:[]},{value:"9.18.3.3 Sql \u4ed3\u50a8\u65b9\u5f0f",id:"91833-sql-\u4ed3\u50a8\u65b9\u5f0f",children:[]},{value:"9.18.3.4 \u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f",id:"91834-\u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f",children:[]},{value:"9.18.3.5 Linq \u51fd\u6570\u65b9\u5f0f",id:"91835-linq-\u51fd\u6570\u65b9\u5f0f",children:[]}]},{value:"9.18.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9184-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)(i.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"9181-furion-\u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668"},"9.18.1 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion")," \u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668"),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714")))),Object(o.b)("h3",{id:"91811-\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305"},"9.18.1.1 \u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"SqlServer"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.SqlServer")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Sqlite"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Sqlite")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Cosmos"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Cosmos")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"InMemoryDatabase"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.InMemory")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"MySql"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Pomelo.EntityFrameworkCore.MySql"),"\uff0c",Object(o.b)("strong",{parentName:"li"},"Nuget\u9700\u52fe\u9009\u9884\u89c8\u7248")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"PostgreSQL"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Npgsql.EntityFrameworkCore.PostgreSQL")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Oracle"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Citms.EntityFrameworkCore.Oracle"),"\uff0c",Object(o.b)("strong",{parentName:"li"},"\u6682\u672a\u53ef\u7528")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Firebird"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"FirebirdSql.EntityFrameworkCore.Firebird")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Dm"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Dm"))),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8fd9\u4e9b\u6570\u636e\u5e93\u5305\u5e94\u8be5\u5b89\u88c5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u5c42\u3002\u7279\u6b8a\u60c5\u51b5\u9700\u5b89\u88c5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u4e2d\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"Mysql")," ",Object(o.b)("inlineCode",{parentName:"p"},"HasCharset()")," \u914d\u7f6e\u3002"))),Object(o.b)("h2",{id:"9182-\u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c"},"9.18.2 \u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u6ce8\u518c SqlServer\noptions.AddDbPool(DbProvider.SqlServer);\n\n// \u6ce8\u518c Sqlite\noptions.AddDbPool(DbProvider.Sqlite);\n\n// \u6ce8\u518c Cosmos\noptions.AddDbPool(DbProvider.Cosmos);\n\n// \u6ce8\u518c InMemoryDatabase\noptions.AddDbPool(DbProvider.InMemoryDatabase);\n\n// \u6ce8\u518c MySql\noptions.AddDbPool(DbProvider.MySql);\noptions.AddDbPool($"{DbProvider.MySql}@8.0.22"); // \u53ef\u4ee5\u6307\u5b9a\u7248\u672c\u53f7\n\n// \u6ce8\u518c PostgreSQL\noptions.AddDbPool(DbProvider.Npgsql);\n\n// \u6ce8\u518c Oracle\noptions.AddDbPool(DbProvider.Oracle);\n\n// \u6ce8\u518c Firebird\noptions.AddDbPool(DbProvider.Firebird);\n\n// \u6ce8\u518c Dm\noptions.AddDbPool(DbProvider.Dm);\n')),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u65b0\u7248 MySQL \u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"MySQL")," \u5728\u65b0\u7248\u672c\u5305\u4e2d\u6ce8\u518c\u6709\u6240\u4fee\u6539\uff0c\u6240\u4ee5\u6ce8\u518c\u65b9\u5f0f\u4e3a\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDatabaseAccessor(options =>\n{\n options.AddDbPool($"{DbProvider.MySql}@8.0.22");\n});\n')))),Object(o.b)("h2",{id:"9183-\u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f"},"9.18.3 \u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u901a\u8fc7\u72ec\u521b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668")," \u5b9e\u73b0\u591a\u6570\u636e\u5e93\u7075\u6d3b\u64cd\u4f5c\u5207\u6362\u3002\u53ea\u9700\u8981\u4e3a\u6bcf\u4e00\u79cd\u6570\u636e\u5e93\u7ed1\u5b9a\u552f\u4e00\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5373\u53ef\u3002"),Object(o.b)("p",null,"\u4ee5\u4e0b\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u5b9e\u4f8b\uff1a"),Object(o.b)("h3",{id:"91831-\u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f"},"9.18.3.1 \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = personRepository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = personRepository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = personRepository.Change();\n\n")),Object(o.b)("h3",{id:"91832-\u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f"},"9.18.3.2 \u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = repository.Change();\n")),Object(o.b)("h3",{id:"91833-sql-\u4ed3\u50a8\u65b9\u5f0f"},"9.18.3.3 ",Object(o.b)("inlineCode",{parentName:"h3"},"Sql")," \u4ed3\u50a8\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = sqlRepository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = sqlRepository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = sqlRepository.Change();\n")),Object(o.b)("h3",{id:"91834-\u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f"},"9.18.3.4 \u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"\n// \u652f\u6301\u4e00\u4e2a\u6570\u636e\u5e93\npublic class Person: IEntity\n{\n // ....\n}\n\n// \u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\npublic class Person: IEntity\n{\n // ....\n}\n")),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6240\u6709\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9e\u4f53\u4f9d\u8d56\u63a5\u53e3\u6216\u62bd\u8c61\u7c7b")," \u90fd\u652f\u6301\u6cdb\u578b\u65b9\u5f0f \u6307\u5b9a \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u6700\u591a\u652f\u6301 ",Object(o.b)("inlineCode",{parentName:"p"},"8")," \u4e2a\u3002"))),Object(o.b)("h3",{id:"91835-linq-\u51fd\u6570\u65b9\u5f0f"},"9.18.3.5 Linq \u51fd\u6570\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public static class QueryFunctions\n{\n [QueryableFunction("FN_GetId", "dbo", typeof(MySqlDbContextLocator), typeof(SqliteDbContextLocator))]\n public static int GetId(int id) => throw new NotSupportedException();\n}\n')),Object(o.b)("h2",{id:"9184-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.18.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(191);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return u}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),s=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},d=function(e){var t=s(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),d=s(n),m=a,u=d["".concat(i,".").concat(m)]||d[m]||p[m]||o;return n?r.a.createElement(u,c(c({ref:t},l),{},{components:n})):r.a.createElement(u,c({ref:t},l))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=m;var c={};for(var b in t)hasOwnProperty.call(t,b)&&(c[b]=t[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tt.value===e)&&v(e)}const f=e=>{v(e),null!=p&&O(p,e)},h=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.a)("tabs",{"tabs--block":n},m)},d.map(({value:e,label:t})=>r.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(i.a)("tabs__item",b.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,t,n)=>{switch(n.keyCode){case s:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case l:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(h,e.target,e)},onFocus:()=>f(e),onClick:()=>{f(e)}},t))),t?Object(a.cloneElement)(N.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):r.a.createElement("div",{className:"margin-vert--md"},N.map((e,t)=>Object(a.cloneElement)(e,{key:t,hidden:e.props.value!==j}))))}},200:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r);t.a=function({children:e,hidden:t,className:n}){return o.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:t,className:n}),e)}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{118:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),o=(n(0),n(196)),i=(n(194),n(203),n(204),n(197)),c={id:"dbcontext-multi-database",title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",sidebar_label:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c"},b={unversionedId:"dbcontext-multi-database",id:"dbcontext-multi-database",isDocsHomePage:!1,title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",description:"9.18.1 Furion \u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668",source:"@site/docs\\dbcontext-multi-database.mdx",slug:"/dbcontext-multi-database",permalink:"/docs/dbcontext-multi-database",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-multi-database.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",permalink:"/docs/dbcontext-sql-proxy"},next:{title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",permalink:"/docs/dbcontext-db-first"}},l=[{value:"9.18.1 Furion \u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668",id:"9181-furion-\u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668",children:[{value:"9.18.1.1 \u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305",id:"91811-\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305",children:[]}]},{value:"9.18.2 \u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c",id:"9182-\u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c",children:[]},{value:"9.18.3 \u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f",id:"9183-\u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f",children:[{value:"9.18.3.1 \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f",id:"91831-\u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f",children:[]},{value:"9.18.3.2 \u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f",id:"91832-\u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f",children:[]},{value:"9.18.3.3 Sql \u4ed3\u50a8\u65b9\u5f0f",id:"91833-sql-\u4ed3\u50a8\u65b9\u5f0f",children:[]},{value:"9.18.3.4 \u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f",id:"91834-\u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f",children:[]},{value:"9.18.3.5 Linq \u51fd\u6570\u65b9\u5f0f",id:"91835-linq-\u51fd\u6570\u65b9\u5f0f",children:[]}]},{value:"9.18.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9184-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)(i.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"9181-furion-\u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668"},"9.18.1 ",Object(o.b)("inlineCode",{parentName:"h2"},"Furion")," \u652f\u6301\u6570\u636e\u5e93\u63d0\u4f9b\u5668"),Object(o.b)("table",null,Object(o.b)("thead",{parentName:"table"},Object(o.b)("tr",{parentName:"thead"},Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(o.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(o.b)("tbody",{parentName:"table"},Object(o.b)("tr",{parentName:"tbody"},Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(o.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714")))),Object(o.b)("h3",{id:"91811-\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305"},"9.18.1.1 \u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"SqlServer"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.SqlServer")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Sqlite"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Sqlite")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Cosmos"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Cosmos")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"InMemoryDatabase"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.InMemory")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"MySql"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Pomelo.EntityFrameworkCore.MySql"),"\uff0c",Object(o.b)("strong",{parentName:"li"},"Nuget\u9700\u52fe\u9009\u9884\u89c8\u7248")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"PostgreSQL"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Npgsql.EntityFrameworkCore.PostgreSQL")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Oracle"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Citms.EntityFrameworkCore.Oracle"),"\uff0c",Object(o.b)("strong",{parentName:"li"},"\u6682\u672a\u53ef\u7528")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Firebird"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"FirebirdSql.EntityFrameworkCore.Firebird")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Dm"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Dm"))),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u8fd9\u4e9b\u6570\u636e\u5e93\u5305\u5e94\u8be5\u5b89\u88c5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u5c42\u3002\u7279\u6b8a\u60c5\u51b5\u9700\u5b89\u88c5\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u4e2d\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"Mysql")," ",Object(o.b)("inlineCode",{parentName:"p"},"HasCharset()")," \u914d\u7f6e\u3002"))),Object(o.b)("h2",{id:"9182-\u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c"},"9.18.2 \u591a\u6570\u636e\u5e93\u670d\u52a1\u6ce8\u518c"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u6ce8\u518c SqlServer\noptions.AddDbPool(DbProvider.SqlServer);\n\n// \u6ce8\u518c Sqlite\noptions.AddDbPool(DbProvider.Sqlite);\n\n// \u6ce8\u518c Cosmos\noptions.AddDbPool(DbProvider.Cosmos);\n\n// \u6ce8\u518c InMemoryDatabase\noptions.AddDbPool(DbProvider.InMemoryDatabase);\n\n// \u6ce8\u518c MySql\noptions.AddDbPool(DbProvider.MySql);\noptions.AddDbPool($"{DbProvider.MySql}@8.0.22"); // \u53ef\u4ee5\u6307\u5b9a\u7248\u672c\u53f7\n\n// \u6ce8\u518c PostgreSQL\noptions.AddDbPool(DbProvider.Npgsql);\n\n// \u6ce8\u518c Oracle\noptions.AddDbPool(DbProvider.Oracle);\n\n// \u6ce8\u518c Firebird\noptions.AddDbPool(DbProvider.Firebird);\n\n// \u6ce8\u518c Dm\noptions.AddDbPool(DbProvider.Dm);\n')),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u65b0\u7248 MySQL \u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"MySQL")," \u5728\u65b0\u7248\u672c\u5305\u4e2d\u6ce8\u518c\u6709\u6240\u4fee\u6539\uff0c\u6240\u4ee5\u6ce8\u518c\u65b9\u5f0f\u4e3a\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDatabaseAccessor(options =>\n{\n options.AddDbPool($"{DbProvider.MySql}@8.0.22");\n});\n')))),Object(o.b)("h2",{id:"9183-\u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f"},"9.18.3 \u591a\u6570\u636e\u5e93\u4f7f\u7528\u65b9\u5f0f"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u901a\u8fc7\u72ec\u521b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668")," \u5b9e\u73b0\u591a\u6570\u636e\u5e93\u7075\u6d3b\u64cd\u4f5c\u5207\u6362\u3002\u53ea\u9700\u8981\u4e3a\u6bcf\u4e00\u79cd\u6570\u636e\u5e93\u7ed1\u5b9a\u552f\u4e00\u7684\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5373\u53ef\u3002"),Object(o.b)("p",null,"\u4ee5\u4e0b\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u5b9e\u4f8b\uff1a"),Object(o.b)("h3",{id:"91831-\u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f"},"9.18.3.1 \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = personRepository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = personRepository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = personRepository.Change();\n\n")),Object(o.b)("h3",{id:"91832-\u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f"},"9.18.3.2 \u975e\u6cdb\u578b\u4ed3\u50a8\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = repository.Change();\n")),Object(o.b)("h3",{id:"91833-sql-\u4ed3\u50a8\u65b9\u5f0f"},"9.18.3.3 ",Object(o.b)("inlineCode",{parentName:"h3"},"Sql")," \u4ed3\u50a8\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = sqlRepository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = sqlRepository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = sqlRepository.Change();\n")),Object(o.b)("h3",{id:"91834-\u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f"},"9.18.3.4 \u5b9e\u4f53\u5b9a\u4e49\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"\n// \u652f\u6301\u4e00\u4e2a\u6570\u636e\u5e93\npublic class Person: IEntity\n{\n // ....\n}\n\n// \u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\npublic class Person: IEntity\n{\n // ....\n}\n")),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6240\u6709\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9e\u4f53\u4f9d\u8d56\u63a5\u53e3\u6216\u62bd\u8c61\u7c7b")," \u90fd\u652f\u6301\u6cdb\u578b\u65b9\u5f0f \u6307\u5b9a \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u6700\u591a\u652f\u6301 ",Object(o.b)("inlineCode",{parentName:"p"},"8")," \u4e2a\u3002"))),Object(o.b)("h3",{id:"91835-linq-\u51fd\u6570\u65b9\u5f0f"},"9.18.3.5 Linq \u51fd\u6570\u65b9\u5f0f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public static class QueryFunctions\n{\n [QueryableFunction("FN_GetId", "dbo", typeof(MySqlDbContextLocator), typeof(SqliteDbContextLocator))]\n public static int GetId(int id) => throw new NotSupportedException();\n}\n')),Object(o.b)("h2",{id:"9184-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.18.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return u}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),s=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},d=function(e){var t=s(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),d=s(n),m=a,u=d["".concat(i,".").concat(m)]||d[m]||p[m]||o;return n?r.a.createElement(u,c(c({ref:t},l),{},{components:n})):r.a.createElement(u,c({ref:t},l))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=m;var c={};for(var b in t)hasOwnProperty.call(t,b)&&(c[b]=t[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,t,n){"use strict";function a(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;tt.value===e)&&v(e)}const f=e=>{v(e),null!=p&&O(p,e)},h=[];return r.a.createElement("div",null,r.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.a)("tabs",{"tabs--block":n},m)},d.map(({value:e,label:t})=>r.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(i.a)("tabs__item",b.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,t,n)=>{switch(n.keyCode){case s:((e,t)=>{const n=e.indexOf(t)+1;e[n]?e[n].focus():e[0].focus()})(e,t);break;case l:((e,t)=>{const n=e.indexOf(t)-1;e[n]?e[n].focus():e[e.length-1].focus()})(e,t)}})(h,e.target,e)},onFocus:()=>f(e),onClick:()=>{f(e)}},t))),t?Object(a.cloneElement)(N.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):r.a.createElement("div",{className:"margin-vert--md"},N.map((e,t)=>Object(a.cloneElement)(e,{key:t,hidden:e.props.value!==j}))))}},204:function(e,t,n){"use strict";var a=n(3),r=n(0),o=n.n(r);t.a=function({children:e,hidden:t,className:n}){return o.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:t,className:n}),e)}}}]); \ No newline at end of file diff --git a/docs/5c4ee1d6.89ac5146.js b/docs/5c4ee1d6.77dc724b.js similarity index 50% rename from docs/5c4ee1d6.89ac5146.js rename to docs/5c4ee1d6.77dc724b.js index 8c18010aef6..5c9096b7959 100644 --- a/docs/5c4ee1d6.89ac5146.js +++ b/docs/5c4ee1d6.77dc724b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{116:function(o){o.exports=JSON.parse('{"permalink":"/blog","page":1,"postsPerPage":10,"totalPages":1,"totalCount":1,"previousPage":null,"nextPage":null,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{119:function(o){o.exports=JSON.parse('{"permalink":"/blog","page":1,"postsPerPage":10,"totalPages":1,"totalCount":3,"previousPage":null,"nextPage":null,"blogDescription":"Blog","blogTitle":"Blog"}')}}]); \ No newline at end of file diff --git a/docs/5ce0ebbd.19b2d3c9.js b/docs/5ce0ebbd.f85d6cd6.js similarity index 98% rename from docs/5ce0ebbd.19b2d3c9.js rename to docs/5ce0ebbd.f85d6cd6.js index bf03b572906..057fd4c3cca 100644 --- a/docs/5ce0ebbd.19b2d3c9.js +++ b/docs/5ce0ebbd.f85d6cd6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{117:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return p})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return l}));var a=t(3),i=t(7),r=(t(0),t(192)),c=t(193),p={id:"appstartup",title:"3. \u5e94\u7528\u542f\u52a8",sidebar_label:"3. \u5e94\u7528\u542f\u52a8"},o={unversionedId:"appstartup",id:"appstartup",isDocsHomePage:!1,title:"3. \u5e94\u7528\u542f\u52a8",description:"3.1 Startup \u7c7b",source:"@site/docs\\appstartup.mdx",slug:"/appstartup",permalink:"/docs/appstartup",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/appstartup.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"3. \u5e94\u7528\u542f\u52a8",sidebar:"docs",previous:{title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",permalink:"/docs/reference"},next:{title:"4.1 \u914d\u7f6e",permalink:"/docs/configuration"}},b=[{value:"3.1 Startup \u7c7b",id:"31-startup-\u7c7b",children:[{value:"3.1.1 Startup \u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5",id:"311-startup-\u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5",children:[]}]},{value:"3.2 AppStartup",id:"32-appstartup",children:[{value:"3.2.1 \u5982\u4f55\u914d\u7f6e AppStartup",id:"321-\u5982\u4f55\u914d\u7f6e-appstartup",children:[]},{value:"3.2.2 AppStartup \u7ea6\u5b9a",id:"322-appstartup-\u7ea6\u5b9a",children:[]},{value:"3.2.3 AppStartup \u914d\u7f6e\u987a\u5e8f",id:"323-appstartup-\u914d\u7f6e\u987a\u5e8f",children:[]},{value:"3.2.4 AppStartup \u65b9\u6cd5\u8c03\u7528\u987a\u5e8f",id:"324-appstartup-\u65b9\u6cd5\u8c03\u7528\u987a\u5e8f",children:[]}]},{value:"3.3 Startup \u914d\u7f6e\u6700\u4f73\u5b9e\u8df5",id:"33-startup-\u914d\u7f6e\u6700\u4f73\u5b9e\u8df5",children:[]},{value:"3.4 \u5173\u4e8e appsettings.json",id:"34-\u5173\u4e8e-appsettingsjson",children:[]},{value:"3.5 \u795e\u5947\u7684 Inject()",id:"35-\u795e\u5947\u7684-inject",children:[]},{value:"3.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"36-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:b};function l(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"31-startup-\u7c7b"},"3.1 ",Object(r.b)("inlineCode",{parentName:"h2"},"Startup")," \u7c7b"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u7c7b\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u9ed8\u8ba4\u8c03\u7528\u7684\u7c7b\uff0c\u8be5\u7c7b\u662f\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Program.cs")," \u4e2d\u914d\u7f6e\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{19} title="Furion.Web.Entry\\Program.cs"',"{19}":!0,title:'"Furion.Web.Entry\\Program.cs"'}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder\n .Inject()\n .UseStartup();\n });\n }\n }\n}\n")),Object(r.b)("h3",{id:"311-startup-\u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5"},"3.1.1 ",Object(r.b)("inlineCode",{parentName:"h3"},"Startup")," \u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u9ed8\u8ba4\u6709\u4e24\u4e2a\u91cd\u8981\u7684\u65b9\u6cd5:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ConfigureServices"),"\uff1a\u914d\u7f6e\u5e94\u7528\u6240\u9700\u670d\u52a1\uff0c\u5728\u8be5\u65b9\u6cd5\u4e2d\u53ef\u4ee5\u6dfb\u52a0\u5e94\u7528\u6240\u9700\u8981\u7684\u529f\u80fd\u6216\u670d\u52a1"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Configure"),"\uff1a\u914d\u7f6e\u5e94\u7528\u8bf7\u6c42\u5904\u7406\u7ba1\u9053")),Object(r.b)("p",null,"\u9ed8\u8ba4\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{9,13} title="Furion.Web.Entry\\Startup.cs"',"{9,13}":!0,title:'"Furion.Web.Entry\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Entry\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("p",null,"\u5728\u8fd9\u91cc\uff0c\u4e0d\u6253\u7b97\u8be6\u7ec6\u8bb2 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u7c7b\u7684\u5177\u4f53\u529f\u80fd\u548c\u4f5c\u7528\u3002"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/startup?view=aspnetcore-3.1"}),"ASP.NET Core - Startup \u7c7b")," \u7ae0\u8282\u3002"))),Object(r.b)("h2",{id:"32-appstartup"},"3.2 ",Object(r.b)("inlineCode",{parentName:"h2"},"AppStartup")),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7075\u6d3b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u7c7b\u914d\u7f6e\u65b9\u5f0f\uff0c\u65e0\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u542f\u7528\u5c42")," \u4e2d\u914d\u7f6e\uff0c\u53ef\u5c06\u914d\u7f6e\u653e\u5230\u4efb\u4f55\u9879\u76ee\u5c42\u3002"),Object(r.b)("p",null,"\u53ef\u80fd\u4f1a\u6709\u8bfb\u8005\u6709\u7591\u95ee\uff0c\u4e3a\u4ec0\u4e48\u8981\u591a\u6b64\u4e00\u4e3e\u5462\uff1f\u539f\u56e0\u6709\u51e0\u70b9\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u7c7b\u9ed8\u8ba4\u548c ",Object(r.b)("inlineCode",{parentName:"li"},"Web \u5e94\u7528\u5c42")," \u7ed1\u5b9a\u5728\u4e00\u8d77\uff0c\u8fd9\u6837\u5c31\u4f1a\u5bfc\u81f4\u5982\u679c\u6211\u521b\u5efa\u4e86\u65b0\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Web \u5e94\u7528\u5c42"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u53c8\u8981\u91cd\u65b0\u914d\u7f6e"),Object(r.b)("li",{parentName:"ul"},"\u968f\u7740\u4e1a\u52a1\u7684\u589e\u957f\uff0c\u9700\u8981\u96c6\u6210\u8d8a\u6765\u8d8a\u591a\u7684\u7b2c\u4e09\u65b9\u670d\u52a1\uff0c\u8fd9\u65f6\u5019 ",Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u7c7b\u5c31\u4f1a\u53d8\u5f97\u8d8a\u6765\u8d8a\u81c3\u80bf\uff0c\u96be\u4ee5\u7ef4\u62a4"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u7c7b\u65e0\u6cd5\u4e0e\u5176\u4ed6\u9879\u76ee\u7c7b\u578b\u8fdb\u884c\u5171\u7528")),Object(r.b)("p",null,"\u6240\u4ee5\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u65b9\u5f0f\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup"),"\u3002"),Object(r.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u6ce8\u610f\u4e8b\u9879")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c ",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u7684\u6d3e\u751f\u7c7b\u6240\u5728\u7684\u9879\u76ee\u5c42\u6ca1\u6709\u88ab\u542f\u52a8\u5c42\u76f4\u63a5\u6216\u95f4\u63a5\u6dfb\u52a0\u5f15\u7528\uff0c\u90a3\u4e48\u8fd9\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u5c31\u4f1a\u88ab\u5ffd\u7565\uff0c\u4e5f\u5c31\u662f\u4e0d\u4f1a\u81ea\u52a8\u8f7d\u5165\u6ce8\u518c\u3002"))),Object(r.b)("h3",{id:"321-\u5982\u4f55\u914d\u7f6e-appstartup"},"3.2.1 \u5982\u4f55\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u662f\u4e00\u4e2a\u62bd\u8c61\u7684\u7a7a\u7c7b\uff0c\u6ca1\u6709\u4efb\u4f55\u5b9a\u4e49\u6210\u5458\u3002\u6b63\u662f\u56e0\u4e3a\u8fd9\u6837\uff0c\u624d\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u65b9\u5f0f\u3002"),Object(r.b)("h3",{id:"322-appstartup-\u7ea6\u5b9a"},"3.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")," \u7ea6\u5b9a"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u6d3e\u751f\u7c7b\u53ea\u6709\u4e24\u4e2a\u5c0f\u7ea6\u5b9a\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u4efb\u4f55\u516c\u5f00\u3001\u975e\u9759\u6001\u3001\u8fd4\u56de\u503c\u4e3a ",Object(r.b)("inlineCode",{parentName:"li"},"void")," \u4e14\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"IServiceCollection")," \u7c7b\u578b\uff0c\u90a3\u4e48\u4ed6\u5c31\u662f\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"li"},"ConfigureServices")," \u65b9\u6cd5"),Object(r.b)("li",{parentName:"ul"},"\u4efb\u4f55\u516c\u5f00\u3001\u975e\u9759\u6001\u3001\u8fd4\u56de\u503c\u4e3a ",Object(r.b)("inlineCode",{parentName:"li"},"void")," \u4e14\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"IApplicationBuilder")," \u7c7b\u578b\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"IWebHostEnvironment")," \u7c7b\u578b\uff0c\u90a3\u4e48\u4ed6\u5c31\u662f\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"li"},"Configure")," \u65b9\u6cd5")),Object(r.b)("p",null,"\u6240\u4ee5\uff0c\u6211\u4eec\u53ef\u4ee5\u81ea\u7531\u7684\u7f16\u5199\u65b9\u6cd5\uff0c\u53ea\u8981\u9075\u5faa\u7ea6\u5b9a\u5373\u53ef\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,7,12,18,23}","{5,7,12,18,23}":!0}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n public class MyStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDataValidation();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n app.UseSwagger();\n }\n\n // \u53ef\u4ee5\u968f\u610f\u5b9a\u4e49\u540d\u5b57\u548c\u65b9\u6cd5\n public void XXXXName(IServiceCollection services)\n {\n }\n\n // \u53ef\u4ee5\u968f\u610f\u5b9a\u4e49\u540d\u5b57\u548c\u65b9\u6cd5\n public void ZZZName(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("h3",{id:"323-appstartup-\u914d\u7f6e\u987a\u5e8f"},"3.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")," \u914d\u7f6e\u987a\u5e8f"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u914d\u7f6e\u987a\u5e8f\u7531\u6240\u5728\u7a0b\u5e8f\u96c6\u7684\u540d\u79f0\u8fdb\u884c\u6b63\u5e8f\u8c03\u7528\uff0c\u5982\u679c\u6211\u4eec\u9700\u8981\u914d\u7f6e\u6267\u884c\u987a\u5e8f\uff0c\u53ea\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u6d3e\u751f\u7c7b\u4e2d\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[AppStartup(order)]")," \u7279\u6027\u5373\u53ef\u3002"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"order")," \u6570\u503c\u8d8a\u5927\uff0c\u8d8a\u5728\u524d\u9762\u8c03\u7528\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(10)]\n public class FirstStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(9)]\n public class SecondStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"FirstStartup")," \u4f1a\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"SecondStartup")," \u4e4b\u524d\u8c03\u7528\u3002"),Object(r.b)("h3",{id:"324-appstartup-\u65b9\u6cd5\u8c03\u7528\u987a\u5e8f"},"3.2.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")," \u65b9\u6cd5\u8c03\u7528\u987a\u5e8f"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u65b9\u6cd5\u8c03\u7528\u987a\u5e8f\u548c\u65b9\u6cd5\u7684\u4e66\u5199\u5148\u540e\u6709\u5173\uff0c\u8d8a\u5728\u524d\u9762\u7684\u65b9\u6cd5\u8d8a\u5148\u8c03\u7528\u3002"),Object(r.b)("h2",{id:"33-startup-\u914d\u7f6e\u6700\u4f73\u5b9e\u8df5"},"3.3 ",Object(r.b)("inlineCode",{parentName:"h2"},"Startup")," \u914d\u7f6e\u6700\u4f73\u5b9e\u8df5"),Object(r.b)("p",null,"\u5efa\u8bae ",Object(r.b)("inlineCode",{parentName:"p"},"Web")," \u542f\u52a8\u5c42\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4fdd\u6301\u4e3a\u7a7a\u65b9\u6cd5\u4f53\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Entry\\Startup.cs"',title:'"Furion.Web.Entry\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Entry\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("p",null,"\u5c06\u6240\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u5e94\u7528\u5c42")," \u914d\u7f6e\u8fc1\u79fb\u5230 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core.Startup.cs")," \u4e2d\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Core\\Startup.cs"',title:'"Furion.Web.Core\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddCorsAccessor();\n\n services.AddControllers().AddInject();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n app.UseHttpsRedirection();\n\n app.UseRouting();\n\n app.UseCorsAccessor();\n\n app.UseAuthentication();\n app.UseAuthorization();\n\n app.UseInject();\n\n app.UseEndpoints(endpoints =>\n {\n endpoints.MapControllers();\n });\n }\n }\n}\n")),Object(r.b)("p",null,"\u8fd9\u6837\uff0c\u540e\u7eed\u66f4\u6362 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u5e94\u7528\u5c42")," \u4e5f\u65e0\u9700\u91cd\u65b0\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")),Object(r.b)("h2",{id:"34-\u5173\u4e8e-appsettingsjson"},"3.4 \u5173\u4e8e ",Object(r.b)("inlineCode",{parentName:"h2"},"appsettings.json")),Object(r.b)("p",null,"\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u914d\u7f6e\u653e\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u914d\u7f6e\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u65b9\u5f0f\u548c ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u914d\u7f6e\u4e00\u6837\u7684\u9053\u7406\uff0c\u4e00\u65e6\u6211\u4eec\u66f4\u6362\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u5e94\u7528\u5c42"),"\uff0c\u90a3\u4e48 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u53c8\u8981\u91cd\u65b0\u914d\u7f6e\u4e00\u6b21\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u66f4\u52a0\u7075\u6d3b\u7684\u65b9\u5f0f\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json"),"\uff0c",Object(r.b)("strong",{parentName:"p"},"\u53ea\u9700\u8981\u5728\u4efb\u4f55\u9879\u76ee\u5c42\u6839\u76ee\u5f55\u4e0b\u521b\u5efa ",Object(r.b)("inlineCode",{parentName:"strong"},".json")," \u6587\u4ef6\u5373\u53ef\u3002",Object(r.b)("inlineCode",{parentName:"strong"},"Furion")," \u6846\u67b6\u6700\u540e\u4f1a\u81ea\u52a8\u5408\u5e76\u6240\u6709\u5206\u6563\u7684\u914d\u7f6e\u6587\u4ef6\u3002")),Object(r.b)("p",null,"\u5982\u6211\u4eec\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u5c42\u521b\u5efa ",Object(r.b)("inlineCode",{parentName:"p"},"dbsettings.json")," \u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'title="Furion.EntityFramework.Core\\dbsettings.json"',title:'"Furion.EntityFramework.Core\\dbsettings.json"'}),'{\n "ConnectionStrings": {\n "DbConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;",\n "Sqlite3ConnectionString": "Data Source=./Furion.db"\n }\n}\n')),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u65e0\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u4e2d\u914d\u7f6e"),"\uff0c\u4e0b\u9762\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u9ed8\u8ba4\u4ee3\u7801:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "Logging": {\n "LogLevel": {\n "Default": "Information",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n },\n "AllowedHosts": "*"\n}\n')),Object(r.b)("p",null,"\u8fd9\u6837\u6211\u4eec\u628a\u914d\u7f6e\u6587\u4ef6\u5206\u6563\u5728\u4e0d\u540c\u9879\u76ee\u5c42\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5171\u7528\u548c\u5171\u4eab\u4e86\u3002"),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5176\u4ed6\u5c42\u7684\u914d\u7f6e\u6587\u4ef6\u4e0d\u80fd\u4ee5 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u547d\u540d\uff0c\u4f1a\u5bfc\u81f4\u8986\u76d6\u542f\u52a8\u5c42\u7684\u914d\u7f6e\u3002"),Object(r.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c\u5728\u5176\u4ed6\u5c42\u521b\u5efa\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"*.json")," \u6587\u4ef6\u5fc5\u987b\u8bbe\u7f6e\u6587\u4ef6\u5c5e\u6027\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"\u59cb\u7ec8\u590d\u5236\u6216\u8f83\u65b0\u590d\u5236"),"\u3002"))),Object(r.b)("h2",{id:"35-\u795e\u5947\u7684-inject"},"3.5 \u795e\u5947\u7684 ",Object(r.b)("inlineCode",{parentName:"h2"},"Inject()")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Inject()")," \u65b9\u6cd5\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u7684\u6700\u5c0f\u4fb5\u5165\u5f0f\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8ba9\u4efb\u4f55 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," Web \u9879\u76ee\u77ac\u95f4\u652f\u6301\u6240\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u7279\u6027\u3002"),Object(r.b)("p",null,"\u6211\u4eec\u521b\u5efa\u4e86\u65b0\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u9879\u76ee"),"\uff0c\u53ea\u9700\u8981\u4e09\u4e2a\u6b65\u9aa4\u5373\u53ef\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Web.Core")," \u9879\u76ee\u5f15\u7528"),Object(r.b)("li",{parentName:"ul"},"\u5728 ",Object(r.b)("inlineCode",{parentName:"li"},"Program.cs")," \u4e2d\u8c03\u7528\u5373\u53ef"),Object(r.b)("li",{parentName:"ul"},"\u5c06 ",Object(r.b)("inlineCode",{parentName:"li"},"Startup.cs")," \u4ee3\u7801\u8fc1\u79fb\u5230 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Web.Core")," \u9879\u76ee\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Startup.cs")," \u4e2d")),Object(r.b)("p",null,"\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{18} title="Furion.Web.Entry\\Program.cs"',"{18}":!0,title:'"Furion.Web.Entry\\Program.cs"'}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.Inject()\n .UseStartup();\n });\n }\n }\n}\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Entry\\Startup.cs"',title:'"Furion.Web.Entry\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Entry\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),Object(r.b)("inlineCode",{parentName:"h5"},"Startup.cs")," \u4ee3\u7801\u8fc1\u79fb")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u53ea\u9700\u8981\u5c06 ",Object(r.b)("inlineCode",{parentName:"p"},"ConfigureServices")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"Configure")," \u65b9\u6cd5\u4ee3\u7801\u8fc1\u79fb\u5230 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core.Startup.cs")," \u4e2d\u5373\u53ef\uff0c\u800c ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u4e24\u4e2a\u65b9\u6cd5\u7559\u7a7a\u5373\u53ef\u3002"))),Object(r.b)("p",null,"\u975e\u5e38\u7b80\u5355\u5427\u3002\u6211\u4eec\u540e\u7eed\u521b\u5efa\u4efb\u4f55 ",Object(r.b)("inlineCode",{parentName:"p"},"MVC"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"RazorPages"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Blazor")," \u9879\u76ee\u53ea\u9700\u8981\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core")," \u5f15\u7528\u548c\u8c03\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"Inject()")," \u5373\u53ef\u3002"),Object(r.b)("h2",{id:"36-\u53cd\u9988\u4e0e\u5efa\u8bae"},"3.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}l.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),i=t(191);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return l})),t.d(n,"b",(function(){return m}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function p(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var b=i.a.createContext({}),s=function(e){var n=i.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):p(p({},n),e)),t},l=function(e){var n=s(e.components);return i.a.createElement(b.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,b=o(e,["components","mdxType","originalType","parentName"]),l=s(t),d=a,m=l["".concat(c,".").concat(d)]||l[d]||u[d]||r;return t?i.a.createElement(m,p(p({ref:n},b),{},{components:t})):i.a.createElement(m,p({ref:n},b))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=d;var p={};for(var o in n)hasOwnProperty.call(n,o)&&(p[o]=n[o]);p.originalType=e,p.mdxType="string"==typeof e?e:a,c[1]=p;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{120:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return p})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return l}));var a=t(3),i=t(7),r=(t(0),t(196)),c=t(197),p={id:"appstartup",title:"3. \u5e94\u7528\u542f\u52a8",sidebar_label:"3. \u5e94\u7528\u542f\u52a8"},o={unversionedId:"appstartup",id:"appstartup",isDocsHomePage:!1,title:"3. \u5e94\u7528\u542f\u52a8",description:"3.1 Startup \u7c7b",source:"@site/docs\\appstartup.mdx",slug:"/appstartup",permalink:"/docs/appstartup",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/appstartup.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"3. \u5e94\u7528\u542f\u52a8",sidebar:"docs",previous:{title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",permalink:"/docs/reference"},next:{title:"4.1 \u914d\u7f6e",permalink:"/docs/configuration"}},b=[{value:"3.1 Startup \u7c7b",id:"31-startup-\u7c7b",children:[{value:"3.1.1 Startup \u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5",id:"311-startup-\u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5",children:[]}]},{value:"3.2 AppStartup",id:"32-appstartup",children:[{value:"3.2.1 \u5982\u4f55\u914d\u7f6e AppStartup",id:"321-\u5982\u4f55\u914d\u7f6e-appstartup",children:[]},{value:"3.2.2 AppStartup \u7ea6\u5b9a",id:"322-appstartup-\u7ea6\u5b9a",children:[]},{value:"3.2.3 AppStartup \u914d\u7f6e\u987a\u5e8f",id:"323-appstartup-\u914d\u7f6e\u987a\u5e8f",children:[]},{value:"3.2.4 AppStartup \u65b9\u6cd5\u8c03\u7528\u987a\u5e8f",id:"324-appstartup-\u65b9\u6cd5\u8c03\u7528\u987a\u5e8f",children:[]}]},{value:"3.3 Startup \u914d\u7f6e\u6700\u4f73\u5b9e\u8df5",id:"33-startup-\u914d\u7f6e\u6700\u4f73\u5b9e\u8df5",children:[]},{value:"3.4 \u5173\u4e8e appsettings.json",id:"34-\u5173\u4e8e-appsettingsjson",children:[]},{value:"3.5 \u795e\u5947\u7684 Inject()",id:"35-\u795e\u5947\u7684-inject",children:[]},{value:"3.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"36-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:b};function l(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"31-startup-\u7c7b"},"3.1 ",Object(r.b)("inlineCode",{parentName:"h2"},"Startup")," \u7c7b"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u7c7b\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u9ed8\u8ba4\u8c03\u7528\u7684\u7c7b\uff0c\u8be5\u7c7b\u662f\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Program.cs")," \u4e2d\u914d\u7f6e\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{19} title="Furion.Web.Entry\\Program.cs"',"{19}":!0,title:'"Furion.Web.Entry\\Program.cs"'}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder\n .Inject()\n .UseStartup();\n });\n }\n }\n}\n")),Object(r.b)("h3",{id:"311-startup-\u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5"},"3.1.1 ",Object(r.b)("inlineCode",{parentName:"h3"},"Startup")," \u4e24\u4e2a\u91cd\u8981\u65b9\u6cd5"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u9ed8\u8ba4\u6709\u4e24\u4e2a\u91cd\u8981\u7684\u65b9\u6cd5:"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ConfigureServices"),"\uff1a\u914d\u7f6e\u5e94\u7528\u6240\u9700\u670d\u52a1\uff0c\u5728\u8be5\u65b9\u6cd5\u4e2d\u53ef\u4ee5\u6dfb\u52a0\u5e94\u7528\u6240\u9700\u8981\u7684\u529f\u80fd\u6216\u670d\u52a1"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Configure"),"\uff1a\u914d\u7f6e\u5e94\u7528\u8bf7\u6c42\u5904\u7406\u7ba1\u9053")),Object(r.b)("p",null,"\u9ed8\u8ba4\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{9,13} title="Furion.Web.Entry\\Startup.cs"',"{9,13}":!0,title:'"Furion.Web.Entry\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Entry\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("p",null,"\u5728\u8fd9\u91cc\uff0c\u4e0d\u6253\u7b97\u8be6\u7ec6\u8bb2 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u7c7b\u7684\u5177\u4f53\u529f\u80fd\u548c\u4f5c\u7528\u3002"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/startup?view=aspnetcore-3.1"}),"ASP.NET Core - Startup \u7c7b")," \u7ae0\u8282\u3002"))),Object(r.b)("h2",{id:"32-appstartup"},"3.2 ",Object(r.b)("inlineCode",{parentName:"h2"},"AppStartup")),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u66f4\u4e3a\u7075\u6d3b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup")," \u7c7b\u914d\u7f6e\u65b9\u5f0f\uff0c\u65e0\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u542f\u7528\u5c42")," \u4e2d\u914d\u7f6e\uff0c\u53ef\u5c06\u914d\u7f6e\u653e\u5230\u4efb\u4f55\u9879\u76ee\u5c42\u3002"),Object(r.b)("p",null,"\u53ef\u80fd\u4f1a\u6709\u8bfb\u8005\u6709\u7591\u95ee\uff0c\u4e3a\u4ec0\u4e48\u8981\u591a\u6b64\u4e00\u4e3e\u5462\uff1f\u539f\u56e0\u6709\u51e0\u70b9\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u7c7b\u9ed8\u8ba4\u548c ",Object(r.b)("inlineCode",{parentName:"li"},"Web \u5e94\u7528\u5c42")," \u7ed1\u5b9a\u5728\u4e00\u8d77\uff0c\u8fd9\u6837\u5c31\u4f1a\u5bfc\u81f4\u5982\u679c\u6211\u521b\u5efa\u4e86\u65b0\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Web \u5e94\u7528\u5c42"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u53c8\u8981\u91cd\u65b0\u914d\u7f6e"),Object(r.b)("li",{parentName:"ul"},"\u968f\u7740\u4e1a\u52a1\u7684\u589e\u957f\uff0c\u9700\u8981\u96c6\u6210\u8d8a\u6765\u8d8a\u591a\u7684\u7b2c\u4e09\u65b9\u670d\u52a1\uff0c\u8fd9\u65f6\u5019 ",Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u7c7b\u5c31\u4f1a\u53d8\u5f97\u8d8a\u6765\u8d8a\u81c3\u80bf\uff0c\u96be\u4ee5\u7ef4\u62a4"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Startup")," \u7c7b\u65e0\u6cd5\u4e0e\u5176\u4ed6\u9879\u76ee\u7c7b\u578b\u8fdb\u884c\u5171\u7528")),Object(r.b)("p",null,"\u6240\u4ee5\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u65b9\u5f0f\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup"),"\u3002"),Object(r.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u6ce8\u610f\u4e8b\u9879")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c ",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u7684\u6d3e\u751f\u7c7b\u6240\u5728\u7684\u9879\u76ee\u5c42\u6ca1\u6709\u88ab\u542f\u52a8\u5c42\u76f4\u63a5\u6216\u95f4\u63a5\u6dfb\u52a0\u5f15\u7528\uff0c\u90a3\u4e48\u8fd9\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u5c31\u4f1a\u88ab\u5ffd\u7565\uff0c\u4e5f\u5c31\u662f\u4e0d\u4f1a\u81ea\u52a8\u8f7d\u5165\u6ce8\u518c\u3002"))),Object(r.b)("h3",{id:"321-\u5982\u4f55\u914d\u7f6e-appstartup"},"3.2.1 \u5982\u4f55\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u662f\u4e00\u4e2a\u62bd\u8c61\u7684\u7a7a\u7c7b\uff0c\u6ca1\u6709\u4efb\u4f55\u5b9a\u4e49\u6210\u5458\u3002\u6b63\u662f\u56e0\u4e3a\u8fd9\u6837\uff0c\u624d\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u7684\u914d\u7f6e\u65b9\u5f0f\u3002"),Object(r.b)("h3",{id:"322-appstartup-\u7ea6\u5b9a"},"3.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")," \u7ea6\u5b9a"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u6d3e\u751f\u7c7b\u53ea\u6709\u4e24\u4e2a\u5c0f\u7ea6\u5b9a\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u4efb\u4f55\u516c\u5f00\u3001\u975e\u9759\u6001\u3001\u8fd4\u56de\u503c\u4e3a ",Object(r.b)("inlineCode",{parentName:"li"},"void")," \u4e14\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"IServiceCollection")," \u7c7b\u578b\uff0c\u90a3\u4e48\u4ed6\u5c31\u662f\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"li"},"ConfigureServices")," \u65b9\u6cd5"),Object(r.b)("li",{parentName:"ul"},"\u4efb\u4f55\u516c\u5f00\u3001\u975e\u9759\u6001\u3001\u8fd4\u56de\u503c\u4e3a ",Object(r.b)("inlineCode",{parentName:"li"},"void")," \u4e14\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"IApplicationBuilder")," \u7c7b\u578b\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"IWebHostEnvironment")," \u7c7b\u578b\uff0c\u90a3\u4e48\u4ed6\u5c31\u662f\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"li"},"Configure")," \u65b9\u6cd5")),Object(r.b)("p",null,"\u6240\u4ee5\uff0c\u6211\u4eec\u53ef\u4ee5\u81ea\u7531\u7684\u7f16\u5199\u65b9\u6cd5\uff0c\u53ea\u8981\u9075\u5faa\u7ea6\u5b9a\u5373\u53ef\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,7,12,18,23}","{5,7,12,18,23}":!0}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n public class MyStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddDataValidation();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n app.UseSwagger();\n }\n\n // \u53ef\u4ee5\u968f\u610f\u5b9a\u4e49\u540d\u5b57\u548c\u65b9\u6cd5\n public void XXXXName(IServiceCollection services)\n {\n }\n\n // \u53ef\u4ee5\u968f\u610f\u5b9a\u4e49\u540d\u5b57\u548c\u65b9\u6cd5\n public void ZZZName(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("h3",{id:"323-appstartup-\u914d\u7f6e\u987a\u5e8f"},"3.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")," \u914d\u7f6e\u987a\u5e8f"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u914d\u7f6e\u987a\u5e8f\u7531\u6240\u5728\u7a0b\u5e8f\u96c6\u7684\u540d\u79f0\u8fdb\u884c\u6b63\u5e8f\u8c03\u7528\uff0c\u5982\u679c\u6211\u4eec\u9700\u8981\u914d\u7f6e\u6267\u884c\u987a\u5e8f\uff0c\u53ea\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u6d3e\u751f\u7c7b\u4e2d\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[AppStartup(order)]")," \u7279\u6027\u5373\u53ef\u3002"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"order")," \u6570\u503c\u8d8a\u5927\uff0c\u8d8a\u5728\u524d\u9762\u8c03\u7528\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(10)]\n public class FirstStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppStartup(9)]\n public class SecondStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"FirstStartup")," \u4f1a\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"SecondStartup")," \u4e4b\u524d\u8c03\u7528\u3002"),Object(r.b)("h3",{id:"324-appstartup-\u65b9\u6cd5\u8c03\u7528\u987a\u5e8f"},"3.2.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"AppStartup")," \u65b9\u6cd5\u8c03\u7528\u987a\u5e8f"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"AppStartup")," \u65b9\u6cd5\u8c03\u7528\u987a\u5e8f\u548c\u65b9\u6cd5\u7684\u4e66\u5199\u5148\u540e\u6709\u5173\uff0c\u8d8a\u5728\u524d\u9762\u7684\u65b9\u6cd5\u8d8a\u5148\u8c03\u7528\u3002"),Object(r.b)("h2",{id:"33-startup-\u914d\u7f6e\u6700\u4f73\u5b9e\u8df5"},"3.3 ",Object(r.b)("inlineCode",{parentName:"h2"},"Startup")," \u914d\u7f6e\u6700\u4f73\u5b9e\u8df5"),Object(r.b)("p",null,"\u5efa\u8bae ",Object(r.b)("inlineCode",{parentName:"p"},"Web")," \u542f\u52a8\u5c42\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4fdd\u6301\u4e3a\u7a7a\u65b9\u6cd5\u4f53\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Entry\\Startup.cs"',title:'"Furion.Web.Entry\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Entry\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("p",null,"\u5c06\u6240\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u5e94\u7528\u5c42")," \u914d\u7f6e\u8fc1\u79fb\u5230 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core.Startup.cs")," \u4e2d\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Core\\Startup.cs"',title:'"Furion.Web.Core\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddCorsAccessor();\n\n services.AddControllers().AddInject();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n app.UseHttpsRedirection();\n\n app.UseRouting();\n\n app.UseCorsAccessor();\n\n app.UseAuthentication();\n app.UseAuthorization();\n\n app.UseInject();\n\n app.UseEndpoints(endpoints =>\n {\n endpoints.MapControllers();\n });\n }\n }\n}\n")),Object(r.b)("p",null,"\u8fd9\u6837\uff0c\u540e\u7eed\u66f4\u6362 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u5e94\u7528\u5c42")," \u4e5f\u65e0\u9700\u91cd\u65b0\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")),Object(r.b)("h2",{id:"34-\u5173\u4e8e-appsettingsjson"},"3.4 \u5173\u4e8e ",Object(r.b)("inlineCode",{parentName:"h2"},"appsettings.json")),Object(r.b)("p",null,"\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u914d\u7f6e\u653e\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u914d\u7f6e\uff0c\u4f46\u662f\u8fd9\u6837\u7684\u65b9\u5f0f\u548c ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u914d\u7f6e\u4e00\u6837\u7684\u9053\u7406\uff0c\u4e00\u65e6\u6211\u4eec\u66f4\u6362\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u5e94\u7528\u5c42"),"\uff0c\u90a3\u4e48 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u53c8\u8981\u91cd\u65b0\u914d\u7f6e\u4e00\u6b21\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u66f4\u52a0\u7075\u6d3b\u7684\u65b9\u5f0f\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json"),"\uff0c",Object(r.b)("strong",{parentName:"p"},"\u53ea\u9700\u8981\u5728\u4efb\u4f55\u9879\u76ee\u5c42\u6839\u76ee\u5f55\u4e0b\u521b\u5efa ",Object(r.b)("inlineCode",{parentName:"strong"},".json")," \u6587\u4ef6\u5373\u53ef\u3002",Object(r.b)("inlineCode",{parentName:"strong"},"Furion")," \u6846\u67b6\u6700\u540e\u4f1a\u81ea\u52a8\u5408\u5e76\u6240\u6709\u5206\u6563\u7684\u914d\u7f6e\u6587\u4ef6\u3002")),Object(r.b)("p",null,"\u5982\u6211\u4eec\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.EntityFramework.Core")," \u5c42\u521b\u5efa ",Object(r.b)("inlineCode",{parentName:"p"},"dbsettings.json")," \u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'title="Furion.EntityFramework.Core\\dbsettings.json"',title:'"Furion.EntityFramework.Core\\dbsettings.json"'}),'{\n "ConnectionStrings": {\n "DbConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;",\n "Sqlite3ConnectionString": "Data Source=./Furion.db"\n }\n}\n')),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u65e0\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u4e2d\u914d\u7f6e"),"\uff0c\u4e0b\u9762\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u9ed8\u8ba4\u4ee3\u7801:"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "Logging": {\n "LogLevel": {\n "Default": "Information",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n },\n "AllowedHosts": "*"\n}\n')),Object(r.b)("p",null,"\u8fd9\u6837\u6211\u4eec\u628a\u914d\u7f6e\u6587\u4ef6\u5206\u6563\u5728\u4e0d\u540c\u9879\u76ee\u5c42\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u5171\u7528\u548c\u5171\u4eab\u4e86\u3002"),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5176\u4ed6\u5c42\u7684\u914d\u7f6e\u6587\u4ef6\u4e0d\u80fd\u4ee5 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u547d\u540d\uff0c\u4f1a\u5bfc\u81f4\u8986\u76d6\u542f\u52a8\u5c42\u7684\u914d\u7f6e\u3002"),Object(r.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c\u5728\u5176\u4ed6\u5c42\u521b\u5efa\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"*.json")," \u6587\u4ef6\u5fc5\u987b\u8bbe\u7f6e\u6587\u4ef6\u5c5e\u6027\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"\u59cb\u7ec8\u590d\u5236\u6216\u8f83\u65b0\u590d\u5236"),"\u3002"))),Object(r.b)("h2",{id:"35-\u795e\u5947\u7684-inject"},"3.5 \u795e\u5947\u7684 ",Object(r.b)("inlineCode",{parentName:"h2"},"Inject()")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Inject()")," \u65b9\u6cd5\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u7684\u6700\u5c0f\u4fb5\u5165\u5f0f\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8ba9\u4efb\u4f55 ",Object(r.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," Web \u9879\u76ee\u77ac\u95f4\u652f\u6301\u6240\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u7279\u6027\u3002"),Object(r.b)("p",null,"\u6211\u4eec\u521b\u5efa\u4e86\u65b0\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Web \u9879\u76ee"),"\uff0c\u53ea\u9700\u8981\u4e09\u4e2a\u6b65\u9aa4\u5373\u53ef\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Web.Core")," \u9879\u76ee\u5f15\u7528"),Object(r.b)("li",{parentName:"ul"},"\u5728 ",Object(r.b)("inlineCode",{parentName:"li"},"Program.cs")," \u4e2d\u8c03\u7528\u5373\u53ef"),Object(r.b)("li",{parentName:"ul"},"\u5c06 ",Object(r.b)("inlineCode",{parentName:"li"},"Startup.cs")," \u4ee3\u7801\u8fc1\u79fb\u5230 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Web.Core")," \u9879\u76ee\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Startup.cs")," \u4e2d")),Object(r.b)("p",null,"\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{18} title="Furion.Web.Entry\\Program.cs"',"{18}":!0,title:'"Furion.Web.Entry\\Program.cs"'}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.Inject()\n .UseStartup();\n });\n }\n }\n}\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'title="Furion.Web.Entry\\Startup.cs"',title:'"Furion.Web.Entry\\Startup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Entry\n{\n public class Startup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n }\n }\n}\n")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),Object(r.b)("inlineCode",{parentName:"h5"},"Startup.cs")," \u4ee3\u7801\u8fc1\u79fb")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u53ea\u9700\u8981\u5c06 ",Object(r.b)("inlineCode",{parentName:"p"},"ConfigureServices")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"Configure")," \u65b9\u6cd5\u4ee3\u7801\u8fc1\u79fb\u5230 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core.Startup.cs")," \u4e2d\u5373\u53ef\uff0c\u800c ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u4e24\u4e2a\u65b9\u6cd5\u7559\u7a7a\u5373\u53ef\u3002"))),Object(r.b)("p",null,"\u975e\u5e38\u7b80\u5355\u5427\u3002\u6211\u4eec\u540e\u7eed\u521b\u5efa\u4efb\u4f55 ",Object(r.b)("inlineCode",{parentName:"p"},"MVC"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"RazorPages"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Blazor")," \u9879\u76ee\u53ea\u9700\u8981\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core")," \u5f15\u7528\u548c\u8c03\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"Inject()")," \u5373\u53ef\u3002"),Object(r.b)("h2",{id:"36-\u53cd\u9988\u4e0e\u5efa\u8bae"},"3.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}l.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),i=t(195);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return l})),t.d(n,"b",(function(){return m}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function p(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var b=i.a.createContext({}),s=function(e){var n=i.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):p(p({},n),e)),t},l=function(e){var n=s(e.components);return i.a.createElement(b.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,b=o(e,["components","mdxType","originalType","parentName"]),l=s(t),d=a,m=l["".concat(c,".").concat(d)]||l[d]||u[d]||r;return t?i.a.createElement(m,p(p({ref:n},b),{},{components:t})):i.a.createElement(m,p({ref:n},b))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=d;var p={};for(var o in n)hasOwnProperty.call(n,o)&&(p[o]=n[o]);p.originalType=e,p.mdxType="string"==typeof e?e:a,c[1]=p;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/5e077782.a1bfa2dc.js b/docs/5e077782.0415f016.js similarity index 99% rename from docs/5e077782.a1bfa2dc.js rename to docs/5e077782.0415f016.js index da1dbb7630a..80f53fed14a 100644 --- a/docs/5e077782.a1bfa2dc.js +++ b/docs/5e077782.0415f016.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[43],{118:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return p})),t.d(n,"default",(function(){return d}));var a=t(3),i=t(7),c=(t(0),t(192)),r=t(190),b=t(193),l={id:"dependency-injection",title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",sidebar_label:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c"},o={unversionedId:"dependency-injection",id:"dependency-injection",isDocsHomePage:!1,title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",description:"12.1 \u4f9d\u8d56\u6ce8\u5165",source:"@site/docs\\dependency-injection.mdx",slug:"/dependency-injection",permalink:"/docs/dependency-injection",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dependency-injection.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",sidebar:"docs",previous:{title:"11. SaaS \u591a\u79df\u6237",permalink:"/docs/saas"},next:{title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",permalink:"/docs/object-mapper"}},p=[{value:"12.1 \u4f9d\u8d56\u6ce8\u5165",id:"121-\u4f9d\u8d56\u6ce8\u5165",children:[]},{value:"12.2 \u63a7\u5236\u53cd\u8f6c",id:"122-\u63a7\u5236\u53cd\u8f6c",children:[]},{value:"12.3 IOC/DI \u4f18\u7f3a\u70b9",id:"123-iocdi-\u4f18\u7f3a\u70b9",children:[]},{value:"12.4 \u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f",id:"124-\u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f",children:[{value:"12.4.1 \u6784\u9020\u65b9\u6cd5\u6ce8\u5165",id:"1241-\u6784\u9020\u65b9\u6cd5\u6ce8\u5165",children:[]},{value:"12.4.2 \u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165",id:"1242-\u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165",children:[]},{value:"12.4.3 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",id:"1243-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",children:[]}]},{value:"12.5 \u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f",id:"125-\u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f",children:[{value:"12.5.1 \u6682\u65f6/\u77ac\u65f6 \u751f\u5b58\u671f",id:"1251-\u6682\u65f6\u77ac\u65f6-\u751f\u5b58\u671f",children:[]},{value:"12.5.2 \u4f5c\u7528\u57df \u751f\u5b58\u671f",id:"1252-\u4f5c\u7528\u57df-\u751f\u5b58\u671f",children:[]},{value:"12.5.3 \u5355\u4f8b \u751f\u5b58\u671f",id:"1253-\u5355\u4f8b-\u751f\u5b58\u671f",children:[]}]},{value:"12.6 \u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3",id:"126-\u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3",children:[]},{value:"12.7 \u5e38\u89c1\u4f7f\u7528",id:"127-\u5e38\u89c1\u4f7f\u7528",children:[{value:"12.7.1 \u7b2c\u4e00\u4e2a\u4f8b\u5b50",id:"1271-\u7b2c\u4e00\u4e2a\u4f8b\u5b50",children:[]},{value:"12.7.2 \u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b",id:"1272-\u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b",children:[]},{value:"12.7.3 \u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0",id:"1273-\u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0",children:[]},{value:"12.7.4 \u65e0\u63a5\u53e3\u65b9\u5f0f",id:"1274-\u65e0\u63a5\u53e3\u65b9\u5f0f",children:[]}]},{value:"12.8 [Injection] \u7279\u6027\u914d\u7f6e",id:"128-injection-\u7279\u6027\u914d\u7f6e",children:[]},{value:"12.9 \u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c",id:"129-\u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c",children:[]},{value:"12.10 appsettings.json \u914d\u7f6e\u6ce8\u518c",id:"1210-appsettingsjson-\u914d\u7f6e\u6ce8\u518c",children:[]},{value:"12.11 \u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7",id:"1211-\u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7",children:[]},{value:"12.12 Aop \u6ce8\u518c\u62e6\u622a",id:"1212-aop-\u6ce8\u518c\u62e6\u622a",children:[{value:"12.12.1 \u5168\u5c40Aop\u62e6\u622a",id:"12121-\u5168\u5c40aop\u62e6\u622a",children:[]},{value:"12.12.2 AOP \u7684\u4f5c\u7528",id:"12122-aop-\u7684\u4f5c\u7528",children:[]}]},{value:"12.13 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"1213-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:p};function d(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"121-\u4f9d\u8d56\u6ce8\u5165"},"12.1 \u4f9d\u8d56\u6ce8\u5165"),Object(c.b)("p",null,"\u6240\u8c13\u4f9d\u8d56\u6ce8\u5165\uff0c\u662f\u6307\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u9700\u8981\u8c03\u7528\u53e6\u4e00\u4e2a\u5bf9\u8c61\u534f\u52a9\u65f6\uff0c\u65e0\u987b\u5728\u4ee3\u7801\u4e2d\u521b\u5efa\u88ab\u8c03\u7528\u8005\uff0c\u800c\u662f\u4f9d\u8d56\u4e8e\u5916\u90e8\u7684\u6ce8\u5165\u3002"),Object(c.b)("p",null,"\u901a\u4fd7\u6765\u8bb2\uff0c\u5c31\u662f\u628a\u6709\u4f9d\u8d56\u5173\u7cfb\u7684\u7c7b\u653e\u5230\u5bb9\u5668\u4e2d\uff0c\u7136\u540e\u5728\u6211\u4eec\u9700\u8981\u8fd9\u4e9b\u7c7b\u65f6\uff0c\u5bb9\u5668\u81ea\u52a8\u89e3\u6790\u51fa\u8fd9\u4e9b\u7c7b\u7684\u5b9e\u4f8b\u3002"),Object(c.b)("p",null,"\u4f9d\u8d56\u6ce8\u5165\u6700\u5927\u7684\u597d\u5904\u65f6\u5b9e\u73b0\u7c7b\u7684\u89e3\u8026\uff0c\u5229\u4e8e\u7a0b\u5e8f\u62d3\u5c55\u3001\u5355\u5143\u6d4b\u8bd5\u3001\u81ea\u52a8\u5316\u6a21\u62df\u6d4b\u8bd5\u7b49\u3002"),Object(c.b)("p",null,"\u4f9d\u8d56\u6ce8\u5165\u7684\u82f1\u6587\u4e3a\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Dependency Injection"),"\uff0c\u7b80\u79f0 ",Object(c.b)("inlineCode",{parentName:"p"},"DI")),Object(c.b)("h2",{id:"122-\u63a7\u5236\u53cd\u8f6c"},"12.2 \u63a7\u5236\u53cd\u8f6c"),Object(c.b)("p",null,"\u63a7\u5236\u53cd\u8f6c\u53ea\u662f\u4e00\u4e2a\u6982\u5ff5\uff0c\u4e5f\u5c31\u662f\u5c06\u521b\u5efa\u5bf9\u8c61\u5b9e\u4f8b\u7684\u63a7\u5236\u6743\uff08\u539f\u672c\u662f\u7a0b\u5e8f\u5458\uff09\u4ece\u4ee3\u7801\u63a7\u5236\u6743\u5265\u79bb\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"IOC \u5bb9\u5668")," \u4e2d\u63a7\u5236\u3002"),Object(c.b)("p",null,"\u63a7\u5236\u53cd\u8f6c\u7684\u82f1\u6587\u4e3a\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Inversion of Control"),"\uff0c\u7b80\u79f0 ",Object(c.b)("inlineCode",{parentName:"p"},"IOC")),Object(c.b)("h2",{id:"123-iocdi-\u4f18\u7f3a\u70b9"},"12.3 ",Object(c.b)("inlineCode",{parentName:"h2"},"IOC/DI")," \u4f18\u7f3a\u70b9"),Object(c.b)("p",null,"\u4f20\u7edf\u7684\u4ee3\u7801\uff0c\u6bcf\u4e2a\u5bf9\u8c61\u8d1f\u8d23\u7ba1\u7406\u4e0e\u81ea\u5df1\u9700\u8981\u4f9d\u8d56\u7684\u5bf9\u8c61\uff0c\u5bfc\u81f4\u5982\u679c\u9700\u8981\u5207\u6362\u4f9d\u8d56\u5bf9\u8c61\u7684\u5b9e\u73b0\u7c7b\u65f6\uff0c\u9700\u8981\u4fee\u6539\u591a\u5904\u5730\u65b9\u3002\u540c\u65f6\uff0c\u8fc7\u5ea6\u8026\u5408\u4e5f\u4f7f\u5f97\u5bf9\u8c61\u96be\u4ee5\u8fdb\u884c\u5355\u5143\u6d4b\u8bd5\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u4f9d\u8d56\u6ce8\u5165\u628a\u5bf9\u8c61\u7684\u521b\u9020\u4ea4\u7ed9\u5916\u90e8\u53bb\u7ba1\u7406,\u5f88\u597d\u7684\u89e3\u51b3\u4e86\u4ee3\u7801\u7d27\u8026\u5408\uff08tight couple\uff09\u7684\u95ee\u9898\uff0c\u662f\u4e00\u79cd\u8ba9\u4ee3\u7801\u5b9e\u73b0\u677e\u8026\u5408\uff08loose couple\uff09\u7684\u673a\u5236"),Object(c.b)("li",{parentName:"ul"},"\u677e\u8026\u5408\u8ba9\u4ee3\u7801\u66f4\u5177\u7075\u6d3b\u6027\uff0c\u80fd\u66f4\u597d\u5730\u5e94\u5bf9\u9700\u6c42\u53d8\u52a8\uff0c\u4ee5\u53ca\u65b9\u4fbf\u5355\u5143\u6d4b\u8bd5"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u76ee\u524d\u4e3b\u6d41\u7684 ",Object(c.b)("inlineCode",{parentName:"li"},"IOC/DI")," \u57fa\u672c\u91c7\u7528\u53cd\u5c04\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u4f9d\u8d56\u6ce8\u5165\uff0c\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4f1a\u5f71\u54cd\u6027\u80fd")))),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728\u672c\u7ae0\u8282\u4e0d\u6253\u7b97\u7ec6\u8bb2 ",Object(c.b)("inlineCode",{parentName:"p"},"\u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c")," \u5177\u4f53\u5b9e\u73b0\u548c\u5e94\u7528\u573a\u666f\uff0c\u60f3\u4e86\u89e3\u66f4\u591a\u77e5\u8bc6\uff0c\u53ef\u67e5\u9605 \u3010",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0"}),"ASP.NET Core \u4f9d\u8d56\u6ce8\u5165"),"\u3011 \u5b98\u65b9\u6587\u6863\u3002"))),Object(c.b)("h2",{id:"124-\u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f"},"12.4 \u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f"),Object(c.b)("h3",{id:"1241-\u6784\u9020\u65b9\u6cd5\u6ce8\u5165"},"12.4.1 \u6784\u9020\u65b9\u6cd5\u6ce8\u5165"),Object(c.b)("p",null,"\u76ee\u524d\u6784\u9020\u65b9\u6cd5\u6ce8\u5165\u662f\u4f9d\u8d56\u6ce8\u5165\u63a8\u8350\u4f7f\u7528\u65b9\u5f0f\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5728\u6784\u9020\u65b9\u6cd5\u4e2d\u4f53\u73b0\u51fa\u5bf9\u5176\u4ed6\u7c7b\u7684\u4f9d\u8d56\uff0c\u4e00\u773c\u5c31\u80fd\u770b\u51fa\u8fd9\u4e2a\u7c7b\u9700\u8981\u5176\u4ed6\u90a3\u4e9b\u7c7b\u624d\u80fd\u5de5\u4f5c"),Object(c.b)("li",{parentName:"ul"},"\u8131\u79bb\u4e86 IOC \u6846\u67b6\uff0c\u8fd9\u4e2a\u7c7b\u4ecd\u7136\u53ef\u4ee5\u5de5\u4f5c\uff0cPOJO \u7684\u6982\u5ff5"),Object(c.b)("li",{parentName:"ul"},"\u4e00\u65e6\u5bf9\u8c61\u521d\u59cb\u5316\u6210\u529f\u4e86\uff0c\u8fd9\u4e2a\u5bf9\u8c61\u7684\u72b6\u6001\u80af\u5b9a\u662f\u6b63\u786e\u7684"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u6784\u9020\u51fd\u6570\u4f1a\u6709\u5f88\u591a\u53c2\u6570\uff08Bad smell\uff09"),Object(c.b)("li",{parentName:"ul"},"\u6709\u4e9b\u7c7b\u662f\u9700\u8981\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u7684\uff0c\u6bd4\u5982 MVC \u6846\u67b6\u7684 Controller \u7c7b\uff0c\u4e00\u65e6\u4f7f\u7528\u6784\u9020\u51fd\u6570\u6ce8\u5165\uff0c\u5c31\u65e0\u6cd5\u4f7f\u7528\u9ed8\u8ba4\u6784\u9020\u51fd\u6570"),Object(c.b)("li",{parentName:"ul"},"\u8fd9\u4e2a\u7c7b\u91cc\u9762\u7684\u6709\u4e9b\u65b9\u6cd5\u5e76\u4e0d\u9700\u8981\u7528\u5230\u8fd9\u4e9b\u4f9d\u8d56\uff08Bad smell\uff09")))),Object(c.b)("p",null,"\u4ee3\u7801\u793a\u4f8b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4}","{4}":!0}),"public class FurionService\n{\n private readonly IRepository _repository;\n public FurionService(IRepository repository)\n {\n _repository = repository;\n }\n}\n")),Object(c.b)("h3",{id:"1242-\u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165"},"12.4.2 \u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165"),Object(c.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u7279\u522b\u58f0\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u65b0\u7248\u672c\u4e2d\uff0c\u5df2\u7ecf\u79fb\u9664\u5c5e\u6027\u6ce8\u5165\u529f\u80fd\uff0c\u5efa\u8bae\u4f7f\u7528\u6784\u9020\u51fd\u6570\u6216\u65b9\u6cd5\u65b9\u5f0f\u6ce8\u5165\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"App.GetService")," \u65b9\u5f0f\u6ce8\u5165\u3002"))),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u901a\u8fc7\u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165\u5bb9\u6613\u548c\u7c7b\u7684\u5b9e\u4f8b\u5c5e\u6027\u6df7\u6dc6\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\u3002")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5728\u5bf9\u8c61\u7684\u6574\u4e2a\u751f\u547d\u5468\u671f\u5185\uff0c\u53ef\u4ee5\u968f\u65f6\u52a8\u6001\u7684\u6539\u53d8\u4f9d\u8d56"),Object(c.b)("li",{parentName:"ul"},"\u975e\u5e38\u7075\u6d3b"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5bf9\u8c61\u5728\u521b\u5efa\u540e\uff0c\u88ab\u8bbe\u7f6e\u4f9d\u8d56\u5bf9\u8c61\u4e4b\u524d\u8fd9\u6bb5\u65f6\u95f4\u72b6\u6001\u662f\u4e0d\u5bf9\u7684"),Object(c.b)("li",{parentName:"ul"},"\u4e0d\u76f4\u89c2\uff0c\u65e0\u6cd5\u6e05\u6670\u5730\u8868\u793a\u54ea\u4e9b\u5c5e\u6027\u662f\u5fc5\u987b\u7684")))),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public class FurionService\n{\n public IRepository Repository { get; set; }\n}\n")),Object(c.b)("h3",{id:"1243-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"},"12.4.3 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"),Object(c.b)("p",null,"\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165\u7684\u610f\u601d\u662f\u5728\u521b\u5efa\u5bf9\u8c61\u540e\uff0c\u901a\u8fc7\u81ea\u52a8\u8c03\u7528\u67d0\u4e2a\u65b9\u6cd5\u6765\u6ce8\u5165\u4f9d\u8d56\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9\uff1a"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u6bd4\u8f83\u7075\u6d3b"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9\uff1a"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u65b0\u52a0\u5165\u4f9d\u8d56\u65f6\u4f1a\u7834\u574f\u539f\u6709\u7684\u65b9\u6cd5\u7b7e\u540d\uff0c\u5982\u679c\u8fd9\u4e2a\u65b9\u6cd5\u5df2\u7ecf\u88ab\u5176\u4ed6\u5f88\u591a\u6a21\u5757\u7528\u5230\u5c31\u5f88\u9ebb\u70e6"),Object(c.b)("li",{parentName:"ul"},"\u4e0e\u6784\u9020\u65b9\u6cd5\u6ce8\u5165\u4e00\u6837\uff0c\u4f1a\u6709\u5f88\u591a\u53c2\u6570")))),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public class FurionService\n{\n public Person GetById([FromServices]IRepository repository, int id)\n {\n return repository.Find(id);\n }\n}\n")),Object(c.b)("h2",{id:"125-\u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f"},"12.5 \u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f"),Object(c.b)("h3",{id:"1251-\u6682\u65f6\u77ac\u65f6-\u751f\u5b58\u671f"},"12.5.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u6682\u65f6/\u77ac\u65f6")," \u751f\u5b58\u671f"),Object(c.b)("p",null,"\u6682\u65f6\u751f\u5b58\u671f\u670d\u52a1\u662f\u6bcf\u6b21\u4ece\u670d\u52a1\u5bb9\u5668\u8fdb\u884c\u8bf7\u6c42\u65f6\u521b\u5efa\u7684\u3002 \u8fd9\u79cd\u751f\u5b58\u671f\u9002\u5408\u8f7b\u91cf\u7ea7\u3001 \u65e0\u72b6\u6001\u7684\u670d\u52a1\u3002"),Object(c.b)("p",null,"\u5728\u5904\u7406\u8bf7\u6c42\u7684\u5e94\u7528\u4e2d\uff0c\u5728\u8bf7\u6c42\u7ed3\u675f\u65f6\u4f1a\u91ca\u653e\u6682\u65f6\u670d\u52a1\u3002"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"ITransient")," \u63a5\u53e3\u4f9d\u8d56\u8868\u793a\u8be5\u751f\u547d\u5468\u671f\u3002"),Object(c.b)("h3",{id:"1252-\u4f5c\u7528\u57df-\u751f\u5b58\u671f"},"12.5.2 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4f5c\u7528\u57df")," \u751f\u5b58\u671f"),Object(c.b)("p",null,"\u4f5c\u7528\u57df\u751f\u5b58\u671f\u670d\u52a1\u9488\u5bf9\u6bcf\u4e2a\u5ba2\u6237\u7aef\u8bf7\u6c42\uff08\u8fde\u63a5\uff09\u521b\u5efa\u4e00\u6b21\u3002\u5728\u5904\u7406\u8bf7\u6c42\u7684\u5e94\u7528\u4e2d\uff0c\u5728\u8bf7\u6c42\u7ed3\u675f\u65f6\u4f1a\u91ca\u653e\u6709\u4f5c\u7528\u57df\u7684\u670d\u52a1\u3002"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"IScoped")," \u63a5\u53e3\u4f9d\u8d56\u8868\u793a\u8be5\u751f\u547d\u5468\u671f\u3002"),Object(c.b)("h3",{id:"1253-\u5355\u4f8b-\u751f\u5b58\u671f"},"12.5.3 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5355\u4f8b")," \u751f\u5b58\u671f"),Object(c.b)("p",null,"\u5728\u9996\u6b21\u8bf7\u6c42\u5b83\u4eec\u65f6\u8fdb\u884c\u521b\u5efa\uff0c\u4e4b\u540e\u6bcf\u4e2a\u540e\u7eed\u8bf7\u6c42\u90fd\u4f7f\u7528\u76f8\u540c\u7684\u5b9e\u4f8b\u3002"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"ISingleton")," \u63a5\u53e3\u4f9d\u8d56\u8868\u793a\u8be5\u751f\u547d\u5468\u671f\u3002"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u670d\u52a1\u751f\u5b58\u671f")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0#service-lifetimes"}),"ASP.NET Core - \u4f9d\u8d56\u6ce8\u5165 - \u670d\u52a1\u751f\u5b58\u671f")," \u7ae0\u8282\u3002"))),Object(c.b)("h2",{id:"126-\u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3"},"12.6 \u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e09\u4e2a\u63a5\u53e3\u4f9d\u8d56\u5206\u522b\u5bf9\u5e94\u4e0d\u540c\u7684\u670d\u52a1\u751f\u5b58\u671f\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ITransient"),"\uff1a\u5bf9\u5e94\u6682\u65f6/\u77ac\u65f6\u4f5c\u7528\u57df\u670d\u52a1\u751f\u5b58\u671f"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"IScoped"),"\uff1a\u5bf9\u5e94\u8bf7\u6c42\u4f5c\u7528\u57df\u670d\u52a1\u751f\u5b58\u671f"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ISingleton"),"\uff1a\u5bf9\u5e94\u5355\u4f8b\u4f5c\u7528\u57df\u670d\u52a1\u751f\u5b58\u671f")),Object(c.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u4ee5\u4e0a\u4e09\u4e2a\u63a5\u53e3\u53ea\u80fd\u5b9e\u4f8b\u7c7b\u5b9e\u73b0\uff0c\u5176\u4ed6\u9759\u6001\u7c7b\u3001\u62bd\u8c61\u7c7b\u3001\u53ca\u63a5\u53e3\u4e0d\u80fd\u5b9e\u73b0\u3002"))),Object(c.b)("h2",{id:"127-\u5e38\u89c1\u4f7f\u7528"},"12.7 \u5e38\u89c1\u4f7f\u7528"),Object(c.b)("h3",{id:"1271-\u7b2c\u4e00\u4e2a\u4f8b\u5b50"},"12.7.1 \u7b2c\u4e00\u4e2a\u4f8b\u5b50"),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u5b9e\u73b0\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12}","{7,12}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public interface IBusinessService\n {\n Person Get(int id);\n }\n\n public class BusinessService : IBusinessService, ITransient\n {\n private readonly IRepository _personRepository;\n\n public BusinessService(IRepository personRepository)\n {\n _personRepository = personRepository;\n }\n\n public Person Get(int id)\n {\n return _personRepository.Find(id);\n }\n }\n}\n")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11,19}","{11,19}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class PersonController : ControllerBase\n {\n private readonly IBusinessService _businessService;\n public PersonController(IBusinessService businessService)\n {\n _businessService = businessService;\n }\n\n [HttpGet]\n public IActionResult Get(int id)\n {\n var person = _businessService.Get(id);\n return new JsonResult(person);\n }\n }\n}\n')),Object(c.b)("img",{src:Object(r.a)("img/di1.gif")}),Object(c.b)("hr",null),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4f8b\u5b50\u89e3\u8bf4")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u4e14\u65b9\u4fbf\u7684\u5b9e\u73b0\u4f9d\u8d56\u6ce8\u5165\u7684\u65b9\u5f0f\uff0c\u53ea\u9700\u8981\u5b9e\u4f8b\u7c7b\u7ee7\u627f\u5bf9\u5e94\u751f\u5b58\u671f\u7684\u63a5\u53e3\u5373\u53ef\uff0c\u8fd9\u91cc\u7ee7\u627f\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ITransient"),"\uff0c\u4e5f\u5c31\u8868\u660e\u4e86\u8fd9\u662f\u4e00\u4e2a ",Object(c.b)("inlineCode",{parentName:"p"},"\u6682\u65f6/\u77ac\u65f6")," \u4f5c\u7528\u57df\u5b9e\u4f8b\u7c7b\u3002\u8be5\u7c7b\u5c31\u53ef\u4ee5\u4f5c\u4e3a\u88ab\u6ce8\u5165\u5bf9\u8c61\uff0c\u540c\u65f6\u4e5f\u80fd\u6ce8\u5165\u5176\u4ed6\u63a5\u53e3\u5bf9\u8c61\u3002"),Object(c.b)("p",null,"\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u6ce8\u5165\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"IRepository")," \u4ed3\u50a8\u63a5\u53e3\uff0c\u540c\u65f6 ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u63a7\u5236\u5668\u6ce8\u5165\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u3002"),Object(c.b)("p",null,"\u8fd9\u6837 ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u4e4b\u95f4\u5c31\u5b9e\u73b0\u4e86\u89e3\u8026\uff0c\u4e0d\u518d\u4f9d\u8d56\u4e8e\u5177\u4f53\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u5b9e\u4f8b\u3002"),Object(c.b)("p",null,"\u8fd9\u5c31\u662f\u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c\u6700\u7ecf\u5178\u7684\u4f8b\u5b50\u3002"),Object(c.b)("h3",{id:"1272-\u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b"},"12.7.2 \u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b"),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u5b9e\u73b0\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12}","{7,12}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public interface IBusinessService\n {\n Person Get(int id);\n }\n\n public class BusinessService : IBusinessService, ITransient\n {\n private readonly IRepository _personRepository;\n\n public BusinessService(IRepository personRepository)\n {\n _personRepository = personRepository;\n }\n\n public Person Get(int id)\n {\n return _personRepository.Find(id);\n }\n }\n}\n")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11,19}","{11,19}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class PersonController : ControllerBase\n {\n private readonly IBusinessService _businessService;\n public PersonController(IBusinessService businessService)\n {\n _businessService = businessService;\n }\n\n [HttpGet]\n public IActionResult Get(int id)\n {\n var person = _businessService.Get(id);\n return new JsonResult(person);\n }\n }\n}\n')),Object(c.b)("h3",{id:"1273-\u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0"},"12.7.3 \u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0"),Object(c.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e00\u4e2a\u63a5\u53e3\u53ea\u5bf9\u5e94\u4e00\u4e2a\u5b9e\u73b0\u7c7b\uff0c\u4f46\u6709\u4e9b\u7279\u6b8a\u60c5\u51b5\uff0c\u9700\u8981\u9700\u8981\u591a\u4e2a\u5b9e\u73b0\u7c7b\u6ce8\u518c\u540c\u4e00\u4e2a\u63a5\u53e3\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"DbContext")," \u591a\u6570\u636e\u5e93\u60c5\u51b5\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165 ",Object(c.b)("inlineCode",{parentName:"p"},"Func")," \u59d4\u6258\u6765\u89e3\u6790\u591a\u4e2a\u5b9e\u4f8b\uff0c\u5176\u4e2d\u59d4\u6258\u7684\u53c2\u6570\u5206\u522b\u4e3a\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u53c2\u6570 1\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b\uff0c\u4e0d\u540c\u5b9e\u73b0\u7c7b\u552f\u4e00\u6807\u8bc6\uff0c\u9ed8\u8ba4\u4e3a ",Object(c.b)("inlineCode",{parentName:"li"},"nameof(\u5b9e\u73b0\u7c7b)")," \u540d\u79f0"),Object(c.b)("li",{parentName:"ul"},"\u53c2\u6570 2\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Type")," \u7c7b\u578b\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"IPrivateDependency")," \u6d3e\u751f\u63a5\u53e3\uff0c\u4e5f\u5c31\u662f ",Object(c.b)("inlineCode",{parentName:"li"},"ITransient"),"\u3001",Object(c.b)("inlineCode",{parentName:"li"},"IScoped"),"\u3001",Object(c.b)("inlineCode",{parentName:"li"},"ISingleton")),Object(c.b)("li",{parentName:"ul"},"\u8fd4\u56de\u503c\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"object")," \u7c7b\u578b\uff0c\u8fd4\u56de\u5177\u4f53\u7684\u5b9e\u73b0\u7c7b\u5b9e\u4f8b")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService"),"\u3001",Object(c.b)("inlineCode",{parentName:"p"},"OtherBusinessService")," \u4e24\u4e2a\u5b9e\u73b0\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,10,18}","{5,10,18}":!0}),'using Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public interface IBusinessService\n {\n string GetName();\n }\n\n public class BusinessService : IBusinessService, ITransient\n {\n public string GetName()\n {\n return "\u6211\u662f\uff1a" + nameof(BusinessService);\n }\n }\n\n public class OtherBusinessService : IBusinessService, ITransient\n {\n public string GetName()\n {\n return "\u6211\u662f\uff1a" + nameof(OtherBusinessService);\n }\n }\n}\n')),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"ValueController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{15,17,18}","{15,17,18}":!0}),'using Furion.Application;\nusing Furion.DependencyInjection;\nusing Microsoft.AspNetCore.Mvc;\nusing System;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class ValueController : ControllerBase\n {\n private readonly IBusinessService _businessService;\n private readonly IBusinessService _otherBusinessService;\n\n public ValueController(Func resolveNamed)\n {\n _businessService = resolveNamed("BusinessService", default) as IBusinessService;\n _otherBusinessService = resolveNamed("OtherBusinessService", default) as IBusinessService;\n }\n\n [HttpGet]\n public string GetName()\n {\n return _businessService.GetName() + "----------" + _otherBusinessService.GetName();\n }\n }\n}\n')),Object(c.b)("img",{src:Object(r.a)("img/di2.gif")}),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u9700\u8981\u81ea\u5b9a\u4e49\u89e3\u6790\u540d\u79f0\uff0c\u53ea\u9700\u8981\u8d34 ",Object(c.b)("inlineCode",{parentName:"p"},'[Injection(Named = "\u540d\u79f0")]')," \u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,11}","{5,11}":!0}),'using Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n [Injection(Named = "BusName1")]\n public class BusinessService : IBusinessService, ITransient\n {\n // ...\n }\n\n [Injection(Named = "BusName2")]\n public class OtherBusinessService : IBusinessService, ITransient\n {\n // ...\n }\n}\n')),Object(c.b)("p",{parentName:"div"},"\u89e3\u6790\u670d\u52a1\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'_businessService = resolveNamed("BusName1", default) as IBusinessService;\n_otherBusinessService = resolveNamed("BusName2", default) as IBusinessService;\n')))),Object(c.b)("h3",{id:"1274-\u65e0\u63a5\u53e3\u65b9\u5f0f"},"12.7.4 \u65e0\u63a5\u53e3\u65b9\u5f0f"),Object(c.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u60f3\u5b9a\u4e49\u63a5\u53e3\uff0c\u800c\u662f\u60f3\u628a\u5b9e\u4f8b\u7c7b\u4f5c\u4e3a\u53ef\u4f9d\u8d56\u6ce8\u5165\u7684\u5bf9\u8c61\uff0c\u5982 MVC \u4e2d\u7684\u63a7\u5236\u5668\u3002"),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"SelfService")," \u5b9e\u4f8b\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,11}","{7,11}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public class SelfService : ITransient\n {\n private readonly IRepository _personRepository;\n\n public SelfService(IRepository personRepository)\n {\n _personRepository = personRepository;\n }\n\n public Person Get(int id)\n {\n return _personRepository.Find(id);\n }\n }\n}\n")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"ValueController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,21}","{13,21}":!0}),'using Furion.Application;\nusing Furion.Core;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class ValueController : ControllerBase\n {\n private readonly SelfService _selfService;\n\n public ValueController(SelfService selfService)\n {\n _selfService = selfService;\n }\n\n [HttpGet]\n public Person Get(int id)\n {\n return _selfService.Get(id);\n }\n }\n}\n')),Object(c.b)("h2",{id:"128-injection-\u7279\u6027\u914d\u7f6e"},"12.8 ",Object(c.b)("inlineCode",{parentName:"h2"},"[Injection]")," \u7279\u6027\u914d\u7f6e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection]")," \u7279\u6027\u53ef\u4ee5\u6539\u53d8\u6ce8\u518c\u65b9\u5f0f\uff0c\u540c\u65f6\u8fd8\u80fd\u914d\u7f6e ",Object(c.b)("inlineCode",{parentName:"p"},"AOP")," \u62e6\u622a\u3002"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"[Injection]")," \u63d0\u4f9b\u4ee5\u4e0b\u914d\u7f6e\u652f\u6301\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Action"),"\uff1a\u914d\u7f6e\u6ce8\u518c\u884c\u4e3a\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"InjectionActions")," \u7c7b\u578b\uff0c\u53ef\u9009\u503c\uff1a",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Add"),"\uff1a",Object(c.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c"),"\uff0c\u8868\u793a\u65e0\u9650\u5236\u6dfb\u52a0\u6ce8\u518c\u670d\u52a1\uff0c\u8be5\u65b9\u5f0f\u652f\u6301\u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"TryAdd"),"\uff1a\u8868\u793a\u6ce8\u518c\u5df2\u5b58\u5728\u5219\u8df3\u8fc7\u6ce8\u518c"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Pattern"),"\uff1a\u914d\u7f6e\u6ce8\u518c\u9009\u9879\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"InjectionPatterns")," \u7c7b\u578b\uff0c\u53ef\u9009\u503c\uff1a",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Self"),"\uff1a\u53ea\u6ce8\u518c\u81ea\u5df1"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"FirstInterface"),"\uff1a\u53ea\u6ce8\u518c\u7b2c\u4e00\u4e2a\u63a5\u53e3"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"SelfWithFirstInterface"),"\uff1a\u6ce8\u518c\u81ea\u5df1\u548c\u7b2c\u4e00\u4e2a\u63a5\u53e3\uff0c",Object(c.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ImplementedInterfaces"),"\uff1a\u6ce8\u518c\u6240\u6709\u63a5\u53e3"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"All"),"\uff1a\u6ce8\u518c\u81ea\u5df1\u5305\u62ec\u6240\u6709\u63a5\u53e3"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Named"),"\uff1a\u914d\u7f6e\u5b9e\u4f8b\u522b\u540d\uff0c\u901a\u8fc7\u522b\u540d\u53ef\u4ee5\u89e3\u6790\u63a5\u53e3\uff0c\u5982\u540c\u4e00\u4e2a\u63a5\u53e3\u6709\u591a\u4e2a\u5b9e\u73b0\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u522b\u540d\u89e3\u6790\u4e0d\u540c\u7684\u5b9e\u73b0\uff0c\u9ed8\u8ba4\u53ea\u4e3a\u5b9e\u73b0\u7c7b\u7684\u7c7b\u540d"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u6ce8\u518c\u6392\u5e8f\uff0c\u6570\u5b57\u8d8a\u5927\uff0c\u5219\u8d8a\u5728\u6700\u540e\u6ce8\u518c\uff0c\u9ed8\u8ba4 ",Object(c.b)("inlineCode",{parentName:"li"},"0")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Proxy"),"\uff1a\u914d\u7f6e\u4ee3\u7406\u62e6\u622a\u7c7b\u578b\uff0c\u4e5f\u5c31\u662f ",Object(c.b)("inlineCode",{parentName:"li"},"AOP"),"\uff0c",Object(c.b)("strong",{parentName:"li"},"\u4ee3\u7406\u7c7b\u578b\u5fc5\u987b\u7ee7\u627f ",Object(c.b)("inlineCode",{parentName:"strong"},"AspectDispatchProxy")," \u7c7b\u548c ",Object(c.b)("inlineCode",{parentName:"strong"},"IDispatchProxy")," \u63a5\u53e3"),"\uff0c\u65e0\u9ed8\u8ba4\u503c"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ExpectInterfaces"),"\uff1a\u914d\u7f6e\u5ffd\u7565\u6ce8\u518c\u7684\u63a5\u53e3\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"Type[]")," \u7c7b\u578b")),Object(c.b)("h2",{id:"129-\u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c"},"12.9 \u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c"),Object(c.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u7684\u6ce8\u518c\u65b9\u5f0f\u53ef\u4ee5\u6ee1\u8db3\u5927\u591a\u6570\u4f9d\u8d56\u6ce8\u5165\u7684\u9700\u6c42\uff0c\u5982\u6709\u7279\u522b\u6ce8\u518c\u9700\u6c42\uff0c\u53ea\u9700\u8981\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddScoped(typeof(ISpecService), provider = > {\n // \u81ea\u5b9a\u4e49\u4efb\u4f55\u521b\u5efa\u5b9e\u4f8b\u7684\u65b9\u5f0f\n var instance = new SpecService(); // \u6216\u8005\u53ef\u4ee5\u901a\u8fc7 AOP\u63d2\u4ef6\u8fd4\u56de\u4ee3\u7406\u5b9e\u4f8b\n\n return instance;\n});\n")),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8865\u5145\u8bf4\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u8fd8\u6709 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy")," \u90fd\u662f\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u521b\u5efa\u7684\u3002"))),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u77e5\u8bc6\u5bfc\u822a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a\u81ea\u5b9a\u4e49\u9ad8\u7ea7\u4e2d\u6ce8\u518c\uff0c\u53ef\u67e5\u9605 \u3010",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0"}),"ASP.NET Core \u4f9d\u8d56\u6ce8\u5165"),"\u3011 \u5b98\u65b9\u6587\u6863\u3002"))),Object(c.b)("h2",{id:"1210-appsettingsjson-\u914d\u7f6e\u6ce8\u518c"},"12.10 ",Object(c.b)("inlineCode",{parentName:"h2"},"appsettings.json")," \u914d\u7f6e\u6ce8\u518c"),Object(c.b)("p",null,"\u9664\u4e86\u5728\u4ee3\u7801\u4e2d\u5b9e\u73b0\u4f9d\u8d56\u6ce8\u5165\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u52a8\u6001\u4f9d\u8d56\u6ce8\u5165\uff0c\u65e0\u9700\u4fee\u6539\u4ee3\u7801\u6216\u91cd\u65b0\u7f16\u8bd1\u5373\u53ef\u5b9e\u73b0\u70ed\u62d4\u63d2\uff08\u63d2\u4ef6\uff09\u6548\u679c\u3002\u914d\u7f6e\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2}","{2}":!0}),'{\n "DependencyInjectionSettings": {\n "Definitions": [\n {\n "Interface": "Furion.Application;Furion.Application.ITestService",\n "Service": "Furion.Application;Furion.Application.TestService",\n "RegisterType": "Transient",\n "Action": "Add",\n "Pattern": "SelfWithFirstInterface",\n "Named": "TestService",\n "Order": 1,\n "Proxy": "Furion.Application;Furion.Application.LogDispathProxy"\n }\n ]\n }\n}\n')),Object(c.b)("p",null,"\u914d\u7f6e\u8bf4\u660e\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"DependencyInjectionSettings"),"\uff1a\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u6839\u8282\u70b9",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u52a8\u6001\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u8282\u70b9\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"ExternalService")," \u6570\u7ec4\u7c7b\u578b",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ExternalService"),"\uff1a\u914d\u7f6e\u5355\u4e2a\u4f9d\u8d56\u6ce8\u5165\u4fe1\u606f",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Interface"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u63a5\u53e3\u4fe1\u606f\uff0c\u683c\u5f0f\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u63a5\u53e3\u5b8c\u6574\u540d\u79f0"),"\uff0c\u5982\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Furion.Application;Furion.Application.ITestService")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Service"),"\uff1a\u914d\u7f6e\u63a5\u53e3\u5b9e\u73b0\u4fe1\u606f\uff0c\u683c\u5f0f\u540c\u4e0a"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"RegisterType"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u6ce8\u5165\u7684\u5bf9\u8c61\u751f\u5b58\u671f\uff0c\u53d6\u503c\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Transient"),"\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"Scoped"),"\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"Singleton")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Action"),"\uff1a\u6ce8\u518c\u884c\u4e3a\uff0c\u53ef\u9009\u503c\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Add"),"\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"TryAdd"),"\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Pattern"),"\uff1a\u6ce8\u518c\u9009\u9879\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Named"),"\uff1a\u6ce8\u518c\u522b\u540d\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u6ce8\u518c\u6392\u5e8f\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Proxy"),"\uff1a\u914d\u7f6e\u4ee3\u7406\u62e6\u622a\uff0c\uff0c\u683c\u5f0f\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u4ee3\u7406\u7c7b\u5b8c\u6574\u540d\u79f0"),"\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e"))))))))),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u5916\u90e8\u7a0b\u5e8f\u96c6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u52a8\u6001\u6ce8\u5165\u7684\u5bf9\u8c61\u662f\u5916\u90e8\u7a0b\u5e8f\u96c6\uff0c\u90a3\u4e48\u9996\u5148\u5148\u6ce8\u518c\u5916\u90e8\u7a0b\u5e8f\u96c6\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "AppSettings": {\n "ExternalAssemblies": ["\u5916\u90e8\u7a0b\u5e8f\u96c6\u540d\u79f0", "Taobao.Pay"] // \u652f\u6301\u591a\u4e2a\n }\n}\n')))),Object(c.b)("h2",{id:"1211-\u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7"},"12.11 \u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u6ce8\u518c\u987a\u5e8f\u662f\u6309\u7167\u7a0b\u5e8f\u96c6\u626b\u63cf\u987a\u5e8f\u8fdb\u884c\u6ce8\u518c\uff0c\u5982\u679c\u9700\u8981\u6539\u53d8\u6ce8\u518c\u987a\u5e8f\uff0c\u53ef\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection(Order)]")," \u7279\u6027\u6307\u5b9a\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Order")," \u503c\u8d8a\u5927\uff0c\u5219\u8d8a\u5728\u6700\u540e\u6ce8\u518c\u3002"),Object(c.b)("p",null,"\u53e6\u5916 ",Object(c.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u7684\u4f18\u5148\u7ea7\u6700\u5927\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u7684\u6ce8\u518c\u4f1a\u8986\u76d6\u4e4b\u524d\u6240\u6709\u6ce8\u518c\u3002"),Object(c.b)("h2",{id:"1212-aop-\u6ce8\u518c\u62e6\u622a"},"12.12 ",Object(c.b)("inlineCode",{parentName:"h2"},"Aop")," \u6ce8\u518c\u62e6\u622a"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"AOP")," \u662f\u975e\u5e38\u91cd\u8981\u7684\u601d\u60f3\u548c\u6280\u672f\uff0c\u4e5f\u5c31\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"\u9762\u5411\u5207\u9762")," \u7f16\u7a0b\uff0c\u53ef\u4ee5\u8ba9\u6211\u4eec\u5728\u4e0d\u6539\u52a8\u539f\u6765\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u52a8\u6001\u7be1\u6539\u4e1a\u52a1\u4ee3\u7801\u3002"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"Aop")," \u975e\u5e38\u7b80\u5355\uff0c\u5982\uff1a"),Object(c.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u6709 ",Object(c.b)("inlineCode",{parentName:"p"},"ITestService")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"TestService")," \u4e24\u4e2a\u7c7b\u578b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class ITestService\n{\n string SayHello(string word);\n}\n")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public class TestService: ITestService, ITransient\n{\n public string SayHello(string word)\n {\n return $"Hello {word}";\n }\n}\n')),Object(c.b)("p",null,"\u73b0\u5728\u6211\u4eec\u6709\u4e00\u4e2a\u9700\u6c42\uff0c\u6211\u4eec\u5e0c\u671b\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"SayHello")," \u7684\u65f6\u5019\u53ef\u4ee5\u8bb0\u5f55\u65e5\u5fd7\u548c\u6743\u9650\u63a7\u5236\uff08\u4e4b\u524d\u6ca1\u6709\u8003\u8651\u5230\u7684\u9700\u6c42\uff09\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ea\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u4ee3\u7406\u7c7b\u5373\u53ef\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"LogDispatchProxy")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3,7,25,37,48}","{1,3,7,25,37,48}":!0}),'using Furion.DependencyInjection;\nusing System;\nusing System.Reflection;\n\nnamespace Furion.Application\n{\n public class LogDispatchProxy : AspectDispatchProxy, IDispatchProxy\n {\n /// \n /// \u5f53\u524d\u670d\u52a1\u5b9e\u4f8b\n /// \n public object Target { get; set; }\n\n /// \n /// \u670d\u52a1\u63d0\u4f9b\u5668\uff0c\u53ef\u4ee5\u7528\u6765\u89e3\u6790\u670d\u52a1\uff0c\u5982\uff1aServices.GetService()\n /// \n public IServiceProvider Services { get; set; }\n\n /// \n /// \u62e6\u622a\u65b9\u6cd5\n /// \n /// \n /// \n /// \n public override object Invoke(MethodInfo method, object[] args)\n {\n Console.WriteLine("SayHello \u65b9\u6cd5\u88ab\u8c03\u7528\u4e86");\n\n var result = method.Invoke(Target, args);\n\n Console.WriteLine("SayHello \u65b9\u6cd5\u8fd4\u56de\u503c\uff1a" + result);\n\n return result;\n }\n\n // \u5f02\u6b65\u65e0\u8fd4\u56de\u503c\n public override async Task InvokeAsync(MethodInfo method, object[] args)\n {\n Console.WriteLine("SayHello \u65b9\u6cd5\u88ab\u8c03\u7528\u4e86");\n\n var task = method.Invoke(Target, args) as Task;\n await task;\n\n Console.WriteLine("SayHello \u65b9\u6cd5\u8c03\u7528\u5b8c\u6210");\n }\n\n // \u5f02\u6b65\u5e26\u8fd4\u56de\u503c\n public override async Task InvokeAsyncT(MethodInfo method, object[] args)\n {\n Console.WriteLine("SayHello \u65b9\u6cd5\u88ab\u8c03\u7528\u4e86");\n\n var taskT = method.Invoke(Target, args) as Task;\n var result = await taskT;\n\n Console.WriteLine("SayHello \u65b9\u6cd5\u8fd4\u56de\u503c\uff1a" + result);\n\n return result;\n }\n }\n}\n')),Object(c.b)("p",null,"\u4e4b\u540e\u6211\u4eec\u53ea\u9700\u8981\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"TestService")," \u589e\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection]")," \u7279\u6027\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),'[Injection(Proxy = typeof(LogDispatchProxy))]\npublic class TestService: ITestService, ITransient\n{\n public string SayHello(string word)\n {\n return $"Hello {word}";\n }\n}\n')),Object(c.b)("p",null,"\u4e4b\u540e ",Object(c.b)("inlineCode",{parentName:"p"},"SayHello")," \u65b9\u6cd5\u88ab\u8c03\u7528\u7684\u65f6\u5019\u5c31\u53ef\u4ee5\u5b9e\u73b0\u52a8\u6001\u62e6\u622a\u4e86\uff0c\u6bd4\u5982\u8fd9\u91cc\u5199\u65e5\u5fd7\u3002"),Object(c.b)("h3",{id:"12121-\u5168\u5c40aop\u62e6\u622a"},"12.12.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5168\u5c40Aop\u62e6\u622a")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u5168\u5c40\u62e6\u622a\u7684\u65b9\u5f0f\uff0c\u53ea\u9700\u8981\u5c06 ",Object(c.b)("inlineCode",{parentName:"p"},"IDispatchProxy")," \u4fee\u6539\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"IGlobalDispatchProxy")," \u5373\u53ef\u3002"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Furion;\nusing System.Reflection;\n\nnamespace Furion.Application\n{\n public class LogDispatchProxy : AspectDispatchProxy, IGlobalDispatchProxy\n {\n // ....\n }\n}\n")),Object(c.b)("p",null,"\u8fd9\u6837\u5c31\u4f1a\u62e6\u622a\u6240\u6709\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Service"),"\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7ed9\u7279\u5b9a\u7c7b\u8d34 ",Object(c.b)("inlineCode",{parentName:"p"},"[SkipProxy]")," \u8df3\u8fc7\u5168\u5c40\u62e6\u622a\u64cd\u4f5c\u3002"),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u62e6\u622a\u4f18\u5148\u7ea7")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"[SkipProxy]")," > ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection(Proxy = typeof(LogDispatchProxy))]")," > ",Object(c.b)("inlineCode",{parentName:"p"},"\u5168\u5c40\u62e6\u622a"),"\u3002"))),Object(c.b)("h3",{id:"12122-aop-\u7684\u4f5c\u7528"},"12.12.2 ",Object(c.b)("inlineCode",{parentName:"h3"},"AOP")," \u7684\u4f5c\u7528"),Object(c.b)("p",null,"\u8fd9\u79cd\u9762\u5411\u5207\u9762\u7684\u80fd\u529b\uff08\u52a8\u6001\u62e6\u622a/\u4ee3\u7406\uff09\u53ef\u4ee5\u5b9e\u73b0\u5f88\u591a\u5f88\u591a\u529f\u80fd\uff0c\u5982\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u65e5\u5fd7\u8bb0\u5f55"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u4fee\u6539\u53c2\u6570"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u4fee\u6539\u8fd4\u56de\u503c"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u65b9\u6cd5\u91cd\u5b9a\u5411"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u4fee\u6539\u4ee3\u7801\u903b\u8f91"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u5b9e\u73b0\u5f02\u5e38\u76d1\u542c")),Object(c.b)("p",null,"\u8fd8\u53ef\u4ee5\u505a\u66f4\u591a\u66f4\u591a\u7684\u4e8b\u60c5\u3002"),Object(c.b)("h2",{id:"1213-\u53cd\u9988\u4e0e\u5efa\u8bae"},"12.13 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(191);function c(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return c?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=c();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return m}));var a=t(0),i=t.n(a);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var o=i.a.createContext({}),p=function(e){var n=i.a.useContext(o),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(o.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},j=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,c=e.originalType,r=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=p(t),j=a,m=s["".concat(r,".").concat(j)]||s[j]||d[j]||c;return t?i.a.createElement(m,b(b({ref:n},o),{},{components:t})):i.a.createElement(m,b({ref:n},o))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var c=t.length,r=new Array(c);r[0]=j;var b={};for(var l in n)hasOwnProperty.call(n,l)&&(b[l]=n[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var o=2;on(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{121:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return p})),t.d(n,"default",(function(){return d}));var a=t(3),i=t(7),c=(t(0),t(196)),r=t(194),b=t(197),l={id:"dependency-injection",title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",sidebar_label:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c"},o={unversionedId:"dependency-injection",id:"dependency-injection",isDocsHomePage:!1,title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",description:"12.1 \u4f9d\u8d56\u6ce8\u5165",source:"@site/docs\\dependency-injection.mdx",slug:"/dependency-injection",permalink:"/docs/dependency-injection",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dependency-injection.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",sidebar:"docs",previous:{title:"11. SaaS \u591a\u79df\u6237",permalink:"/docs/saas"},next:{title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",permalink:"/docs/object-mapper"}},p=[{value:"12.1 \u4f9d\u8d56\u6ce8\u5165",id:"121-\u4f9d\u8d56\u6ce8\u5165",children:[]},{value:"12.2 \u63a7\u5236\u53cd\u8f6c",id:"122-\u63a7\u5236\u53cd\u8f6c",children:[]},{value:"12.3 IOC/DI \u4f18\u7f3a\u70b9",id:"123-iocdi-\u4f18\u7f3a\u70b9",children:[]},{value:"12.4 \u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f",id:"124-\u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f",children:[{value:"12.4.1 \u6784\u9020\u65b9\u6cd5\u6ce8\u5165",id:"1241-\u6784\u9020\u65b9\u6cd5\u6ce8\u5165",children:[]},{value:"12.4.2 \u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165",id:"1242-\u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165",children:[]},{value:"12.4.3 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",id:"1243-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",children:[]}]},{value:"12.5 \u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f",id:"125-\u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f",children:[{value:"12.5.1 \u6682\u65f6/\u77ac\u65f6 \u751f\u5b58\u671f",id:"1251-\u6682\u65f6\u77ac\u65f6-\u751f\u5b58\u671f",children:[]},{value:"12.5.2 \u4f5c\u7528\u57df \u751f\u5b58\u671f",id:"1252-\u4f5c\u7528\u57df-\u751f\u5b58\u671f",children:[]},{value:"12.5.3 \u5355\u4f8b \u751f\u5b58\u671f",id:"1253-\u5355\u4f8b-\u751f\u5b58\u671f",children:[]}]},{value:"12.6 \u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3",id:"126-\u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3",children:[]},{value:"12.7 \u5e38\u89c1\u4f7f\u7528",id:"127-\u5e38\u89c1\u4f7f\u7528",children:[{value:"12.7.1 \u7b2c\u4e00\u4e2a\u4f8b\u5b50",id:"1271-\u7b2c\u4e00\u4e2a\u4f8b\u5b50",children:[]},{value:"12.7.2 \u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b",id:"1272-\u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b",children:[]},{value:"12.7.3 \u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0",id:"1273-\u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0",children:[]},{value:"12.7.4 \u65e0\u63a5\u53e3\u65b9\u5f0f",id:"1274-\u65e0\u63a5\u53e3\u65b9\u5f0f",children:[]}]},{value:"12.8 [Injection] \u7279\u6027\u914d\u7f6e",id:"128-injection-\u7279\u6027\u914d\u7f6e",children:[]},{value:"12.9 \u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c",id:"129-\u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c",children:[]},{value:"12.10 appsettings.json \u914d\u7f6e\u6ce8\u518c",id:"1210-appsettingsjson-\u914d\u7f6e\u6ce8\u518c",children:[]},{value:"12.11 \u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7",id:"1211-\u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7",children:[]},{value:"12.12 Aop \u6ce8\u518c\u62e6\u622a",id:"1212-aop-\u6ce8\u518c\u62e6\u622a",children:[{value:"12.12.1 \u5168\u5c40Aop\u62e6\u622a",id:"12121-\u5168\u5c40aop\u62e6\u622a",children:[]},{value:"12.12.2 AOP \u7684\u4f5c\u7528",id:"12122-aop-\u7684\u4f5c\u7528",children:[]}]},{value:"12.13 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"1213-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:p};function d(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(c.b)(b.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"121-\u4f9d\u8d56\u6ce8\u5165"},"12.1 \u4f9d\u8d56\u6ce8\u5165"),Object(c.b)("p",null,"\u6240\u8c13\u4f9d\u8d56\u6ce8\u5165\uff0c\u662f\u6307\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u9700\u8981\u8c03\u7528\u53e6\u4e00\u4e2a\u5bf9\u8c61\u534f\u52a9\u65f6\uff0c\u65e0\u987b\u5728\u4ee3\u7801\u4e2d\u521b\u5efa\u88ab\u8c03\u7528\u8005\uff0c\u800c\u662f\u4f9d\u8d56\u4e8e\u5916\u90e8\u7684\u6ce8\u5165\u3002"),Object(c.b)("p",null,"\u901a\u4fd7\u6765\u8bb2\uff0c\u5c31\u662f\u628a\u6709\u4f9d\u8d56\u5173\u7cfb\u7684\u7c7b\u653e\u5230\u5bb9\u5668\u4e2d\uff0c\u7136\u540e\u5728\u6211\u4eec\u9700\u8981\u8fd9\u4e9b\u7c7b\u65f6\uff0c\u5bb9\u5668\u81ea\u52a8\u89e3\u6790\u51fa\u8fd9\u4e9b\u7c7b\u7684\u5b9e\u4f8b\u3002"),Object(c.b)("p",null,"\u4f9d\u8d56\u6ce8\u5165\u6700\u5927\u7684\u597d\u5904\u65f6\u5b9e\u73b0\u7c7b\u7684\u89e3\u8026\uff0c\u5229\u4e8e\u7a0b\u5e8f\u62d3\u5c55\u3001\u5355\u5143\u6d4b\u8bd5\u3001\u81ea\u52a8\u5316\u6a21\u62df\u6d4b\u8bd5\u7b49\u3002"),Object(c.b)("p",null,"\u4f9d\u8d56\u6ce8\u5165\u7684\u82f1\u6587\u4e3a\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Dependency Injection"),"\uff0c\u7b80\u79f0 ",Object(c.b)("inlineCode",{parentName:"p"},"DI")),Object(c.b)("h2",{id:"122-\u63a7\u5236\u53cd\u8f6c"},"12.2 \u63a7\u5236\u53cd\u8f6c"),Object(c.b)("p",null,"\u63a7\u5236\u53cd\u8f6c\u53ea\u662f\u4e00\u4e2a\u6982\u5ff5\uff0c\u4e5f\u5c31\u662f\u5c06\u521b\u5efa\u5bf9\u8c61\u5b9e\u4f8b\u7684\u63a7\u5236\u6743\uff08\u539f\u672c\u662f\u7a0b\u5e8f\u5458\uff09\u4ece\u4ee3\u7801\u63a7\u5236\u6743\u5265\u79bb\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"IOC \u5bb9\u5668")," \u4e2d\u63a7\u5236\u3002"),Object(c.b)("p",null,"\u63a7\u5236\u53cd\u8f6c\u7684\u82f1\u6587\u4e3a\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Inversion of Control"),"\uff0c\u7b80\u79f0 ",Object(c.b)("inlineCode",{parentName:"p"},"IOC")),Object(c.b)("h2",{id:"123-iocdi-\u4f18\u7f3a\u70b9"},"12.3 ",Object(c.b)("inlineCode",{parentName:"h2"},"IOC/DI")," \u4f18\u7f3a\u70b9"),Object(c.b)("p",null,"\u4f20\u7edf\u7684\u4ee3\u7801\uff0c\u6bcf\u4e2a\u5bf9\u8c61\u8d1f\u8d23\u7ba1\u7406\u4e0e\u81ea\u5df1\u9700\u8981\u4f9d\u8d56\u7684\u5bf9\u8c61\uff0c\u5bfc\u81f4\u5982\u679c\u9700\u8981\u5207\u6362\u4f9d\u8d56\u5bf9\u8c61\u7684\u5b9e\u73b0\u7c7b\u65f6\uff0c\u9700\u8981\u4fee\u6539\u591a\u5904\u5730\u65b9\u3002\u540c\u65f6\uff0c\u8fc7\u5ea6\u8026\u5408\u4e5f\u4f7f\u5f97\u5bf9\u8c61\u96be\u4ee5\u8fdb\u884c\u5355\u5143\u6d4b\u8bd5\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u4f9d\u8d56\u6ce8\u5165\u628a\u5bf9\u8c61\u7684\u521b\u9020\u4ea4\u7ed9\u5916\u90e8\u53bb\u7ba1\u7406,\u5f88\u597d\u7684\u89e3\u51b3\u4e86\u4ee3\u7801\u7d27\u8026\u5408\uff08tight couple\uff09\u7684\u95ee\u9898\uff0c\u662f\u4e00\u79cd\u8ba9\u4ee3\u7801\u5b9e\u73b0\u677e\u8026\u5408\uff08loose couple\uff09\u7684\u673a\u5236"),Object(c.b)("li",{parentName:"ul"},"\u677e\u8026\u5408\u8ba9\u4ee3\u7801\u66f4\u5177\u7075\u6d3b\u6027\uff0c\u80fd\u66f4\u597d\u5730\u5e94\u5bf9\u9700\u6c42\u53d8\u52a8\uff0c\u4ee5\u53ca\u65b9\u4fbf\u5355\u5143\u6d4b\u8bd5"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u76ee\u524d\u4e3b\u6d41\u7684 ",Object(c.b)("inlineCode",{parentName:"li"},"IOC/DI")," \u57fa\u672c\u91c7\u7528\u53cd\u5c04\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u4f9d\u8d56\u6ce8\u5165\uff0c\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4f1a\u5f71\u54cd\u6027\u80fd")))),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728\u672c\u7ae0\u8282\u4e0d\u6253\u7b97\u7ec6\u8bb2 ",Object(c.b)("inlineCode",{parentName:"p"},"\u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c")," \u5177\u4f53\u5b9e\u73b0\u548c\u5e94\u7528\u573a\u666f\uff0c\u60f3\u4e86\u89e3\u66f4\u591a\u77e5\u8bc6\uff0c\u53ef\u67e5\u9605 \u3010",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0"}),"ASP.NET Core \u4f9d\u8d56\u6ce8\u5165"),"\u3011 \u5b98\u65b9\u6587\u6863\u3002"))),Object(c.b)("h2",{id:"124-\u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f"},"12.4 \u4f9d\u8d56\u6ce8\u5165\u7684\u4e09\u79cd\u65b9\u5f0f"),Object(c.b)("h3",{id:"1241-\u6784\u9020\u65b9\u6cd5\u6ce8\u5165"},"12.4.1 \u6784\u9020\u65b9\u6cd5\u6ce8\u5165"),Object(c.b)("p",null,"\u76ee\u524d\u6784\u9020\u65b9\u6cd5\u6ce8\u5165\u662f\u4f9d\u8d56\u6ce8\u5165\u63a8\u8350\u4f7f\u7528\u65b9\u5f0f\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5728\u6784\u9020\u65b9\u6cd5\u4e2d\u4f53\u73b0\u51fa\u5bf9\u5176\u4ed6\u7c7b\u7684\u4f9d\u8d56\uff0c\u4e00\u773c\u5c31\u80fd\u770b\u51fa\u8fd9\u4e2a\u7c7b\u9700\u8981\u5176\u4ed6\u90a3\u4e9b\u7c7b\u624d\u80fd\u5de5\u4f5c"),Object(c.b)("li",{parentName:"ul"},"\u8131\u79bb\u4e86 IOC \u6846\u67b6\uff0c\u8fd9\u4e2a\u7c7b\u4ecd\u7136\u53ef\u4ee5\u5de5\u4f5c\uff0cPOJO \u7684\u6982\u5ff5"),Object(c.b)("li",{parentName:"ul"},"\u4e00\u65e6\u5bf9\u8c61\u521d\u59cb\u5316\u6210\u529f\u4e86\uff0c\u8fd9\u4e2a\u5bf9\u8c61\u7684\u72b6\u6001\u80af\u5b9a\u662f\u6b63\u786e\u7684"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u6784\u9020\u51fd\u6570\u4f1a\u6709\u5f88\u591a\u53c2\u6570\uff08Bad smell\uff09"),Object(c.b)("li",{parentName:"ul"},"\u6709\u4e9b\u7c7b\u662f\u9700\u8981\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u7684\uff0c\u6bd4\u5982 MVC \u6846\u67b6\u7684 Controller \u7c7b\uff0c\u4e00\u65e6\u4f7f\u7528\u6784\u9020\u51fd\u6570\u6ce8\u5165\uff0c\u5c31\u65e0\u6cd5\u4f7f\u7528\u9ed8\u8ba4\u6784\u9020\u51fd\u6570"),Object(c.b)("li",{parentName:"ul"},"\u8fd9\u4e2a\u7c7b\u91cc\u9762\u7684\u6709\u4e9b\u65b9\u6cd5\u5e76\u4e0d\u9700\u8981\u7528\u5230\u8fd9\u4e9b\u4f9d\u8d56\uff08Bad smell\uff09")))),Object(c.b)("p",null,"\u4ee3\u7801\u793a\u4f8b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4}","{4}":!0}),"public class FurionService\n{\n private readonly IRepository _repository;\n public FurionService(IRepository repository)\n {\n _repository = repository;\n }\n}\n")),Object(c.b)("h3",{id:"1242-\u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165"},"12.4.2 \u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165"),Object(c.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u7279\u522b\u58f0\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u65b0\u7248\u672c\u4e2d\uff0c\u5df2\u7ecf\u79fb\u9664\u5c5e\u6027\u6ce8\u5165\u529f\u80fd\uff0c\u5efa\u8bae\u4f7f\u7528\u6784\u9020\u51fd\u6570\u6216\u65b9\u6cd5\u65b9\u5f0f\u6ce8\u5165\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"App.GetService")," \u65b9\u5f0f\u6ce8\u5165\u3002"))),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u901a\u8fc7\u5c5e\u6027\u65b9\u5f0f\u6ce8\u5165\u5bb9\u6613\u548c\u7c7b\u7684\u5b9e\u4f8b\u5c5e\u6027\u6df7\u6dc6\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\u3002")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5728\u5bf9\u8c61\u7684\u6574\u4e2a\u751f\u547d\u5468\u671f\u5185\uff0c\u53ef\u4ee5\u968f\u65f6\u52a8\u6001\u7684\u6539\u53d8\u4f9d\u8d56"),Object(c.b)("li",{parentName:"ul"},"\u975e\u5e38\u7075\u6d3b"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u5bf9\u8c61\u5728\u521b\u5efa\u540e\uff0c\u88ab\u8bbe\u7f6e\u4f9d\u8d56\u5bf9\u8c61\u4e4b\u524d\u8fd9\u6bb5\u65f6\u95f4\u72b6\u6001\u662f\u4e0d\u5bf9\u7684"),Object(c.b)("li",{parentName:"ul"},"\u4e0d\u76f4\u89c2\uff0c\u65e0\u6cd5\u6e05\u6670\u5730\u8868\u793a\u54ea\u4e9b\u5c5e\u6027\u662f\u5fc5\u987b\u7684")))),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public class FurionService\n{\n public IRepository Repository { get; set; }\n}\n")),Object(c.b)("h3",{id:"1243-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"},"12.4.3 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"),Object(c.b)("p",null,"\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165\u7684\u610f\u601d\u662f\u5728\u521b\u5efa\u5bf9\u8c61\u540e\uff0c\u901a\u8fc7\u81ea\u52a8\u8c03\u7528\u67d0\u4e2a\u65b9\u6cd5\u6765\u6ce8\u5165\u4f9d\u8d56\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u4f18\u70b9\uff1a"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u6bd4\u8f83\u7075\u6d3b"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("p",{parentName:"li"},"\u7f3a\u70b9\uff1a"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},"\u65b0\u52a0\u5165\u4f9d\u8d56\u65f6\u4f1a\u7834\u574f\u539f\u6709\u7684\u65b9\u6cd5\u7b7e\u540d\uff0c\u5982\u679c\u8fd9\u4e2a\u65b9\u6cd5\u5df2\u7ecf\u88ab\u5176\u4ed6\u5f88\u591a\u6a21\u5757\u7528\u5230\u5c31\u5f88\u9ebb\u70e6"),Object(c.b)("li",{parentName:"ul"},"\u4e0e\u6784\u9020\u65b9\u6cd5\u6ce8\u5165\u4e00\u6837\uff0c\u4f1a\u6709\u5f88\u591a\u53c2\u6570")))),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public class FurionService\n{\n public Person GetById([FromServices]IRepository repository, int id)\n {\n return repository.Find(id);\n }\n}\n")),Object(c.b)("h2",{id:"125-\u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f"},"12.5 \u6ce8\u518c\u5bf9\u8c61\u751f\u5b58\u671f"),Object(c.b)("h3",{id:"1251-\u6682\u65f6\u77ac\u65f6-\u751f\u5b58\u671f"},"12.5.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u6682\u65f6/\u77ac\u65f6")," \u751f\u5b58\u671f"),Object(c.b)("p",null,"\u6682\u65f6\u751f\u5b58\u671f\u670d\u52a1\u662f\u6bcf\u6b21\u4ece\u670d\u52a1\u5bb9\u5668\u8fdb\u884c\u8bf7\u6c42\u65f6\u521b\u5efa\u7684\u3002 \u8fd9\u79cd\u751f\u5b58\u671f\u9002\u5408\u8f7b\u91cf\u7ea7\u3001 \u65e0\u72b6\u6001\u7684\u670d\u52a1\u3002"),Object(c.b)("p",null,"\u5728\u5904\u7406\u8bf7\u6c42\u7684\u5e94\u7528\u4e2d\uff0c\u5728\u8bf7\u6c42\u7ed3\u675f\u65f6\u4f1a\u91ca\u653e\u6682\u65f6\u670d\u52a1\u3002"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"ITransient")," \u63a5\u53e3\u4f9d\u8d56\u8868\u793a\u8be5\u751f\u547d\u5468\u671f\u3002"),Object(c.b)("h3",{id:"1252-\u4f5c\u7528\u57df-\u751f\u5b58\u671f"},"12.5.2 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u4f5c\u7528\u57df")," \u751f\u5b58\u671f"),Object(c.b)("p",null,"\u4f5c\u7528\u57df\u751f\u5b58\u671f\u670d\u52a1\u9488\u5bf9\u6bcf\u4e2a\u5ba2\u6237\u7aef\u8bf7\u6c42\uff08\u8fde\u63a5\uff09\u521b\u5efa\u4e00\u6b21\u3002\u5728\u5904\u7406\u8bf7\u6c42\u7684\u5e94\u7528\u4e2d\uff0c\u5728\u8bf7\u6c42\u7ed3\u675f\u65f6\u4f1a\u91ca\u653e\u6709\u4f5c\u7528\u57df\u7684\u670d\u52a1\u3002"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"IScoped")," \u63a5\u53e3\u4f9d\u8d56\u8868\u793a\u8be5\u751f\u547d\u5468\u671f\u3002"),Object(c.b)("h3",{id:"1253-\u5355\u4f8b-\u751f\u5b58\u671f"},"12.5.3 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5355\u4f8b")," \u751f\u5b58\u671f"),Object(c.b)("p",null,"\u5728\u9996\u6b21\u8bf7\u6c42\u5b83\u4eec\u65f6\u8fdb\u884c\u521b\u5efa\uff0c\u4e4b\u540e\u6bcf\u4e2a\u540e\u7eed\u8bf7\u6c42\u90fd\u4f7f\u7528\u76f8\u540c\u7684\u5b9e\u4f8b\u3002"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"ISingleton")," \u63a5\u53e3\u4f9d\u8d56\u8868\u793a\u8be5\u751f\u547d\u5468\u671f\u3002"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u670d\u52a1\u751f\u5b58\u671f")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0#service-lifetimes"}),"ASP.NET Core - \u4f9d\u8d56\u6ce8\u5165 - \u670d\u52a1\u751f\u5b58\u671f")," \u7ae0\u8282\u3002"))),Object(c.b)("h2",{id:"126-\u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3"},"12.6 \u5185\u7f6e\u4f9d\u8d56\u63a5\u53e3"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e09\u4e2a\u63a5\u53e3\u4f9d\u8d56\u5206\u522b\u5bf9\u5e94\u4e0d\u540c\u7684\u670d\u52a1\u751f\u5b58\u671f\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ITransient"),"\uff1a\u5bf9\u5e94\u6682\u65f6/\u77ac\u65f6\u4f5c\u7528\u57df\u670d\u52a1\u751f\u5b58\u671f"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"IScoped"),"\uff1a\u5bf9\u5e94\u8bf7\u6c42\u4f5c\u7528\u57df\u670d\u52a1\u751f\u5b58\u671f"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ISingleton"),"\uff1a\u5bf9\u5e94\u5355\u4f8b\u4f5c\u7528\u57df\u670d\u52a1\u751f\u5b58\u671f")),Object(c.b)("div",{className:"admonition admonition-warning alert alert--danger"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M5.05.31c.81 2.17.41 3.38-.52 4.31C3.55 5.67 1.98 6.45.9 7.98c-1.45 2.05-1.7 6.53 3.53 7.7-2.2-1.16-2.67-4.52-.3-6.61-.61 2.03.53 3.33 1.94 2.86 1.39-.47 2.3.53 2.27 1.67-.02.78-.31 1.44-1.13 1.81 3.42-.59 4.78-3.42 4.78-5.56 0-2.84-2.53-3.22-1.25-5.61-1.52.13-2.03 1.13-1.89 2.75.09 1.08-1.02 1.8-1.86 1.33-.67-.41-.66-1.19-.06-1.78C8.18 5.31 8.68 2.45 5.05.32L5.03.3l.02.01z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u4ee5\u4e0a\u4e09\u4e2a\u63a5\u53e3\u53ea\u80fd\u5b9e\u4f8b\u7c7b\u5b9e\u73b0\uff0c\u5176\u4ed6\u9759\u6001\u7c7b\u3001\u62bd\u8c61\u7c7b\u3001\u53ca\u63a5\u53e3\u4e0d\u80fd\u5b9e\u73b0\u3002"))),Object(c.b)("h2",{id:"127-\u5e38\u89c1\u4f7f\u7528"},"12.7 \u5e38\u89c1\u4f7f\u7528"),Object(c.b)("h3",{id:"1271-\u7b2c\u4e00\u4e2a\u4f8b\u5b50"},"12.7.1 \u7b2c\u4e00\u4e2a\u4f8b\u5b50"),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u5b9e\u73b0\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12}","{7,12}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public interface IBusinessService\n {\n Person Get(int id);\n }\n\n public class BusinessService : IBusinessService, ITransient\n {\n private readonly IRepository _personRepository;\n\n public BusinessService(IRepository personRepository)\n {\n _personRepository = personRepository;\n }\n\n public Person Get(int id)\n {\n return _personRepository.Find(id);\n }\n }\n}\n")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11,19}","{11,19}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class PersonController : ControllerBase\n {\n private readonly IBusinessService _businessService;\n public PersonController(IBusinessService businessService)\n {\n _businessService = businessService;\n }\n\n [HttpGet]\n public IActionResult Get(int id)\n {\n var person = _businessService.Get(id);\n return new JsonResult(person);\n }\n }\n}\n')),Object(c.b)("img",{src:Object(r.a)("img/di1.gif")}),Object(c.b)("hr",null),Object(c.b)("p",null,Object(c.b)("strong",{parentName:"p"},"\u4f8b\u5b50\u89e3\u8bf4")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u4e14\u65b9\u4fbf\u7684\u5b9e\u73b0\u4f9d\u8d56\u6ce8\u5165\u7684\u65b9\u5f0f\uff0c\u53ea\u9700\u8981\u5b9e\u4f8b\u7c7b\u7ee7\u627f\u5bf9\u5e94\u751f\u5b58\u671f\u7684\u63a5\u53e3\u5373\u53ef\uff0c\u8fd9\u91cc\u7ee7\u627f\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ITransient"),"\uff0c\u4e5f\u5c31\u8868\u660e\u4e86\u8fd9\u662f\u4e00\u4e2a ",Object(c.b)("inlineCode",{parentName:"p"},"\u6682\u65f6/\u77ac\u65f6")," \u4f5c\u7528\u57df\u5b9e\u4f8b\u7c7b\u3002\u8be5\u7c7b\u5c31\u53ef\u4ee5\u4f5c\u4e3a\u88ab\u6ce8\u5165\u5bf9\u8c61\uff0c\u540c\u65f6\u4e5f\u80fd\u6ce8\u5165\u5176\u4ed6\u63a5\u53e3\u5bf9\u8c61\u3002"),Object(c.b)("p",null,"\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u6ce8\u5165\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"IRepository")," \u4ed3\u50a8\u63a5\u53e3\uff0c\u540c\u65f6 ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u63a7\u5236\u5668\u6ce8\u5165\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u3002"),Object(c.b)("p",null,"\u8fd9\u6837 ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u4e4b\u95f4\u5c31\u5b9e\u73b0\u4e86\u89e3\u8026\uff0c\u4e0d\u518d\u4f9d\u8d56\u4e8e\u5177\u4f53\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u5b9e\u4f8b\u3002"),Object(c.b)("p",null,"\u8fd9\u5c31\u662f\u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c\u6700\u7ecf\u5178\u7684\u4f8b\u5b50\u3002"),Object(c.b)("h3",{id:"1272-\u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b"},"12.7.2 \u6ce8\u518c\u6cdb\u578b\u5b9e\u4f8b"),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService")," \u5b9e\u73b0\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,12}","{7,12}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public interface IBusinessService\n {\n Person Get(int id);\n }\n\n public class BusinessService : IBusinessService, ITransient\n {\n private readonly IRepository _personRepository;\n\n public BusinessService(IRepository personRepository)\n {\n _personRepository = personRepository;\n }\n\n public Person Get(int id)\n {\n return _personRepository.Find(id);\n }\n }\n}\n")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"PersonController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11,19}","{11,19}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class PersonController : ControllerBase\n {\n private readonly IBusinessService _businessService;\n public PersonController(IBusinessService businessService)\n {\n _businessService = businessService;\n }\n\n [HttpGet]\n public IActionResult Get(int id)\n {\n var person = _businessService.Get(id);\n return new JsonResult(person);\n }\n }\n}\n')),Object(c.b)("h3",{id:"1273-\u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0"},"12.7.3 \u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0"),Object(c.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4e00\u4e2a\u63a5\u53e3\u53ea\u5bf9\u5e94\u4e00\u4e2a\u5b9e\u73b0\u7c7b\uff0c\u4f46\u6709\u4e9b\u7279\u6b8a\u60c5\u51b5\uff0c\u9700\u8981\u9700\u8981\u591a\u4e2a\u5b9e\u73b0\u7c7b\u6ce8\u518c\u540c\u4e00\u4e2a\u63a5\u53e3\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"DbContext")," \u591a\u6570\u636e\u5e93\u60c5\u51b5\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165 ",Object(c.b)("inlineCode",{parentName:"p"},"Func")," \u59d4\u6258\u6765\u89e3\u6790\u591a\u4e2a\u5b9e\u4f8b\uff0c\u5176\u4e2d\u59d4\u6258\u7684\u53c2\u6570\u5206\u522b\u4e3a\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u53c2\u6570 1\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b\uff0c\u4e0d\u540c\u5b9e\u73b0\u7c7b\u552f\u4e00\u6807\u8bc6\uff0c\u9ed8\u8ba4\u4e3a ",Object(c.b)("inlineCode",{parentName:"li"},"nameof(\u5b9e\u73b0\u7c7b)")," \u540d\u79f0"),Object(c.b)("li",{parentName:"ul"},"\u53c2\u6570 2\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Type")," \u7c7b\u578b\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"IPrivateDependency")," \u6d3e\u751f\u63a5\u53e3\uff0c\u4e5f\u5c31\u662f ",Object(c.b)("inlineCode",{parentName:"li"},"ITransient"),"\u3001",Object(c.b)("inlineCode",{parentName:"li"},"IScoped"),"\u3001",Object(c.b)("inlineCode",{parentName:"li"},"ISingleton")),Object(c.b)("li",{parentName:"ul"},"\u8fd4\u56de\u503c\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"object")," \u7c7b\u578b\uff0c\u8fd4\u56de\u5177\u4f53\u7684\u5b9e\u73b0\u7c7b\u5b9e\u4f8b")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"IBusinessService")," \u63a5\u53e3\u548c ",Object(c.b)("inlineCode",{parentName:"p"},"BusinessService"),"\u3001",Object(c.b)("inlineCode",{parentName:"p"},"OtherBusinessService")," \u4e24\u4e2a\u5b9e\u73b0\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,10,18}","{5,10,18}":!0}),'using Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public interface IBusinessService\n {\n string GetName();\n }\n\n public class BusinessService : IBusinessService, ITransient\n {\n public string GetName()\n {\n return "\u6211\u662f\uff1a" + nameof(BusinessService);\n }\n }\n\n public class OtherBusinessService : IBusinessService, ITransient\n {\n public string GetName()\n {\n return "\u6211\u662f\uff1a" + nameof(OtherBusinessService);\n }\n }\n}\n')),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"ValueController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{15,17,18}","{15,17,18}":!0}),'using Furion.Application;\nusing Furion.DependencyInjection;\nusing Microsoft.AspNetCore.Mvc;\nusing System;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class ValueController : ControllerBase\n {\n private readonly IBusinessService _businessService;\n private readonly IBusinessService _otherBusinessService;\n\n public ValueController(Func resolveNamed)\n {\n _businessService = resolveNamed("BusinessService", default) as IBusinessService;\n _otherBusinessService = resolveNamed("OtherBusinessService", default) as IBusinessService;\n }\n\n [HttpGet]\n public string GetName()\n {\n return _businessService.GetName() + "----------" + _otherBusinessService.GetName();\n }\n }\n}\n')),Object(c.b)("img",{src:Object(r.a)("img/di2.gif")}),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u9700\u8981\u81ea\u5b9a\u4e49\u89e3\u6790\u540d\u79f0\uff0c\u53ea\u9700\u8981\u8d34 ",Object(c.b)("inlineCode",{parentName:"p"},'[Injection(Named = "\u540d\u79f0")]')," \u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,11}","{5,11}":!0}),'using Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n [Injection(Named = "BusName1")]\n public class BusinessService : IBusinessService, ITransient\n {\n // ...\n }\n\n [Injection(Named = "BusName2")]\n public class OtherBusinessService : IBusinessService, ITransient\n {\n // ...\n }\n}\n')),Object(c.b)("p",{parentName:"div"},"\u89e3\u6790\u670d\u52a1\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'_businessService = resolveNamed("BusName1", default) as IBusinessService;\n_otherBusinessService = resolveNamed("BusName2", default) as IBusinessService;\n')))),Object(c.b)("h3",{id:"1274-\u65e0\u63a5\u53e3\u65b9\u5f0f"},"12.7.4 \u65e0\u63a5\u53e3\u65b9\u5f0f"),Object(c.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u60f3\u5b9a\u4e49\u63a5\u53e3\uff0c\u800c\u662f\u60f3\u628a\u5b9e\u4f8b\u7c7b\u4f5c\u4e3a\u53ef\u4f9d\u8d56\u6ce8\u5165\u7684\u5bf9\u8c61\uff0c\u5982 MVC \u4e2d\u7684\u63a7\u5236\u5668\u3002"),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"SelfService")," \u5b9e\u4f8b\u7c7b\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,11}","{7,11}":!0}),"using Furion.Core;\nusing Furion.DatabaseAccessor;\nusing Furion.DependencyInjection;\n\nnamespace Furion.Application\n{\n public class SelfService : ITransient\n {\n private readonly IRepository _personRepository;\n\n public SelfService(IRepository personRepository)\n {\n _personRepository = personRepository;\n }\n\n public Person Get(int id)\n {\n return _personRepository.Find(id);\n }\n }\n}\n")),Object(c.b)("p",null,"\u521b\u5efa ",Object(c.b)("inlineCode",{parentName:"p"},"ValueController")," \u63a7\u5236\u5668\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,21}","{13,21}":!0}),'using Furion.Application;\nusing Furion.Core;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n [ApiController]\n public class ValueController : ControllerBase\n {\n private readonly SelfService _selfService;\n\n public ValueController(SelfService selfService)\n {\n _selfService = selfService;\n }\n\n [HttpGet]\n public Person Get(int id)\n {\n return _selfService.Get(id);\n }\n }\n}\n')),Object(c.b)("h2",{id:"128-injection-\u7279\u6027\u914d\u7f6e"},"12.8 ",Object(c.b)("inlineCode",{parentName:"h2"},"[Injection]")," \u7279\u6027\u914d\u7f6e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection]")," \u7279\u6027\u53ef\u4ee5\u6539\u53d8\u6ce8\u518c\u65b9\u5f0f\uff0c\u540c\u65f6\u8fd8\u80fd\u914d\u7f6e ",Object(c.b)("inlineCode",{parentName:"p"},"AOP")," \u62e6\u622a\u3002"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"[Injection]")," \u63d0\u4f9b\u4ee5\u4e0b\u914d\u7f6e\u652f\u6301\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Action"),"\uff1a\u914d\u7f6e\u6ce8\u518c\u884c\u4e3a\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"InjectionActions")," \u7c7b\u578b\uff0c\u53ef\u9009\u503c\uff1a",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Add"),"\uff1a",Object(c.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c"),"\uff0c\u8868\u793a\u65e0\u9650\u5236\u6dfb\u52a0\u6ce8\u518c\u670d\u52a1\uff0c\u8be5\u65b9\u5f0f\u652f\u6301\u4e00\u4e2a\u63a5\u53e3\u591a\u4e2a\u5b9e\u73b0"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"TryAdd"),"\uff1a\u8868\u793a\u6ce8\u518c\u5df2\u5b58\u5728\u5219\u8df3\u8fc7\u6ce8\u518c"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Pattern"),"\uff1a\u914d\u7f6e\u6ce8\u518c\u9009\u9879\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"InjectionPatterns")," \u7c7b\u578b\uff0c\u53ef\u9009\u503c\uff1a",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Self"),"\uff1a\u53ea\u6ce8\u518c\u81ea\u5df1"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"FirstInterface"),"\uff1a\u53ea\u6ce8\u518c\u7b2c\u4e00\u4e2a\u63a5\u53e3"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"SelfWithFirstInterface"),"\uff1a\u6ce8\u518c\u81ea\u5df1\u548c\u7b2c\u4e00\u4e2a\u63a5\u53e3\uff0c",Object(c.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ImplementedInterfaces"),"\uff1a\u6ce8\u518c\u6240\u6709\u63a5\u53e3"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"All"),"\uff1a\u6ce8\u518c\u81ea\u5df1\u5305\u62ec\u6240\u6709\u63a5\u53e3"))),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Named"),"\uff1a\u914d\u7f6e\u5b9e\u4f8b\u522b\u540d\uff0c\u901a\u8fc7\u522b\u540d\u53ef\u4ee5\u89e3\u6790\u63a5\u53e3\uff0c\u5982\u540c\u4e00\u4e2a\u63a5\u53e3\u6709\u591a\u4e2a\u5b9e\u73b0\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u522b\u540d\u89e3\u6790\u4e0d\u540c\u7684\u5b9e\u73b0\uff0c\u9ed8\u8ba4\u53ea\u4e3a\u5b9e\u73b0\u7c7b\u7684\u7c7b\u540d"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u6ce8\u518c\u6392\u5e8f\uff0c\u6570\u5b57\u8d8a\u5927\uff0c\u5219\u8d8a\u5728\u6700\u540e\u6ce8\u518c\uff0c\u9ed8\u8ba4 ",Object(c.b)("inlineCode",{parentName:"li"},"0")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Proxy"),"\uff1a\u914d\u7f6e\u4ee3\u7406\u62e6\u622a\u7c7b\u578b\uff0c\u4e5f\u5c31\u662f ",Object(c.b)("inlineCode",{parentName:"li"},"AOP"),"\uff0c",Object(c.b)("strong",{parentName:"li"},"\u4ee3\u7406\u7c7b\u578b\u5fc5\u987b\u7ee7\u627f ",Object(c.b)("inlineCode",{parentName:"strong"},"AspectDispatchProxy")," \u7c7b\u548c ",Object(c.b)("inlineCode",{parentName:"strong"},"IDispatchProxy")," \u63a5\u53e3"),"\uff0c\u65e0\u9ed8\u8ba4\u503c"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ExpectInterfaces"),"\uff1a\u914d\u7f6e\u5ffd\u7565\u6ce8\u518c\u7684\u63a5\u53e3\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"Type[]")," \u7c7b\u578b")),Object(c.b)("h2",{id:"129-\u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c"},"12.9 \u81ea\u5b9a\u4e49\u9ad8\u7ea7\u6ce8\u518c"),Object(c.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u7684\u6ce8\u518c\u65b9\u5f0f\u53ef\u4ee5\u6ee1\u8db3\u5927\u591a\u6570\u4f9d\u8d56\u6ce8\u5165\u7684\u9700\u6c42\uff0c\u5982\u6709\u7279\u522b\u6ce8\u518c\u9700\u6c42\uff0c\u53ea\u9700\u8981\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddScoped(typeof(ISpecService), provider = > {\n // \u81ea\u5b9a\u4e49\u4efb\u4f55\u521b\u5efa\u5b9e\u4f8b\u7684\u65b9\u5f0f\n var instance = new SpecService(); // \u6216\u8005\u53ef\u4ee5\u901a\u8fc7 AOP\u63d2\u4ef6\u8fd4\u56de\u4ee3\u7406\u5b9e\u4f8b\n\n return instance;\n});\n")),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8865\u5145\u8bf4\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u8fd8\u6709 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy")," \u90fd\u662f\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u521b\u5efa\u7684\u3002"))),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u77e5\u8bc6\u5bfc\u822a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a\u81ea\u5b9a\u4e49\u9ad8\u7ea7\u4e2d\u6ce8\u518c\uff0c\u53ef\u67e5\u9605 \u3010",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-5.0"}),"ASP.NET Core \u4f9d\u8d56\u6ce8\u5165"),"\u3011 \u5b98\u65b9\u6587\u6863\u3002"))),Object(c.b)("h2",{id:"1210-appsettingsjson-\u914d\u7f6e\u6ce8\u518c"},"12.10 ",Object(c.b)("inlineCode",{parentName:"h2"},"appsettings.json")," \u914d\u7f6e\u6ce8\u518c"),Object(c.b)("p",null,"\u9664\u4e86\u5728\u4ee3\u7801\u4e2d\u5b9e\u73b0\u4f9d\u8d56\u6ce8\u5165\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u52a8\u6001\u4f9d\u8d56\u6ce8\u5165\uff0c\u65e0\u9700\u4fee\u6539\u4ee3\u7801\u6216\u91cd\u65b0\u7f16\u8bd1\u5373\u53ef\u5b9e\u73b0\u70ed\u62d4\u63d2\uff08\u63d2\u4ef6\uff09\u6548\u679c\u3002\u914d\u7f6e\u5982\u4e0b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2}","{2}":!0}),'{\n "DependencyInjectionSettings": {\n "Definitions": [\n {\n "Interface": "Furion.Application;Furion.Application.ITestService",\n "Service": "Furion.Application;Furion.Application.TestService",\n "RegisterType": "Transient",\n "Action": "Add",\n "Pattern": "SelfWithFirstInterface",\n "Named": "TestService",\n "Order": 1,\n "Proxy": "Furion.Application;Furion.Application.LogDispathProxy"\n }\n ]\n }\n}\n')),Object(c.b)("p",null,"\u914d\u7f6e\u8bf4\u660e\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"DependencyInjectionSettings"),"\uff1a\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u6839\u8282\u70b9",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u52a8\u6001\u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e\u8282\u70b9\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"ExternalService")," \u6570\u7ec4\u7c7b\u578b",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"ExternalService"),"\uff1a\u914d\u7f6e\u5355\u4e2a\u4f9d\u8d56\u6ce8\u5165\u4fe1\u606f",Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Interface"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u63a5\u53e3\u4fe1\u606f\uff0c\u683c\u5f0f\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u63a5\u53e3\u5b8c\u6574\u540d\u79f0"),"\uff0c\u5982\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Furion.Application;Furion.Application.ITestService")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Service"),"\uff1a\u914d\u7f6e\u63a5\u53e3\u5b9e\u73b0\u4fe1\u606f\uff0c\u683c\u5f0f\u540c\u4e0a"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"RegisterType"),"\uff1a\u914d\u7f6e\u4f9d\u8d56\u6ce8\u5165\u7684\u5bf9\u8c61\u751f\u5b58\u671f\uff0c\u53d6\u503c\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Transient"),"\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"Scoped"),"\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"Singleton")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Action"),"\uff1a\u6ce8\u518c\u884c\u4e3a\uff0c\u53ef\u9009\u503c\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"Add"),"\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"TryAdd"),"\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Pattern"),"\uff1a\u6ce8\u518c\u9009\u9879\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Named"),"\uff1a\u6ce8\u518c\u522b\u540d\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Order"),"\uff1a\u6ce8\u518c\u6392\u5e8f\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"Proxy"),"\uff1a\u914d\u7f6e\u4ee3\u7406\u62e6\u622a\uff0c\uff0c\u683c\u5f0f\uff1a",Object(c.b)("inlineCode",{parentName:"li"},"\u7a0b\u5e8f\u96c6\u540d\u79f0;\u4ee3\u7406\u7c7b\u5b8c\u6574\u540d\u79f0"),"\uff0c\u53c2\u89c1 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"#128-injection-%E7%89%B9%E6%80%A7%E9%85%8D%E7%BD%AE"}),"#128-injection-\u7279\u6027\u914d\u7f6e"))))))))),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u5916\u90e8\u7a0b\u5e8f\u96c6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u52a8\u6001\u6ce8\u5165\u7684\u5bf9\u8c61\u662f\u5916\u90e8\u7a0b\u5e8f\u96c6\uff0c\u90a3\u4e48\u9996\u5148\u5148\u6ce8\u518c\u5916\u90e8\u7a0b\u5e8f\u96c6\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "AppSettings": {\n "ExternalAssemblies": ["\u5916\u90e8\u7a0b\u5e8f\u96c6\u540d\u79f0", "Taobao.Pay"] // \u652f\u6301\u591a\u4e2a\n }\n}\n')))),Object(c.b)("h2",{id:"1211-\u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7"},"12.11 \u6ce8\u518c\u987a\u5e8f\u548c\u4f18\u5148\u7ea7"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u6ce8\u518c\u987a\u5e8f\u662f\u6309\u7167\u7a0b\u5e8f\u96c6\u626b\u63cf\u987a\u5e8f\u8fdb\u884c\u6ce8\u518c\uff0c\u5982\u679c\u9700\u8981\u6539\u53d8\u6ce8\u518c\u987a\u5e8f\uff0c\u53ef\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection(Order)]")," \u7279\u6027\u6307\u5b9a\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Order")," \u503c\u8d8a\u5927\uff0c\u5219\u8d8a\u5728\u6700\u540e\u6ce8\u518c\u3002"),Object(c.b)("p",null,"\u53e6\u5916 ",Object(c.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u7684\u4f18\u5148\u7ea7\u6700\u5927\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u7684\u6ce8\u518c\u4f1a\u8986\u76d6\u4e4b\u524d\u6240\u6709\u6ce8\u518c\u3002"),Object(c.b)("h2",{id:"1212-aop-\u6ce8\u518c\u62e6\u622a"},"12.12 ",Object(c.b)("inlineCode",{parentName:"h2"},"Aop")," \u6ce8\u518c\u62e6\u622a"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"AOP")," \u662f\u975e\u5e38\u91cd\u8981\u7684\u601d\u60f3\u548c\u6280\u672f\uff0c\u4e5f\u5c31\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"\u9762\u5411\u5207\u9762")," \u7f16\u7a0b\uff0c\u53ef\u4ee5\u8ba9\u6211\u4eec\u5728\u4e0d\u6539\u52a8\u539f\u6765\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u52a8\u6001\u7be1\u6539\u4e1a\u52a1\u4ee3\u7801\u3002"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"Aop")," \u975e\u5e38\u7b80\u5355\uff0c\u5982\uff1a"),Object(c.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u6709 ",Object(c.b)("inlineCode",{parentName:"p"},"ITestService")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"TestService")," \u4e24\u4e2a\u7c7b\u578b\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class ITestService\n{\n string SayHello(string word);\n}\n")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'public class TestService: ITestService, ITransient\n{\n public string SayHello(string word)\n {\n return $"Hello {word}";\n }\n}\n')),Object(c.b)("p",null,"\u73b0\u5728\u6211\u4eec\u6709\u4e00\u4e2a\u9700\u6c42\uff0c\u6211\u4eec\u5e0c\u671b\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"SayHello")," \u7684\u65f6\u5019\u53ef\u4ee5\u8bb0\u5f55\u65e5\u5fd7\u548c\u6743\u9650\u63a7\u5236\uff08\u4e4b\u524d\u6ca1\u6709\u8003\u8651\u5230\u7684\u9700\u6c42\uff09\u3002"),Object(c.b)("p",null,"\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ea\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u4ee3\u7406\u7c7b\u5373\u53ef\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"LogDispatchProxy")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,3,7,25,37,48}","{1,3,7,25,37,48}":!0}),'using Furion.DependencyInjection;\nusing System;\nusing System.Reflection;\n\nnamespace Furion.Application\n{\n public class LogDispatchProxy : AspectDispatchProxy, IDispatchProxy\n {\n /// \n /// \u5f53\u524d\u670d\u52a1\u5b9e\u4f8b\n /// \n public object Target { get; set; }\n\n /// \n /// \u670d\u52a1\u63d0\u4f9b\u5668\uff0c\u53ef\u4ee5\u7528\u6765\u89e3\u6790\u670d\u52a1\uff0c\u5982\uff1aServices.GetService()\n /// \n public IServiceProvider Services { get; set; }\n\n /// \n /// \u62e6\u622a\u65b9\u6cd5\n /// \n /// \n /// \n /// \n public override object Invoke(MethodInfo method, object[] args)\n {\n Console.WriteLine("SayHello \u65b9\u6cd5\u88ab\u8c03\u7528\u4e86");\n\n var result = method.Invoke(Target, args);\n\n Console.WriteLine("SayHello \u65b9\u6cd5\u8fd4\u56de\u503c\uff1a" + result);\n\n return result;\n }\n\n // \u5f02\u6b65\u65e0\u8fd4\u56de\u503c\n public override async Task InvokeAsync(MethodInfo method, object[] args)\n {\n Console.WriteLine("SayHello \u65b9\u6cd5\u88ab\u8c03\u7528\u4e86");\n\n var task = method.Invoke(Target, args) as Task;\n await task;\n\n Console.WriteLine("SayHello \u65b9\u6cd5\u8c03\u7528\u5b8c\u6210");\n }\n\n // \u5f02\u6b65\u5e26\u8fd4\u56de\u503c\n public override async Task InvokeAsyncT(MethodInfo method, object[] args)\n {\n Console.WriteLine("SayHello \u65b9\u6cd5\u88ab\u8c03\u7528\u4e86");\n\n var taskT = method.Invoke(Target, args) as Task;\n var result = await taskT;\n\n Console.WriteLine("SayHello \u65b9\u6cd5\u8fd4\u56de\u503c\uff1a" + result);\n\n return result;\n }\n }\n}\n')),Object(c.b)("p",null,"\u4e4b\u540e\u6211\u4eec\u53ea\u9700\u8981\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"TestService")," \u589e\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection]")," \u7279\u6027\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),'[Injection(Proxy = typeof(LogDispatchProxy))]\npublic class TestService: ITestService, ITransient\n{\n public string SayHello(string word)\n {\n return $"Hello {word}";\n }\n}\n')),Object(c.b)("p",null,"\u4e4b\u540e ",Object(c.b)("inlineCode",{parentName:"p"},"SayHello")," \u65b9\u6cd5\u88ab\u8c03\u7528\u7684\u65f6\u5019\u5c31\u53ef\u4ee5\u5b9e\u73b0\u52a8\u6001\u62e6\u622a\u4e86\uff0c\u6bd4\u5982\u8fd9\u91cc\u5199\u65e5\u5fd7\u3002"),Object(c.b)("h3",{id:"12121-\u5168\u5c40aop\u62e6\u622a"},"12.12.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5168\u5c40Aop\u62e6\u622a")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u5168\u5c40\u62e6\u622a\u7684\u65b9\u5f0f\uff0c\u53ea\u9700\u8981\u5c06 ",Object(c.b)("inlineCode",{parentName:"p"},"IDispatchProxy")," \u4fee\u6539\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"IGlobalDispatchProxy")," \u5373\u53ef\u3002"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Furion;\nusing System.Reflection;\n\nnamespace Furion.Application\n{\n public class LogDispatchProxy : AspectDispatchProxy, IGlobalDispatchProxy\n {\n // ....\n }\n}\n")),Object(c.b)("p",null,"\u8fd9\u6837\u5c31\u4f1a\u62e6\u622a\u6240\u6709\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Service"),"\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7ed9\u7279\u5b9a\u7c7b\u8d34 ",Object(c.b)("inlineCode",{parentName:"p"},"[SkipProxy]")," \u8df3\u8fc7\u5168\u5c40\u62e6\u622a\u64cd\u4f5c\u3002"),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u62e6\u622a\u4f18\u5148\u7ea7")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"[SkipProxy]")," > ",Object(c.b)("inlineCode",{parentName:"p"},"[Injection(Proxy = typeof(LogDispatchProxy))]")," > ",Object(c.b)("inlineCode",{parentName:"p"},"\u5168\u5c40\u62e6\u622a"),"\u3002"))),Object(c.b)("h3",{id:"12122-aop-\u7684\u4f5c\u7528"},"12.12.2 ",Object(c.b)("inlineCode",{parentName:"h3"},"AOP")," \u7684\u4f5c\u7528"),Object(c.b)("p",null,"\u8fd9\u79cd\u9762\u5411\u5207\u9762\u7684\u80fd\u529b\uff08\u52a8\u6001\u62e6\u622a/\u4ee3\u7406\uff09\u53ef\u4ee5\u5b9e\u73b0\u5f88\u591a\u5f88\u591a\u529f\u80fd\uff0c\u5982\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u65e5\u5fd7\u8bb0\u5f55"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u4fee\u6539\u53c2\u6570"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u4fee\u6539\u8fd4\u56de\u503c"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u65b9\u6cd5\u91cd\u5b9a\u5411"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u4fee\u6539\u4ee3\u7801\u903b\u8f91"),Object(c.b)("li",{parentName:"ul"},"\u52a8\u6001\u5b9e\u73b0\u5f02\u5e38\u76d1\u542c")),Object(c.b)("p",null,"\u8fd8\u53ef\u4ee5\u505a\u66f4\u591a\u66f4\u591a\u7684\u4e8b\u60c5\u3002"),Object(c.b)("h2",{id:"1213-\u53cd\u9988\u4e0e\u5efa\u8bae"},"12.13 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(195);function c(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return c?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=c();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return m}));var a=t(0),i=t.n(a);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var o=i.a.createContext({}),p=function(e){var n=i.a.useContext(o),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(o.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},j=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,c=e.originalType,r=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=p(t),j=a,m=s["".concat(r,".").concat(j)]||s[j]||d[j]||c;return t?i.a.createElement(m,b(b({ref:n},o),{},{components:t})):i.a.createElement(m,b({ref:n},o))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var c=t.length,r=new Array(c);r[0]=j;var b={};for(var l in n)hasOwnProperty.call(n,l)&&(b[l]=n[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,r[1]=b;for(var o=2;on(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/62953dcd.df88f1b5.js b/docs/62953dcd.cdddf4ad.js similarity index 99% rename from docs/62953dcd.df88f1b5.js rename to docs/62953dcd.cdddf4ad.js index e9609bca0e7..58fac613534 100644 --- a/docs/62953dcd.df88f1b5.js +++ b/docs/62953dcd.cdddf4ad.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{119:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return p})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return d}));var a=t(3),r=t(7),i=(t(0),t(192)),o=t(190),c=t(193),b={id:"friendly-exception",title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",sidebar_label:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406"},p={unversionedId:"friendly-exception",id:"friendly-exception",isDocsHomePage:!1,title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",description:"7.1 \u4ec0\u4e48\u662f\u5f02\u5e38",source:"@site/docs\\friendly-exception.mdx",slug:"/friendly-exception",permalink:"/docs/friendly-exception",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/friendly-exception.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",sidebar:"docs",previous:{title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",permalink:"/docs/specification-document"},next:{title:"8. \u6570\u636e\u6821\u9a8c",permalink:"/docs/data-validation"}},l=[{value:"7.1 \u4ec0\u4e48\u662f\u5f02\u5e38",id:"71-\u4ec0\u4e48\u662f\u5f02\u5e38",children:[]},{value:"7.2 \u5904\u7406\u5f02\u5e38\u65b9\u5f0f",id:"72-\u5904\u7406\u5f02\u5e38\u65b9\u5f0f",children:[]},{value:"7.3 \u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406",id:"73-\u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406",children:[{value:"7.3.1 \u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406",id:"731-\u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406",children:[]},{value:"7.3.2 \u53cb\u597d\u5f02\u5e38\u5904\u7406",id:"732-\u53cb\u597d\u5f02\u5e38\u5904\u7406",children:[]}]},{value:"7.4 \u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b",id:"74-\u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b",children:[{value:"7.4.1 \u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1",id:"741-\u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1",children:[]},{value:"7.4.2 \u4e24\u4e2a\u4f8b\u5b50",id:"742-\u4e24\u4e2a\u4f8b\u5b50",children:[]}]},{value:"7.5 \u5173\u4e8e Oops.Oh",id:"75-\u5173\u4e8e-oopsoh",children:[{value:"7.6.1 \u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f",id:"761-\u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f",children:[]},{value:"7.6.2 Oops.Oh \u91cd\u8f7d\u65b9\u6cd5",id:"762-oopsoh-\u91cd\u8f7d\u65b9\u6cd5",children:[]}]},{value:"7.6 \u6700\u4f73\u5b9e\u8df5 \ud83e\udd17",id:"76-\u6700\u4f73\u5b9e\u8df5-",children:[{value:"7.6.1 \u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",id:"761-\u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",children:[]},{value:"7.6.2 \u5173\u4e8e [ErrorCodeItemMetadata]",id:"762-\u5173\u4e8e-errorcodeitemmetadata",children:[]},{value:"7.6.3 \u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528",id:"763-\u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528",children:[]},{value:"7.6.4 \u66f4\u591a\u4f8b\u5b50",id:"764-\u66f4\u591a\u4f8b\u5b50",children:[]}]},{value:"7.7 \u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",id:"77-\u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",children:[]},{value:"7.8 IErrorCodeTypeProvider \u63d0\u4f9b\u5668",id:"78-ierrorcodetypeprovider-\u63d0\u4f9b\u5668",children:[]},{value:"7.9 appsetting.json \u4e2d\u914d\u7f6e",id:"79-appsettingjson-\u4e2d\u914d\u7f6e",children:[]},{value:"7.10 [IfException] \u4f7f\u7528",id:"710-ifexception-\u4f7f\u7528",children:[{value:"7.10.1 \u4f7f\u7528\u793a\u4f8b",id:"7101-\u4f7f\u7528\u793a\u4f8b",children:[]},{value:"7.10.2 \u66f4\u591a\u4f8b\u5b50",id:"7102-\u66f4\u591a\u4f8b\u5b50",children:[]}]},{value:"7.11 \u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7",id:"711-\u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7",children:[]},{value:"7.12 \u591a\u8bed\u8a00\u652f\u6301",id:"712-\u591a\u8bed\u8a00\u652f\u6301",children:[]},{value:"7.13 \u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668",id:"713-\u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668",children:[]},{value:"7.14 \u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668",id:"714-\u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668",children:[]},{value:"7.15 FriendlyExceptionSettings \u914d\u7f6e",id:"715-friendlyexceptionsettings-\u914d\u7f6e",children:[]},{value:"7.16 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"716-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function d(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"71-\u4ec0\u4e48\u662f\u5f02\u5e38"},"7.1 \u4ec0\u4e48\u662f\u5f02\u5e38"),Object(i.b)("p",null,"\u5f02\u5e38\u4e00\u822c\u662f\u6307\u8fd0\u884c\u671f\uff08\u6b64\u5904\u7279\u6307 ",Object(i.b)("inlineCode",{parentName:"p"},"Exception")," \u7c7b\uff09\u4f1a\u53d1\u751f\u7684\u5bfc\u81f4\u7a0b\u5e8f\u610f\u5916\u4e2d\u6b62\u7684\u95ee\u9898\uff0c\u662f\u4e00\u79cd\u5bf9\u95ee\u9898\u7684\u63cf\u8ff0\u540e\u7684\u5c01\u88c5\u5bf9\u8c61\u3002"),Object(i.b)("p",null,"\u5728\u8fc7\u53bb\u5f00\u53d1\u4e2d\uff0c\u901a\u5e38\u5f02\u5e38\u7531\u7cfb\u7edf\u8fd0\u884c\u65f6\u51fa\u9519\u629b\u51fa\uff0c\u4f46\u73b0\u5728\u7684\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u5e94\u5728\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u5408\u7406\u7684\u629b\u51fa\u5f02\u5e38\uff0c\u6bd4\u5982\u66f4\u65b0\u4e00\u6761\u4e0d\u5b58\u5728\u7684\u5b9e\u4f53\uff0c\u6216\u67e5\u8be2\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u6570\u636e\u7b49\u7b49\u3002"),Object(i.b)("h2",{id:"72-\u5904\u7406\u5f02\u5e38\u65b9\u5f0f"},"7.2 \u5904\u7406\u5f02\u5e38\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u4e0d\u5904\u7406\uff0c\u76f4\u63a5\u4e2d\u65ad\u7a0b\u5e8f\u6267\u884c\uff08\u4e0d\u63a8\u8350\uff09"),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"li"},"try catch finally")," \u5904\u7406\uff08\u4e0d\u63a8\u8350\uff09"),Object(i.b)("li",{parentName:"ul"},"\u5168\u5c40\u7edf\u4e00\u5904\u7406\uff0c\u5e76\u8bb0\u5f55\u5f02\u5e38\u4fe1\u606f",Object(i.b)("strong",{parentName:"li"},"\uff08\u63a8\u8350\uff09")),Object(i.b)("li",{parentName:"ul"},"\u5f02\u5e38\u6ce8\u89e3\u65b9\u5f0f\u5904\u7406\uff0c\u652f\u6301",Object(i.b)("strong",{parentName:"li"},"\u672c\u5730\u5316")," ",Object(i.b)("strong",{parentName:"li"},"\uff08\u63a8\u8350\uff09"))),Object(i.b)("h2",{id:"73-\u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406"},"7.3 \u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406"),Object(i.b)("h3",{id:"731-\u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406"},"7.3.1 \u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406"),Object(i.b)("p",null,"\u5728\u4e86\u89e3\u53cb\u597d\u5f02\u5e38\u5904\u7406\u4e4b\u524d\u53ef\u4ee5\u770b\u770b\u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5bf9\u7ec8\u7aef\u7528\u6237\u629b\u51fa ",Object(i.b)("inlineCode",{parentName:"li"},"500\u72b6\u6001\u7801")," \u5806\u6808\u4fe1\u606f"),Object(i.b)("li",{parentName:"ul"},"\u5927\u91cf\u7684 ",Object(i.b)("inlineCode",{parentName:"li"},"try catch")," \u4ee3\u7801\uff0c\u6c61\u67d3\u6b63\u5e38\u4e1a\u52a1\u903b\u8f91"),Object(i.b)("li",{parentName:"ul"},"\u6ca1\u6709\u89c4\u8303\u5316\u7684\u5f02\u5e38\u72b6\u6001\u7801\u548c\u5f02\u5e38\u6d88\u606f\u7ba1\u7406"),Object(i.b)("li",{parentName:"ul"},"\u6ca1\u6709\u5f02\u5e38\u65e5\u5fd7\u6536\u96c6\u8bb0\u5f55"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5f02\u5e38\u6d88\u606f\u672c\u5730\u5316\u5904\u7406"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5f02\u5e38\u7b56\u7565\uff0c\u5931\u8d25\u540e\u7a0b\u5e8f\u7acb\u5373\u7ec8\u6b62"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5206\u5e03\u5f0f\u4e8b\u52a1 CAP"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5f02\u5e38\u4f20\u64ad"),Object(i.b)("li",{parentName:"ul"},"\u8fd4\u56de\u7684\u5f02\u5e38\u683c\u5f0f\u6742\u4e71")),Object(i.b)("h3",{id:"732-\u53cb\u597d\u5f02\u5e38\u5904\u7406"},"7.3.2 \u53cb\u597d\u5f02\u5e38\u5904\u7406"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5bf9\u7ec8\u7aef\u7528\u6237\u63d0\u793a\u53cb\u597d"),Object(i.b)("li",{parentName:"ul"},"\u5bf9\u540e\u7aef\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u8be6\u7ec6\u7684\u5f02\u5e38\u5806\u6808"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u5e72\u6270\u6b63\u5e38\u4e1a\u52a1\u903b\u8f91\u4ee3\u7801\uff0c\u5982 \u6ca1\u6709 ",Object(i.b)("inlineCode",{parentName:"li"},"try catch")," \u4ee3\u7801"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u72b6\u6001\u7801\u591a\u65b9\u8bbe\u7f6e"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u6d88\u606f\u672c\u5730\u5316"),Object(i.b)("li",{parentName:"ul"},"\u5f02\u5e38\u4fe1\u606f\u7edf\u4e00\u914d\u7f6e\u7ba1\u7406"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u7b56\u7565\uff0c\u5982\u91cd\u8bd5"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u65e5\u5fd7\u6536\u96c6\u8bb0\u5f55"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301 CAP \u5206\u5e03\u5f0f\u4e8b\u52a1\u5173\u8054"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5185\u90e8\u5f02\u5e38\u5916\u90e8\u4f20\u64ad"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u8fd4\u56de\u7edf\u4e00\u7684\u5f02\u5e38\u683c\u5f0f\u6570\u636e")),Object(i.b)("h2",{id:"74-\u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b"},"7.4 \u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u53cb\u597d\u5f02\u5e38\u5904\u7406\u65b9\u5f0f\u3002"),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},".AddFriendlyException()")," \u9ed8\u8ba4\u5df2\u7ecf\u7ee7\u627f\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002\u4e5f\u5c31\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"7.4.1")," \u7ae0\u8282\u53ef\u4e0d\u914d\u7f6e\u3002"))),Object(i.b)("h3",{id:"741-\u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1"},"7.4.1 \u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddFriendlyException();\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},".AddFriendlyException()")," \u9700\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u540e\u6ce8\u518c\u3002"))),Object(i.b)("h3",{id:"742-\u4e24\u4e2a\u4f8b\u5b50"},"7.4.2 \u4e24\u4e2a\u4f8b\u5b50"),Object(i.b)("h4",{id:"\u7b80\u5355\u629b\u4e2a\u5f02\u5e38"},"\u7b80\u5355\u629b\u4e2a\u5f02\u5e38"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,12}","{2,12}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh($"{id} \u4e0d\u80fd\u5c0f\u4e8e3");\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc1.gif")}),Object(i.b)("h4",{id:"\u629b\u51fa\u7279\u5b9a\u7c7b\u578b\u5f02\u5e38"},"\u629b\u51fa\u7279\u5b9a\u7c7b\u578b\u5f02\u5e38"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,13}","{2,13}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\nusing System;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh($"{id} \u4e0d\u80fd\u5c0f\u4e8e3\u3002", typeof(InvalidOperationException));\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc2.png")}),Object(i.b)("h2",{id:"75-\u5173\u4e8e-oopsoh"},"7.5 \u5173\u4e8e Oops.Oh"),Object(i.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u4f8b\u5b50\u53ef\u4ee5\u770b\u51fa\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh(errorMessage)")," \u53ef\u4ee5\u7ed3\u5408 ",Object(i.b)("inlineCode",{parentName:"p"},"throw")," \u629b\u51fa\u5f02\u5e38\u3002\u5bf9\u4e8e\u719f\u6089",Object(i.b)("inlineCode",{parentName:"p"},"C#"),"\u7684\u4eba\u5458\u6765\u8bf4\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"throw")," \u540e\u9762\u53ea\u80fd ",Object(i.b)("inlineCode",{parentName:"p"},"Exception")," \u5b9e\u4f8b\u3002",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh(...)")," \u65b9\u6cd5\u8fd4\u56de\u6b63\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"Exception")," \u5b9e\u4f8b\u3002"),Object(i.b)("h3",{id:"761-\u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f"},"7.6.1 \u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f"),Object(i.b)("p",null,"\u8fd9\u4e2a\u540d\u5b57\u6765\u6e90\u4e8e\u4e00\u4e2a\u82f1\u8bed\u53e5\u5b50\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"Oh, Oops!"),"\uff0c\u610f\u601d\u662f ",Object(i.b)("strong",{parentName:"p"},"\u5662\uff08\u54ce\uff09\uff0c\u51fa\u9519\u4e86\uff01"),"\uff0c\u6240\u4ee5\u5c31\u6709\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh"),"\u3002"),Object(i.b)("h3",{id:"762-oopsoh-\u91cd\u8f7d\u65b9\u6cd5"},"7.6.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"Oops.Oh")," \u91cd\u8f7d\u65b9\u6cd5"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,22,30,39}","{13,22,30,39}":!0}),'using System;\n\nnamespace Furion.FriendlyException\n{\n public static class Oops\n {\n /// \n /// \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38\n /// \n /// \u5f02\u5e38\u6d88\u606f\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(string errorMessage, params object[] args);\n\n /// \n /// \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38\n /// \n /// \u5f02\u5e38\u6d88\u606f\n /// \u5177\u4f53\u5f02\u5e38\u7c7b\u578b\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(string errorMessage, Type exceptionType, params object[] args);\n\n /// \n /// \u629b\u51fa\u9519\u8bef\u7801\u5f02\u5e38\n /// \n /// \u9519\u8bef\u7801\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(object errorCode, params object[] args);\n\n /// \n /// \u629b\u51fa\u9519\u8bef\u7801\u5f02\u5e38\n /// \n /// \u9519\u8bef\u7801\n /// \u5177\u4f53\u5f02\u5e38\u7c7b\u578b\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(object errorCode, Type exceptionType, params object[] args);\n }\n}\n')),Object(i.b)("h2",{id:"76-\u6700\u4f73\u5b9e\u8df5-"},"7.6 \u6700\u4f73\u5b9e\u8df5 \ud83e\udd17"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u4e14\u89c4\u8303\u5316\u7684\u53cb\u597d\u5f02\u5e38\u5904\u7406\u65b9\u5f0f\uff0c\u901a\u8fc7\u8fd9\u4e2a\u65b9\u5f0f\u53ef\u4ee5\u65b9\u4fbf\u7ba1\u7406\u5f02\u5e38\u72b6\u6001\u7801\u3001\u5f02\u5e38\u4fe1\u606f\u53ca\u5f02\u5e38\u672c\u5730\u5316\u3002"),Object(i.b)("h3",{id:"761-\u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"},"7.6.1 \u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"),Object(i.b)("p",null,"\u5b9e\u73b0\u81ea\u5b9a\u4e49\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b\u5fc5\u987b\u9075\u5faa\u4ee5\u4e0b\u914d\u7f6e\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u7c7b\u578b\u5fc5\u987b\u662f\u516c\u5f00\u4e14\u662f ",Object(i.b)("inlineCode",{parentName:"li"},"Enum")," \u679a\u4e3e\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},"\u679a\u4e3e\u7c7b\u578b\u5fc5\u987b\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"li"},"[ErrorCodeType]")," \u7279\u6027"),Object(i.b)("li",{parentName:"ul"},"\u679a\u4e3e\u4e2d\u6bcf\u4e00\u9879\u5fc5\u987b\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"li"},"[ErrorCodeItemMetadata]")," \u7279\u6027")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,8,11,14,17}","{1,5,8,11,14,17}":!0}),'using Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n [ErrorCodeType]\n public enum ErrorCodes\n {\n [ErrorCodeItemMetadata("{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n z1000,\n\n [ErrorCodeItemMetadata("\u6570\u636e\u4e0d\u5b58\u5728")]\n x1000,\n\n [ErrorCodeItemMetadata("{0} \u53d1\u73b0 {1} \u4e2a\u5f02\u5e38", "\u767e\u5c0f\u50e7", 2)]\n x1001,\n\n [ErrorCodeItemMetadata("\u670d\u52a1\u5668\u8fd0\u884c\u5f02\u5e38", ErrorCode = "Error")]\n SERVER_ERROR\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"important")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u7279\u6027\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u63d0\u4f9b\u5668\u63a5\u53e3\u6765\u63d0\u4f9b\u5f02\u5e38\u4fe1\u606f\u626b\u63cf\uff0c\u8fd9\u91cc\u7528\u7684\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u7279\u6027\u7c7b\u3002"))),Object(i.b)("h3",{id:"762-\u5173\u4e8e-errorcodeitemmetadata"},"7.6.2 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h3"},"[ErrorCodeItemMetadata]")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeItemMetadata]")," \u7279\u6027\u7528\u6765\u6807\u8bc6",Object(i.b)("strong",{parentName:"p"},"\u679a\u4e3e\u5b57\u6bb5"),"\u5f02\u5e38\u5143\u6570\u636e\uff0c\u8be5\u7279\u6027\u652f\u6301\u4f20\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"\u6d88\u606f\u5185\u5bb9")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\u3002\u6700\u7ec8\u4f1a\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"String.Format(\u6d88\u606f\u5185\u5bb9\uff0c\u683c\u5f0f\u5316\u53c2\u6570)")," \u8fdb\u884c\u683c\u5f0f\u5316\u3002"),Object(i.b)("p",null,"\u5982\u679c\u6d88\u606f\u5185\u5bb9\u4e2d\u5305\u542b",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u5360\u4f4d\u7b26"),"\u4f46\u672a\u6307\u5b9a",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\uff0c\u90a3\u4e48\u4f1a\u67e5\u627e\u5f02\u5e38\u6240\u5728\u65b9\u6cd5\u662f\u5426\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u7279\u6027\u4e14\u542b\u6709\u683c\u5f0f\u5316\u53c2\u6570\uff0c\u63a5\u7740\u5c31\u4f1a\u67e5\u627e ",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh")," \u4e2d\u6307\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\u3002"),Object(i.b)("h3",{id:"763-\u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528"},"7.6.3 \u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,12}","{2,12}":!0}),"using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(ErrorCodes.z1000, id, 3);\n }\n\n return id;\n }\n }\n}\n")),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc3.gif")}),Object(i.b)("h3",{id:"764-\u66f4\u591a\u4f8b\u5b50"},"7.6.4 \u66f4\u591a\u4f8b\u5b50"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6}","{6}":!0}),'throw Oops.Oh(1000);\nthrow Oops.Oh(ErrorCodes.x1000);\nthrow Oops.Oh("\u54c8\u54c8\u54c8\u54c8");\nthrow Oops.Oh(errorCode: "x1001");\nthrow Oops.Oh(1000, typeof(Exception));\nthrow Oops.Oh(1000).StatusCode(400); // \u8bbe\u7f6e\u9519\u8bef\u7801\n')),Object(i.b)("h2",{id:"77-\u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"},"7.7 \u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5-6,21-22}","{5-6,21-22}":!0}),'using Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n [ErrorCodeType]\n public enum ErrorCodes\n {\n [ErrorCodeItemMetadata("{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n z1000,\n\n [ErrorCodeItemMetadata("\u6570\u636e\u4e0d\u5b58\u5728")]\n x1000,\n\n [ErrorCodeItemMetadata("{0} \u53d1\u73b0 {1} \u4e2a\u5f02\u5e38", "\u767e\u5c0f\u50e7", 2)]\n x1001,\n\n [ErrorCodeItemMetadata("\u670d\u52a1\u5668\u8fd0\u884c\u5f02\u5e38", ErrorCode = "Error")]\n SERVER_ERROR\n }\n\n [ErrorCodeType]\n public enum UserErrorCodes\n {\n [ErrorCodeItemMetadata("\u7528\u6237\u6570\u636e\u4e0d\u5b58\u5728")]\n u1000,\n\n [ErrorCodeItemMetadata("\u5176\u4ed6\u5f02\u5e38")]\n u1001\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u591a\u4e2a\u5f02\u5e38\u9759\u6001\u7c7b\u4e2d\u4e5f\u5fc5\u987b\u4fdd\u8bc1\u5e38\u91cf\u503c\u552f\u4e00\u6027\uff0c\u4e0d\u53ef\u91cd\u590d\u3002"))),Object(i.b)("h2",{id:"78-ierrorcodetypeprovider-\u63d0\u4f9b\u5668"},"7.8 ",Object(i.b)("inlineCode",{parentName:"h2"},"IErrorCodeTypeProvider")," \u63d0\u4f9b\u5668"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u8fd8\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u5f02\u5e38\u6d88\u606f\u63d0\u4f9b\u5668\u63a5\u53e3\uff0c\u65b9\u4fbf\u5728\u4e0d\u80fd\u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u7279\u6027\u60c5\u51b5\u4e0b\u4f7f\u7528\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6,8-11}","{2,6,8-11}":!0}),"using Furion.FriendlyException;\nusing System;\n\nnamespace Furion.Application\n{\n public class CustomErrorCodeTypeProvider : IErrorCodeTypeProvider\n {\n public Type[] Definitions => new[] {\n typeof(ErrorCodes),\n typeof(ErrorCodes2)\n };\n }\n}\n")),Object(i.b)("p",null,"\u542f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u63d0\u4f9b\u5668\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddFriendlyException();\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u53ea\u6709\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u65b9\u5f0f\u624d\u9700\u4f7f\u7528\u6cdb\u578b\u65b9\u5f0f\u6ce8\u518c\u3002\u901a\u8fc7\u4e0a\u9762\u7684\u65b9\u5f0f\u6ce8\u518c\u53ef\u4ee5\u540c\u65f6\u652f\u6301 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u65b9\u5f0f\u3002"))),Object(i.b)("h2",{id:"79-appsettingjson-\u4e2d\u914d\u7f6e"},"7.9 ",Object(i.b)("inlineCode",{parentName:"h2"},"appsetting.json")," \u4e2d\u914d\u7f6e"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e\u5f02\u5e38\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u5f02\u5e38\u4fe1\u606f\u540e\u671f\u914d\u7f6e\uff0c\u4e5f\u5c31\u662f\u65e0\u9700\u5728\u5f00\u53d1\u9636\u6bb5\u9884\u5148\u5b9a\u4e49\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-8} title="Furion.Web.Entry/appsettings.json"',"{2-8}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "ErrorCodeMessageSettings": {\n "Definitions": [\n [5000, "{0} \u4e0d\u80fd\u5c0f\u4e8e {1}"],\n [5001, "\u6211\u53eb {0} \u540d\u5b57", "\u767e\u5c0f\u50e7"],\n [5002, "Oops! \u51fa\u9519\u4e86"]\n ]\n }\n}\n')),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Definitions")," \u7c7b\u578b\u4e3a\u4e8c\u7ef4\u6570\u7ec4\uff0c\u4e8c\u7ef4\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e00\u4e2a\u6570\u7ec4\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"ErrorCode")," \u4e5f\u5c31\u662f\u9519\u8bef\u7801\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"ErrorMessage")," \u6d88\u606f\u5185\u5bb9\uff0c\u5269\u4f59\u53c2\u6570\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"ErrorMessage")," \u7684\u683c\u5f0f\u5316\u53c2\u6570\u3002"),Object(i.b)("h4",{id:"\u4f7f\u7528\u793a\u4f8b"},"\u4f7f\u7528\u793a\u4f8b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,12}","{2,12}":!0}),"using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(5000, id, 3); // \u53ef\u4ee5\u5c06 5000\u4f5c\u4e3a\u5e38\u91cf\u914d\u7f6e\u8d77\u6765\n }\n\n return id;\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u53ef\u4ee5\u540c\u65f6\u4f7f\u7528\u3002"))),Object(i.b)("h2",{id:"710-ifexception-\u4f7f\u7528"},"7.10 ",Object(i.b)("inlineCode",{parentName:"h2"},"[IfException]")," \u4f7f\u7528"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u7279\u6027\u53ef\u4ee5",Object(i.b)("strong",{parentName:"p"},"\u8986\u76d6\u9ed8\u8ba4\u6d88\u606f\u914d\u7f6e"),"\u3002\u4e5f\u5c31\u662f\u8986\u76d6 ",Object(i.b)("inlineCode",{parentName:"p"},"\u5f02\u5e38\u6d88\u606f\u7c7b\u578b")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u7684\u914d\u7f6e\u3002"),Object(i.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u53ea\u80fd\u8d34\u5728\u65b9\u6cd5\u4e0a\uff0c\u652f\u6301\u591a\u4e2a\u3002"))),Object(i.b)("h3",{id:"7101-\u4f7f\u7528\u793a\u4f8b"},"7.10.1 \u4f7f\u7528\u793a\u4f8b"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5f02\u5e38\u6d88\u606f\u7c7b\u5b9a\u4e49")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,4}","{1,4}":!0}),'[ErrorCodeType]\npublic static class ErrorCodes\n{\n [ErrorCodeItemMetadata("{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n z1000\n}\n')),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u8986\u76d6\u9ed8\u8ba4\u914d\u7f6e")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [IfException(ErrorCodes.z1000, ErrorMessage = "\u6211\u8986\u76d6\u4e86\u9ed8\u8ba4\u7684\uff1a{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(ErrorCodes.z1000, id, 3);\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc4.png")}),Object(i.b)("h3",{id:"7102-\u66f4\u591a\u4f8b\u5b50"},"7.10.2 \u66f4\u591a\u4f8b\u5b50"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8-11}","{2,8-11}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [IfException(typeof(ExceptionType), ErrorMessage = "\u7279\u5b9a\u5f02\u5e38\u7c7b\u578b\u5168\u5c40\u62e6\u622a")]\n [IfException(ErrorMessage = "\u5168\u5c40\u5f02\u5e38\u62e6\u622a")]\n [IfException(ErrorCodes.z1000, ErrorMessage = "\u6211\u8986\u76d6\u4e86\u9ed8\u8ba4\u7684\uff1a{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n [IfException(ErrorCodes.x1001, "\u683c\u5f0f\u5316\u53c2\u65701", "\u683c\u5f0f\u5316\u53c2\u65702", ErrorMessage = "\u6211\u8986\u76d6\u4e86\u9ed8\u8ba4\u7684\uff1a{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n [IfException(ErrorCodes.x1000, "\u683c\u5f0f\u5316\u53c2\u65701", "\u683c\u5f0f\u5316\u53c2\u65702")]\n [IfException(ErrorCodes.SERVER_ERROR, "\u683c\u5f0f\u5316\u53c2\u65701", "\u683c\u5f0f\u5316\u53c2\u65702")]\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(ErrorCodes.z1000, id, 3);\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u683c\u5f0f\u5316\u6d41\u7a0b")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u6d88\u606f\u5185\u5bb9\u4e2d\u5305\u542b",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u5360\u4f4d\u7b26"),"\u4f46\u672a\u6307\u5b9a",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\uff0c\u90a3\u4e48\u4f1a\u67e5\u627e\u5f02\u5e38\u6240\u5728\u65b9\u6cd5\u662f\u5426\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u7279\u6027\u4e14\u542b\u6709\u683c\u5f0f\u5316\u53c2\u6570\uff0c\u63a5\u7740\u5c31\u4f1a\u67e5\u627e ",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh")," \u4e2d\u6307\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\u3002"))),Object(i.b)("h2",{id:"711-\u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7"},"7.11 \u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeItemMetadata]")," -> ",Object(i.b)("inlineCode",{parentName:"p"},"appsettings.json")," -> ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]"),"\u3002",Object(i.b)("strong",{parentName:"p"},"\uff08\u4f4e -> \u9ad8\uff09")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"[IfException]")," \u4f1a\u8986\u76d6 ",Object(i.b)("inlineCode",{parentName:"li"},"appsettings.json")," \u5b9a\u4e49\u7684\u72b6\u6001\u7801\u6d88\u606f\u3002"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"appsettings.json")," \u4f1a\u8986\u76d6 ",Object(i.b)("inlineCode",{parentName:"li"},"[ErrorCodeItemMetadata]")," \u5b9a\u4e49\u7684\u6d88\u606f\u3002")),Object(i.b)("h2",{id:"712-\u591a\u8bed\u8a00\u652f\u6301"},"7.12 \u591a\u8bed\u8a00\u652f\u6301"),Object(i.b)("p",null,"\u53c2\u89c1 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"./local-language"}),"\u3010\u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09\u3011")," \u7ae0\u8282"),Object(i.b)("h2",{id:"713-\u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668"},"7.13 \u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16,17}","{16,17}":!0}),'using Furion.DependencyInjection;\nusing Furion.Utilities;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing Microsoft.AspNetCore.Mvc.ModelBinding;\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Furion.UnifyResult\n{\n /// \n /// RESTful \u98ce\u683c\u8fd4\u56de\u503c\n /// \n [SkipScan, UnifyModel(typeof(RESTfulResult<>))]\n public class RESTfulResultProvider : IUnifyResultProvider\n {\n /// \n /// \u5f02\u5e38\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnException(ExceptionContext context)\n {\n // \u89e3\u6790\u5f02\u5e38\u4fe1\u606f\n var (ErrorCode, ErrorContent) = UnifyContext.GetExceptionMetadata(context);\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = ErrorCode,\n Succeeded = false,\n Data = null,\n Errors = ErrorContent,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u6210\u529f\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnSucceeded(ActionExecutedContext context)\n {\n object data;\n // \u5904\u7406\u5185\u5bb9\u7ed3\u679c\n if (context.Result is ContentResult contentResult) data = contentResult.Content;\n // \u5904\u7406\u5bf9\u8c61\u7ed3\u679c\n else if (context.Result is ObjectResult objectResult) data = objectResult.Value;\n else if (context.Result is EmptyResult) data = null;\n else return null;\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = context.Result is EmptyResult ? StatusCodes.Status204NoContent : StatusCodes.Status200OK, // \u5904\u7406\u6ca1\u6709\u8fd4\u56de\u503c\u60c5\u51b5 204\n Succeeded = true,\n Data = data,\n Errors = null,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u9a8c\u8bc1\u5931\u8d25\u8fd4\u56de\u503c\n /// \n /// \n /// \n /// \n /// \n /// \n public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, Dictionary> validationResults, string validateFailedMessage)\n {\n return new JsonResult(new RESTfulResult\n {\n StatusCode = StatusCodes.Status400BadRequest,\n Succeeded = false,\n Data = null,\n Errors = validationResults,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u5904\u7406\u8f93\u51fa\u72b6\u6001\u7801\n /// \n /// \n /// \n /// \n public async Task OnResponseStatusCodes(HttpContext context, int statusCode)\n {\n switch (statusCode)\n {\n // \u5904\u7406 401 \u72b6\u6001\u7801\n case StatusCodes.Status401Unauthorized:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status401Unauthorized,\n Succeeded = false,\n Data = null,\n Errors = "401 Unauthorized",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n // \u5904\u7406 403 \u72b6\u6001\u7801\n case StatusCodes.Status403Forbidden:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status403Forbidden,\n Succeeded = false,\n Data = null,\n Errors = "403 Forbidden",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n\n default:\n break;\n }\n }\n }\n}\n')),Object(i.b)("p",null,"\u4e4b\u540e\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddControllers()\n .AddInjectWithUnifyResult();\n")),Object(i.b)("h2",{id:"714-\u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668"},"7.14 \u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668"),Object(i.b)("p",null,"\u901a\u5e38\u6211\u4eec\u9700\u8981\u5728\u5f02\u5e38\u6355\u83b7\u7684\u65f6\u5019\u5199\u65e5\u5fd7\uff0c\u8fd9\u65f6\u5019\u5c31\u9700\u8981\u4f7f\u7528\u5230 ",Object(i.b)("inlineCode",{parentName:"p"},"IGlobalExceptionHandler")," \u5f02\u5e38\u5b9a\u4e49\u5904\u7406\u7a0b\u5e8f\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),"using Furion.DependencyInjection;\nusing Furion.FriendlyException;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing System.Threading.Tasks;\n\nnamespace Furion.Application\n{\n public class LogExceptionHandler : IGlobalExceptionHandler, ISingleton\n {\n public Task OnExceptionAsync(ExceptionContext context)\n {\n // \u5199\u65e5\u5fd7\n\n return Task.CompletedTask;\n }\n }\n}\n")),Object(i.b)("h2",{id:"715-friendlyexceptionsettings-\u914d\u7f6e"},"7.15 ",Object(i.b)("inlineCode",{parentName:"h2"},"FriendlyExceptionSettings")," \u914d\u7f6e"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"HideErrorCode"),"\uff1a\u9690\u85cf\u9519\u8bef\u7801\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(i.b)("inlineCode",{parentName:"li"},"false")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DefaultErrorCode"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u7801\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DefaultErrorMessage"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u6d88\u606f\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b")),Object(i.b)("p",null,"\u914d\u7f6e\u793a\u4f8b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "FriendlyExceptionSettings": {\n "DefaultErrorMessage": "\u7cfb\u7edf\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458"\n }\n}\n')),Object(i.b)("h2",{id:"716-\u53cd\u9988\u4e0e\u5efa\u8bae"},"7.16 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return o}));var a=t(21),r=t(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+o:o}(n,e,t,a)}}function o(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return u}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var p=r.a.createContext({}),l=function(e){var n=r.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=l(e.components);return r.a.createElement(p.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},m=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,p=b(e,["components","mdxType","originalType","parentName"]),s=l(t),m=a,u=s["".concat(o,".").concat(m)]||s[m]||d[m]||i;return t?r.a.createElement(u,c(c({ref:n},p),{},{components:t})):r.a.createElement(u,c({ref:n},p))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=m;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var p=2;pn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{122:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return p})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return d}));var a=t(3),r=t(7),i=(t(0),t(196)),o=t(194),c=t(197),b={id:"friendly-exception",title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",sidebar_label:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406"},p={unversionedId:"friendly-exception",id:"friendly-exception",isDocsHomePage:!1,title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",description:"7.1 \u4ec0\u4e48\u662f\u5f02\u5e38",source:"@site/docs\\friendly-exception.mdx",slug:"/friendly-exception",permalink:"/docs/friendly-exception",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/friendly-exception.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",sidebar:"docs",previous:{title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",permalink:"/docs/specification-document"},next:{title:"8. \u6570\u636e\u6821\u9a8c",permalink:"/docs/data-validation"}},l=[{value:"7.1 \u4ec0\u4e48\u662f\u5f02\u5e38",id:"71-\u4ec0\u4e48\u662f\u5f02\u5e38",children:[]},{value:"7.2 \u5904\u7406\u5f02\u5e38\u65b9\u5f0f",id:"72-\u5904\u7406\u5f02\u5e38\u65b9\u5f0f",children:[]},{value:"7.3 \u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406",id:"73-\u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406",children:[{value:"7.3.1 \u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406",id:"731-\u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406",children:[]},{value:"7.3.2 \u53cb\u597d\u5f02\u5e38\u5904\u7406",id:"732-\u53cb\u597d\u5f02\u5e38\u5904\u7406",children:[]}]},{value:"7.4 \u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b",id:"74-\u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b",children:[{value:"7.4.1 \u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1",id:"741-\u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1",children:[]},{value:"7.4.2 \u4e24\u4e2a\u4f8b\u5b50",id:"742-\u4e24\u4e2a\u4f8b\u5b50",children:[]}]},{value:"7.5 \u5173\u4e8e Oops.Oh",id:"75-\u5173\u4e8e-oopsoh",children:[{value:"7.6.1 \u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f",id:"761-\u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f",children:[]},{value:"7.6.2 Oops.Oh \u91cd\u8f7d\u65b9\u6cd5",id:"762-oopsoh-\u91cd\u8f7d\u65b9\u6cd5",children:[]}]},{value:"7.6 \u6700\u4f73\u5b9e\u8df5 \ud83e\udd17",id:"76-\u6700\u4f73\u5b9e\u8df5-",children:[{value:"7.6.1 \u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",id:"761-\u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",children:[]},{value:"7.6.2 \u5173\u4e8e [ErrorCodeItemMetadata]",id:"762-\u5173\u4e8e-errorcodeitemmetadata",children:[]},{value:"7.6.3 \u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528",id:"763-\u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528",children:[]},{value:"7.6.4 \u66f4\u591a\u4f8b\u5b50",id:"764-\u66f4\u591a\u4f8b\u5b50",children:[]}]},{value:"7.7 \u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",id:"77-\u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b",children:[]},{value:"7.8 IErrorCodeTypeProvider \u63d0\u4f9b\u5668",id:"78-ierrorcodetypeprovider-\u63d0\u4f9b\u5668",children:[]},{value:"7.9 appsetting.json \u4e2d\u914d\u7f6e",id:"79-appsettingjson-\u4e2d\u914d\u7f6e",children:[]},{value:"7.10 [IfException] \u4f7f\u7528",id:"710-ifexception-\u4f7f\u7528",children:[{value:"7.10.1 \u4f7f\u7528\u793a\u4f8b",id:"7101-\u4f7f\u7528\u793a\u4f8b",children:[]},{value:"7.10.2 \u66f4\u591a\u4f8b\u5b50",id:"7102-\u66f4\u591a\u4f8b\u5b50",children:[]}]},{value:"7.11 \u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7",id:"711-\u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7",children:[]},{value:"7.12 \u591a\u8bed\u8a00\u652f\u6301",id:"712-\u591a\u8bed\u8a00\u652f\u6301",children:[]},{value:"7.13 \u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668",id:"713-\u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668",children:[]},{value:"7.14 \u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668",id:"714-\u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668",children:[]},{value:"7.15 FriendlyExceptionSettings \u914d\u7f6e",id:"715-friendlyexceptionsettings-\u914d\u7f6e",children:[]},{value:"7.16 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"716-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function d(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"71-\u4ec0\u4e48\u662f\u5f02\u5e38"},"7.1 \u4ec0\u4e48\u662f\u5f02\u5e38"),Object(i.b)("p",null,"\u5f02\u5e38\u4e00\u822c\u662f\u6307\u8fd0\u884c\u671f\uff08\u6b64\u5904\u7279\u6307 ",Object(i.b)("inlineCode",{parentName:"p"},"Exception")," \u7c7b\uff09\u4f1a\u53d1\u751f\u7684\u5bfc\u81f4\u7a0b\u5e8f\u610f\u5916\u4e2d\u6b62\u7684\u95ee\u9898\uff0c\u662f\u4e00\u79cd\u5bf9\u95ee\u9898\u7684\u63cf\u8ff0\u540e\u7684\u5c01\u88c5\u5bf9\u8c61\u3002"),Object(i.b)("p",null,"\u5728\u8fc7\u53bb\u5f00\u53d1\u4e2d\uff0c\u901a\u5e38\u5f02\u5e38\u7531\u7cfb\u7edf\u8fd0\u884c\u65f6\u51fa\u9519\u629b\u51fa\uff0c\u4f46\u73b0\u5728\u7684\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u5e94\u5728\u7a0b\u5e8f\u5f00\u53d1\u4e2d\u5408\u7406\u7684\u629b\u51fa\u5f02\u5e38\uff0c\u6bd4\u5982\u66f4\u65b0\u4e00\u6761\u4e0d\u5b58\u5728\u7684\u5b9e\u4f53\uff0c\u6216\u67e5\u8be2\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684\u6570\u636e\u7b49\u7b49\u3002"),Object(i.b)("h2",{id:"72-\u5904\u7406\u5f02\u5e38\u65b9\u5f0f"},"7.2 \u5904\u7406\u5f02\u5e38\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u4e0d\u5904\u7406\uff0c\u76f4\u63a5\u4e2d\u65ad\u7a0b\u5e8f\u6267\u884c\uff08\u4e0d\u63a8\u8350\uff09"),Object(i.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"li"},"try catch finally")," \u5904\u7406\uff08\u4e0d\u63a8\u8350\uff09"),Object(i.b)("li",{parentName:"ul"},"\u5168\u5c40\u7edf\u4e00\u5904\u7406\uff0c\u5e76\u8bb0\u5f55\u5f02\u5e38\u4fe1\u606f",Object(i.b)("strong",{parentName:"li"},"\uff08\u63a8\u8350\uff09")),Object(i.b)("li",{parentName:"ul"},"\u5f02\u5e38\u6ce8\u89e3\u65b9\u5f0f\u5904\u7406\uff0c\u652f\u6301",Object(i.b)("strong",{parentName:"li"},"\u672c\u5730\u5316")," ",Object(i.b)("strong",{parentName:"li"},"\uff08\u63a8\u8350\uff09"))),Object(i.b)("h2",{id:"73-\u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406"},"7.3 \u4ec0\u4e48\u662f\u53cb\u597d\u5f02\u5e38\u5904\u7406"),Object(i.b)("h3",{id:"731-\u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406"},"7.3.1 \u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406"),Object(i.b)("p",null,"\u5728\u4e86\u89e3\u53cb\u597d\u5f02\u5e38\u5904\u7406\u4e4b\u524d\u53ef\u4ee5\u770b\u770b\u975e\u53cb\u597d\u5f02\u5e38\u5904\u7406\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5bf9\u7ec8\u7aef\u7528\u6237\u629b\u51fa ",Object(i.b)("inlineCode",{parentName:"li"},"500\u72b6\u6001\u7801")," \u5806\u6808\u4fe1\u606f"),Object(i.b)("li",{parentName:"ul"},"\u5927\u91cf\u7684 ",Object(i.b)("inlineCode",{parentName:"li"},"try catch")," \u4ee3\u7801\uff0c\u6c61\u67d3\u6b63\u5e38\u4e1a\u52a1\u903b\u8f91"),Object(i.b)("li",{parentName:"ul"},"\u6ca1\u6709\u89c4\u8303\u5316\u7684\u5f02\u5e38\u72b6\u6001\u7801\u548c\u5f02\u5e38\u6d88\u606f\u7ba1\u7406"),Object(i.b)("li",{parentName:"ul"},"\u6ca1\u6709\u5f02\u5e38\u65e5\u5fd7\u6536\u96c6\u8bb0\u5f55"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5f02\u5e38\u6d88\u606f\u672c\u5730\u5316\u5904\u7406"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5f02\u5e38\u7b56\u7565\uff0c\u5931\u8d25\u540e\u7a0b\u5e8f\u7acb\u5373\u7ec8\u6b62"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5206\u5e03\u5f0f\u4e8b\u52a1 CAP"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u5f02\u5e38\u4f20\u64ad"),Object(i.b)("li",{parentName:"ul"},"\u8fd4\u56de\u7684\u5f02\u5e38\u683c\u5f0f\u6742\u4e71")),Object(i.b)("h3",{id:"732-\u53cb\u597d\u5f02\u5e38\u5904\u7406"},"7.3.2 \u53cb\u597d\u5f02\u5e38\u5904\u7406"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5bf9\u7ec8\u7aef\u7528\u6237\u63d0\u793a\u53cb\u597d"),Object(i.b)("li",{parentName:"ul"},"\u5bf9\u540e\u7aef\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u8be6\u7ec6\u7684\u5f02\u5e38\u5806\u6808"),Object(i.b)("li",{parentName:"ul"},"\u4e0d\u5e72\u6270\u6b63\u5e38\u4e1a\u52a1\u903b\u8f91\u4ee3\u7801\uff0c\u5982 \u6ca1\u6709 ",Object(i.b)("inlineCode",{parentName:"li"},"try catch")," \u4ee3\u7801"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u72b6\u6001\u7801\u591a\u65b9\u8bbe\u7f6e"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u6d88\u606f\u672c\u5730\u5316"),Object(i.b)("li",{parentName:"ul"},"\u5f02\u5e38\u4fe1\u606f\u7edf\u4e00\u914d\u7f6e\u7ba1\u7406"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u7b56\u7565\uff0c\u5982\u91cd\u8bd5"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5f02\u5e38\u65e5\u5fd7\u6536\u96c6\u8bb0\u5f55"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301 CAP \u5206\u5e03\u5f0f\u4e8b\u52a1\u5173\u8054"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u5185\u90e8\u5f02\u5e38\u5916\u90e8\u4f20\u64ad"),Object(i.b)("li",{parentName:"ul"},"\u652f\u6301\u8fd4\u56de\u7edf\u4e00\u7684\u5f02\u5e38\u683c\u5f0f\u6570\u636e")),Object(i.b)("h2",{id:"74-\u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b"},"7.4 \u53cb\u597d\u5f02\u5e38\u5904\u7406\u4f7f\u7528\u793a\u4f8b"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u53cb\u597d\u5f02\u5e38\u5904\u7406\u65b9\u5f0f\u3002"),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},".AddFriendlyException()")," \u9ed8\u8ba4\u5df2\u7ecf\u7ee7\u627f\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002\u4e5f\u5c31\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"7.4.1")," \u7ae0\u8282\u53ef\u4e0d\u914d\u7f6e\u3002"))),Object(i.b)("h3",{id:"741-\u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1"},"7.4.1 \u6ce8\u518c\u53cb\u597d\u5f02\u5e38\u670d\u52a1"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddFriendlyException();\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},".AddFriendlyException()")," \u9700\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u540e\u6ce8\u518c\u3002"))),Object(i.b)("h3",{id:"742-\u4e24\u4e2a\u4f8b\u5b50"},"7.4.2 \u4e24\u4e2a\u4f8b\u5b50"),Object(i.b)("h4",{id:"\u7b80\u5355\u629b\u4e2a\u5f02\u5e38"},"\u7b80\u5355\u629b\u4e2a\u5f02\u5e38"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,12}","{2,12}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh($"{id} \u4e0d\u80fd\u5c0f\u4e8e3");\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc1.gif")}),Object(i.b)("h4",{id:"\u629b\u51fa\u7279\u5b9a\u7c7b\u578b\u5f02\u5e38"},"\u629b\u51fa\u7279\u5b9a\u7c7b\u578b\u5f02\u5e38"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,13}","{2,13}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\nusing System;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh($"{id} \u4e0d\u80fd\u5c0f\u4e8e3\u3002", typeof(InvalidOperationException));\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc2.png")}),Object(i.b)("h2",{id:"75-\u5173\u4e8e-oopsoh"},"7.5 \u5173\u4e8e Oops.Oh"),Object(i.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u4f8b\u5b50\u53ef\u4ee5\u770b\u51fa\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh(errorMessage)")," \u53ef\u4ee5\u7ed3\u5408 ",Object(i.b)("inlineCode",{parentName:"p"},"throw")," \u629b\u51fa\u5f02\u5e38\u3002\u5bf9\u4e8e\u719f\u6089",Object(i.b)("inlineCode",{parentName:"p"},"C#"),"\u7684\u4eba\u5458\u6765\u8bf4\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"throw")," \u540e\u9762\u53ea\u80fd ",Object(i.b)("inlineCode",{parentName:"p"},"Exception")," \u5b9e\u4f8b\u3002",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh(...)")," \u65b9\u6cd5\u8fd4\u56de\u6b63\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"Exception")," \u5b9e\u4f8b\u3002"),Object(i.b)("h3",{id:"761-\u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f"},"7.6.1 \u4e3a\u4ec0\u4e48\u8d77\u8fd9\u4e2a\u540d\u5b57\uff1f"),Object(i.b)("p",null,"\u8fd9\u4e2a\u540d\u5b57\u6765\u6e90\u4e8e\u4e00\u4e2a\u82f1\u8bed\u53e5\u5b50\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"Oh, Oops!"),"\uff0c\u610f\u601d\u662f ",Object(i.b)("strong",{parentName:"p"},"\u5662\uff08\u54ce\uff09\uff0c\u51fa\u9519\u4e86\uff01"),"\uff0c\u6240\u4ee5\u5c31\u6709\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh"),"\u3002"),Object(i.b)("h3",{id:"762-oopsoh-\u91cd\u8f7d\u65b9\u6cd5"},"7.6.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"Oops.Oh")," \u91cd\u8f7d\u65b9\u6cd5"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,22,30,39}","{13,22,30,39}":!0}),'using System;\n\nnamespace Furion.FriendlyException\n{\n public static class Oops\n {\n /// \n /// \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38\n /// \n /// \u5f02\u5e38\u6d88\u606f\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(string errorMessage, params object[] args);\n\n /// \n /// \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38\n /// \n /// \u5f02\u5e38\u6d88\u606f\n /// \u5177\u4f53\u5f02\u5e38\u7c7b\u578b\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(string errorMessage, Type exceptionType, params object[] args);\n\n /// \n /// \u629b\u51fa\u9519\u8bef\u7801\u5f02\u5e38\n /// \n /// \u9519\u8bef\u7801\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(object errorCode, params object[] args);\n\n /// \n /// \u629b\u51fa\u9519\u8bef\u7801\u5f02\u5e38\n /// \n /// \u9519\u8bef\u7801\n /// \u5177\u4f53\u5f02\u5e38\u7c7b\u578b\n /// String.Format \u53c2\u6570\n /// \u5f02\u5e38\u5b9e\u4f8b\n public static Exception Oh(object errorCode, Type exceptionType, params object[] args);\n }\n}\n')),Object(i.b)("h2",{id:"76-\u6700\u4f73\u5b9e\u8df5-"},"7.6 \u6700\u4f73\u5b9e\u8df5 \ud83e\udd17"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u4e14\u89c4\u8303\u5316\u7684\u53cb\u597d\u5f02\u5e38\u5904\u7406\u65b9\u5f0f\uff0c\u901a\u8fc7\u8fd9\u4e2a\u65b9\u5f0f\u53ef\u4ee5\u65b9\u4fbf\u7ba1\u7406\u5f02\u5e38\u72b6\u6001\u7801\u3001\u5f02\u5e38\u4fe1\u606f\u53ca\u5f02\u5e38\u672c\u5730\u5316\u3002"),Object(i.b)("h3",{id:"761-\u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"},"7.6.1 \u521b\u5efa\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"),Object(i.b)("p",null,"\u5b9e\u73b0\u81ea\u5b9a\u4e49\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b\u5fc5\u987b\u9075\u5faa\u4ee5\u4e0b\u914d\u7f6e\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u7c7b\u578b\u5fc5\u987b\u662f\u516c\u5f00\u4e14\u662f ",Object(i.b)("inlineCode",{parentName:"li"},"Enum")," \u679a\u4e3e\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},"\u679a\u4e3e\u7c7b\u578b\u5fc5\u987b\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"li"},"[ErrorCodeType]")," \u7279\u6027"),Object(i.b)("li",{parentName:"ul"},"\u679a\u4e3e\u4e2d\u6bcf\u4e00\u9879\u5fc5\u987b\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"li"},"[ErrorCodeItemMetadata]")," \u7279\u6027")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,8,11,14,17}","{1,5,8,11,14,17}":!0}),'using Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n [ErrorCodeType]\n public enum ErrorCodes\n {\n [ErrorCodeItemMetadata("{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n z1000,\n\n [ErrorCodeItemMetadata("\u6570\u636e\u4e0d\u5b58\u5728")]\n x1000,\n\n [ErrorCodeItemMetadata("{0} \u53d1\u73b0 {1} \u4e2a\u5f02\u5e38", "\u767e\u5c0f\u50e7", 2)]\n x1001,\n\n [ErrorCodeItemMetadata("\u670d\u52a1\u5668\u8fd0\u884c\u5f02\u5e38", ErrorCode = "Error")]\n SERVER_ERROR\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"important")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u7279\u6027\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u63d0\u4f9b\u5668\u63a5\u53e3\u6765\u63d0\u4f9b\u5f02\u5e38\u4fe1\u606f\u626b\u63cf\uff0c\u8fd9\u91cc\u7528\u7684\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u7279\u6027\u7c7b\u3002"))),Object(i.b)("h3",{id:"762-\u5173\u4e8e-errorcodeitemmetadata"},"7.6.2 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h3"},"[ErrorCodeItemMetadata]")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeItemMetadata]")," \u7279\u6027\u7528\u6765\u6807\u8bc6",Object(i.b)("strong",{parentName:"p"},"\u679a\u4e3e\u5b57\u6bb5"),"\u5f02\u5e38\u5143\u6570\u636e\uff0c\u8be5\u7279\u6027\u652f\u6301\u4f20\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"\u6d88\u606f\u5185\u5bb9")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\u3002\u6700\u7ec8\u4f1a\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"String.Format(\u6d88\u606f\u5185\u5bb9\uff0c\u683c\u5f0f\u5316\u53c2\u6570)")," \u8fdb\u884c\u683c\u5f0f\u5316\u3002"),Object(i.b)("p",null,"\u5982\u679c\u6d88\u606f\u5185\u5bb9\u4e2d\u5305\u542b",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u5360\u4f4d\u7b26"),"\u4f46\u672a\u6307\u5b9a",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\uff0c\u90a3\u4e48\u4f1a\u67e5\u627e\u5f02\u5e38\u6240\u5728\u65b9\u6cd5\u662f\u5426\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u7279\u6027\u4e14\u542b\u6709\u683c\u5f0f\u5316\u53c2\u6570\uff0c\u63a5\u7740\u5c31\u4f1a\u67e5\u627e ",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh")," \u4e2d\u6307\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\u3002"),Object(i.b)("h3",{id:"763-\u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528"},"7.6.3 \u9759\u6001\u5f02\u5e38\u7c7b\u4f7f\u7528"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,12}","{2,12}":!0}),"using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(ErrorCodes.z1000, id, 3);\n }\n\n return id;\n }\n }\n}\n")),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc3.gif")}),Object(i.b)("h3",{id:"764-\u66f4\u591a\u4f8b\u5b50"},"7.6.4 \u66f4\u591a\u4f8b\u5b50"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6}","{6}":!0}),'throw Oops.Oh(1000);\nthrow Oops.Oh(ErrorCodes.x1000);\nthrow Oops.Oh("\u54c8\u54c8\u54c8\u54c8");\nthrow Oops.Oh(errorCode: "x1001");\nthrow Oops.Oh(1000, typeof(Exception));\nthrow Oops.Oh(1000).StatusCode(400); // \u8bbe\u7f6e\u9519\u8bef\u7801\n')),Object(i.b)("h2",{id:"77-\u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"},"7.7 \u591a\u4e2a\u5f02\u5e38\u4fe1\u606f\u7c7b\u578b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5-6,21-22}","{5-6,21-22}":!0}),'using Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n [ErrorCodeType]\n public enum ErrorCodes\n {\n [ErrorCodeItemMetadata("{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n z1000,\n\n [ErrorCodeItemMetadata("\u6570\u636e\u4e0d\u5b58\u5728")]\n x1000,\n\n [ErrorCodeItemMetadata("{0} \u53d1\u73b0 {1} \u4e2a\u5f02\u5e38", "\u767e\u5c0f\u50e7", 2)]\n x1001,\n\n [ErrorCodeItemMetadata("\u670d\u52a1\u5668\u8fd0\u884c\u5f02\u5e38", ErrorCode = "Error")]\n SERVER_ERROR\n }\n\n [ErrorCodeType]\n public enum UserErrorCodes\n {\n [ErrorCodeItemMetadata("\u7528\u6237\u6570\u636e\u4e0d\u5b58\u5728")]\n u1000,\n\n [ErrorCodeItemMetadata("\u5176\u4ed6\u5f02\u5e38")]\n u1001\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u591a\u4e2a\u5f02\u5e38\u9759\u6001\u7c7b\u4e2d\u4e5f\u5fc5\u987b\u4fdd\u8bc1\u5e38\u91cf\u503c\u552f\u4e00\u6027\uff0c\u4e0d\u53ef\u91cd\u590d\u3002"))),Object(i.b)("h2",{id:"78-ierrorcodetypeprovider-\u63d0\u4f9b\u5668"},"7.8 ",Object(i.b)("inlineCode",{parentName:"h2"},"IErrorCodeTypeProvider")," \u63d0\u4f9b\u5668"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u8fd8\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u5f02\u5e38\u6d88\u606f\u63d0\u4f9b\u5668\u63a5\u53e3\uff0c\u65b9\u4fbf\u5728\u4e0d\u80fd\u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u7279\u6027\u60c5\u51b5\u4e0b\u4f7f\u7528\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,6,8-11}","{2,6,8-11}":!0}),"using Furion.FriendlyException;\nusing System;\n\nnamespace Furion.Application\n{\n public class CustomErrorCodeTypeProvider : IErrorCodeTypeProvider\n {\n public Type[] Definitions => new[] {\n typeof(ErrorCodes),\n typeof(ErrorCodes2)\n };\n }\n}\n")),Object(i.b)("p",null,"\u542f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u63d0\u4f9b\u5668\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers()\n .AddFriendlyException();\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u53ea\u6709\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u65b9\u5f0f\u624d\u9700\u4f7f\u7528\u6cdb\u578b\u65b9\u5f0f\u6ce8\u518c\u3002\u901a\u8fc7\u4e0a\u9762\u7684\u65b9\u5f0f\u6ce8\u518c\u53ef\u4ee5\u540c\u65f6\u652f\u6301 ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u65b9\u5f0f\u3002"))),Object(i.b)("h2",{id:"79-appsettingjson-\u4e2d\u914d\u7f6e"},"7.9 ",Object(i.b)("inlineCode",{parentName:"h2"},"appsetting.json")," \u4e2d\u914d\u7f6e"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e\u5f02\u5e38\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u5f02\u5e38\u4fe1\u606f\u540e\u671f\u914d\u7f6e\uff0c\u4e5f\u5c31\u662f\u65e0\u9700\u5728\u5f00\u53d1\u9636\u6bb5\u9884\u5148\u5b9a\u4e49\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-8} title="Furion.Web.Entry/appsettings.json"',"{2-8}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "ErrorCodeMessageSettings": {\n "Definitions": [\n [5000, "{0} \u4e0d\u80fd\u5c0f\u4e8e {1}"],\n [5001, "\u6211\u53eb {0} \u540d\u5b57", "\u767e\u5c0f\u50e7"],\n [5002, "Oops! \u51fa\u9519\u4e86"]\n ]\n }\n}\n')),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Definitions")," \u7c7b\u578b\u4e3a\u4e8c\u7ef4\u6570\u7ec4\uff0c\u4e8c\u7ef4\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e00\u4e2a\u6570\u7ec4\u7b2c\u4e00\u4e2a\u53c2\u6570\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"ErrorCode")," \u4e5f\u5c31\u662f\u9519\u8bef\u7801\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"ErrorMessage")," \u6d88\u606f\u5185\u5bb9\uff0c\u5269\u4f59\u53c2\u6570\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"ErrorMessage")," \u7684\u683c\u5f0f\u5316\u53c2\u6570\u3002"),Object(i.b)("h4",{id:"\u4f7f\u7528\u793a\u4f8b"},"\u4f7f\u7528\u793a\u4f8b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,12}","{2,12}":!0}),"using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(5000, id, 3); // \u53ef\u4ee5\u5c06 5000\u4f5c\u4e3a\u5e38\u91cf\u914d\u7f6e\u8d77\u6765\n }\n\n return id;\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeType]")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"IErrorCodeTypeProvider")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u53ef\u4ee5\u540c\u65f6\u4f7f\u7528\u3002"))),Object(i.b)("h2",{id:"710-ifexception-\u4f7f\u7528"},"7.10 ",Object(i.b)("inlineCode",{parentName:"h2"},"[IfException]")," \u4f7f\u7528"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u7279\u6027\u53ef\u4ee5",Object(i.b)("strong",{parentName:"p"},"\u8986\u76d6\u9ed8\u8ba4\u6d88\u606f\u914d\u7f6e"),"\u3002\u4e5f\u5c31\u662f\u8986\u76d6 ",Object(i.b)("inlineCode",{parentName:"p"},"\u5f02\u5e38\u6d88\u606f\u7c7b\u578b")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u7684\u914d\u7f6e\u3002"),Object(i.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u53ea\u80fd\u8d34\u5728\u65b9\u6cd5\u4e0a\uff0c\u652f\u6301\u591a\u4e2a\u3002"))),Object(i.b)("h3",{id:"7101-\u4f7f\u7528\u793a\u4f8b"},"7.10.1 \u4f7f\u7528\u793a\u4f8b"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5f02\u5e38\u6d88\u606f\u7c7b\u5b9a\u4e49")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,4}","{1,4}":!0}),'[ErrorCodeType]\npublic static class ErrorCodes\n{\n [ErrorCodeItemMetadata("{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n z1000\n}\n')),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u8986\u76d6\u9ed8\u8ba4\u914d\u7f6e")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [IfException(ErrorCodes.z1000, ErrorMessage = "\u6211\u8986\u76d6\u4e86\u9ed8\u8ba4\u7684\uff1a{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(ErrorCodes.z1000, id, 3);\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(i.b)("img",{src:Object(o.a)("img/yhyc4.png")}),Object(i.b)("h3",{id:"7102-\u66f4\u591a\u4f8b\u5b50"},"7.10.2 \u66f4\u591a\u4f8b\u5b50"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8-11}","{2,8-11}":!0}),'using Furion.DynamicApiController;\nusing Furion.FriendlyException;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [IfException(typeof(ExceptionType), ErrorMessage = "\u7279\u5b9a\u5f02\u5e38\u7c7b\u578b\u5168\u5c40\u62e6\u622a")]\n [IfException(ErrorMessage = "\u5168\u5c40\u5f02\u5e38\u62e6\u622a")]\n [IfException(ErrorCodes.z1000, ErrorMessage = "\u6211\u8986\u76d6\u4e86\u9ed8\u8ba4\u7684\uff1a{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n [IfException(ErrorCodes.x1001, "\u683c\u5f0f\u5316\u53c2\u65701", "\u683c\u5f0f\u5316\u53c2\u65702", ErrorMessage = "\u6211\u8986\u76d6\u4e86\u9ed8\u8ba4\u7684\uff1a{0} \u4e0d\u80fd\u5c0f\u4e8e {1}")]\n [IfException(ErrorCodes.x1000, "\u683c\u5f0f\u5316\u53c2\u65701", "\u683c\u5f0f\u5316\u53c2\u65702")]\n [IfException(ErrorCodes.SERVER_ERROR, "\u683c\u5f0f\u5316\u53c2\u65701", "\u683c\u5f0f\u5316\u53c2\u65702")]\n public int Get(int id)\n {\n if (id < 3)\n {\n throw Oops.Oh(ErrorCodes.z1000, id, 3);\n }\n\n return id;\n }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u683c\u5f0f\u5316\u6d41\u7a0b")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u6d88\u606f\u5185\u5bb9\u4e2d\u5305\u542b",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u5360\u4f4d\u7b26"),"\u4f46\u672a\u6307\u5b9a",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\uff0c\u90a3\u4e48\u4f1a\u67e5\u627e\u5f02\u5e38\u6240\u5728\u65b9\u6cd5\u662f\u5426\u8d34\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]")," \u7279\u6027\u4e14\u542b\u6709\u683c\u5f0f\u5316\u53c2\u6570\uff0c\u63a5\u7740\u5c31\u4f1a\u67e5\u627e ",Object(i.b)("inlineCode",{parentName:"p"},"Oops.Oh")," \u4e2d\u6307\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u683c\u5f0f\u5316\u53c2\u6570"),"\u3002"))),Object(i.b)("h2",{id:"711-\u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7"},"7.11 \u5f02\u5e38\u6d88\u606f\u4f18\u5148\u7ea7"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"[ErrorCodeItemMetadata]")," -> ",Object(i.b)("inlineCode",{parentName:"p"},"appsettings.json")," -> ",Object(i.b)("inlineCode",{parentName:"p"},"[IfException]"),"\u3002",Object(i.b)("strong",{parentName:"p"},"\uff08\u4f4e -> \u9ad8\uff09")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"[IfException]")," \u4f1a\u8986\u76d6 ",Object(i.b)("inlineCode",{parentName:"li"},"appsettings.json")," \u5b9a\u4e49\u7684\u72b6\u6001\u7801\u6d88\u606f\u3002"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"appsettings.json")," \u4f1a\u8986\u76d6 ",Object(i.b)("inlineCode",{parentName:"li"},"[ErrorCodeItemMetadata]")," \u5b9a\u4e49\u7684\u6d88\u606f\u3002")),Object(i.b)("h2",{id:"712-\u591a\u8bed\u8a00\u652f\u6301"},"7.12 \u591a\u8bed\u8a00\u652f\u6301"),Object(i.b)("p",null,"\u53c2\u89c1 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"./local-language"}),"\u3010\u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09\u3011")," \u7ae0\u8282"),Object(i.b)("h2",{id:"713-\u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668"},"7.13 \u5f02\u5e38\u6a21\u578b\u63d0\u4f9b\u5668"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16,17}","{16,17}":!0}),'using Furion.DependencyInjection;\nusing Furion.Utilities;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing Microsoft.AspNetCore.Mvc.ModelBinding;\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Furion.UnifyResult\n{\n /// \n /// RESTful \u98ce\u683c\u8fd4\u56de\u503c\n /// \n [SkipScan, UnifyModel(typeof(RESTfulResult<>))]\n public class RESTfulResultProvider : IUnifyResultProvider\n {\n /// \n /// \u5f02\u5e38\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnException(ExceptionContext context)\n {\n // \u89e3\u6790\u5f02\u5e38\u4fe1\u606f\n var (ErrorCode, ErrorContent) = UnifyContext.GetExceptionMetadata(context);\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = ErrorCode,\n Succeeded = false,\n Data = null,\n Errors = ErrorContent,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u6210\u529f\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnSucceeded(ActionExecutedContext context)\n {\n object data;\n // \u5904\u7406\u5185\u5bb9\u7ed3\u679c\n if (context.Result is ContentResult contentResult) data = contentResult.Content;\n // \u5904\u7406\u5bf9\u8c61\u7ed3\u679c\n else if (context.Result is ObjectResult objectResult) data = objectResult.Value;\n else if (context.Result is EmptyResult) data = null;\n else return null;\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = context.Result is EmptyResult ? StatusCodes.Status204NoContent : StatusCodes.Status200OK, // \u5904\u7406\u6ca1\u6709\u8fd4\u56de\u503c\u60c5\u51b5 204\n Succeeded = true,\n Data = data,\n Errors = null,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u9a8c\u8bc1\u5931\u8d25\u8fd4\u56de\u503c\n /// \n /// \n /// \n /// \n /// \n /// \n public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, Dictionary> validationResults, string validateFailedMessage)\n {\n return new JsonResult(new RESTfulResult\n {\n StatusCode = StatusCodes.Status400BadRequest,\n Succeeded = false,\n Data = null,\n Errors = validationResults,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u5904\u7406\u8f93\u51fa\u72b6\u6001\u7801\n /// \n /// \n /// \n /// \n public async Task OnResponseStatusCodes(HttpContext context, int statusCode)\n {\n switch (statusCode)\n {\n // \u5904\u7406 401 \u72b6\u6001\u7801\n case StatusCodes.Status401Unauthorized:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status401Unauthorized,\n Succeeded = false,\n Data = null,\n Errors = "401 Unauthorized",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n // \u5904\u7406 403 \u72b6\u6001\u7801\n case StatusCodes.Status403Forbidden:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status403Forbidden,\n Succeeded = false,\n Data = null,\n Errors = "403 Forbidden",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n\n default:\n break;\n }\n }\n }\n}\n')),Object(i.b)("p",null,"\u4e4b\u540e\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddControllers()\n .AddInjectWithUnifyResult();\n")),Object(i.b)("h2",{id:"714-\u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668"},"7.14 \u5168\u5c40\u5f02\u5e38\u5904\u7406\u63d0\u4f9b\u5668"),Object(i.b)("p",null,"\u901a\u5e38\u6211\u4eec\u9700\u8981\u5728\u5f02\u5e38\u6355\u83b7\u7684\u65f6\u5019\u5199\u65e5\u5fd7\uff0c\u8fd9\u65f6\u5019\u5c31\u9700\u8981\u4f7f\u7528\u5230 ",Object(i.b)("inlineCode",{parentName:"p"},"IGlobalExceptionHandler")," \u5f02\u5e38\u5b9a\u4e49\u5904\u7406\u7a0b\u5e8f\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8}","{8}":!0}),"using Furion.DependencyInjection;\nusing Furion.FriendlyException;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing System.Threading.Tasks;\n\nnamespace Furion.Application\n{\n public class LogExceptionHandler : IGlobalExceptionHandler, ISingleton\n {\n public Task OnExceptionAsync(ExceptionContext context)\n {\n // \u5199\u65e5\u5fd7\n\n return Task.CompletedTask;\n }\n }\n}\n")),Object(i.b)("h2",{id:"715-friendlyexceptionsettings-\u914d\u7f6e"},"7.15 ",Object(i.b)("inlineCode",{parentName:"h2"},"FriendlyExceptionSettings")," \u914d\u7f6e"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"HideErrorCode"),"\uff1a\u9690\u85cf\u9519\u8bef\u7801\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(i.b)("inlineCode",{parentName:"li"},"false")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DefaultErrorCode"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u7801\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DefaultErrorMessage"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u6d88\u606f\uff0c",Object(i.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b")),Object(i.b)("p",null,"\u914d\u7f6e\u793a\u4f8b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "FriendlyExceptionSettings": {\n "DefaultErrorMessage": "\u7cfb\u7edf\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458"\n }\n}\n')),Object(i.b)("h2",{id:"716-\u53cd\u9988\u4e0e\u5efa\u8bae"},"7.16 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return o}));var a=t(21),r=t(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+o:o}(n,e,t,a)}}function o(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return u}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var p=r.a.createContext({}),l=function(e){var n=r.a.useContext(p),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=l(e.components);return r.a.createElement(p.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},m=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,p=b(e,["components","mdxType","originalType","parentName"]),s=l(t),m=a,u=s["".concat(o,".").concat(m)]||s[m]||d[m]||i;return t?r.a.createElement(u,c(c({ref:n},p),{},{components:t})):r.a.createElement(u,c({ref:n},p))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=m;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var p=2;pn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/654ac364.96988a37.js b/docs/654ac364.96988a37.js deleted file mode 100644 index 9095aa768a5..00000000000 --- a/docs/654ac364.96988a37.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{120:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return u})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return p}));var n=r(3),o=r(7),a=(r(0),r(192)),c=r(193),i={id:"errors",title:"31.2 \u5e38\u89c1\u9519\u8bef",sidebar_label:"31.2 \u5e38\u89c1\u9519\u8bef"},u={unversionedId:"errors",id:"errors",isDocsHomePage:!1,title:"31.2 \u5e38\u89c1\u9519\u8bef",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\erros.mdx",slug:"/errors",permalink:"/docs/errors",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/erros.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"31.2 \u5e38\u89c1\u9519\u8bef",sidebar:"docs",previous:{title:"31.1 \u5e38\u89c1\u95ee\u9898",permalink:"/docs/answer"},next:{title:"31.3 \u6700\u4f73\u5b9e\u8df5",permalink:"/docs/gooduse"}},s=[],l={toc:s};function p(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},l,r,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}p.isMDXComponent=!0},190:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return c}));var n=r(21),o=r(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:a=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const c=r.startsWith(t)?r:t+r.replace(/^\//,"");return a?e+c:c}(t,e,r,n)}}function c(e,t={}){const{withBaseUrl:r}=a();return r(e,t)}},191:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return b}));var n=r(0),o=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(r),d=n,b=p["".concat(c,".").concat(d)]||p[d]||f[d]||a;return r?o.a.createElement(b,i(i({ref:t},s),{},{components:r})):o.a.createElement(b,i({ref:t},s))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/6875c492.9bfc60f0.js b/docs/6875c492.09853175.js similarity index 80% rename from docs/6875c492.9bfc60f0.js rename to docs/6875c492.09853175.js index 54c5abc3d74..ef267893108 100644 --- a/docs/6875c492.9bfc60f0.js +++ b/docs/6875c492.09853175.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{121:function(e,a,t){"use strict";t.r(a);var n=t(0),r=t.n(n),l=t(203),c=t(230),m=t(198),s=t(210);a.default=function(e){const{metadata:a,items:t,sidebar:n}=e,{allTagsPath:i,name:o,count:d}=a;return r.a.createElement(l.a,{title:`Posts tagged "${o}"`,description:`Blog | Tagged "${o}"`,wrapperClassName:"blog-wrapper"},r.a.createElement("div",{className:"container margin-vert--lg"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col col--2"},r.a.createElement(s.a,{sidebar:n})),r.a.createElement("main",{className:"col col--8"},r.a.createElement("h1",null,d," ",function(e,a){return e>1?a+"s":a}(d,"post"),' tagged with "',o,'"'),r.a.createElement(m.a,{href:i},"View All Tags"),r.a.createElement("div",{className:"margin-vert--xl"},t.map(({content:e})=>r.a.createElement(c.a,{key:e.metadata.permalink,frontMatter:e.frontMatter,metadata:e.metadata,truncated:!0},r.a.createElement(e,null))))))))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{123:function(e,a,t){"use strict";t.r(a);var n=t(0),r=t.n(n),l=t(207),c=t(234),m=t(202),s=t(214);a.default=function(e){const{metadata:a,items:t,sidebar:n}=e,{allTagsPath:i,name:o,count:d}=a;return r.a.createElement(l.a,{title:`Posts tagged "${o}"`,description:`Blog | Tagged "${o}"`,wrapperClassName:"blog-wrapper"},r.a.createElement("div",{className:"container margin-vert--lg"},r.a.createElement("div",{className:"row"},r.a.createElement("div",{className:"col col--2"},r.a.createElement(s.a,{sidebar:n})),r.a.createElement("main",{className:"col col--8"},r.a.createElement("h1",null,d," ",function(e,a){return e>1?a+"s":a}(d,"post"),' tagged with "',o,'"'),r.a.createElement(m.a,{href:i},"View All Tags"),r.a.createElement("div",{className:"margin-vert--xl"},t.map(({content:e})=>r.a.createElement(c.a,{key:e.metadata.permalink,frontMatter:e.frontMatter,metadata:e.metadata,truncated:!0},r.a.createElement(e,null))))))))}}}]); \ No newline at end of file diff --git a/docs/6b2792e5.68f4ea49.js b/docs/6b2792e5.e636eac3.js similarity index 95% rename from docs/6b2792e5.68f4ea49.js rename to docs/6b2792e5.e636eac3.js index f7e7e931a91..4ea2ef6f999 100644 --- a/docs/6b2792e5.68f4ea49.js +++ b/docs/6b2792e5.e636eac3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{123:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(192)),i=n(193),o={id:"encryption",title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",sidebar_label:"20. \u6570\u636e\u52a0\u89e3\u5bc6"},l={unversionedId:"encryption",id:"encryption",isDocsHomePage:!1,title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",description:"20.1 \u6570\u636e\u52a0\u89e3\u5bc6",source:"@site/docs\\encryption.mdx",slug:"/encryption",permalink:"/docs/encryption",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/encryption.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"20. \u6570\u636e\u52a0\u89e3\u5bc6",sidebar:"docs",previous:{title:"19. \u8fdc\u7a0b\u8bf7\u6c42",permalink:"/docs/http"},next:{title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",permalink:"/docs/local-language"}},u=[{value:"20.1 \u6570\u636e\u52a0\u89e3\u5bc6",id:"201-\u6570\u636e\u52a0\u89e3\u5bc6",children:[]},{value:"20.2 \u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b",id:"202-\u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b",children:[]},{value:"20.2 \u52a0\u89e3\u5bc6\u4f7f\u7528",id:"202-\u52a0\u89e3\u5bc6\u4f7f\u7528",children:[{value:"20.2.1 MD5 \u52a0\u5bc6",id:"2021-md5-\u52a0\u5bc6",children:[]},{value:"20.2.2 DESC \u52a0\u89e3\u5bc6",id:"2022-desc-\u52a0\u89e3\u5bc6",children:[]},{value:"20.2.3 AES \u52a0\u89e3\u5bc6",id:"2023-aes-\u52a0\u89e3\u5bc6",children:[]},{value:"20.2.4 JWT \u52a0\u89e3\u5bc6",id:"2024-jwt-\u52a0\u89e3\u5bc6",children:[]}]},{value:"20.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"203-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:u};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"201-\u6570\u636e\u52a0\u89e3\u5bc6"},"20.1 \u6570\u636e\u52a0\u89e3\u5bc6"),Object(c.b)("p",null,"\u7531\u4e8e\u73b0\u5728\u7684\u4e92\u8054\u7f51\u8d8a\u5177\u53d1\u8fbe\uff0c\u6570\u636e\u6210\u4e3a\u4e86\u6211\u4eec\u751f\u6d3b\u7684\u4e00\u90e8\u5206\uff0c\u5f53\u7136\u4e5f\u5e26\u6765\u4e86\u5f88\u591a\u6570\u636e\u5b89\u5168\u6027\u7684\u95ee\u9898\uff0c\u6bd4\u5982\u7528\u6237\u5bc6\u7801\u660e\u6587\u5b58\u50a8\uff0c\u7528\u6237\u4fe1\u606f\u660e\u6587\u5b58\u5728\u5728\u6d4f\u89c8\u5668 ",Object(c.b)("inlineCode",{parentName:"p"},"cookies")," \u4e2d\u7b49\u7b49\u4e0d\u5b89\u5168\u64cd\u4f5c\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c\u5bf9\u6570\u636e\u7684\u52a0\u89e3\u5bc6\u662f\u7cfb\u7edf\u5f00\u53d1\u5fc5\u8981\u7684\u73af\u8282\u3002"),Object(c.b)("h2",{id:"202-\u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b"},"20.2 \u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"MD5")," \u52a0\u5bc6"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"DESC")," \u52a0\u89e3\u5bc6"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"AES")," \u52a0\u89e3\u5bc6"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"JWT")," \u52a0\u89e3\u5bc6")),Object(c.b)("h2",{id:"202-\u52a0\u89e3\u5bc6\u4f7f\u7528"},"20.2 \u52a0\u89e3\u5bc6\u4f7f\u7528"),Object(c.b)("h3",{id:"2021-md5-\u52a0\u5bc6"},"20.2.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"MD5")," \u52a0\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6d4b\u8bd5 MD5 \u52a0\u5bc6\uff0c\u6bd4\u8f83\nvar md5Hash = MD5Encryption.Encrypt("\u767e\u5c0f\u50e7"); // \u52a0\u5bc6\nvar isEqual = MD5Encryption.Compare("\u767e\u5c0f\u50e7", md5Hash); // \u6bd4\u8f83\nreturn (md5Hash, isEqual);\n')),Object(c.b)("h3",{id:"2022-desc-\u52a0\u89e3\u5bc6"},"20.2.2 ",Object(c.b)("inlineCode",{parentName:"h3"},"DESC")," \u52a0\u89e3\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6d4b\u8bd5 DESC \u52a0\u89e3\u5bc6\nvar descHash = DESCEncryption.Encrypt("\u767e\u5c0f\u50e7", "Furion"); // \u52a0\u5bc6\nvar str = DESCEncryption.Decrypt(descHash, "Furion"); // \u89e3\u5bc6\nreturn (descHash, str);\n')),Object(c.b)("h3",{id:"2023-aes-\u52a0\u89e3\u5bc6"},"20.2.3 ",Object(c.b)("inlineCode",{parentName:"h3"},"AES")," \u52a0\u89e3\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6d4b\u8bd5 AES \u52a0\u89e3\u5bc6\nvar key = Guid.NewGuid().ToString("N"); // \u5bc6\u94a5\uff0c\u957f\u5ea6\u5fc5\u987b\u5927\u4e8e20\u4f4d\n\nvar aesHash = AESEncryption.Encrypt("\u767e\u5c0f\u50e7", key); // \u52a0\u5bc6\nvar str2 = AESEncryption.Decrypt(aesHash, key); // \u89e3\u5bc6\nreturn (aesHash, str2);\n')),Object(c.b)("h3",{id:"2024-jwt-\u52a0\u89e3\u5bc6"},"20.2.4 ",Object(c.b)("inlineCode",{parentName:"h3"},"JWT")," \u52a0\u89e3\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var token = JWTEncryption.Encrypt(new Dictionary() // \u52a0\u5bc6\n {\n { "UserId", user.Id },\n { "Account",user.Account }\n });\n\nvar tokenData = JWTEncryption.ReadJwtToken("\u4f60\u7684token"); // \u89e3\u5bc6\n\nvar (isValid, tokenData) = JWTEncryption.Validate("\u4f60\u7684token"); // \u9a8c\u8bc1token\u6709\u6548\u671f\n')),Object(c.b)("h2",{id:"203-\u53cd\u9988\u4e0e\u5efa\u8bae"},"20.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),s=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},b=function(e){var t=s(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},p=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),b=s(n),p=r,m=b["".concat(i,".").concat(p)]||b[p]||d[p]||c;return n?a.a.createElement(m,o(o({ref:t},u),{},{components:n})):a.a.createElement(m,o({ref:t},u))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=p;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{125:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(196)),i=n(197),o={id:"encryption",title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",sidebar_label:"20. \u6570\u636e\u52a0\u89e3\u5bc6"},l={unversionedId:"encryption",id:"encryption",isDocsHomePage:!1,title:"20. \u6570\u636e\u52a0\u89e3\u5bc6",description:"20.1 \u6570\u636e\u52a0\u89e3\u5bc6",source:"@site/docs\\encryption.mdx",slug:"/encryption",permalink:"/docs/encryption",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/encryption.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"20. \u6570\u636e\u52a0\u89e3\u5bc6",sidebar:"docs",previous:{title:"19. \u8fdc\u7a0b\u8bf7\u6c42",permalink:"/docs/http"},next:{title:"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316",permalink:"/docs/local-language"}},u=[{value:"20.1 \u6570\u636e\u52a0\u89e3\u5bc6",id:"201-\u6570\u636e\u52a0\u89e3\u5bc6",children:[]},{value:"20.2 \u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b",id:"202-\u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b",children:[]},{value:"20.2 \u52a0\u89e3\u5bc6\u4f7f\u7528",id:"202-\u52a0\u89e3\u5bc6\u4f7f\u7528",children:[{value:"20.2.1 MD5 \u52a0\u5bc6",id:"2021-md5-\u52a0\u5bc6",children:[]},{value:"20.2.2 DESC \u52a0\u89e3\u5bc6",id:"2022-desc-\u52a0\u89e3\u5bc6",children:[]},{value:"20.2.3 AES \u52a0\u89e3\u5bc6",id:"2023-aes-\u52a0\u89e3\u5bc6",children:[]},{value:"20.2.4 JWT \u52a0\u89e3\u5bc6",id:"2024-jwt-\u52a0\u89e3\u5bc6",children:[]}]},{value:"20.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"203-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:u};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"201-\u6570\u636e\u52a0\u89e3\u5bc6"},"20.1 \u6570\u636e\u52a0\u89e3\u5bc6"),Object(c.b)("p",null,"\u7531\u4e8e\u73b0\u5728\u7684\u4e92\u8054\u7f51\u8d8a\u5177\u53d1\u8fbe\uff0c\u6570\u636e\u6210\u4e3a\u4e86\u6211\u4eec\u751f\u6d3b\u7684\u4e00\u90e8\u5206\uff0c\u5f53\u7136\u4e5f\u5e26\u6765\u4e86\u5f88\u591a\u6570\u636e\u5b89\u5168\u6027\u7684\u95ee\u9898\uff0c\u6bd4\u5982\u7528\u6237\u5bc6\u7801\u660e\u6587\u5b58\u50a8\uff0c\u7528\u6237\u4fe1\u606f\u660e\u6587\u5b58\u5728\u5728\u6d4f\u89c8\u5668 ",Object(c.b)("inlineCode",{parentName:"p"},"cookies")," \u4e2d\u7b49\u7b49\u4e0d\u5b89\u5168\u64cd\u4f5c\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c\u5bf9\u6570\u636e\u7684\u52a0\u89e3\u5bc6\u662f\u7cfb\u7edf\u5f00\u53d1\u5fc5\u8981\u7684\u73af\u8282\u3002"),Object(c.b)("h2",{id:"202-\u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b"},"20.2 \u5185\u7f6e\u52a0\u5bc6\u7c7b\u578b"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"MD5")," \u52a0\u5bc6"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"DESC")," \u52a0\u89e3\u5bc6"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"AES")," \u52a0\u89e3\u5bc6"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"JWT")," \u52a0\u89e3\u5bc6")),Object(c.b)("h2",{id:"202-\u52a0\u89e3\u5bc6\u4f7f\u7528"},"20.2 \u52a0\u89e3\u5bc6\u4f7f\u7528"),Object(c.b)("h3",{id:"2021-md5-\u52a0\u5bc6"},"20.2.1 ",Object(c.b)("inlineCode",{parentName:"h3"},"MD5")," \u52a0\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6d4b\u8bd5 MD5 \u52a0\u5bc6\uff0c\u6bd4\u8f83\nvar md5Hash = MD5Encryption.Encrypt("\u767e\u5c0f\u50e7"); // \u52a0\u5bc6\nvar isEqual = MD5Encryption.Compare("\u767e\u5c0f\u50e7", md5Hash); // \u6bd4\u8f83\nreturn (md5Hash, isEqual);\n')),Object(c.b)("h3",{id:"2022-desc-\u52a0\u89e3\u5bc6"},"20.2.2 ",Object(c.b)("inlineCode",{parentName:"h3"},"DESC")," \u52a0\u89e3\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6d4b\u8bd5 DESC \u52a0\u89e3\u5bc6\nvar descHash = DESCEncryption.Encrypt("\u767e\u5c0f\u50e7", "Furion"); // \u52a0\u5bc6\nvar str = DESCEncryption.Decrypt(descHash, "Furion"); // \u89e3\u5bc6\nreturn (descHash, str);\n')),Object(c.b)("h3",{id:"2023-aes-\u52a0\u89e3\u5bc6"},"20.2.3 ",Object(c.b)("inlineCode",{parentName:"h3"},"AES")," \u52a0\u89e3\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u6d4b\u8bd5 AES \u52a0\u89e3\u5bc6\nvar key = Guid.NewGuid().ToString("N"); // \u5bc6\u94a5\uff0c\u957f\u5ea6\u5fc5\u987b\u5927\u4e8e20\u4f4d\n\nvar aesHash = AESEncryption.Encrypt("\u767e\u5c0f\u50e7", key); // \u52a0\u5bc6\nvar str2 = AESEncryption.Decrypt(aesHash, key); // \u89e3\u5bc6\nreturn (aesHash, str2);\n')),Object(c.b)("h3",{id:"2024-jwt-\u52a0\u89e3\u5bc6"},"20.2.4 ",Object(c.b)("inlineCode",{parentName:"h3"},"JWT")," \u52a0\u89e3\u5bc6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var token = JWTEncryption.Encrypt(new Dictionary() // \u52a0\u5bc6\n {\n { "UserId", user.Id },\n { "Account",user.Account }\n });\n\nvar tokenData = JWTEncryption.ReadJwtToken("\u4f60\u7684token"); // \u89e3\u5bc6\n\nvar (isValid, tokenData) = JWTEncryption.Validate("\u4f60\u7684token"); // \u9a8c\u8bc1token\u6709\u6548\u671f\n')),Object(c.b)("h2",{id:"203-\u53cd\u9988\u4e0e\u5efa\u8bae"},"20.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),s=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},b=function(e){var t=s(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},p=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),b=s(n),p=r,m=b["".concat(i,".").concat(p)]||b[p]||d[p]||c;return n?a.a.createElement(m,o(o({ref:t},u),{},{components:n})):a.a.createElement(m,o({ref:t},u))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=p;var o={};for(var l in t)hasOwnProperty.call(t,l)&&(o[l]=t[l]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/6c04d4c2.3ae058f4.js b/docs/6c04d4c2.3ae058f4.js new file mode 100644 index 00000000000..df2ad178364 --- /dev/null +++ b/docs/6c04d4c2.3ae058f4.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{126:function(t){t.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"httpcontext","name":"httpcontext","count":1,"permalink":"/blog/tags/httpcontext"}')}}]); \ No newline at end of file diff --git a/docs/70699f3e.62344dc7.js b/docs/70699f3e.d90f1afa.js similarity index 97% rename from docs/70699f3e.62344dc7.js rename to docs/70699f3e.d90f1afa.js index c4a9a3af48b..a02a451e3fa 100644 --- a/docs/70699f3e.62344dc7.js +++ b/docs/70699f3e.d90f1afa.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[48],{124:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return o})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var a=n(3),r=n(7),c=(n(0),n(192)),i=n(193),b={id:"cors",title:"16. CORS \u8de8\u57df",sidebar_label:"16. CORS \u8de8\u57df"},o={unversionedId:"cors",id:"cors",isDocsHomePage:!1,title:"16. CORS \u8de8\u57df",description:"16.1 \u4ec0\u4e48\u662f\u8de8\u57df",source:"@site/docs\\cors.mdx",slug:"/cors",permalink:"/docs/cors",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/cors.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"16. CORS \u8de8\u57df",sidebar:"docs",previous:{title:"15. \u5b89\u5168\u9274\u6743",permalink:"/docs/auth-control"},next:{title:"17. \u89c6\u56fe\u5f15\u64ce",permalink:"/docs/view-engine"}},l=[{value:"16.1 \u4ec0\u4e48\u662f\u8de8\u57df",id:"161-\u4ec0\u4e48\u662f\u8de8\u57df",children:[]},{value:"16.2 \u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b",id:"162-\u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b",children:[]},{value:"16.3 \u4ec0\u4e48\u662f CORS",id:"163-\u4ec0\u4e48\u662f-cors",children:[]},{value:"16.4 \u5982\u4f55\u4f7f\u7528",id:"164-\u5982\u4f55\u4f7f\u7528",children:[{value:"16.4.1 \u6dfb\u52a0 CORS \u670d\u52a1",id:"1641-\u6dfb\u52a0-cors-\u670d\u52a1",children:[]},{value:"16.4.2 \u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d",id:"1642-\u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d",children:[]}]},{value:"16.5 CorsAccessorSettings \u914d\u7f6e",id:"165-corsaccessorsettings-\u914d\u7f6e",children:[]},{value:"16.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"166-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function s(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"161-\u4ec0\u4e48\u662f\u8de8\u57df"},"16.1 \u4ec0\u4e48\u662f\u8de8\u57df"),Object(c.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5f53\u4e00\u4e2a\u8bf7\u6c42 ",Object(c.b)("inlineCode",{parentName:"p"},"url")," \u7684\u534f\u8bae\u3001\u57df\u540d\u3001\u7aef\u53e3\u4e09\u8005\u4e4b\u95f4\u4efb\u610f\u4e00\u4e2a\u4e0e\u5f53\u524d\u9875\u9762 ",Object(c.b)("inlineCode",{parentName:"p"},"url")," \u4e0d\u540c\u5373\u4e3a\u8de8\u57df\u3002\u90a3\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8de8\u57df\u95ee\u9898\u5462\uff1f"),Object(c.b)("p",null,"\u51fa\u4e8e\u6d4f\u89c8\u5668\u7684\u540c\u6e90\u7b56\u7565\u9650\u5236\u3002\u540c\u6e90\u7b56\u7565\uff08Sameoriginpolicy\uff09\u662f\u4e00\u79cd\u7ea6\u5b9a\uff0c\u5b83\u662f\u6d4f\u89c8\u5668\u6700\u6838\u5fc3\u4e5f\u6700\u57fa\u672c\u7684\u5b89\u5168\u529f\u80fd\uff0c\u5982\u679c\u7f3a\u5c11\u4e86\u540c\u6e90\u7b56\u7565\uff0c\u5219\u6d4f\u89c8\u5668\u7684\u6b63\u5e38\u529f\u80fd\u53ef\u80fd\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002\u53ef\u4ee5\u8bf4 ",Object(c.b)("inlineCode",{parentName:"p"},"Web")," \u662f\u6784\u5efa\u5728\u540c\u6e90\u7b56\u7565\u57fa\u7840\u4e4b\u4e0a\u7684\uff0c\u6d4f\u89c8\u5668\u53ea\u662f\u9488\u5bf9\u540c\u6e90\u7b56\u7565\u7684\u4e00\u79cd\u5b9e\u73b0\u3002\u540c\u6e90\u7b56\u7565\u4f1a\u963b\u6b62\u4e00\u4e2a\u57df\u7684 javascript \u811a\u672c\u548c\u53e6\u5916\u4e00\u4e2a\u57df\u7684\u5185\u5bb9\u8fdb\u884c\u4ea4\u4e92\u3002\u6240\u8c13\u540c\u6e90\uff08\u5373\u6307\u5728\u540c\u4e00\u4e2a\u57df\uff09\u5c31\u662f\u4e24\u4e2a\u9875\u9762\u5177\u6709\u76f8\u540c\u7684\u534f\u8bae\uff08protocol\uff09\uff0c\u4e3b\u673a\uff08host\uff09\u548c\u7aef\u53e3\u53f7\uff08port\uff09"),Object(c.b)("h2",{id:"162-\u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b"},"16.2 \u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b"),Object(c.b)("table",null,Object(c.b)("thead",{parentName:"table"},Object(c.b)("tr",{parentName:"thead"},Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u5f53\u524d\u9875\u9762 url"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u88ab\u8bf7\u6c42\u9875\u9762 url"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u662f\u5426\u8de8\u57df"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u539f\u56e0"))),Object(c.b)("tbody",{parentName:"table"},Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/index.html"}),"http://www.furion.pro/index.html")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5426"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u540c\u6e90\uff08\u534f\u8bae\u3001\u57df\u540d\u3001\u7aef\u53e3\u53f7\u76f8\u540c\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"https://www.furion.pro/index.html"}),"https://www.furion.pro/index.html")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u534f\u8bae\u4e0d\u540c\uff08http/https\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.baidu.com/"}),"http://www.baidu.com/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u4e3b\u57df\u540d\u4e0d\u540c\uff08chinadot/baidu\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://blog.furion.pro/"}),"http://blog.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5b50\u57df\u540d\u4e0d\u540c\uff08www/blog\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro:8080/"}),"http://www.furion.pro:8080/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro:7001/"}),"http://www.furion.pro:7001/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u7aef\u53e3\u53f7\u4e0d\u540c\uff088080/7001\uff09")))),Object(c.b)("h2",{id:"163-\u4ec0\u4e48\u662f-cors"},"16.3 \u4ec0\u4e48\u662f CORS"),Object(c.b)("p",null,"\u8de8\u6e90\u8d44\u6e90\u5171\u4eab (",Object(c.b)("inlineCode",{parentName:"p"},"CORS"),") \uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u662f\u4e00\u79cd ",Object(c.b)("inlineCode",{parentName:"li"},"W3C")," \u6807\u51c6\uff0c\u53ef\u8ba9\u670d\u52a1\u5668\u653e\u5bbd\u76f8\u540c\u7684\u6e90\u7b56\u7565\u3002"),Object(c.b)("li",{parentName:"ul"},"\u4e0d\u662f\u4e00\u9879\u5b89\u5168\u529f\u80fd\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"CORS")," \u653e\u5bbd ",Object(c.b)("inlineCode",{parentName:"li"},"security"),"\u3002 ",Object(c.b)("inlineCode",{parentName:"li"},"API")," \u4e0d\u80fd\u901a\u8fc7\u5141\u8bb8 ",Object(c.b)("inlineCode",{parentName:"li"},"CORS")," \u6765\u66f4\u5b89\u5168\u3002 \u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/security/cors?view=aspnetcore-5.0#how-cors"}),"CORS \u5de5\u4f5c\u539f\u7406"),"\u3002"),Object(c.b)("li",{parentName:"ul"},"\u5141\u8bb8\u670d\u52a1\u5668\u660e\u786e\u5141\u8bb8\u4e00\u4e9b\u8de8\u6e90\u8bf7\u6c42\uff0c\u540c\u65f6\u62d2\u7edd\u5176\u4ed6\u8bf7\u6c42\u3002"),Object(c.b)("li",{parentName:"ul"},"\u6bd4\u65e9\u671f\u7684\u6280\u672f\uff08\u5982 JSONP\uff09\u66f4\u5b89\u5168\u4e14\u66f4\u7075\u6d3b\u3002")),Object(c.b)("h2",{id:"164-\u5982\u4f55\u4f7f\u7528"},"16.4 \u5982\u4f55\u4f7f\u7528"),Object(c.b)("h3",{id:"1641-\u6dfb\u52a0-cors-\u670d\u52a1"},"16.4.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"CORS")," \u670d\u52a1"),Object(c.b)("p",null,"\u542f\u7528\u8de8\u57df ",Object(c.b)("inlineCode",{parentName:"p"},"Cors")," \u652f\u6301\u9996\u5148\u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"CorsAccessor")," \u670d\u52a1\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,22}","{13,22}":!0}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(700)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddCorsAccessor();\n\n // ...\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n //...\n\n app.UseCorsAccessor();\n\n // ...\n }\n }\n}\n")),Object(c.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"services.AddCorsAccessor();")," \u9700\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u524d\u6ce8\u518c\u3002"),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"app.UseCorsAccessor();")," \u9700\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"app.UseRouting();")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"app.UseAuthentication();")," \u4e4b\u95f4\u6ce8\u518c\u3002"))),Object(c.b)("h3",{id:"1642-\u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d"},"16.4.2 \u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d"),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5c0f\u63d0\u9192")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5141\u8bb8\u6240\u6709\u57df\u540d\u6765\u6e90\u8bbf\u95ee\uff0c\u4e5f\u5c31\u662f\u65e0\u9700\u914d\u7f6e\u4efb\u4f55\u6765\u6e90\u57df\u540d\uff0c\u53e6\u5916\u524d\u7aef\u4e5f\u9700\u8981\u8bbe\u7f6e\u8bf7\u6c42\u53c2\u6570\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"withCredentials:false")))),Object(c.b)("p",null,"\u5982\u679c\u9700\u8981\u6307\u5b9a\u7279\u5b9a\u57df\u540d\uff0c\u5219\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\u5373\u53ef\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{4}","{4}":!0}),'{\n "CorsAccessorSettings": {\n "PolicyName": "\u81ea\u5b9a\u4e49\u8de8\u57df\u7b56\u7565\u540d",\n "WithOrigins": ["http://localhost:4200", "https://furion.pro"]\n }\n}\n')),Object(c.b)("h2",{id:"165-corsaccessorsettings-\u914d\u7f6e"},"16.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"CorsAccessorSettings")," \u914d\u7f6e"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"CorsAccessorSettings"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"PolicyName"),"\uff1a\u8de8\u57df\u7b56\u7565\u540d\uff0c\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u5fc5\u586b\uff0c\u9ed8\u8ba4 ",Object(c.b)("inlineCode",{parentName:"li"},"FurCorsAccessor")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithOrigins"),"\uff1a\u5141\u8bb8\u8de8\u57df\u7684\u57df\u540d\u5217\u8868\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(c.b)("inlineCode",{parentName:"li"},'[ "http://localhost:4200" ]')),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithHeaders"),"\uff1a\u8bf7\u6c42\u8868\u5934\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\u8868\u5934\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithExposedHeaders"),"\uff1a\u54cd\u5e94\u6807\u5934\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithMethods"),"\uff1a\u8bbe\u7f6e\u8de8\u57df\u5141\u8bb8\u8bf7\u6c42\u8c13\u8bcd\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"AllowCredentials"),"\uff1a\u8de8\u57df\u8bf7\u6c42\u4e2d\u7684\u51ed\u636e\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"SetPreflightMaxAge"),"\uff1a\u8bbe\u7f6e\u9884\u68c0\u8fc7\u671f\u65f6\u95f4\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"int")," \u7c7b\u578b")))),Object(c.b)("h2",{id:"166-\u53cd\u9988\u4e0e\u5efa\u8bae"},"16.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u8de8\u57df\u8bf7\u6c42")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/security/cors?view=aspnetcore-5.0"}),"ASP.NET Core - \u542f\u7528\u8de8\u57df\u8bf7\u6c42")," \u7ae0\u8282\u3002"))))}s.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},O=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),s=p(n),O=a,m=s["".concat(i,".").concat(O)]||s[O]||d[O]||c;return n?r.a.createElement(m,b(b({ref:t},l),{},{components:n})):r.a.createElement(m,b({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=O;var b={};for(var o in t)hasOwnProperty.call(t,o)&&(b[o]=t[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,i[1]=b;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{127:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return o})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var a=n(3),r=n(7),c=(n(0),n(196)),i=n(197),b={id:"cors",title:"16. CORS \u8de8\u57df",sidebar_label:"16. CORS \u8de8\u57df"},o={unversionedId:"cors",id:"cors",isDocsHomePage:!1,title:"16. CORS \u8de8\u57df",description:"16.1 \u4ec0\u4e48\u662f\u8de8\u57df",source:"@site/docs\\cors.mdx",slug:"/cors",permalink:"/docs/cors",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/cors.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"16. CORS \u8de8\u57df",sidebar:"docs",previous:{title:"15. \u5b89\u5168\u9274\u6743",permalink:"/docs/auth-control"},next:{title:"17. \u89c6\u56fe\u5f15\u64ce",permalink:"/docs/view-engine"}},l=[{value:"16.1 \u4ec0\u4e48\u662f\u8de8\u57df",id:"161-\u4ec0\u4e48\u662f\u8de8\u57df",children:[]},{value:"16.2 \u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b",id:"162-\u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b",children:[]},{value:"16.3 \u4ec0\u4e48\u662f CORS",id:"163-\u4ec0\u4e48\u662f-cors",children:[]},{value:"16.4 \u5982\u4f55\u4f7f\u7528",id:"164-\u5982\u4f55\u4f7f\u7528",children:[{value:"16.4.1 \u6dfb\u52a0 CORS \u670d\u52a1",id:"1641-\u6dfb\u52a0-cors-\u670d\u52a1",children:[]},{value:"16.4.2 \u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d",id:"1642-\u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d",children:[]}]},{value:"16.5 CorsAccessorSettings \u914d\u7f6e",id:"165-corsaccessorsettings-\u914d\u7f6e",children:[]},{value:"16.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"166-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function s(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"161-\u4ec0\u4e48\u662f\u8de8\u57df"},"16.1 \u4ec0\u4e48\u662f\u8de8\u57df"),Object(c.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5f53\u4e00\u4e2a\u8bf7\u6c42 ",Object(c.b)("inlineCode",{parentName:"p"},"url")," \u7684\u534f\u8bae\u3001\u57df\u540d\u3001\u7aef\u53e3\u4e09\u8005\u4e4b\u95f4\u4efb\u610f\u4e00\u4e2a\u4e0e\u5f53\u524d\u9875\u9762 ",Object(c.b)("inlineCode",{parentName:"p"},"url")," \u4e0d\u540c\u5373\u4e3a\u8de8\u57df\u3002\u90a3\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8de8\u57df\u95ee\u9898\u5462\uff1f"),Object(c.b)("p",null,"\u51fa\u4e8e\u6d4f\u89c8\u5668\u7684\u540c\u6e90\u7b56\u7565\u9650\u5236\u3002\u540c\u6e90\u7b56\u7565\uff08Sameoriginpolicy\uff09\u662f\u4e00\u79cd\u7ea6\u5b9a\uff0c\u5b83\u662f\u6d4f\u89c8\u5668\u6700\u6838\u5fc3\u4e5f\u6700\u57fa\u672c\u7684\u5b89\u5168\u529f\u80fd\uff0c\u5982\u679c\u7f3a\u5c11\u4e86\u540c\u6e90\u7b56\u7565\uff0c\u5219\u6d4f\u89c8\u5668\u7684\u6b63\u5e38\u529f\u80fd\u53ef\u80fd\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002\u53ef\u4ee5\u8bf4 ",Object(c.b)("inlineCode",{parentName:"p"},"Web")," \u662f\u6784\u5efa\u5728\u540c\u6e90\u7b56\u7565\u57fa\u7840\u4e4b\u4e0a\u7684\uff0c\u6d4f\u89c8\u5668\u53ea\u662f\u9488\u5bf9\u540c\u6e90\u7b56\u7565\u7684\u4e00\u79cd\u5b9e\u73b0\u3002\u540c\u6e90\u7b56\u7565\u4f1a\u963b\u6b62\u4e00\u4e2a\u57df\u7684 javascript \u811a\u672c\u548c\u53e6\u5916\u4e00\u4e2a\u57df\u7684\u5185\u5bb9\u8fdb\u884c\u4ea4\u4e92\u3002\u6240\u8c13\u540c\u6e90\uff08\u5373\u6307\u5728\u540c\u4e00\u4e2a\u57df\uff09\u5c31\u662f\u4e24\u4e2a\u9875\u9762\u5177\u6709\u76f8\u540c\u7684\u534f\u8bae\uff08protocol\uff09\uff0c\u4e3b\u673a\uff08host\uff09\u548c\u7aef\u53e3\u53f7\uff08port\uff09"),Object(c.b)("h2",{id:"162-\u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b"},"16.2 \u6709\u8de8\u57df\u884c\u4e3a\u793a\u4f8b"),Object(c.b)("table",null,Object(c.b)("thead",{parentName:"table"},Object(c.b)("tr",{parentName:"thead"},Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u5f53\u524d\u9875\u9762 url"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u88ab\u8bf7\u6c42\u9875\u9762 url"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u662f\u5426\u8de8\u57df"),Object(c.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u539f\u56e0"))),Object(c.b)("tbody",{parentName:"table"},Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/index.html"}),"http://www.furion.pro/index.html")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5426"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u540c\u6e90\uff08\u534f\u8bae\u3001\u57df\u540d\u3001\u7aef\u53e3\u53f7\u76f8\u540c\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"https://www.furion.pro/index.html"}),"https://www.furion.pro/index.html")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u534f\u8bae\u4e0d\u540c\uff08http/https\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.baidu.com/"}),"http://www.baidu.com/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u4e3b\u57df\u540d\u4e0d\u540c\uff08chinadot/baidu\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro/"}),"http://www.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://blog.furion.pro/"}),"http://blog.furion.pro/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5b50\u57df\u540d\u4e0d\u540c\uff08www/blog\uff09")),Object(c.b)("tr",{parentName:"tbody"},Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro:8080/"}),"http://www.furion.pro:8080/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),Object(c.b)("a",Object(a.a)({parentName:"td"},{href:"http://www.furion.pro:7001/"}),"http://www.furion.pro:7001/")),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8de8\u57df"),Object(c.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u7aef\u53e3\u53f7\u4e0d\u540c\uff088080/7001\uff09")))),Object(c.b)("h2",{id:"163-\u4ec0\u4e48\u662f-cors"},"16.3 \u4ec0\u4e48\u662f CORS"),Object(c.b)("p",null,"\u8de8\u6e90\u8d44\u6e90\u5171\u4eab (",Object(c.b)("inlineCode",{parentName:"p"},"CORS"),") \uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u662f\u4e00\u79cd ",Object(c.b)("inlineCode",{parentName:"li"},"W3C")," \u6807\u51c6\uff0c\u53ef\u8ba9\u670d\u52a1\u5668\u653e\u5bbd\u76f8\u540c\u7684\u6e90\u7b56\u7565\u3002"),Object(c.b)("li",{parentName:"ul"},"\u4e0d\u662f\u4e00\u9879\u5b89\u5168\u529f\u80fd\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"CORS")," \u653e\u5bbd ",Object(c.b)("inlineCode",{parentName:"li"},"security"),"\u3002 ",Object(c.b)("inlineCode",{parentName:"li"},"API")," \u4e0d\u80fd\u901a\u8fc7\u5141\u8bb8 ",Object(c.b)("inlineCode",{parentName:"li"},"CORS")," \u6765\u66f4\u5b89\u5168\u3002 \u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"li"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/security/cors?view=aspnetcore-5.0#how-cors"}),"CORS \u5de5\u4f5c\u539f\u7406"),"\u3002"),Object(c.b)("li",{parentName:"ul"},"\u5141\u8bb8\u670d\u52a1\u5668\u660e\u786e\u5141\u8bb8\u4e00\u4e9b\u8de8\u6e90\u8bf7\u6c42\uff0c\u540c\u65f6\u62d2\u7edd\u5176\u4ed6\u8bf7\u6c42\u3002"),Object(c.b)("li",{parentName:"ul"},"\u6bd4\u65e9\u671f\u7684\u6280\u672f\uff08\u5982 JSONP\uff09\u66f4\u5b89\u5168\u4e14\u66f4\u7075\u6d3b\u3002")),Object(c.b)("h2",{id:"164-\u5982\u4f55\u4f7f\u7528"},"16.4 \u5982\u4f55\u4f7f\u7528"),Object(c.b)("h3",{id:"1641-\u6dfb\u52a0-cors-\u670d\u52a1"},"16.4.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"CORS")," \u670d\u52a1"),Object(c.b)("p",null,"\u542f\u7528\u8de8\u57df ",Object(c.b)("inlineCode",{parentName:"p"},"Cors")," \u652f\u6301\u9996\u5148\u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"CorsAccessor")," \u670d\u52a1\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13,22}","{13,22}":!0}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(700)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddCorsAccessor();\n\n // ...\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n //...\n\n app.UseCorsAccessor();\n\n // ...\n }\n }\n}\n")),Object(c.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"services.AddCorsAccessor();")," \u9700\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"services.AddControllers()")," \u4e4b\u524d\u6ce8\u518c\u3002"),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"app.UseCorsAccessor();")," \u9700\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"app.UseRouting();")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"app.UseAuthentication();")," \u4e4b\u95f4\u6ce8\u518c\u3002"))),Object(c.b)("h3",{id:"1642-\u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d"},"16.4.2 \u914d\u7f6e\u5141\u8bb8\u8de8\u57df\u57df\u540d"),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5c0f\u63d0\u9192")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5141\u8bb8\u6240\u6709\u57df\u540d\u6765\u6e90\u8bbf\u95ee\uff0c\u4e5f\u5c31\u662f\u65e0\u9700\u914d\u7f6e\u4efb\u4f55\u6765\u6e90\u57df\u540d\uff0c\u53e6\u5916\u524d\u7aef\u4e5f\u9700\u8981\u8bbe\u7f6e\u8bf7\u6c42\u53c2\u6570\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"withCredentials:false")))),Object(c.b)("p",null,"\u5982\u679c\u9700\u8981\u6307\u5b9a\u7279\u5b9a\u57df\u540d\uff0c\u5219\u6dfb\u52a0\u4ee5\u4e0b\u914d\u7f6e\u5373\u53ef\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{4}","{4}":!0}),'{\n "CorsAccessorSettings": {\n "PolicyName": "\u81ea\u5b9a\u4e49\u8de8\u57df\u7b56\u7565\u540d",\n "WithOrigins": ["http://localhost:4200", "https://furion.pro"]\n }\n}\n')),Object(c.b)("h2",{id:"165-corsaccessorsettings-\u914d\u7f6e"},"16.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"CorsAccessorSettings")," \u914d\u7f6e"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"CorsAccessorSettings"),Object(c.b)("ul",{parentName:"li"},Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"PolicyName"),"\uff1a\u8de8\u57df\u7b56\u7565\u540d\uff0c\u5b57\u7b26\u4e32\u7c7b\u578b\uff0c\u5fc5\u586b\uff0c\u9ed8\u8ba4 ",Object(c.b)("inlineCode",{parentName:"li"},"FurCorsAccessor")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithOrigins"),"\uff1a\u5141\u8bb8\u8de8\u57df\u7684\u57df\u540d\u5217\u8868\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(c.b)("inlineCode",{parentName:"li"},'[ "http://localhost:4200" ]')),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithHeaders"),"\uff1a\u8bf7\u6c42\u8868\u5934\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\u8868\u5934\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithExposedHeaders"),"\uff1a\u54cd\u5e94\u6807\u5934\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"WithMethods"),"\uff1a\u8bbe\u7f6e\u8de8\u57df\u5141\u8bb8\u8bf7\u6c42\u8c13\u8bcd\uff0c\u6ca1\u6709\u914d\u7f6e\u5219\u5141\u8bb8\u6240\u6709\uff0c\u5b57\u7b26\u4e32\u6570\u7ec4\u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"AllowCredentials"),"\uff1a\u8de8\u57df\u8bf7\u6c42\u4e2d\u7684\u51ed\u636e\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"SetPreflightMaxAge"),"\uff1a\u8bbe\u7f6e\u9884\u68c0\u8fc7\u671f\u65f6\u95f4\uff0c",Object(c.b)("inlineCode",{parentName:"li"},"int")," \u7c7b\u578b")))),Object(c.b)("h2",{id:"166-\u53cd\u9988\u4e0e\u5efa\u8bae"},"16.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"\u8de8\u57df\u8bf7\u6c42")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/security/cors?view=aspnetcore-5.0"}),"ASP.NET Core - \u542f\u7528\u8de8\u57df\u8bf7\u6c42")," \u7ae0\u8282\u3002"))))}s.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},O=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),s=p(n),O=a,m=s["".concat(i,".").concat(O)]||s[O]||d[O]||c;return n?r.a.createElement(m,b(b({ref:t},l),{},{components:n})):r.a.createElement(m,b({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=O;var b={};for(var o in t)hasOwnProperty.call(t,o)&&(b[o]=t[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,i[1]=b;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/7696a0ae.d25fd6c2.js b/docs/7696a0ae.d25fd6c2.js deleted file mode 100644 index edcb6d28906..00000000000 --- a/docs/7696a0ae.d25fd6c2.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[49],{125:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(3),i=n(7),c=(n(0),n(192)),o=n(193),a={id:"contribute",title:"30. \u8d21\u732e\u6307\u5357",sidebar_label:"30. \u8d21\u732e\u6307\u5357"},u={unversionedId:"contribute",id:"contribute",isDocsHomePage:!1,title:"30. \u8d21\u732e\u6307\u5357",description:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a",source:"@site/docs\\contribute.mdx",slug:"/contribute",permalink:"/docs/contribute",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/contribute.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"30. \u8d21\u732e\u6307\u5357",sidebar:"docs",previous:{title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",permalink:"/docs/benchmark"},next:{title:"31.1 \u5e38\u89c1\u95ee\u9898",permalink:"/docs/answer"}},l=[{value:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a",id:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a",children:[]},{value:"\u5b89\u5168\u95ee\u9898\u5904\u7406",id:"\u5b89\u5168\u95ee\u9898\u5904\u7406",children:[]},{value:"\u89e3\u51b3\u73b0\u6709\u95ee\u9898",id:"\u89e3\u51b3\u73b0\u6709\u95ee\u9898",children:[]},{value:"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd",id:"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd",children:[]},{value:"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5",id:"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5",children:[]},{value:"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219",id:"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219",children:[]},{value:"\u7f16\u7801\u7ea6\u5b9a",id:"\u7f16\u7801\u7ea6\u5b9a",children:[]},{value:"\u5206\u652f\u5904\u7406\u7ea6\u5b9a",id:"\u5206\u652f\u5904\u7406\u7ea6\u5b9a",children:[]},{value:"\u5408\u5e76 PR \u7684\u5f62\u5f0f",id:"\u5408\u5e76-pr-\u7684\u5f62\u5f0f",children:[]}],b={toc:l};function s(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(o.a,{mdxType:"JoinGroup"}),Object(c.b)("h3",{id:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a"},"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a"),Object(c.b)("p",null,"\u5982\u679c\u60a8\u5728 XXX \u4e2d\u53d1\u73b0\u4e86\u4e00\u4e2a\u4e0d\u5b58\u5728\u5b89\u5168\u95ee\u9898\u7684\u6f0f\u6d1e\uff0c\u8bf7\u5728 XXX \u4ed3\u5e93\u4e2d\u7684 Issues \u4e2d\u641c\u7d22\uff0c\u4ee5\u9632\u8be5\u6f0f\u6d1e\u5df2\u88ab\u63d0\u4ea4\uff0c\u5982\u679c\u627e\u4e0d\u5230\u6f0f\u6d1e\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Issues\uff0c\u5982\u679c\u53d1\u73b0\u4e86\u4e00\u4e2a\u5b89\u5168\u95ee\u9898\u8bf7\u4e0d\u8981\u5c06\u5176\u516c\u5f00\uff0c\u8bf7\u53c2\u9605\u5b89\u5168\u95ee\u9898\u5904\u7406\u65b9\u5f0f\uff0c\u63d0\u4ea4\u9519\u8bef\u62a5\u544a\u65f6\u5e94\u8be5\u8be6\u5c3d\u3002"),Object(c.b)("h3",{id:"\u5b89\u5168\u95ee\u9898\u5904\u7406"},"\u5b89\u5168\u95ee\u9898\u5904\u7406"),Object(c.b)("p",null,"\u672c\u9879\u76ee\u4e2d\u5bf9\u5b89\u5168\u95ee\u9898\u5904\u7406\u7684\u5f62\u5f0f\uff0c\u9879\u76ee\u6838\u5fc3\u4eba\u5458\u786e\u8ba4\u7f16\u8f91\uff0c\u8be5\u90e8\u5206\u5185\u5bb9\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u60c5\u51b5\u6dfb\u52a0\u3002"),Object(c.b)("h3",{id:"\u89e3\u51b3\u73b0\u6709\u95ee\u9898"},"\u89e3\u51b3\u73b0\u6709\u95ee\u9898"),Object(c.b)("p",null,"\u901a\u8fc7\u67e5\u770b\u4ed3\u5e93\u7684 Issues \u5217\u8868\u4f55\u4ee5\u53d1\u73b0\u9700\u8981\u5904\u7406\u7684\u95ee\u9898\u4fe1\u606f\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u89e3\u51b3\u5176\u4e2d\u7684\u67d0\u4e2a\u95ee\u9898\u3002"),Object(c.b)("h3",{id:"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd"},"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd"),Object(c.b)("p",null,"\u63d0\u51fa\u65b0\u529f\u80fd\u6709\u4e9b\u9879\u76ee\u4f7f\u7528 Issues \u7684 Feature \u6807\u7b7e\u8fdb\u884c\u7ba1\u7406\uff0c\u6709\u4e9b\u5219\u901a\u8fc7\u90ae\u4ef6\u7684\u5f62\u5f0f\u7edf\u4e00\u6536\u96c6\uff0c\u5728\u6536\u96c6\u540e\u9879\u76ee\u5185\u4eba\u5458\u4f1a\u8fdb\u884c\u786e\u8ba4\u5f00\u53d1\uff0c\u4e00\u822c\u7684\u5c06\u786e\u8ba4\u5f00\u53d1\u7684\u529f\u80fd\u4f1a\u653e\u5165\u4e0b\u4e00\u4e2a\u7248\u672c\u7684\u4efb\u52a1\u5217\u8868\u3002"),Object(c.b)("h3",{id:"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5"},"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5"),Object(c.b)("p",null,"\u5982\u679c\u662f\u901a\u8fc7 Git \u7ba1\u7406\u53ef\u4ee5\u4ece ",Object(c.b)("inlineCode",{parentName:"p"},"git clone xxx")," \u5f00\u59cb\u7f16\u5199\uff0c\u5c06\u5f00\u53d1\u73af\u5883\u7684\u914d\u7f6e\u4fe1\u606f\uff0cIDE \u7684\u8bbe\u7f6e\u7b49\u4fe1\u606f\u914d\u7f6e\u6587\u6863\u7f16\u5199\u3002"),Object(c.b)("h3",{id:"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219"},"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219"),Object(c.b)("ol",null,Object(c.b)("li",{parentName:"ol"},"\u4f7f\u7528\u73b0\u5728\u65f6\u6001"),Object(c.b)("li",{parentName:"ol"},"\u7b2c\u4e00\u884c\u5b57\u6570\u9650\u5236"),Object(c.b)("li",{parentName:"ol"},"\u63d0\u4ea4\u5185\u5bb9\u7684\u7ea6\u675f")),Object(c.b)("h3",{id:"\u7f16\u7801\u7ea6\u5b9a"},"\u7f16\u7801\u7ea6\u5b9a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u9879\u76ee\u5185\u7f16\u7801\u7ea6\u5b9a\u6587\u4ef6\uff1a",Object(c.b)("inlineCode",{parentName:"li"},".editorconfig"))),Object(c.b)("h3",{id:"\u5206\u652f\u5904\u7406\u7ea6\u5b9a"},"\u5206\u652f\u5904\u7406\u7ea6\u5b9a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u5206\u652f\u5904\u7406\u5f62\u5f0f\uff0c\u5982 gitFlow")),Object(c.b)("h3",{id:"\u5408\u5e76-pr-\u7684\u5f62\u5f0f"},"\u5408\u5e76 PR \u7684\u5f62\u5f0f"),Object(c.b)("p",null,"\u5728\u4ec0\u4e48\u60c5\u51b5\u4e0b\u53ef\u4ee5\u5408\u5e76\u5230 master/main\uff1a"),Object(c.b)("ol",null,Object(c.b)("li",{parentName:"ol"},"\u901a\u8fc7 CI"),Object(c.b)("li",{parentName:"ol"},"\u4e24\u4e2a\u53ca\u4ee5\u4e0a\u7684\u7ef4\u62a4\u8005\u901a\u8fc7."),Object(c.b)("li",{parentName:"ol"},"\u6700\u65b0\u7248\u672c")))}s.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=i.a.createContext({}),b=function(e){var t=i.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},s=function(e){var t=b(e.components);return i.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,o=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=b(n),d=r,f=s["".concat(o,".").concat(d)]||s[d]||p[d]||c;return n?i.a.createElement(f,a(a({ref:t},l),{},{components:n})):i.a.createElement(f,a({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,o=new Array(c);o[0]=d;var a={};for(var u in t)hasOwnProperty.call(t,u)&&(a[u]=t[u]);a.originalType=e,a.mdxType="string"==typeof e?e:r,o[1]=a;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/7696a0ae.f4c544eb.js b/docs/7696a0ae.f4c544eb.js new file mode 100644 index 00000000000..b5171afc1ee --- /dev/null +++ b/docs/7696a0ae.f4c544eb.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{128:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(3),c=n(7),i=(n(0),n(196)),o=n(197),a={id:"contribute",title:"30. \u8d21\u732e\u6307\u5357",sidebar_label:"30. \u8d21\u732e\u6307\u5357"},u={unversionedId:"contribute",id:"contribute",isDocsHomePage:!1,title:"30. \u8d21\u732e\u6307\u5357",description:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a",source:"@site/docs\\contribute.mdx",slug:"/contribute",permalink:"/docs/contribute",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/contribute.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"30. \u8d21\u732e\u6307\u5357",sidebar:"docs",previous:{title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",permalink:"/docs/benchmark"}},l=[{value:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a",id:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a",children:[]},{value:"\u5b89\u5168\u95ee\u9898\u5904\u7406",id:"\u5b89\u5168\u95ee\u9898\u5904\u7406",children:[]},{value:"\u89e3\u51b3\u73b0\u6709\u95ee\u9898",id:"\u89e3\u51b3\u73b0\u6709\u95ee\u9898",children:[]},{value:"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd",id:"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd",children:[]},{value:"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5",id:"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5",children:[]},{value:"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219",id:"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219",children:[]},{value:"\u7f16\u7801\u7ea6\u5b9a",id:"\u7f16\u7801\u7ea6\u5b9a",children:[]},{value:"\u5206\u652f\u5904\u7406\u7ea6\u5b9a",id:"\u5206\u652f\u5904\u7406\u7ea6\u5b9a",children:[]},{value:"\u5408\u5e76 PR \u7684\u5f62\u5f0f",id:"\u5408\u5e76-pr-\u7684\u5f62\u5f0f",children:[]}],b={toc:l};function s(e){var t=e.components,n=Object(c.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h3",{id:"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a"},"\u63d0\u4ea4\u9519\u8bef\u62a5\u544a"),Object(i.b)("p",null,"\u5982\u679c\u60a8\u5728 XXX \u4e2d\u53d1\u73b0\u4e86\u4e00\u4e2a\u4e0d\u5b58\u5728\u5b89\u5168\u95ee\u9898\u7684\u6f0f\u6d1e\uff0c\u8bf7\u5728 XXX \u4ed3\u5e93\u4e2d\u7684 Issues \u4e2d\u641c\u7d22\uff0c\u4ee5\u9632\u8be5\u6f0f\u6d1e\u5df2\u88ab\u63d0\u4ea4\uff0c\u5982\u679c\u627e\u4e0d\u5230\u6f0f\u6d1e\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Issues\uff0c\u5982\u679c\u53d1\u73b0\u4e86\u4e00\u4e2a\u5b89\u5168\u95ee\u9898\u8bf7\u4e0d\u8981\u5c06\u5176\u516c\u5f00\uff0c\u8bf7\u53c2\u9605\u5b89\u5168\u95ee\u9898\u5904\u7406\u65b9\u5f0f\uff0c\u63d0\u4ea4\u9519\u8bef\u62a5\u544a\u65f6\u5e94\u8be5\u8be6\u5c3d\u3002"),Object(i.b)("h3",{id:"\u5b89\u5168\u95ee\u9898\u5904\u7406"},"\u5b89\u5168\u95ee\u9898\u5904\u7406"),Object(i.b)("p",null,"\u672c\u9879\u76ee\u4e2d\u5bf9\u5b89\u5168\u95ee\u9898\u5904\u7406\u7684\u5f62\u5f0f\uff0c\u9879\u76ee\u6838\u5fc3\u4eba\u5458\u786e\u8ba4\u7f16\u8f91\uff0c\u8be5\u90e8\u5206\u5185\u5bb9\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u60c5\u51b5\u6dfb\u52a0\u3002"),Object(i.b)("h3",{id:"\u89e3\u51b3\u73b0\u6709\u95ee\u9898"},"\u89e3\u51b3\u73b0\u6709\u95ee\u9898"),Object(i.b)("p",null,"\u901a\u8fc7\u67e5\u770b\u4ed3\u5e93\u7684 Issues \u5217\u8868\u4f55\u4ee5\u53d1\u73b0\u9700\u8981\u5904\u7406\u7684\u95ee\u9898\u4fe1\u606f\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u89e3\u51b3\u5176\u4e2d\u7684\u67d0\u4e2a\u95ee\u9898\u3002"),Object(i.b)("h3",{id:"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd"},"\u5982\u4f55\u63d0\u51fa\u65b0\u529f\u80fd"),Object(i.b)("p",null,"\u63d0\u51fa\u65b0\u529f\u80fd\u6709\u4e9b\u9879\u76ee\u4f7f\u7528 Issues \u7684 Feature \u6807\u7b7e\u8fdb\u884c\u7ba1\u7406\uff0c\u6709\u4e9b\u5219\u901a\u8fc7\u90ae\u4ef6\u7684\u5f62\u5f0f\u7edf\u4e00\u6536\u96c6\uff0c\u5728\u6536\u96c6\u540e\u9879\u76ee\u5185\u4eba\u5458\u4f1a\u8fdb\u884c\u786e\u8ba4\u5f00\u53d1\uff0c\u4e00\u822c\u7684\u5c06\u786e\u8ba4\u5f00\u53d1\u7684\u529f\u80fd\u4f1a\u653e\u5165\u4e0b\u4e00\u4e2a\u7248\u672c\u7684\u4efb\u52a1\u5217\u8868\u3002"),Object(i.b)("h3",{id:"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5"},"\u5982\u4f55\u8bbe\u7f6e\u5f00\u53d1\u73af\u5883\u5e76\u8fd0\u884c\u6d4b\u8bd5"),Object(i.b)("p",null,"\u5982\u679c\u662f\u901a\u8fc7 Git \u7ba1\u7406\u53ef\u4ee5\u4ece ",Object(i.b)("inlineCode",{parentName:"p"},"git clone xxx")," \u5f00\u59cb\u7f16\u5199\uff0c\u5c06\u5f00\u53d1\u73af\u5883\u7684\u914d\u7f6e\u4fe1\u606f\uff0cIDE \u7684\u8bbe\u7f6e\u7b49\u4fe1\u606f\u914d\u7f6e\u6587\u6863\u7f16\u5199\u3002"),Object(i.b)("h3",{id:"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219"},"\u53d8\u66f4\u65e5\u5fd7\u586b\u5199\u89c4\u5219"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},"\u4f7f\u7528\u73b0\u5728\u65f6\u6001"),Object(i.b)("li",{parentName:"ol"},"\u7b2c\u4e00\u884c\u5b57\u6570\u9650\u5236"),Object(i.b)("li",{parentName:"ol"},"\u63d0\u4ea4\u5185\u5bb9\u7684\u7ea6\u675f")),Object(i.b)("h3",{id:"\u7f16\u7801\u7ea6\u5b9a"},"\u7f16\u7801\u7ea6\u5b9a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u9879\u76ee\u5185\u7f16\u7801\u7ea6\u5b9a\u6587\u4ef6\uff1a",Object(i.b)("inlineCode",{parentName:"li"},".editorconfig"))),Object(i.b)("h3",{id:"\u5206\u652f\u5904\u7406\u7ea6\u5b9a"},"\u5206\u652f\u5904\u7406\u7ea6\u5b9a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5206\u652f\u5904\u7406\u5f62\u5f0f\uff0c\u5982 gitFlow")),Object(i.b)("h3",{id:"\u5408\u5e76-pr-\u7684\u5f62\u5f0f"},"\u5408\u5e76 PR \u7684\u5f62\u5f0f"),Object(i.b)("p",null,"\u5728\u4ec0\u4e48\u60c5\u51b5\u4e0b\u53ef\u4ee5\u5408\u5e76\u5230 master/main\uff1a"),Object(i.b)("ol",null,Object(i.b)("li",{parentName:"ol"},"\u901a\u8fc7 CI"),Object(i.b)("li",{parentName:"ol"},"\u4e24\u4e2a\u53ca\u4ee5\u4e0a\u7684\u7ef4\u62a4\u8005\u901a\u8fc7."),Object(i.b)("li",{parentName:"ol"},"\u6700\u65b0\u7248\u672c")))}s.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var r=n(21),c=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(c.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return c}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return f}));var r=n(0),c=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var l=c.a.createContext({}),b=function(e){var t=c.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},s=function(e){var t=b(e.components);return c.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},d=c.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=b(n),d=r,f=s["".concat(o,".").concat(d)]||s[d]||p[d]||i;return n?c.a.createElement(f,a(a({ref:t},l),{},{components:n})):c.a.createElement(f,a({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=d;var a={};for(var u in t)hasOwnProperty.call(t,u)&&(a[u]=t[u]);a.originalType=e,a.mdxType="string"==typeof e?e:r,o[1]=a;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/7b4b163f.22d726d3.js b/docs/7b4b163f.013d137b.js similarity index 97% rename from docs/7b4b163f.22d726d3.js rename to docs/7b4b163f.013d137b.js index aea7516624b..86c773c42c7 100644 --- a/docs/7b4b163f.22d726d3.js +++ b/docs/7b4b163f.013d137b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[50],{126:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return i})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return u}));var a=t(3),o=t(7),r=(t(0),t(192)),c=t(193),i={id:"dbcontext-Interceptor",title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",sidebar_label:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668"},l={unversionedId:"dbcontext-Interceptor",id:"dbcontext-Interceptor",isDocsHomePage:!1,title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",description:"9.24.1 \u6570\u636e\u5e93\u62e6\u622a\u5668",source:"@site/docs\\dbcontext-Interceptor.mdx",slug:"/dbcontext-Interceptor",permalink:"/docs/dbcontext-Interceptor",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-Interceptor.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",sidebar:"docs",previous:{title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",permalink:"/docs/dbcontext-filter"},next:{title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",permalink:"/docs/dbcontext-entitytrigger"}},s=[{value:"9.24.1 \u6570\u636e\u5e93\u62e6\u622a\u5668",id:"9241-\u6570\u636e\u5e93\u62e6\u622a\u5668",children:[]},{value:"9.24.2 \u652f\u6301\u62e6\u622a\u7c7b\u578b",id:"9242-\u652f\u6301\u62e6\u622a\u7c7b\u578b",children:[{value:"9.24.2.1 DbConnectionInterceptor",id:"92421-dbconnectioninterceptor",children:[]},{value:"9.24.2.2 DbCommandInterceptor",id:"92422-dbcommandinterceptor",children:[]},{value:"9.24.2.3 SaveChangesInterceptor",id:"92423-savechangesinterceptor",children:[]},{value:"9.24.2.4 SavedChangesEvent \u62e6\u622a",id:"92424-savedchangesevent-\u62e6\u622a",children:[]}]},{value:"9.24.3 \u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668",id:"9243-\u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668",children:[]},{value:"9.24.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9244-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:s};function u(e){var n=e.components,t=Object(o.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"9241-\u6570\u636e\u5e93\u62e6\u622a\u5668"},"9.24.1 \u6570\u636e\u5e93\u62e6\u622a\u5668"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u56db\u79cd\u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u62e6\u622a\u5668\u52a8\u6001\u4fee\u6539\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u52a8\u6001\u4fee\u6539 sql\uff0c\u52a8\u6001\u66f4\u6539\u53c2\u6570\u7b49\u64cd\u4f5c\u3002"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u652f\u6301\u8fd9\u56db\u79cd\u62e6\u622a\u5668\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DbConnectionInterceptor"),"\uff1a\u6570\u636e\u5e93\u8fde\u63a5\u62e6\u622a\u5668"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DbCommandInterceptor"),"\uff1a\u6570\u636e\u5e93\u6267\u884c ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u62e6\u622a\u5668"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SaveChangesInterceptor"),"\uff1a\u63d0\u4ea4\u5230\u6570\u636e\u5e93\u62e6\u622a\u5668"),Object(r.b)("li",{parentName:"ul"},"\u5728\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u91cd\u5199 ",Object(r.b)("inlineCode",{parentName:"li"},"SavedChangesEvent")," \u76f8\u5173\u4e8b\u4ef6")),Object(r.b)("h2",{id:"9242-\u652f\u6301\u62e6\u622a\u7c7b\u578b"},"9.24.2 \u652f\u6301\u62e6\u622a\u7c7b\u578b"),Object(r.b)("h3",{id:"92421-dbconnectioninterceptor"},"9.24.2.1 ",Object(r.b)("inlineCode",{parentName:"h3"},"DbConnectionInterceptor")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Microsoft.EntityFrameworkCore.Diagnostics;\nusing System.Data.Common;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Furion.DatabaseAccessor.Interceptors\n{\n public class SqlConnectionInterceptor : DbConnectionInterceptor\n {\n // \u6570\u636e\u5e93\u8fde\u63a5\u4e4b\u524d\n public override InterceptionResult ConnectionOpening(DbConnection connection, ConnectionEventData eventData, InterceptionResult result)\n {\n return base.ConnectionOpening(connection, eventData, result);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask ConnectionOpeningAsync(DbConnection connection, ConnectionEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.ConnectionOpeningAsync(connection, eventData, result, cancellationToken);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u6210\u529f\n public override void ConnectionOpened(DbConnection connection, ConnectionEndEventData eventData)\n {\n base.ConnectionOpened(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u6210\u529f\uff08\u5f02\u6b65\uff09\n public override Task ConnectionOpenedAsync(DbConnection connection, ConnectionEndEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.ConnectionOpenedAsync(connection, eventData, cancellationToken);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u4e4b\u524d\n public override InterceptionResult ConnectionClosing(DbConnection connection, ConnectionEventData eventData, InterceptionResult result)\n {\n return base.ConnectionClosing(connection, eventData, result);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask ConnectionClosingAsync(DbConnection connection, ConnectionEventData eventData, InterceptionResult result)\n {\n return base.ConnectionClosingAsync(connection, eventData, result);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u6210\u529f\n public override void ConnectionClosed(DbConnection connection, ConnectionEndEventData eventData)\n {\n base.ConnectionClosed(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u6210\u529f\uff08\u5f02\u6b65\uff09\n public override Task ConnectionClosedAsync(DbConnection connection, ConnectionEndEventData eventData)\n {\n return base.ConnectionClosedAsync(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\n public override void ConnectionFailed(DbConnection connection, ConnectionErrorEventData eventData)\n {\n base.ConnectionFailed(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff08\u5f02\u6b65\uff09\n public override Task ConnectionFailedAsync(DbConnection connection, ConnectionErrorEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.ConnectionFailedAsync(connection, eventData, cancellationToken);\n }\n }\n}\n")),Object(r.b)("h3",{id:"92422-dbcommandinterceptor"},"9.24.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"DbCommandInterceptor")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Microsoft.EntityFrameworkCore.Diagnostics;\nusing System.Data.Common;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Furion.DatabaseAccessor\n{\n internal sealed class SqlCommandProfilerInterceptor : DbCommandInterceptor\n {\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u4e4b\u524d\n public override InterceptionResult CommandCreating(CommandCorrelatedEventData eventData, InterceptionResult result)\n {\n return base.CommandCreating(eventData, result);\n }\n\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u4e4b\u540e\n public override DbCommand CommandCreated(CommandEndEventData eventData, DbCommand result)\n {\n return base.CommandCreated(eventData, result);\n }\n\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u5931\u8d25\n public override void CommandFailed(DbCommand command, CommandErrorEventData eventData)\n {\n base.CommandFailed(command, eventData);\n }\n\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u5931\u8d25\uff08\u5f02\u6b65\uff09\n public override Task CommandFailedAsync(DbCommand command, CommandErrorEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.CommandFailedAsync(command, eventData, cancellationToken);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u524d\n public override InterceptionResult ReaderExecuting(DbCommand command, CommandEventData eventData, InterceptionResult result)\n {\n return base.ReaderExecuting(command, eventData, result);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> ReaderExecutingAsync(DbCommand command, CommandEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.ReaderExecutingAsync(command, eventData, result, cancellationToken);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u540e\n public override DbDataReader ReaderExecuted(DbCommand command, CommandExecutedEventData eventData, DbDataReader result)\n {\n return base.ReaderExecuted(command, eventData, result);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask ReaderExecutedAsync(DbCommand command, CommandExecutedEventData eventData, DbDataReader result, CancellationToken cancellationToken = default)\n {\n return base.ReaderExecutedAsync(command, eventData, result, cancellationToken);\n }\n\n // DataReader \u5bf9\u8c61\u91ca\u653e\u4e4b\u524d\n public override InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData, InterceptionResult result)\n {\n return base.DataReaderDisposing(command, eventData, result);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u524d\n public override InterceptionResult NonQueryExecuting(DbCommand command, CommandEventData eventData, InterceptionResult result)\n {\n return base.NonQueryExecuting(command, eventData, result);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> NonQueryExecutingAsync(DbCommand command, CommandEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.NonQueryExecutingAsync(command, eventData, result, cancellationToken);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u540e\n public override int NonQueryExecuted(DbCommand command, CommandExecutedEventData eventData, int result)\n {\n return base.NonQueryExecuted(command, eventData, result);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask NonQueryExecutedAsync(DbCommand command, CommandExecutedEventData eventData, int result, CancellationToken cancellationToken = default)\n {\n return base.NonQueryExecutedAsync(command, eventData, result, cancellationToken);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u524d\n public override InterceptionResult ScalarExecuting(DbCommand command, CommandEventData eventData, InterceptionResult result)\n {\n return base.ScalarExecuting(command, eventData, result);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> ScalarExecutingAsync(DbCommand command, CommandEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.ScalarExecutingAsync(command, eventData, result, cancellationToken);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u540e\n public override object ScalarExecuted(DbCommand command, CommandExecutedEventData eventData, object result)\n {\n return base.ScalarExecuted(command, eventData, result);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask ScalarExecutedAsync(DbCommand command, CommandExecutedEventData eventData, object result, CancellationToken cancellationToken = default)\n {\n return base.ScalarExecutedAsync(command, eventData, result, cancellationToken);\n }\n }\n}\n")),Object(r.b)("h3",{id:"92423-savechangesinterceptor"},"9.24.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"SaveChangesInterceptor")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Microsoft.EntityFrameworkCore.Diagnostics;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Furion.DatabaseAccessor\n{\n public class DbContextSaveChangesInterceptor : SaveChangesInterceptor\n {\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u524d\n public override InterceptionResult SavingChanges(DbContextEventData eventData, InterceptionResult result)\n {\n return base.SavingChanges(eventData, result);\n }\n\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> SavingChangesAsync(DbContextEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.SavingChangesAsync(eventData, result, cancellationToken);\n }\n\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u540e\n public override int SavedChanges(SaveChangesCompletedEventData eventData, int result)\n {\n return base.SavedChanges(eventData, result);\n }\n\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask SavedChangesAsync(SaveChangesCompletedEventData eventData, int result, CancellationToken cancellationToken = default)\n {\n return base.SavedChangesAsync(eventData, result, cancellationToken);\n }\n\n // \u63d0\u4ea4\u6570\u636e\u5e93\u5931\u8d25\n public override void SaveChangesFailed(DbContextErrorEventData eventData)\n {\n base.SaveChangesFailed(eventData);\n }\n\n // \u63d0\u4ea4\u6570\u636e\u5e93\u5931\u8d25\uff08\u5f02\u6b65\uff09\n public override Task SaveChangesFailedAsync(DbContextErrorEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.SaveChangesFailedAsync(eventData, cancellationToken);\n }\n }\n}\n")),Object(r.b)("h3",{id:"92424-savedchangesevent-\u62e6\u622a"},"9.24.2.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"SavedChangesEvent")," \u62e6\u622a"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e3a\u6240\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b50\u7c7b\u90fd\u63d0\u4f9b\u4e86\u4e09\u4e2a\u53ef\u91cd\u5199\u7684\u65b9\u6cd5\uff0c\u8fd9\u4e09\u4e2a\u65b9\u6cd5\u5206\u522b\u7531\u4e09\u4e2a\u4e8b\u4ef6\u89e6\u53d1\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u524d SavingChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(r.b)("inlineCode",{parentName:"li"},"void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)")," \u65b9\u6cd5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u540e SavedChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(r.b)("inlineCode",{parentName:"li"},"void SavedChangesEvent(SaveChangesCompletedEventData eventData, int result)")," \u65b9\u6cd5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u5931\u8d25 SaveChangesFailed \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(r.b)("inlineCode",{parentName:"li"},"void SaveChangesFailedEvent(DbContextErrorEventData eventData)")," \u65b9\u6cd5")),Object(r.b)("p",null,"\u901a\u8fc7\u8fd9\u4e09\u4e2a\u4e8b\u4ef6\u6211\u4eec\u53ef\u4ee5",Object(r.b)("strong",{parentName:"p"},"\u5728\u6570\u636e\u5e93\u505a\u589e\u3001\u5220\u3001\u6539\u65f6\u5019\u505a\u62e6\u622a\uff0c\u6bd4\u5982\u8bbe\u7f6e\u521b\u5efa\u65f6\u95f4\u3001\u66f4\u65b0\u65f6\u95f4\u6216\u5176\u4ed6\u9ed8\u8ba4\u64cd\u4f5c"),"\u3002"),Object(r.b)("p",null,"\u5982\u81ea\u52a8\u6dfb\u52a0\u79df\u6237 Id\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)\n{\n // \u83b7\u53d6\u5f53\u524d\u4e8b\u4ef6\u5bf9\u5e94\u4e0a\u4e0b\u6587\n var dbContext = eventData.Context;\n\n // \u83b7\u53d6\u6240\u6709\u65b0\u589e\u548c\u66f4\u65b0\u7684\u5b9e\u4f53\n var entities = dbContext.ChangeTracker.Entries()\n .Where(u => u.State == EntityState.Added || u.State == EntityState.Modified);\n\n foreach (var entity in entities)\n {\n switch (entity.State)\n {\n // \u81ea\u52a8\u8bbe\u7f6e\u79df\u6237Id\n case EntityState.Added:\n entity.Property(nameof(Entity.TenantId)).CurrentValue = GetTenantId();\n break;\n // \u6392\u9664\u79df\u6237Id\n case EntityState.Modified:\n entity.Property(nameof(Entity.TenantId)).IsModified = false;\n break;\n }\n }\n}\n")),Object(r.b)("h2",{id:"9243-\u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668"},"9.24.3 \u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668"),Object(r.b)("p",null,"\u5b9a\u4e49\u597d\u8fc7\u6ee4\u5668\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u5728\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u6ce8\u518c\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddDbPool(interceptors: new IInterceptor[] {\n new YourSqlConnectionProfilerInterceptor(),\n new YourDbContextSaveChangesInterceptor(),\n new YourSqlCommandProfilerInterceptor()\n});\n")),Object(r.b)("h2",{id:"9244-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.24.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),o=t(191);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(o.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return p}));var a=t(0),o=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=o.a.createContext({}),d=function(e){var n=o.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},u=function(e){var n=d(e.components);return o.a.createElement(s.Provider,{value:n},e.children)},b={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},m=o.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=d(t),m=a,p=u["".concat(c,".").concat(m)]||u[m]||b[m]||r;return t?o.a.createElement(p,i(i({ref:n},s),{},{components:t})):o.a.createElement(p,i({ref:n},s))}));function p(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=m;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,c[1]=i;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{129:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return i})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return u}));var a=t(3),o=t(7),r=(t(0),t(196)),c=t(197),i={id:"dbcontext-Interceptor",title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",sidebar_label:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668"},l={unversionedId:"dbcontext-Interceptor",id:"dbcontext-Interceptor",isDocsHomePage:!1,title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",description:"9.24.1 \u6570\u636e\u5e93\u62e6\u622a\u5668",source:"@site/docs\\dbcontext-Interceptor.mdx",slug:"/dbcontext-Interceptor",permalink:"/docs/dbcontext-Interceptor",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-Interceptor.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",sidebar:"docs",previous:{title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",permalink:"/docs/dbcontext-filter"},next:{title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",permalink:"/docs/dbcontext-entitytrigger"}},s=[{value:"9.24.1 \u6570\u636e\u5e93\u62e6\u622a\u5668",id:"9241-\u6570\u636e\u5e93\u62e6\u622a\u5668",children:[]},{value:"9.24.2 \u652f\u6301\u62e6\u622a\u7c7b\u578b",id:"9242-\u652f\u6301\u62e6\u622a\u7c7b\u578b",children:[{value:"9.24.2.1 DbConnectionInterceptor",id:"92421-dbconnectioninterceptor",children:[]},{value:"9.24.2.2 DbCommandInterceptor",id:"92422-dbcommandinterceptor",children:[]},{value:"9.24.2.3 SaveChangesInterceptor",id:"92423-savechangesinterceptor",children:[]},{value:"9.24.2.4 SavedChangesEvent \u62e6\u622a",id:"92424-savedchangesevent-\u62e6\u622a",children:[]}]},{value:"9.24.3 \u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668",id:"9243-\u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668",children:[]},{value:"9.24.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9244-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:s};function u(e){var n=e.components,t=Object(o.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"9241-\u6570\u636e\u5e93\u62e6\u622a\u5668"},"9.24.1 \u6570\u636e\u5e93\u62e6\u622a\u5668"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u56db\u79cd\u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668\uff0c\u53ef\u4ee5\u901a\u8fc7\u62e6\u622a\u5668\u52a8\u6001\u4fee\u6539\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u52a8\u6001\u4fee\u6539 sql\uff0c\u52a8\u6001\u66f4\u6539\u53c2\u6570\u7b49\u64cd\u4f5c\u3002"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u652f\u6301\u8fd9\u56db\u79cd\u62e6\u622a\u5668\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DbConnectionInterceptor"),"\uff1a\u6570\u636e\u5e93\u8fde\u63a5\u62e6\u622a\u5668"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DbCommandInterceptor"),"\uff1a\u6570\u636e\u5e93\u6267\u884c ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u62e6\u622a\u5668"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SaveChangesInterceptor"),"\uff1a\u63d0\u4ea4\u5230\u6570\u636e\u5e93\u62e6\u622a\u5668"),Object(r.b)("li",{parentName:"ul"},"\u5728\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u91cd\u5199 ",Object(r.b)("inlineCode",{parentName:"li"},"SavedChangesEvent")," \u76f8\u5173\u4e8b\u4ef6")),Object(r.b)("h2",{id:"9242-\u652f\u6301\u62e6\u622a\u7c7b\u578b"},"9.24.2 \u652f\u6301\u62e6\u622a\u7c7b\u578b"),Object(r.b)("h3",{id:"92421-dbconnectioninterceptor"},"9.24.2.1 ",Object(r.b)("inlineCode",{parentName:"h3"},"DbConnectionInterceptor")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Microsoft.EntityFrameworkCore.Diagnostics;\nusing System.Data.Common;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Furion.DatabaseAccessor.Interceptors\n{\n public class SqlConnectionInterceptor : DbConnectionInterceptor\n {\n // \u6570\u636e\u5e93\u8fde\u63a5\u4e4b\u524d\n public override InterceptionResult ConnectionOpening(DbConnection connection, ConnectionEventData eventData, InterceptionResult result)\n {\n return base.ConnectionOpening(connection, eventData, result);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask ConnectionOpeningAsync(DbConnection connection, ConnectionEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.ConnectionOpeningAsync(connection, eventData, result, cancellationToken);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u6210\u529f\n public override void ConnectionOpened(DbConnection connection, ConnectionEndEventData eventData)\n {\n base.ConnectionOpened(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u6210\u529f\uff08\u5f02\u6b65\uff09\n public override Task ConnectionOpenedAsync(DbConnection connection, ConnectionEndEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.ConnectionOpenedAsync(connection, eventData, cancellationToken);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u4e4b\u524d\n public override InterceptionResult ConnectionClosing(DbConnection connection, ConnectionEventData eventData, InterceptionResult result)\n {\n return base.ConnectionClosing(connection, eventData, result);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask ConnectionClosingAsync(DbConnection connection, ConnectionEventData eventData, InterceptionResult result)\n {\n return base.ConnectionClosingAsync(connection, eventData, result);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u6210\u529f\n public override void ConnectionClosed(DbConnection connection, ConnectionEndEventData eventData)\n {\n base.ConnectionClosed(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5173\u95ed\u6210\u529f\uff08\u5f02\u6b65\uff09\n public override Task ConnectionClosedAsync(DbConnection connection, ConnectionEndEventData eventData)\n {\n return base.ConnectionClosedAsync(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\n public override void ConnectionFailed(DbConnection connection, ConnectionErrorEventData eventData)\n {\n base.ConnectionFailed(connection, eventData);\n }\n\n // \u6570\u636e\u5e93\u8fde\u63a5\u5931\u8d25\uff08\u5f02\u6b65\uff09\n public override Task ConnectionFailedAsync(DbConnection connection, ConnectionErrorEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.ConnectionFailedAsync(connection, eventData, cancellationToken);\n }\n }\n}\n")),Object(r.b)("h3",{id:"92422-dbcommandinterceptor"},"9.24.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"DbCommandInterceptor")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Microsoft.EntityFrameworkCore.Diagnostics;\nusing System.Data.Common;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Furion.DatabaseAccessor\n{\n internal sealed class SqlCommandProfilerInterceptor : DbCommandInterceptor\n {\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u4e4b\u524d\n public override InterceptionResult CommandCreating(CommandCorrelatedEventData eventData, InterceptionResult result)\n {\n return base.CommandCreating(eventData, result);\n }\n\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u4e4b\u540e\n public override DbCommand CommandCreated(CommandEndEventData eventData, DbCommand result)\n {\n return base.CommandCreated(eventData, result);\n }\n\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u5931\u8d25\n public override void CommandFailed(DbCommand command, CommandErrorEventData eventData)\n {\n base.CommandFailed(command, eventData);\n }\n\n // \u521b\u5efa\u547d\u4ee4\u5bf9\u8c61\u5931\u8d25\uff08\u5f02\u6b65\uff09\n public override Task CommandFailedAsync(DbCommand command, CommandErrorEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.CommandFailedAsync(command, eventData, cancellationToken);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u524d\n public override InterceptionResult ReaderExecuting(DbCommand command, CommandEventData eventData, InterceptionResult result)\n {\n return base.ReaderExecuting(command, eventData, result);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> ReaderExecutingAsync(DbCommand command, CommandEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.ReaderExecutingAsync(command, eventData, result, cancellationToken);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u540e\n public override DbDataReader ReaderExecuted(DbCommand command, CommandExecutedEventData eventData, DbDataReader result)\n {\n return base.ReaderExecuted(command, eventData, result);\n }\n\n // \u8bfb\u53d6\u6570\u636e\u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask ReaderExecutedAsync(DbCommand command, CommandExecutedEventData eventData, DbDataReader result, CancellationToken cancellationToken = default)\n {\n return base.ReaderExecutedAsync(command, eventData, result, cancellationToken);\n }\n\n // DataReader \u5bf9\u8c61\u91ca\u653e\u4e4b\u524d\n public override InterceptionResult DataReaderDisposing(DbCommand command, DataReaderDisposingEventData eventData, InterceptionResult result)\n {\n return base.DataReaderDisposing(command, eventData, result);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u524d\n public override InterceptionResult NonQueryExecuting(DbCommand command, CommandEventData eventData, InterceptionResult result)\n {\n return base.NonQueryExecuting(command, eventData, result);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> NonQueryExecutingAsync(DbCommand command, CommandEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.NonQueryExecutingAsync(command, eventData, result, cancellationToken);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u540e\n public override int NonQueryExecuted(DbCommand command, CommandExecutedEventData eventData, int result)\n {\n return base.NonQueryExecuted(command, eventData, result);\n }\n\n // \u65e0\u67e5\u8be2\u6267\u884c sql \u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask NonQueryExecutedAsync(DbCommand command, CommandExecutedEventData eventData, int result, CancellationToken cancellationToken = default)\n {\n return base.NonQueryExecutedAsync(command, eventData, result, cancellationToken);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u524d\n public override InterceptionResult ScalarExecuting(DbCommand command, CommandEventData eventData, InterceptionResult result)\n {\n return base.ScalarExecuting(command, eventData, result);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> ScalarExecutingAsync(DbCommand command, CommandEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.ScalarExecutingAsync(command, eventData, result, cancellationToken);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u540e\n public override object ScalarExecuted(DbCommand command, CommandExecutedEventData eventData, object result)\n {\n return base.ScalarExecuted(command, eventData, result);\n }\n\n // \u6267\u884c sql \u8fd4\u56de\u5355\u884c\u5355\u5217\u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask ScalarExecutedAsync(DbCommand command, CommandExecutedEventData eventData, object result, CancellationToken cancellationToken = default)\n {\n return base.ScalarExecutedAsync(command, eventData, result, cancellationToken);\n }\n }\n}\n")),Object(r.b)("h3",{id:"92423-savechangesinterceptor"},"9.24.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"SaveChangesInterceptor")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Microsoft.EntityFrameworkCore.Diagnostics;\nusing System.Threading;\nusing System.Threading.Tasks;\n\nnamespace Furion.DatabaseAccessor\n{\n public class DbContextSaveChangesInterceptor : SaveChangesInterceptor\n {\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u524d\n public override InterceptionResult SavingChanges(DbContextEventData eventData, InterceptionResult result)\n {\n return base.SavingChanges(eventData, result);\n }\n\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u524d\uff08\u5f02\u6b65\uff09\n public override ValueTask> SavingChangesAsync(DbContextEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)\n {\n return base.SavingChangesAsync(eventData, result, cancellationToken);\n }\n\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u540e\n public override int SavedChanges(SaveChangesCompletedEventData eventData, int result)\n {\n return base.SavedChanges(eventData, result);\n }\n\n // \u63d0\u4ea4\u5230\u6570\u636e\u5e93\u4e4b\u540e\uff08\u5f02\u6b65\uff09\n public override ValueTask SavedChangesAsync(SaveChangesCompletedEventData eventData, int result, CancellationToken cancellationToken = default)\n {\n return base.SavedChangesAsync(eventData, result, cancellationToken);\n }\n\n // \u63d0\u4ea4\u6570\u636e\u5e93\u5931\u8d25\n public override void SaveChangesFailed(DbContextErrorEventData eventData)\n {\n base.SaveChangesFailed(eventData);\n }\n\n // \u63d0\u4ea4\u6570\u636e\u5e93\u5931\u8d25\uff08\u5f02\u6b65\uff09\n public override Task SaveChangesFailedAsync(DbContextErrorEventData eventData, CancellationToken cancellationToken = default)\n {\n return base.SaveChangesFailedAsync(eventData, cancellationToken);\n }\n }\n}\n")),Object(r.b)("h3",{id:"92424-savedchangesevent-\u62e6\u622a"},"9.24.2.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"SavedChangesEvent")," \u62e6\u622a"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e3a\u6240\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b50\u7c7b\u90fd\u63d0\u4f9b\u4e86\u4e09\u4e2a\u53ef\u91cd\u5199\u7684\u65b9\u6cd5\uff0c\u8fd9\u4e09\u4e2a\u65b9\u6cd5\u5206\u522b\u7531\u4e09\u4e2a\u4e8b\u4ef6\u89e6\u53d1\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u524d SavingChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(r.b)("inlineCode",{parentName:"li"},"void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)")," \u65b9\u6cd5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u540e SavedChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(r.b)("inlineCode",{parentName:"li"},"void SavedChangesEvent(SaveChangesCompletedEventData eventData, int result)")," \u65b9\u6cd5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u5931\u8d25 SaveChangesFailed \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(r.b)("inlineCode",{parentName:"li"},"void SaveChangesFailedEvent(DbContextErrorEventData eventData)")," \u65b9\u6cd5")),Object(r.b)("p",null,"\u901a\u8fc7\u8fd9\u4e09\u4e2a\u4e8b\u4ef6\u6211\u4eec\u53ef\u4ee5",Object(r.b)("strong",{parentName:"p"},"\u5728\u6570\u636e\u5e93\u505a\u589e\u3001\u5220\u3001\u6539\u65f6\u5019\u505a\u62e6\u622a\uff0c\u6bd4\u5982\u8bbe\u7f6e\u521b\u5efa\u65f6\u95f4\u3001\u66f4\u65b0\u65f6\u95f4\u6216\u5176\u4ed6\u9ed8\u8ba4\u64cd\u4f5c"),"\u3002"),Object(r.b)("p",null,"\u5982\u81ea\u52a8\u6dfb\u52a0\u79df\u6237 Id\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)\n{\n // \u83b7\u53d6\u5f53\u524d\u4e8b\u4ef6\u5bf9\u5e94\u4e0a\u4e0b\u6587\n var dbContext = eventData.Context;\n\n // \u83b7\u53d6\u6240\u6709\u65b0\u589e\u548c\u66f4\u65b0\u7684\u5b9e\u4f53\n var entities = dbContext.ChangeTracker.Entries()\n .Where(u => u.State == EntityState.Added || u.State == EntityState.Modified);\n\n foreach (var entity in entities)\n {\n switch (entity.State)\n {\n // \u81ea\u52a8\u8bbe\u7f6e\u79df\u6237Id\n case EntityState.Added:\n entity.Property(nameof(Entity.TenantId)).CurrentValue = GetTenantId();\n break;\n // \u6392\u9664\u79df\u6237Id\n case EntityState.Modified:\n entity.Property(nameof(Entity.TenantId)).IsModified = false;\n break;\n }\n }\n}\n")),Object(r.b)("h2",{id:"9243-\u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668"},"9.24.3 \u6ce8\u518c\u81ea\u5b9a\u4e49\u8fc7\u6ee4\u5668"),Object(r.b)("p",null,"\u5b9a\u4e49\u597d\u8fc7\u6ee4\u5668\u4e4b\u540e\uff0c\u6211\u4eec\u9700\u8981\u5728\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4e2d\u6ce8\u518c\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddDbPool(interceptors: new IInterceptor[] {\n new YourSqlConnectionProfilerInterceptor(),\n new YourDbContextSaveChangesInterceptor(),\n new YourSqlCommandProfilerInterceptor()\n});\n")),Object(r.b)("h2",{id:"9244-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.24.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),o=t(195);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(o.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return p}));var a=t(0),o=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function i(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=o.a.createContext({}),d=function(e){var n=o.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},u=function(e){var n=d(e.components);return o.a.createElement(s.Provider,{value:n},e.children)},b={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},m=o.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),u=d(t),m=a,p=u["".concat(c,".").concat(m)]||u[m]||b[m]||r;return t?o.a.createElement(p,i(i({ref:n},s),{},{components:t})):o.a.createElement(p,i({ref:n},s))}));function p(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=m;var i={};for(var l in n)hasOwnProperty.call(n,l)&&(i[l]=n[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,c[1]=i;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/7c7b3a8a.46029e7a.js b/docs/7c7b3a8a.f2d0005c.js similarity index 97% rename from docs/7c7b3a8a.46029e7a.js rename to docs/7c7b3a8a.f2d0005c.js index e0782fdcbb4..d9657dc5123 100644 --- a/docs/7c7b3a8a.46029e7a.js +++ b/docs/7c7b3a8a.f2d0005c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[51],{127:function(e,n,r){"use strict";r.r(n),r.d(n,"frontMatter",(function(){return s})),r.d(n,"metadata",(function(){return u})),r.d(n,"toc",(function(){return c})),r.d(n,"default",(function(){return l}));var t=r(3),a=r(7),i=(r(0),r(192)),o=r(193),s={id:"dbcontext-query",title:"9.10 \u67e5\u8be2\u64cd\u4f5c",sidebar_label:"9.10 \u67e5\u8be2\u64cd\u4f5c"},u={unversionedId:"dbcontext-query",id:"dbcontext-query",isDocsHomePage:!1,title:"9.10 \u67e5\u8be2\u64cd\u4f5c",description:"9.10.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",source:"@site/docs\\dbcontext-query.mdx",slug:"/dbcontext-query",permalink:"/docs/dbcontext-query",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-query.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.10 \u67e5\u8be2\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.9 \u6279\u91cf\u64cd\u4f5c",permalink:"/docs/dbcontext-batch"},next:{title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-hight-query"}},c=[{value:"9.10.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",id:"9101-\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",children:[]},{value:"9.10.2 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761",id:"9102-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761",children:[]},{value:"9.10.3 \u67e5\u8be2\u6240\u6709\u6570\u636e",id:"9103-\u67e5\u8be2\u6240\u6709\u6570\u636e",children:[]},{value:"9.10.4 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e",id:"9104-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e",children:[]},{value:"9.10.5 \u5206\u9875\u67e5\u8be2",id:"9105-\u5206\u9875\u67e5\u8be2",children:[]},{value:"9.10.6 \u5176\u4ed6\u67e5\u8be2",id:"9106-\u5176\u4ed6\u67e5\u8be2",children:[{value:"9.10.6.1 \u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728",id:"91061-\u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728",children:[]},{value:"9.10.6.2 \u67e5\u8be2\u8bb0\u5f55\u6570",id:"91062-\u67e5\u8be2\u8bb0\u5f55\u6570",children:[]},{value:"9.10.6.3 \u67e5\u8be2\u6700\u5927\u503c",id:"91063-\u67e5\u8be2\u6700\u5927\u503c",children:[]},{value:"9.10.6.4 \u67e5\u8be2\u6700\u5c0f\u503c",id:"91064-\u67e5\u8be2\u6700\u5c0f\u503c",children:[]},{value:"9.10.6.5 \u6c42\u548c\u67e5\u8be2",id:"91065-\u6c42\u548c\u67e5\u8be2",children:[]},{value:"9.10.6.6 \u6c42\u5e73\u5747\u503c\u67e5\u8be2",id:"91066-\u6c42\u5e73\u5747\u503c\u67e5\u8be2",children:[]},{value:"9.10.6.7 \u65f6\u95f4\u67e5\u8be2",id:"91067-\u65f6\u95f4\u67e5\u8be2",children:[]},{value:"9.10.6.8 \u6a21\u7cca\u67e5\u8be2",id:"91068-\u6a21\u7cca\u67e5\u8be2",children:[]},{value:"9.10.6.9 Case When",id:"91069-case-when",children:[]}]},{value:"9.10.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9107-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:c};function l(e){var n=e.components,r=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(t.a)({},p,r,{components:n,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9101-\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761"},"9.10.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = repository.Find(1);\n\n// \u793a\u4f8b\u4e8c\nvar person = repository.FindOrDefault(1);\n\n// \u793a\u4f8b\u4e09\nvar person = repository.Entities.Find(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = await repository.FindAsync(1);\n\n// \u793a\u4f8b\u4e8c\nvar person = await repository.FindOrDefaultAsync(1);\n\n// \u793a\u4f8b\u4e09\nvar person = await repository.Entities.FindAsync(1);\n\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u63d0\u793a")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u53ef\u4ee5\u652f\u6301\u591a\u4e2a\u952e\u67e5\u8be2\uff0c\u5982\u4e3b\u952e\u3001\u8054\u5408\u952e\u3002",Object(i.b)("inlineCode",{parentName:"p"},'repository.Find(1, "\u767e\u5c0f\u50e7")'),";"))),Object(i.b)("h2",{id:"9102-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761"},"9.10.2 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = repository.Single(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e8c\nvar person = repository.SingleOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e09\nvar person = repository.First(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u56db\nvar person = repository.FirstOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e94\nvar person = repository.Last(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516d\nvar person = repository.LastOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e03\nvar person = repository.Entities.Single(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516b\nvar person = repository.Entities.First(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e5d\nvar person = repository.Entities.FirstOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\nvar person = repository.Entities.Last(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\u4e00\nvar person = repository.Entities.LastOrDefault(u => u.Name == "Furion");\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = await repository.SingleAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e8c\nvar person = await repository.SingleOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e09\nvar person = await repository.FirstAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u56db\nvar person = await repository.FirstOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e94\nvar person = await repository.LastAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516d\nvar person = await repository.LastOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e03\nvar person = await repository.Entities.SingleAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516b\nvar person = await repository.Entities.FirstAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e5d\nvar person = await repository.Entities.FirstOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\nvar person = await repository.Entities.LastAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\u4e00\nvar person = await repository.Entities.LastOrDefaultAsync(u => u.Name == "Furion");\n')),Object(i.b)("h2",{id:"9103-\u67e5\u8be2\u6240\u6709\u6570\u636e"},"9.10.3 \u67e5\u8be2\u6240\u6709\u6570\u636e"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = repository.Entities;\n\n// \u793a\u4f8b\u4e8c\nvar persons = repository.DetachedEntities;\n\n// \u793a\u4f8b\u4e09\nvar persons = repository.AsQueryable();\n\n// \u793a\u4f8b\u56db\nvar persons = repository.AsEnumerable();\n\n// \u793a\u4f8b\u4e94\nvar persons = await AsAsyncEnumerable();\n")),Object(i.b)("h2",{id:"9104-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e"},"9.10.4 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar persons = repository.Where(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e8c\nvar persons = repository.Where(u => u.Id > 10 && u.Name.Equals("Furion"));\n\n// \u793a\u4f8b\u4e09\nvar persons = repository.Where(u => u.Id > 10).Where(u => u.Name.Equals("Furion"));\n\n// \u793a\u4f8b\u56db\nvar persons = repository.Where(!string.IsNullOrEmpty(name), u => u.Id > 10 && u.Name.Equals("Furion"));\n\n// \u793a\u4f8b\u4e94\nvar persons = repository.Where(!string.IsNullOrEmpty(name), u => u.Id > 10)\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"))\n .Where(u => u.Age > 18);\n\n// \u793a\u4f8b\u516d\nvar persons = repository.Where(u => u.Name == "Furion",\n u => u.Name == "\u767e\u5c0f\u50e7",\n u => u.Name == "MonkSoul");\n\n// \u793a\u4f8b\u4e03\nvar persons = repository.Where(u => u.Id > 10).Where(u => u.Name.Equals("Furion"))\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"))\n .Where(u => u.Name == "Furion",\n u => u.Name == "\u767e\u5c0f\u50e7",\n u => u.Name == "MonkSoul");\n\n// \u793a\u4f8b\u516b\nvar persons = repository.Where((age > 18, u => u.Name == "Furion"),\n (!string.IsNullOrEmpty(name), u => u.Id > 10));\n\n// \u793a\u4f8b\u4e5d\nvar persons = repository.Where(u => u.Id > 10).Where(u => u.Name.Equals("Furion"))\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"))\n .Where(u => u.Name == "Furion",\n u => u.Name == "\u767e\u5c0f\u50e7",\n u => u.Name == "MonkSoul")\n .Where((age > 18, u => u.Name == "Furion"),\n (!string.IsNullOrEmpty(name), u => u.Id > 10));\n\n// \u793a\u4f8b\u5341\nvar persons = repository.Entities.Where(u => u.Id > 10)\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"));\n\n// \u793a\u4f8b\u5341\u4e00\nvar persons = repository.DetachedEntities.Where(u => u.Id > 20);\n\n// \u793a\u4f8b\u5341\u4e8c\nvar persons = repository.AsQueryable(u => u.Id > 20).Where(u => u.Name == "Furion");\n')),Object(i.b)("h2",{id:"9105-\u5206\u9875\u67e5\u8be2"},"9.10.5 \u5206\u9875\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = repository.Where(u => u.Id > 10).ToPagedList();\n\n// \u793a\u4f8b\u4e8c\nvar persons = repository.Where(u => u.Id > 10).ToPagedList(1, 10);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await repository.Where(u => u.Id > 10).ToPagedListAsync();\n\n// \u793a\u4f8b\u4e8c\nvar persons = await repository.Where(u => u.Id > 10).ToPagedListAsync(1, 10);\n")),Object(i.b)("h2",{id:"9106-\u5176\u4ed6\u67e5\u8be2"},"9.10.6 \u5176\u4ed6\u67e5\u8be2"),Object(i.b)("h3",{id:"91061-\u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728"},"9.10.6.1 \u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar isExists = repository.Any();\n\n// \u793a\u4f8b\u4e8c\nvar isExists = repository.Any(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar isExists = repository.Entities.Any();\n\n// \u793a\u4f8b\u56db\nvar isExists = repository.DetachedEntities.Any(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e94\nvar isExists = repository.Where(u => u.Id > 10).Any();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar isExists = await repository.AnyAsync();\n\n// \u793a\u4f8b\u4e8c\nvar isExists = await repository.AnyAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar isExists = await repository.Entities.AnyAsync();\n\n// \u793a\u4f8b\u56db\nvar isExists = await repository.DetachedEntities.AnyAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e94\nvar isExists = await repository.Where(u => u.Id > 10).AnyAsync();\n")),Object(i.b)("h3",{id:"91062-\u67e5\u8be2\u8bb0\u5f55\u6570"},"9.10.6.2 \u67e5\u8be2\u8bb0\u5f55\u6570"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar count = repository.Count();\n\n// \u793a\u4f8b\u4e8c\nvar count = repository.Count(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar count = repository.Entities.Count(u => u.Id > 10);\n\n// \u793a\u4f8b\u56db\nvar count = repository.Entities.DetachedEntities.Count();\n\n// \u793a\u4f8b\u4e94\nvar count = repository.Where(u => u.Id > 10).Count();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar count = await repository.CountAsync();\n\n// \u793a\u4f8b\u4e8c\nvar count = await repository.CountAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar count = await repository.Entities.CountAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u56db\nvar count = await repository.Entities.DetachedEntities.CountAsync();\n\n// \u793a\u4f8b\u4e94\nvar count = await repository.Where(u => u.Id > 10).CountAsync();\n")),Object(i.b)("h3",{id:"91063-\u67e5\u8be2\u6700\u5927\u503c"},"9.10.6.3 \u67e5\u8be2\u6700\u5927\u503c"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = repository.Max();\n\n// \u793a\u4f8b\u4e8c\nvar value = repository.Max(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = repository.Entities.Max();\n\n// \u793a\u4f8b\u56db\nvar value = repository.Entities.DetachedEntities.Max(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = repository.Where(u => u.Id > 10).Max(u => u.Age);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = await repository.MaxAsync();\n\n// \u793a\u4f8b\u4e8c\nvar value = await repository.MaxAsync(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = await repository.Entities.MaxAsync();\n\n// \u793a\u4f8b\u56db\nvar value = await repository.Entities.DetachedEntities.MaxAsync(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = await repository.Where(u => u.Id > 10).MaxAsync(u => u.Age);\n")),Object(i.b)("h3",{id:"91064-\u67e5\u8be2\u6700\u5c0f\u503c"},"9.10.6.4 \u67e5\u8be2\u6700\u5c0f\u503c"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = repository.Min();\n\n// \u793a\u4f8b\u4e8c\nvar value = repository.Min(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = repository.Entities.Min();\n\n// \u793a\u4f8b\u56db\nvar value = repository.Entities.DetachedEntities.Min(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = repository.Where(u => u.Id > 10).Min(u => u.Age);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = await repository.MinAsync();\n\n// \u793a\u4f8b\u4e8c\nvar value = await repository.MinAsync(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = await repository.Entities.MinAsync();\n\n// \u793a\u4f8b\u56db\nvar value = await repository.Entities.DetachedEntities.MinAsync(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = await repository.Where(u => u.Id > 10).MinAsync(u => u.Age);\n")),Object(i.b)("h3",{id:"91065-\u6c42\u548c\u67e5\u8be2"},"9.10.6.5 \u6c42\u548c\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = repository.Entities.Sum(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = repository.AsQueryable().Sum(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = repository.DetachedEntities.Sum(u => u.Cost);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = await repository.Entities.SumAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = await repository.AsQueryable().SumAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = await repository.DetachedEntities.SumAsync(u => u.Cost);\n")),Object(i.b)("h3",{id:"91066-\u6c42\u5e73\u5747\u503c\u67e5\u8be2"},"9.10.6.6 \u6c42\u5e73\u5747\u503c\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = repository.Entities.Average(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = repository.AsQueryable().Average(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = repository.DetachedEntities.Average(u => u.Cost);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = await repository.Entities.AverageAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = await repository.AsQueryable().AverageAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = await repository.DetachedEntities.AverageAsync(u => u.Cost);\n")),Object(i.b)("h3",{id:"91067-\u65f6\u95f4\u67e5\u8be2"},"9.10.6.7 \u65f6\u95f4\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var starDate = DateTime.Parse("2020-09-10");\nvar endDate = DateTime.Parse("2020-09-10");\nvar query = repository.Where(u => u.CreatedDt >= starDate && u.CreatedDt <= endDate);\n')),Object(i.b)("h3",{id:"91068-\u6a21\u7cca\u67e5\u8be2"},"9.10.6.8 \u6a21\u7cca\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nrepository.Where(u => u.Name.StartWith("Furion"));\n\n// \u793a\u4f8b\u4e8c\n_testRepository.Where(u => u.Name.EndWith("Furion"));\n\n// \u793a\u4f8b\u4e09\n_testRepository.Where(u => u.Name.Contains("Furion"));\n')),Object(i.b)("h3",{id:"91069-case-when"},"9.10.6.9 ",Object(i.b)("inlineCode",{parentName:"h3"},"Case When")),Object(i.b)("p",null,"\u6570\u636e\u5e93\u4e2d\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Case When")," \u5b9e\u9645\u4e0a\u5bf9\u5e94\u7684\u662f\u6211\u4eec\u7a0b\u5e8f\u4e2d\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u4e09\u5143\u8868\u8fbe\u5f0f")," \uff0c\u4e5f\u5c31\u662f\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"\u4e09\u5143\u8868\u8fbe\u5f0f")," \u5373\u53ef\u81ea\u52a8\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},"Case When")," \u8bed\u53e5\u3002"),Object(i.b)("h2",{id:"9107-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.10.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(t.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}l.isMDXComponent=!0},190:function(e,n,r){"use strict";r.d(n,"b",(function(){return i})),r.d(n,"a",(function(){return o}));var t=r(21),a=r(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(r,t)=>function(e,n,r,{forcePrependBaseUrl:t=!1,absolute:i=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(a.b)(r))return r;if(t)return n+r;const o=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?e+o:o}(n,e,r,t)}}function o(e,n={}){const{withBaseUrl:r}=i();return r(e,n)}},191:function(e,n,r){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!t(e)}r.d(n,"b",(function(){return t})),r.d(n,"a",(function(){return a}))},192:function(e,n,r){"use strict";r.d(n,"a",(function(){return l})),r.d(n,"b",(function(){return y}));var t=r(0),a=r.n(t);function i(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function o(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function s(e){for(var n=1;n=0||(a[r]=e[r]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var c=a.a.createContext({}),p=function(e){var n=a.a.useContext(c),r=n;return e&&(r="function"==typeof e?e(n):s(s({},n),e)),r},l=function(e){var n=p(e.components);return a.a.createElement(c.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},b=a.a.forwardRef((function(e,n){var r=e.components,t=e.mdxType,i=e.originalType,o=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),l=p(r),b=t,y=l["".concat(o,".").concat(b)]||l[b]||d[b]||i;return r?a.a.createElement(y,s(s({ref:n},c),{},{components:r})):a.a.createElement(y,s({ref:n},c))}));function y(e,n){var r=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var i=r.length,o=new Array(i);o[0]=b;var s={};for(var u in n)hasOwnProperty.call(n,u)&&(s[u]=n[u]);s.originalType=e,s.mdxType="string"==typeof e?e:t,o[1]=s;for(var c=2;cn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{130:function(e,n,r){"use strict";r.r(n),r.d(n,"frontMatter",(function(){return s})),r.d(n,"metadata",(function(){return u})),r.d(n,"toc",(function(){return c})),r.d(n,"default",(function(){return l}));var t=r(3),a=r(7),i=(r(0),r(196)),o=r(197),s={id:"dbcontext-query",title:"9.10 \u67e5\u8be2\u64cd\u4f5c",sidebar_label:"9.10 \u67e5\u8be2\u64cd\u4f5c"},u={unversionedId:"dbcontext-query",id:"dbcontext-query",isDocsHomePage:!1,title:"9.10 \u67e5\u8be2\u64cd\u4f5c",description:"9.10.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",source:"@site/docs\\dbcontext-query.mdx",slug:"/dbcontext-query",permalink:"/docs/dbcontext-query",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-query.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.10 \u67e5\u8be2\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.9 \u6279\u91cf\u64cd\u4f5c",permalink:"/docs/dbcontext-batch"},next:{title:"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-hight-query"}},c=[{value:"9.10.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",id:"9101-\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",children:[]},{value:"9.10.2 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761",id:"9102-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761",children:[]},{value:"9.10.3 \u67e5\u8be2\u6240\u6709\u6570\u636e",id:"9103-\u67e5\u8be2\u6240\u6709\u6570\u636e",children:[]},{value:"9.10.4 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e",id:"9104-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e",children:[]},{value:"9.10.5 \u5206\u9875\u67e5\u8be2",id:"9105-\u5206\u9875\u67e5\u8be2",children:[]},{value:"9.10.6 \u5176\u4ed6\u67e5\u8be2",id:"9106-\u5176\u4ed6\u67e5\u8be2",children:[{value:"9.10.6.1 \u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728",id:"91061-\u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728",children:[]},{value:"9.10.6.2 \u67e5\u8be2\u8bb0\u5f55\u6570",id:"91062-\u67e5\u8be2\u8bb0\u5f55\u6570",children:[]},{value:"9.10.6.3 \u67e5\u8be2\u6700\u5927\u503c",id:"91063-\u67e5\u8be2\u6700\u5927\u503c",children:[]},{value:"9.10.6.4 \u67e5\u8be2\u6700\u5c0f\u503c",id:"91064-\u67e5\u8be2\u6700\u5c0f\u503c",children:[]},{value:"9.10.6.5 \u6c42\u548c\u67e5\u8be2",id:"91065-\u6c42\u548c\u67e5\u8be2",children:[]},{value:"9.10.6.6 \u6c42\u5e73\u5747\u503c\u67e5\u8be2",id:"91066-\u6c42\u5e73\u5747\u503c\u67e5\u8be2",children:[]},{value:"9.10.6.7 \u65f6\u95f4\u67e5\u8be2",id:"91067-\u65f6\u95f4\u67e5\u8be2",children:[]},{value:"9.10.6.8 \u6a21\u7cca\u67e5\u8be2",id:"91068-\u6a21\u7cca\u67e5\u8be2",children:[]},{value:"9.10.6.9 Case When",id:"91069-case-when",children:[]}]},{value:"9.10.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9107-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:c};function l(e){var n=e.components,r=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(t.a)({},p,r,{components:n,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9101-\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761"},"9.10.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = repository.Find(1);\n\n// \u793a\u4f8b\u4e8c\nvar person = repository.FindOrDefault(1);\n\n// \u793a\u4f8b\u4e09\nvar person = repository.Entities.Find(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = await repository.FindAsync(1);\n\n// \u793a\u4f8b\u4e8c\nvar person = await repository.FindOrDefaultAsync(1);\n\n// \u793a\u4f8b\u4e09\nvar person = await repository.Entities.FindAsync(1);\n\n")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u63d0\u793a")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u53ef\u4ee5\u652f\u6301\u591a\u4e2a\u952e\u67e5\u8be2\uff0c\u5982\u4e3b\u952e\u3001\u8054\u5408\u952e\u3002",Object(i.b)("inlineCode",{parentName:"p"},'repository.Find(1, "\u767e\u5c0f\u50e7")'),";"))),Object(i.b)("h2",{id:"9102-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761"},"9.10.2 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = repository.Single(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e8c\nvar person = repository.SingleOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e09\nvar person = repository.First(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u56db\nvar person = repository.FirstOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e94\nvar person = repository.Last(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516d\nvar person = repository.LastOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e03\nvar person = repository.Entities.Single(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516b\nvar person = repository.Entities.First(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e5d\nvar person = repository.Entities.FirstOrDefault(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\nvar person = repository.Entities.Last(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\u4e00\nvar person = repository.Entities.LastOrDefault(u => u.Name == "Furion");\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar person = await repository.SingleAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e8c\nvar person = await repository.SingleOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e09\nvar person = await repository.FirstAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u56db\nvar person = await repository.FirstOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e94\nvar person = await repository.LastAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516d\nvar person = await repository.LastOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e03\nvar person = await repository.Entities.SingleAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u516b\nvar person = await repository.Entities.FirstAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u4e5d\nvar person = await repository.Entities.FirstOrDefaultAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\nvar person = await repository.Entities.LastAsync(u => u.Name == "Furion");\n\n// \u793a\u4f8b\u5341\u4e00\nvar person = await repository.Entities.LastOrDefaultAsync(u => u.Name == "Furion");\n')),Object(i.b)("h2",{id:"9103-\u67e5\u8be2\u6240\u6709\u6570\u636e"},"9.10.3 \u67e5\u8be2\u6240\u6709\u6570\u636e"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = repository.Entities;\n\n// \u793a\u4f8b\u4e8c\nvar persons = repository.DetachedEntities;\n\n// \u793a\u4f8b\u4e09\nvar persons = repository.AsQueryable();\n\n// \u793a\u4f8b\u56db\nvar persons = repository.AsEnumerable();\n\n// \u793a\u4f8b\u4e94\nvar persons = await AsAsyncEnumerable();\n")),Object(i.b)("h2",{id:"9104-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e"},"9.10.4 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar persons = repository.Where(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e8c\nvar persons = repository.Where(u => u.Id > 10 && u.Name.Equals("Furion"));\n\n// \u793a\u4f8b\u4e09\nvar persons = repository.Where(u => u.Id > 10).Where(u => u.Name.Equals("Furion"));\n\n// \u793a\u4f8b\u56db\nvar persons = repository.Where(!string.IsNullOrEmpty(name), u => u.Id > 10 && u.Name.Equals("Furion"));\n\n// \u793a\u4f8b\u4e94\nvar persons = repository.Where(!string.IsNullOrEmpty(name), u => u.Id > 10)\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"))\n .Where(u => u.Age > 18);\n\n// \u793a\u4f8b\u516d\nvar persons = repository.Where(u => u.Name == "Furion",\n u => u.Name == "\u767e\u5c0f\u50e7",\n u => u.Name == "MonkSoul");\n\n// \u793a\u4f8b\u4e03\nvar persons = repository.Where(u => u.Id > 10).Where(u => u.Name.Equals("Furion"))\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"))\n .Where(u => u.Name == "Furion",\n u => u.Name == "\u767e\u5c0f\u50e7",\n u => u.Name == "MonkSoul");\n\n// \u793a\u4f8b\u516b\nvar persons = repository.Where((age > 18, u => u.Name == "Furion"),\n (!string.IsNullOrEmpty(name), u => u.Id > 10));\n\n// \u793a\u4f8b\u4e5d\nvar persons = repository.Where(u => u.Id > 10).Where(u => u.Name.Equals("Furion"))\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"))\n .Where(u => u.Name == "Furion",\n u => u.Name == "\u767e\u5c0f\u50e7",\n u => u.Name == "MonkSoul")\n .Where((age > 18, u => u.Name == "Furion"),\n (!string.IsNullOrEmpty(name), u => u.Id > 10));\n\n// \u793a\u4f8b\u5341\nvar persons = repository.Entities.Where(u => u.Id > 10)\n .Where(age > 18, u => u.Name.Containes("\u767e\u5c0f\u50e7"));\n\n// \u793a\u4f8b\u5341\u4e00\nvar persons = repository.DetachedEntities.Where(u => u.Id > 20);\n\n// \u793a\u4f8b\u5341\u4e8c\nvar persons = repository.AsQueryable(u => u.Id > 20).Where(u => u.Name == "Furion");\n')),Object(i.b)("h2",{id:"9105-\u5206\u9875\u67e5\u8be2"},"9.10.5 \u5206\u9875\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = repository.Where(u => u.Id > 10).ToPagedList();\n\n// \u793a\u4f8b\u4e8c\nvar persons = repository.Where(u => u.Id > 10).ToPagedList(1, 10);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await repository.Where(u => u.Id > 10).ToPagedListAsync();\n\n// \u793a\u4f8b\u4e8c\nvar persons = await repository.Where(u => u.Id > 10).ToPagedListAsync(1, 10);\n")),Object(i.b)("h2",{id:"9106-\u5176\u4ed6\u67e5\u8be2"},"9.10.6 \u5176\u4ed6\u67e5\u8be2"),Object(i.b)("h3",{id:"91061-\u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728"},"9.10.6.1 \u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar isExists = repository.Any();\n\n// \u793a\u4f8b\u4e8c\nvar isExists = repository.Any(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar isExists = repository.Entities.Any();\n\n// \u793a\u4f8b\u56db\nvar isExists = repository.DetachedEntities.Any(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e94\nvar isExists = repository.Where(u => u.Id > 10).Any();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar isExists = await repository.AnyAsync();\n\n// \u793a\u4f8b\u4e8c\nvar isExists = await repository.AnyAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar isExists = await repository.Entities.AnyAsync();\n\n// \u793a\u4f8b\u56db\nvar isExists = await repository.DetachedEntities.AnyAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e94\nvar isExists = await repository.Where(u => u.Id > 10).AnyAsync();\n")),Object(i.b)("h3",{id:"91062-\u67e5\u8be2\u8bb0\u5f55\u6570"},"9.10.6.2 \u67e5\u8be2\u8bb0\u5f55\u6570"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar count = repository.Count();\n\n// \u793a\u4f8b\u4e8c\nvar count = repository.Count(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar count = repository.Entities.Count(u => u.Id > 10);\n\n// \u793a\u4f8b\u56db\nvar count = repository.Entities.DetachedEntities.Count();\n\n// \u793a\u4f8b\u4e94\nvar count = repository.Where(u => u.Id > 10).Count();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar count = await repository.CountAsync();\n\n// \u793a\u4f8b\u4e8c\nvar count = await repository.CountAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u4e09\nvar count = await repository.Entities.CountAsync(u => u.Id > 10);\n\n// \u793a\u4f8b\u56db\nvar count = await repository.Entities.DetachedEntities.CountAsync();\n\n// \u793a\u4f8b\u4e94\nvar count = await repository.Where(u => u.Id > 10).CountAsync();\n")),Object(i.b)("h3",{id:"91063-\u67e5\u8be2\u6700\u5927\u503c"},"9.10.6.3 \u67e5\u8be2\u6700\u5927\u503c"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = repository.Max();\n\n// \u793a\u4f8b\u4e8c\nvar value = repository.Max(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = repository.Entities.Max();\n\n// \u793a\u4f8b\u56db\nvar value = repository.Entities.DetachedEntities.Max(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = repository.Where(u => u.Id > 10).Max(u => u.Age);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = await repository.MaxAsync();\n\n// \u793a\u4f8b\u4e8c\nvar value = await repository.MaxAsync(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = await repository.Entities.MaxAsync();\n\n// \u793a\u4f8b\u56db\nvar value = await repository.Entities.DetachedEntities.MaxAsync(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = await repository.Where(u => u.Id > 10).MaxAsync(u => u.Age);\n")),Object(i.b)("h3",{id:"91064-\u67e5\u8be2\u6700\u5c0f\u503c"},"9.10.6.4 \u67e5\u8be2\u6700\u5c0f\u503c"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = repository.Min();\n\n// \u793a\u4f8b\u4e8c\nvar value = repository.Min(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = repository.Entities.Min();\n\n// \u793a\u4f8b\u56db\nvar value = repository.Entities.DetachedEntities.Min(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = repository.Where(u => u.Id > 10).Min(u => u.Age);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar entity = await repository.MinAsync();\n\n// \u793a\u4f8b\u4e8c\nvar value = await repository.MinAsync(u => u.Id);\n\n// \u793a\u4f8b\u4e09\nvar entity = await repository.Entities.MinAsync();\n\n// \u793a\u4f8b\u56db\nvar value = await repository.Entities.DetachedEntities.MinAsync(u => u.Age);\n\n// \u793a\u4f8b\u4e94\nvar value = await repository.Where(u => u.Id > 10).MinAsync(u => u.Age);\n")),Object(i.b)("h3",{id:"91065-\u6c42\u548c\u67e5\u8be2"},"9.10.6.5 \u6c42\u548c\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = repository.Entities.Sum(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = repository.AsQueryable().Sum(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = repository.DetachedEntities.Sum(u => u.Cost);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = await repository.Entities.SumAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = await repository.AsQueryable().SumAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = await repository.DetachedEntities.SumAsync(u => u.Cost);\n")),Object(i.b)("h3",{id:"91066-\u6c42\u5e73\u5747\u503c\u67e5\u8be2"},"9.10.6.6 \u6c42\u5e73\u5747\u503c\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = repository.Entities.Average(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = repository.AsQueryable().Average(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = repository.DetachedEntities.Average(u => u.Cost);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar sum = await repository.Entities.AverageAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e8c\nvar sum = await repository.AsQueryable().AverageAsync(u => u.Cost);\n\n// \u793a\u4f8b\u4e09\nvar sum = await repository.DetachedEntities.AverageAsync(u => u.Cost);\n")),Object(i.b)("h3",{id:"91067-\u65f6\u95f4\u67e5\u8be2"},"9.10.6.7 \u65f6\u95f4\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var starDate = DateTime.Parse("2020-09-10");\nvar endDate = DateTime.Parse("2020-09-10");\nvar query = repository.Where(u => u.CreatedDt >= starDate && u.CreatedDt <= endDate);\n')),Object(i.b)("h3",{id:"91068-\u6a21\u7cca\u67e5\u8be2"},"9.10.6.8 \u6a21\u7cca\u67e5\u8be2"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nrepository.Where(u => u.Name.StartWith("Furion"));\n\n// \u793a\u4f8b\u4e8c\n_testRepository.Where(u => u.Name.EndWith("Furion"));\n\n// \u793a\u4f8b\u4e09\n_testRepository.Where(u => u.Name.Contains("Furion"));\n')),Object(i.b)("h3",{id:"91069-case-when"},"9.10.6.9 ",Object(i.b)("inlineCode",{parentName:"h3"},"Case When")),Object(i.b)("p",null,"\u6570\u636e\u5e93\u4e2d\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Case When")," \u5b9e\u9645\u4e0a\u5bf9\u5e94\u7684\u662f\u6211\u4eec\u7a0b\u5e8f\u4e2d\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u4e09\u5143\u8868\u8fbe\u5f0f")," \uff0c\u4e5f\u5c31\u662f\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"\u4e09\u5143\u8868\u8fbe\u5f0f")," \u5373\u53ef\u81ea\u52a8\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},"Case When")," \u8bed\u53e5\u3002"),Object(i.b)("h2",{id:"9107-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.10.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(t.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}l.isMDXComponent=!0},194:function(e,n,r){"use strict";r.d(n,"b",(function(){return i})),r.d(n,"a",(function(){return o}));var t=r(21),a=r(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(r,t)=>function(e,n,r,{forcePrependBaseUrl:t=!1,absolute:i=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(a.b)(r))return r;if(t)return n+r;const o=r.startsWith(n)?r:n+r.replace(/^\//,"");return i?e+o:o}(n,e,r,t)}}function o(e,n={}){const{withBaseUrl:r}=i();return r(e,n)}},195:function(e,n,r){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!t(e)}r.d(n,"b",(function(){return t})),r.d(n,"a",(function(){return a}))},196:function(e,n,r){"use strict";r.d(n,"a",(function(){return l})),r.d(n,"b",(function(){return y}));var t=r(0),a=r.n(t);function i(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function o(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),r.push.apply(r,t)}return r}function s(e){for(var n=1;n=0||(a[r]=e[r]);return a}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var c=a.a.createContext({}),p=function(e){var n=a.a.useContext(c),r=n;return e&&(r="function"==typeof e?e(n):s(s({},n),e)),r},l=function(e){var n=p(e.components);return a.a.createElement(c.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},b=a.a.forwardRef((function(e,n){var r=e.components,t=e.mdxType,i=e.originalType,o=e.parentName,c=u(e,["components","mdxType","originalType","parentName"]),l=p(r),b=t,y=l["".concat(o,".").concat(b)]||l[b]||d[b]||i;return r?a.a.createElement(y,s(s({ref:n},c),{},{components:r})):a.a.createElement(y,s({ref:n},c))}));function y(e,n){var r=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var i=r.length,o=new Array(i);o[0]=b;var s={};for(var u in n)hasOwnProperty.call(n,u)&&(s[u]=n[u]);s.originalType=e,s.mdxType="string"==typeof e?e:t,o[1]=s;for(var c=2;cn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/7cb925f6.07b3db48.js b/docs/7cb925f6.3cee7beb.js similarity index 95% rename from docs/7cb925f6.07b3db48.js rename to docs/7cb925f6.3cee7beb.js index c19a5b894fe..c4b74c387ce 100644 --- a/docs/7cb925f6.07b3db48.js +++ b/docs/7cb925f6.3cee7beb.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[52],{128:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return c})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return u}));var i=n(3),r=n(7),a=(n(0),n(192)),l=n(193),o={id:"dynamicapicontrollersettings",title:"5. \u52a8\u6001API\u914d\u7f6e",sidebar_label:"5. \u52a8\u6001API\u914d\u7f6e"},c={unversionedId:"settings/dynamicapicontrollersettings",id:"settings/dynamicapicontrollersettings",isDocsHomePage:!1,title:"5. \u52a8\u6001API\u914d\u7f6e",description:"5.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\dynamicapicontrollersettings.mdx",slug:"/settings/dynamicapicontrollersettings",permalink:"/docs/settings/dynamicapicontrollersettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/dynamicapicontrollersettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"5. \u52a8\u6001API\u914d\u7f6e",sidebar:"settings",previous:{title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",permalink:"/docs/settings/dependencyinjectionsettings"},next:{title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",permalink:"/docs/settings/friendlyexceptionsettings"}},b=[{value:"5.1 \u5173\u4e8e\u914d\u7f6e",id:"51-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"5.2 \u914d\u7f6e\u4fe1\u606f",id:"52-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"5.3 \u914d\u7f6e\u793a\u4f8b",id:"53-\u914d\u7f6e\u793a\u4f8b",children:[]}],p={toc:b};function u(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(a.b)("wrapper",Object(i.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(l.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"51-\u5173\u4e8e\u914d\u7f6e"},"5.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u52a8\u6001 API \u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u52a8\u6001 API \u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"52-\u914d\u7f6e\u4fe1\u606f"},"5.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("p",{parentName:"li"},Object(a.b)("inlineCode",{parentName:"p"},"DynamicApiControllerSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9"),Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultRoutePrefix"),"\uff1a\u9ed8\u8ba4\u8def\u7531\u524d\u7f00\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"api")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultHttpMethod"),"\uff1a\u9ed8\u8ba4\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"POST")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultModule"),"\uff1a\u9ed8\u8ba4\u6a21\u5757\u540d\u79f0\uff08\u533a\u57df\uff09\uff0c\u53ef\u7528\u4f5c\u63a5\u53e3\u7248\u672c\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"v1")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"LowercaseRoute"),"\uff1a\u5c0f\u5199\u8def\u7531\u683c\u5f0f\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u5426\u4fdd\u7559\u9ed8\u8ba4\u540d\u79f0\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"fasle")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"CamelCaseSeparator"),"\uff1a\u9a86\u9a7c\u547d\u540d\u5206\u9694\u7b26\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"-")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"VersionSeparator"),"\uff1a\u7248\u672c\u5206\u9694\u7b26\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"@")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ModelToQuery"),"\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"GET/HEAD")," \u8bf7\u6c42\u5c06 ",Object(a.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570\u8f6c\u67e5\u8be2\u53c2\u6570"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SupportedMvcController"),"\uff1a\u662f\u5426\u652f\u6301 ",Object(a.b)("inlineCode",{parentName:"li"},"Mvc Controller")," \u52a8\u6001\u914d\u7f6e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AbandonControllerAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u63a7\u5236\u5668\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AppServices")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AppService")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ApiController")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Controller")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Services")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Service")))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AbandonActionAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Async")))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"VerbToHttpMethods"),"\uff1a\u590d\u5199\u9ed8\u8ba4\u65b9\u6cd5\u540d\u8f6c ",Object(a.b)("inlineCode",{parentName:"li"},"[HttpMethod]")," \u89c4\u5219\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[][]")," \u4e8c\u7ef4\u6570\u7ec4\u7c7b\u578b\uff0c\u5185\u7f6e\u5339\u914d\u89c4\u5219\u4e3a\uff1a",Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-cs"}),'["post"] = "POST",\n["add"] = "POST",\n["create"] = "POST",\n["insert"] = "POST",\n["submit"] = "POST",\n["get"] = "GET",\n["find"] = "GET",\n["fetch"] = "GET",\n["query"] = "GET",\n["getlist"] = "GET",\n["getall"] = "GET",\n["put"] = "PUT",\n["update"] = "PUT",\n["delete"] = "DELETE",\n["remove"] = "DELETE",\n["clear"] = "DELETE",\n["patch"] = "PATCH"\n')),Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},"\u590d\u5199\u793a\u4f8b")),Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'"DynamicApiControllerSettings": {\n "VerbToHttpMethods": [\n [ "getall", "HEAD" ], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\n [ "other", "PUT" ] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\n ]\n }\n')))))),Object(a.b)("h2",{id:"53-\u914d\u7f6e\u793a\u4f8b"},"5.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'{\n "DynamicApiControllerSettings": {\n "SupportedMvcController": true\n }\n}\n')))}u.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return l}));var i=n(21),r=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(i.default)();return{withBaseUrl:(n,i)=>function(e,t,n,{forcePrependBaseUrl:i=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(i)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+l:l}(t,e,n,i)}}function l(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!i(e)}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var i=n(0),r=n.n(i);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),p=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),u=p(n),d=i,m=u["".concat(l,".").concat(d)]||u[d]||s[d]||a;return n?r.a.createElement(m,o(o({ref:t},b),{},{components:n})):r.a.createElement(m,o({ref:t},b))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,l=new Array(a);l[0]=d;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{131:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return c})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return u}));var i=n(3),r=n(7),a=(n(0),n(196)),l=n(197),o={id:"dynamicapicontrollersettings",title:"5. \u52a8\u6001API\u914d\u7f6e",sidebar_label:"5. \u52a8\u6001API\u914d\u7f6e"},c={unversionedId:"settings/dynamicapicontrollersettings",id:"settings/dynamicapicontrollersettings",isDocsHomePage:!1,title:"5. \u52a8\u6001API\u914d\u7f6e",description:"5.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\dynamicapicontrollersettings.mdx",slug:"/settings/dynamicapicontrollersettings",permalink:"/docs/settings/dynamicapicontrollersettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/dynamicapicontrollersettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"5. \u52a8\u6001API\u914d\u7f6e",sidebar:"settings",previous:{title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",permalink:"/docs/settings/dependencyinjectionsettings"},next:{title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",permalink:"/docs/settings/friendlyexceptionsettings"}},b=[{value:"5.1 \u5173\u4e8e\u914d\u7f6e",id:"51-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"5.2 \u914d\u7f6e\u4fe1\u606f",id:"52-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"5.3 \u914d\u7f6e\u793a\u4f8b",id:"53-\u914d\u7f6e\u793a\u4f8b",children:[]}],p={toc:b};function u(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(a.b)("wrapper",Object(i.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(l.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"51-\u5173\u4e8e\u914d\u7f6e"},"5.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u52a8\u6001 API \u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u52a8\u6001 API \u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"52-\u914d\u7f6e\u4fe1\u606f"},"5.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("p",{parentName:"li"},Object(a.b)("inlineCode",{parentName:"p"},"DynamicApiControllerSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9"),Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultRoutePrefix"),"\uff1a\u9ed8\u8ba4\u8def\u7531\u524d\u7f00\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"api")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultHttpMethod"),"\uff1a\u9ed8\u8ba4\u8bf7\u6c42\u8c13\u8bcd\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"POST")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultModule"),"\uff1a\u9ed8\u8ba4\u6a21\u5757\u540d\u79f0\uff08\u533a\u57df\uff09\uff0c\u53ef\u7528\u4f5c\u63a5\u53e3\u7248\u672c\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"v1")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"LowercaseRoute"),"\uff1a\u5c0f\u5199\u8def\u7531\u683c\u5f0f\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"KeepVerb"),"\uff1a\u662f\u5426\u4fdd\u7559\u52a8\u4f5c\u8c13\u8bcd\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"KeepName"),"\uff1a\u662f\u5426\u4fdd\u7559\u9ed8\u8ba4\u540d\u79f0\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"fasle")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"CamelCaseSeparator"),"\uff1a\u9a86\u9a7c\u547d\u540d\u5206\u9694\u7b26\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"-")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"VersionSeparator"),"\uff1a\u7248\u672c\u5206\u9694\u7b26\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"@")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ModelToQuery"),"\uff1a",Object(a.b)("inlineCode",{parentName:"li"},"GET/HEAD")," \u8bf7\u6c42\u5c06 ",Object(a.b)("inlineCode",{parentName:"li"},"\u7c7b\u7c7b\u578b\u53c2\u6570\u8f6c\u67e5\u8be2\u53c2\u6570"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SupportedMvcController"),"\uff1a\u662f\u5426\u652f\u6301 ",Object(a.b)("inlineCode",{parentName:"li"},"Mvc Controller")," \u52a8\u6001\u914d\u7f6e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AbandonControllerAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u63a7\u5236\u5668\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AppServices")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AppService")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ApiController")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Controller")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Services")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Service")))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"AbandonActionAffixes"),"\uff1a\u9ed8\u8ba4\u53bb\u9664\u52a8\u4f5c\u65b9\u6cd5\u540d\u79f0\u524d\u540e\u7f00\u5217\u8868\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]"),"\uff0c\u9ed8\u8ba4\uff1a",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Async")))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"VerbToHttpMethods"),"\uff1a\u590d\u5199\u9ed8\u8ba4\u65b9\u6cd5\u540d\u8f6c ",Object(a.b)("inlineCode",{parentName:"li"},"[HttpMethod]")," \u89c4\u5219\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[][]")," \u4e8c\u7ef4\u6570\u7ec4\u7c7b\u578b\uff0c\u5185\u7f6e\u5339\u914d\u89c4\u5219\u4e3a\uff1a",Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-cs"}),'["post"] = "POST",\n["add"] = "POST",\n["create"] = "POST",\n["insert"] = "POST",\n["submit"] = "POST",\n["get"] = "GET",\n["find"] = "GET",\n["fetch"] = "GET",\n["query"] = "GET",\n["getlist"] = "GET",\n["getall"] = "GET",\n["put"] = "PUT",\n["update"] = "PUT",\n["delete"] = "DELETE",\n["remove"] = "DELETE",\n["clear"] = "DELETE",\n["patch"] = "PATCH"\n')),Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},"\u590d\u5199\u793a\u4f8b")),Object(a.b)("pre",{parentName:"li"},Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'"DynamicApiControllerSettings": {\n "VerbToHttpMethods": [\n [ "getall", "HEAD" ], // => getall \u4f1a\u88ab\u590d\u5199\u4e3a `[HttpHead]`\n [ "other", "PUT" ] // => \u65b0\u589e\u4e00\u6761\u65b0\u89c4\u5219\uff0c\u6bd4\u5982\uff0c\u4e00 `[other]` \u5f00\u5934\u4f1a\u8f6c\u6362\u4e3a `[HttpPut]` \u8bf7\u6c42\n ]\n }\n')))))),Object(a.b)("h2",{id:"53-\u914d\u7f6e\u793a\u4f8b"},"5.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'{\n "DynamicApiControllerSettings": {\n "SupportedMvcController": true\n }\n}\n')))}u.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return l}));var i=n(21),r=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(i.default)();return{withBaseUrl:(n,i)=>function(e,t,n,{forcePrependBaseUrl:i=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(i)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+l:l}(t,e,n,i)}}function l(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!i(e)}n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var i=n(0),r=n.n(i);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),p=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},u=function(e){var t=p(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,i=e.mdxType,a=e.originalType,l=e.parentName,b=c(e,["components","mdxType","originalType","parentName"]),u=p(n),d=i,m=u["".concat(l,".").concat(d)]||u[d]||s[d]||a;return n?r.a.createElement(m,o(o({ref:t},b),{},{components:n})):r.a.createElement(m,o({ref:t},b))}));function m(e,t){var n=arguments,i=t&&t.mdxType;if("string"==typeof e||i){var a=n.length,l=new Array(a);l[0]=d;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o.mdxType="string"==typeof e?e:i,l[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/7d3779e7.9b1bffa4.js b/docs/7d3779e7.a80a102b.js similarity index 97% rename from docs/7d3779e7.9b1bffa4.js rename to docs/7d3779e7.a80a102b.js index b618952b011..358c271a924 100644 --- a/docs/7d3779e7.9b1bffa4.js +++ b/docs/7d3779e7.a80a102b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[53],{129:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return p})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),c=(n(0),n(192)),i=n(193),o={id:"object-mapper",title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",sidebar_label:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04"},p={unversionedId:"object-mapper",id:"object-mapper",isDocsHomePage:!1,title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",description:"13.1 \u5bf9\u8c61\u6620\u5c04",source:"@site/docs\\object-mapper.mdx",slug:"/object-mapper",permalink:"/docs/object-mapper",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/object-mapper.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",sidebar:"docs",previous:{title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",permalink:"/docs/dependency-injection"},next:{title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",permalink:"/docs/cache"}},b=[{value:"13.1 \u5bf9\u8c61\u6620\u5c04",id:"131-\u5bf9\u8c61\u6620\u5c04",children:[]},{value:"13.2 \u5148\u770b\u4f8b\u5b50",id:"132-\u5148\u770b\u4f8b\u5b50",children:[]},{value:"13.3 Mapster \u4f7f\u7528",id:"133-mapster-\u4f7f\u7528",children:[{value:"13.3.1 \u6781\u6613\u5165\u95e8",id:"1331-\u6781\u6613\u5165\u95e8",children:[]},{value:"13.3.2 \u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219",id:"1332-\u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219",children:[]},{value:"13.3.3 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",id:"1333-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",children:[]},{value:"13.3.4 \u548c EFCore \u914d\u5408",id:"1334-\u548c-efcore-\u914d\u5408",children:[]}]},{value:"13.5 \u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e",id:"135-\u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e",children:[]},{value:"13.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"136-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:b};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"131-\u5bf9\u8c61\u6620\u5c04"},"13.1 \u5bf9\u8c61\u6620\u5c04"),Object(c.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u5c06\u4e00\u4e2a\u5bf9\u8c61\u7684\u6570\u636e\u6839\u636e\u7279\u5b9a\u89c4\u5219\u6279\u91cf\u6620\u5c04\u5230\u53e6\u4e00\u4e2a\u5bf9\u8c61\u4e2d\uff0c\u51cf\u5c11\u624b\u5de5\u64cd\u4f5c\u548c\u964d\u4f4e\u4eba\u4e3a\u51fa\u9519\u7387\u3002\u5982\u5c06 ",Object(c.b)("inlineCode",{parentName:"p"},"DTO")," \u5bf9\u8c61\u6620\u5c04\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"Entity")," \u5b9e\u4f53\u4e2d\uff0c\u53cd\u4e4b\u4ea6\u7136\u3002"),Object(c.b)("h2",{id:"132-\u5148\u770b\u4f8b\u5b50"},"13.2 \u5148\u770b\u4f8b\u5b50"),Object(c.b)("p",null,"\u5728\u8fc7\u53bb\uff0c\u6211\u4eec\u9700\u8981\u5c06\u4e00\u4e2a\u5bf9\u8c61\u7684\u503c\u8f6c\u6362\u5230\u53e6\u4e00\u4e2a\u5bf9\u8c61\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u8fd9\u6837\u505a\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var entity = repository.Find(1);\n\nvar dto = new Dto();\ndto.Id = entity.Id;\ndto.Name = entity.Name;\ndto.Age = entity.Age;\ndto.Address = entity.Address;\ndto.FullName = entity.FirstName + entity.LastName;\ndto.IdCard = entity.IdCard.Replace("1234", "****");\n')),Object(c.b)("p",null,"\u4e0a\u9762\u7684\u4f8b\u5b50\u4f3c\u4e4e\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u4f46\u662f\u5982\u679c\u5f88\u591a\u5730\u65b9\u9700\u8981\u8fd9\u6837\u7684\u8d4b\u503c\u64cd\u4f5c\u3001\u6216\u8005\u76f8\u540c\u7684\u8d4b\u503c\u64cd\u4f5c\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\uff0c\u53c8\u6216\u8005\u4e00\u4e2a\u7c7b\u4e2d\u542b\u6709\u975e\u5e38\u591a\u7684\u5c5e\u6027\u6216\u81ea\u5b9a\u4e49\u8d4b\u503c\u64cd\u4f5c\u3002\u90a3\u4e48\u8fd9\u6837\u7684\u64cd\u4f5c\u6548\u7387\u6781\u4f4e\uff0c\u5bb9\u6613\u51fa\u9519\uff0c\u4e14\u4ee3\u7801\u975e\u5e38\u81c3\u80bf\u548c\u5197\u4f59\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c\u5b9e\u73b0\u81ea\u52a8\u6620\u5c04\u8d4b\u503c\u548c\u652f\u6301\u7279\u6b8a\u914d\u7f6e\u7684\u9700\u6c42\u5c31\u6709\u4e86\u3002\u76ee\u524d ",Object(c.b)("inlineCode",{parentName:"p"},"C#")," \u5e73\u53f0\u6709\u4e24\u4e2a\u4f18\u79c0\u7684\u5bf9\u8c61\u6620\u5c04\u5de5\u5177\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"AutoMapper"),"\u3002",Object(c.b)("strong",{parentName:"p"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"strong"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u96c6\u6210\u7684\u662f ",Object(c.b)("a",Object(a.a)({parentName:"strong"},{href:"https://github.com/MapsterMapper/Mapster"}),"Mapster"),"\uff0c",Object(c.b)("a",Object(a.a)({parentName:"strong"},{href:"https://github.com/MapsterMapper/Mapster"}),"Mapster")," \u662f\u4e00\u6b3e\u6781\u6613\u4f7f\u7528\u4e14\u8d85\u9ad8\u6027\u80fd\u7684\u5bf9\u8c61\u6620\u5c04\u6846\u67b6\u3002")),Object(c.b)("h2",{id:"133-mapster-\u4f7f\u7528"},"13.3 ",Object(c.b)("inlineCode",{parentName:"h2"},"Mapster")," \u4f7f\u7528"),Object(c.b)("p",null,"\u73b0\u5728\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u63d0\u4f9b\u7684\u5bf9\u8c61\u6620\u5c04\u65b9\u6cd5\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Adapt")," \u65b9\u6cd5\u6539\u9020\u4e0a\u9762\u7684\u4f8b\u5b50\uff1a"),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b89\u88c5\u62d3\u5c55\u5305")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\uff08\u63a8\u8350\uff09\u5b89\u88c5 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Extras.ObjectMapper.Mapster")," \u62d3\u5c55\u5305\uff0c\u65e0\u9700\u624b\u52a8\u8c03\u7528\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u4f1a\u81ea\u52a8\u52a0\u8f7d\u5e76\u8c03\u7528\u3002"))),Object(c.b)("h3",{id:"1331-\u6781\u6613\u5165\u95e8"},"13.3.1 \u6781\u6613\u5165\u95e8"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var entity = repository.Find(1);\nvar dto = entity.Adapt();\n")),Object(c.b)("p",null,"\u4ec5\u4ec5\u4e00\u884c\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"entity -> dto")," \u7684\u8f6c\u6362\uff0c\u5982\u679c\u6d89\u53ca\u5230\u8d4b\u503c\u7684\u590d\u5236\u64cd\u4f5c\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"dto.FullName")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"dto.IdCard"),"\uff0c\u6211\u4eec\u53ea\u9700\u8981\u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219\u7c7b\u5373\u53ef\u3002"),Object(c.b)("h3",{id:"1332-\u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219"},"13.3.2 \u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,10-12}","{1,6,10-12}":!0}),'using Mapster;\nusing System;\n\nnamespace Furion.Application\n{\n public class Mapper : IRegister\n {\n public void Register(TypeAdapterConfig config)\n {\n config.ForType()\n .Map(dest => dest.FullName, src => src.FirstName + src.LastName)\n .Map(dest => dest.IdCard, src => src.IdCard.Replace("1234", "****"));\n }\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u8be5\u6620\u5c04\u6587\u4ef6 ",Object(c.b)("inlineCode",{parentName:"p"},"Mapper.cs")," \u53ef\u4ee5\u653e\u5728\u4efb\u4f55\u9879\u76ee\u6216\u6587\u4ef6\u5939\u4e2d\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u4f1a\u5728\u7a0b\u5e8f\u542f\u52a8\u7684\u65f6\u5019\u81ea\u52a8\u626b\u63cf\u5e76\u6ce8\u5165\u914d\u7f6e\u3002"))),Object(c.b)("h3",{id:"1333-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"},"13.3.3 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u9664\u4e86\u63d0\u4f9b ",Object(c.b)("inlineCode",{parentName:"p"},"Adapt")," \u62d3\u5c55\u65b9\u6cd5\u4ee5\u5916\uff0c\u540c\u65f6\u8fd8\u63d0\u4f9b\u4f9d\u8d56\u6ce8\u5165\u7684\u65b9\u5f0f\u3002"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public Person(IMapper mapper)\n{\n var dto = _mapper.Map(entity);\n}\n")),Object(c.b)("h3",{id:"1334-\u548c-efcore-\u914d\u5408"},"13.3.4 \u548c ",Object(c.b)("inlineCode",{parentName:"h3"},"EFCore")," \u914d\u5408"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u8fd8\u63d0\u4f9b\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ProjectToType")," Linq \u62d3\u5c55\u65b9\u6cd5\u51cf\u5c11\u6211\u4eec\u624b\u52a8 ",Object(c.b)("inlineCode",{parentName:"p"},"Select")," \u64cd\u4f5c\uff0c\u5982\uff1a"),Object(c.b)("p",null,"\u6b63\u5e38\u7684\u64cd\u4f5c\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var destinations = context.Sources\n .Select(c => new Destination {\n Id = p.Id,\n Name = p.Name,\n Surname = p.Surname,\n ....\n })\n .ToList();\n")),Object(c.b)("p",null,"\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u4e4b\u540e\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"})," var destinations = context.Sources.ProjectToType().ToList();\n")),Object(c.b)("h2",{id:"135-\u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e"},"13.5 \u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u5168\u5c40\u9ed8\u8ba4\u6620\u5c04\u914d\u7f6e\u9009\u9879 ",Object(c.b)("inlineCode",{parentName:"p"},"TypeAdapterConfig.GlobalSettings.Default"),"\uff0c\u53ef\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"TypeAdapterConfig.GlobalSettings.Default\n .PreserveReference(true);\n")),Object(c.b)("h2",{id:"136-\u53cd\u9988\u4e0e\u5efa\u8bae"},"13.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/MapsterMapper/Mapster/wiki"}),"Mapster - Wiki")," \u6587\u6863\u3002"))))}d.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return u}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),s=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=s(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},l={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,b=p(e,["components","mdxType","originalType","parentName"]),d=s(n),m=a,u=d["".concat(i,".").concat(m)]||d[m]||l[m]||c;return n?r.a.createElement(u,o(o({ref:t},b),{},{components:n})):r.a.createElement(u,o({ref:t},b))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=m;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{132:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return p})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),c=(n(0),n(196)),i=n(197),o={id:"object-mapper",title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",sidebar_label:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04"},p={unversionedId:"object-mapper",id:"object-mapper",isDocsHomePage:!1,title:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",description:"13.1 \u5bf9\u8c61\u6620\u5c04",source:"@site/docs\\object-mapper.mdx",slug:"/object-mapper",permalink:"/docs/object-mapper",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/object-mapper.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04",sidebar:"docs",previous:{title:"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c",permalink:"/docs/dependency-injection"},next:{title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",permalink:"/docs/cache"}},b=[{value:"13.1 \u5bf9\u8c61\u6620\u5c04",id:"131-\u5bf9\u8c61\u6620\u5c04",children:[]},{value:"13.2 \u5148\u770b\u4f8b\u5b50",id:"132-\u5148\u770b\u4f8b\u5b50",children:[]},{value:"13.3 Mapster \u4f7f\u7528",id:"133-mapster-\u4f7f\u7528",children:[{value:"13.3.1 \u6781\u6613\u5165\u95e8",id:"1331-\u6781\u6613\u5165\u95e8",children:[]},{value:"13.3.2 \u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219",id:"1332-\u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219",children:[]},{value:"13.3.3 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",id:"1333-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",children:[]},{value:"13.3.4 \u548c EFCore \u914d\u5408",id:"1334-\u548c-efcore-\u914d\u5408",children:[]}]},{value:"13.5 \u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e",id:"135-\u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e",children:[]},{value:"13.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"136-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:b};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"131-\u5bf9\u8c61\u6620\u5c04"},"13.1 \u5bf9\u8c61\u6620\u5c04"),Object(c.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u5c06\u4e00\u4e2a\u5bf9\u8c61\u7684\u6570\u636e\u6839\u636e\u7279\u5b9a\u89c4\u5219\u6279\u91cf\u6620\u5c04\u5230\u53e6\u4e00\u4e2a\u5bf9\u8c61\u4e2d\uff0c\u51cf\u5c11\u624b\u5de5\u64cd\u4f5c\u548c\u964d\u4f4e\u4eba\u4e3a\u51fa\u9519\u7387\u3002\u5982\u5c06 ",Object(c.b)("inlineCode",{parentName:"p"},"DTO")," \u5bf9\u8c61\u6620\u5c04\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"Entity")," \u5b9e\u4f53\u4e2d\uff0c\u53cd\u4e4b\u4ea6\u7136\u3002"),Object(c.b)("h2",{id:"132-\u5148\u770b\u4f8b\u5b50"},"13.2 \u5148\u770b\u4f8b\u5b50"),Object(c.b)("p",null,"\u5728\u8fc7\u53bb\uff0c\u6211\u4eec\u9700\u8981\u5c06\u4e00\u4e2a\u5bf9\u8c61\u7684\u503c\u8f6c\u6362\u5230\u53e6\u4e00\u4e2a\u5bf9\u8c61\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u8fd9\u6837\u505a\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var entity = repository.Find(1);\n\nvar dto = new Dto();\ndto.Id = entity.Id;\ndto.Name = entity.Name;\ndto.Age = entity.Age;\ndto.Address = entity.Address;\ndto.FullName = entity.FirstName + entity.LastName;\ndto.IdCard = entity.IdCard.Replace("1234", "****");\n')),Object(c.b)("p",null,"\u4e0a\u9762\u7684\u4f8b\u5b50\u4f3c\u4e4e\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u4f46\u662f\u5982\u679c\u5f88\u591a\u5730\u65b9\u9700\u8981\u8fd9\u6837\u7684\u8d4b\u503c\u64cd\u4f5c\u3001\u6216\u8005\u76f8\u540c\u7684\u8d4b\u503c\u64cd\u4f5c\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\uff0c\u53c8\u6216\u8005\u4e00\u4e2a\u7c7b\u4e2d\u542b\u6709\u975e\u5e38\u591a\u7684\u5c5e\u6027\u6216\u81ea\u5b9a\u4e49\u8d4b\u503c\u64cd\u4f5c\u3002\u90a3\u4e48\u8fd9\u6837\u7684\u64cd\u4f5c\u6548\u7387\u6781\u4f4e\uff0c\u5bb9\u6613\u51fa\u9519\uff0c\u4e14\u4ee3\u7801\u975e\u5e38\u81c3\u80bf\u548c\u5197\u4f59\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c\u5b9e\u73b0\u81ea\u52a8\u6620\u5c04\u8d4b\u503c\u548c\u652f\u6301\u7279\u6b8a\u914d\u7f6e\u7684\u9700\u6c42\u5c31\u6709\u4e86\u3002\u76ee\u524d ",Object(c.b)("inlineCode",{parentName:"p"},"C#")," \u5e73\u53f0\u6709\u4e24\u4e2a\u4f18\u79c0\u7684\u5bf9\u8c61\u6620\u5c04\u5de5\u5177\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"AutoMapper"),"\u3002",Object(c.b)("strong",{parentName:"p"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"strong"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u96c6\u6210\u7684\u662f ",Object(c.b)("a",Object(a.a)({parentName:"strong"},{href:"https://github.com/MapsterMapper/Mapster"}),"Mapster"),"\uff0c",Object(c.b)("a",Object(a.a)({parentName:"strong"},{href:"https://github.com/MapsterMapper/Mapster"}),"Mapster")," \u662f\u4e00\u6b3e\u6781\u6613\u4f7f\u7528\u4e14\u8d85\u9ad8\u6027\u80fd\u7684\u5bf9\u8c61\u6620\u5c04\u6846\u67b6\u3002")),Object(c.b)("h2",{id:"133-mapster-\u4f7f\u7528"},"13.3 ",Object(c.b)("inlineCode",{parentName:"h2"},"Mapster")," \u4f7f\u7528"),Object(c.b)("p",null,"\u73b0\u5728\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u63d0\u4f9b\u7684\u5bf9\u8c61\u6620\u5c04\u65b9\u6cd5\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"Adapt")," \u65b9\u6cd5\u6539\u9020\u4e0a\u9762\u7684\u4f8b\u5b50\uff1a"),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b89\u88c5\u62d3\u5c55\u5305")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\uff08\u63a8\u8350\uff09\u5b89\u88c5 ",Object(c.b)("inlineCode",{parentName:"p"},"Furion.Extras.ObjectMapper.Mapster")," \u62d3\u5c55\u5305\uff0c\u65e0\u9700\u624b\u52a8\u8c03\u7528\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u4f1a\u81ea\u52a8\u52a0\u8f7d\u5e76\u8c03\u7528\u3002"))),Object(c.b)("h3",{id:"1331-\u6781\u6613\u5165\u95e8"},"13.3.1 \u6781\u6613\u5165\u95e8"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var entity = repository.Find(1);\nvar dto = entity.Adapt();\n")),Object(c.b)("p",null,"\u4ec5\u4ec5\u4e00\u884c\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0 ",Object(c.b)("inlineCode",{parentName:"p"},"entity -> dto")," \u7684\u8f6c\u6362\uff0c\u5982\u679c\u6d89\u53ca\u5230\u8d4b\u503c\u7684\u590d\u5236\u64cd\u4f5c\uff0c\u5982 ",Object(c.b)("inlineCode",{parentName:"p"},"dto.FullName")," \u548c ",Object(c.b)("inlineCode",{parentName:"p"},"dto.IdCard"),"\uff0c\u6211\u4eec\u53ea\u9700\u8981\u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219\u7c7b\u5373\u53ef\u3002"),Object(c.b)("h3",{id:"1332-\u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219"},"13.3.2 \u81ea\u5b9a\u4e49\u6620\u5c04\u89c4\u5219"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,10-12}","{1,6,10-12}":!0}),'using Mapster;\nusing System;\n\nnamespace Furion.Application\n{\n public class Mapper : IRegister\n {\n public void Register(TypeAdapterConfig config)\n {\n config.ForType()\n .Map(dest => dest.FullName, src => src.FirstName + src.LastName)\n .Map(dest => dest.IdCard, src => src.IdCard.Replace("1234", "****"));\n }\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u8be5\u6620\u5c04\u6587\u4ef6 ",Object(c.b)("inlineCode",{parentName:"p"},"Mapper.cs")," \u53ef\u4ee5\u653e\u5728\u4efb\u4f55\u9879\u76ee\u6216\u6587\u4ef6\u5939\u4e2d\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u4f1a\u5728\u7a0b\u5e8f\u542f\u52a8\u7684\u65f6\u5019\u81ea\u52a8\u626b\u63cf\u5e76\u6ce8\u5165\u914d\u7f6e\u3002"))),Object(c.b)("h3",{id:"1333-\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"},"13.3.3 \u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u9664\u4e86\u63d0\u4f9b ",Object(c.b)("inlineCode",{parentName:"p"},"Adapt")," \u62d3\u5c55\u65b9\u6cd5\u4ee5\u5916\uff0c\u540c\u65f6\u8fd8\u63d0\u4f9b\u4f9d\u8d56\u6ce8\u5165\u7684\u65b9\u5f0f\u3002"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public Person(IMapper mapper)\n{\n var dto = _mapper.Map(entity);\n}\n")),Object(c.b)("h3",{id:"1334-\u548c-efcore-\u914d\u5408"},"13.3.4 \u548c ",Object(c.b)("inlineCode",{parentName:"h3"},"EFCore")," \u914d\u5408"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u8fd8\u63d0\u4f9b\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ProjectToType")," Linq \u62d3\u5c55\u65b9\u6cd5\u51cf\u5c11\u6211\u4eec\u624b\u52a8 ",Object(c.b)("inlineCode",{parentName:"p"},"Select")," \u64cd\u4f5c\uff0c\u5982\uff1a"),Object(c.b)("p",null,"\u6b63\u5e38\u7684\u64cd\u4f5c\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var destinations = context.Sources\n .Select(c => new Destination {\n Id = p.Id,\n Name = p.Name,\n Surname = p.Surname,\n ....\n })\n .ToList();\n")),Object(c.b)("p",null,"\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u4e4b\u540e\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"})," var destinations = context.Sources.ProjectToType().ToList();\n")),Object(c.b)("h2",{id:"135-\u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e"},"13.5 \u5168\u5c40\u9ed8\u8ba4\u914d\u7f6e"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u5168\u5c40\u9ed8\u8ba4\u6620\u5c04\u914d\u7f6e\u9009\u9879 ",Object(c.b)("inlineCode",{parentName:"p"},"TypeAdapterConfig.GlobalSettings.Default"),"\uff0c\u53ef\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Startup")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff0c\u5982\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"TypeAdapterConfig.GlobalSettings.Default\n .PreserveReference(true);\n")),Object(c.b)("h2",{id:"136-\u53cd\u9988\u4e0e\u5efa\u8bae"},"13.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(c.b)("hr",null),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(c.b)("inlineCode",{parentName:"p"},"Mapster")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://github.com/MapsterMapper/Mapster/wiki"}),"Mapster - Wiki")," \u6587\u6863\u3002"))))}d.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return u}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),s=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=s(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},l={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,b=p(e,["components","mdxType","originalType","parentName"]),d=s(n),m=a,u=d["".concat(i,".").concat(m)]||d[m]||l[m]||c;return n?r.a.createElement(u,o(o({ref:t},b),{},{components:n})):r.a.createElement(u,o({ref:t},b))}));function u(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=m;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/8231c802.cc2df14b.js b/docs/8231c802.de1b2623.js similarity index 97% rename from docs/8231c802.cc2df14b.js rename to docs/8231c802.de1b2623.js index eabb1859183..5bb899c70ee 100644 --- a/docs/8231c802.cc2df14b.js +++ b/docs/8231c802.de1b2623.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[54],{130:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return s}));var a=t(3),i=t(7),r=(t(0),t(192)),c=t(193),b={id:"entity",title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",sidebar_label:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53"},o={unversionedId:"entity",id:"entity",isDocsHomePage:!1,title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",description:"9.3.1 \u6570\u636e\u5e93\u5b9e\u4f53",source:"@site/docs\\entity.mdx",slug:"/entity",permalink:"/docs/entity",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/entity.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",sidebar:"docs",previous:{title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",permalink:"/docs/dbcontext-locator"},next:{title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",permalink:"/docs/dbcontext-repository"}},l=[{value:"9.3.1 \u6570\u636e\u5e93\u5b9e\u4f53",id:"931-\u6570\u636e\u5e93\u5b9e\u4f53",children:[]},{value:"9.3.2 \u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53",id:"932-\u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53",children:[{value:"9.3.2.1 \u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219",id:"9321-\u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219",children:[]},{value:"9.3.2.2 IEntity \u793a\u8303\uff1a",id:"9322-ientity-\u793a\u8303\uff1a",children:[]},{value:"9.3.2.2 EntityBase \u793a\u8303\uff1a",id:"9322-entitybase-\u793a\u8303\uff1a",children:[]},{value:"9.3.2.3 Entity \u793a\u8303\uff1a",id:"9323-entity-\u793a\u8303\uff1a",children:[]},{value:"9.3.2.4 EntityNotKey \u793a\u8303\uff1a",id:"9324-entitynotkey-\u793a\u8303\uff1a",children:[]}]},{value:"9.3.3 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e",id:"933-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e",children:[{value:"9.3.3.1 \u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e",id:"9331-\u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e",children:[]},{value:"9.3.3.2 \u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e",id:"9332-\u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e",children:[]}]},{value:"9.3.4 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e",id:"934-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e",children:[]},{value:"9.3.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"935-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function s(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"931-\u6570\u636e\u5e93\u5b9e\u4f53"},"9.3.1 \u6570\u636e\u5e93\u5b9e\u4f53"),Object(r.b)("p",null,"\u5728\u9762\u5411\u5bf9\u8c61\u5f00\u53d1\u601d\u60f3\u4e2d\uff0c\u6700\u91cd\u8981\u5c24\u4e3a",Object(r.b)("strong",{parentName:"p"},"\u5bf9\u8c61"),"\u4e8c\u5b57\uff0c\u5728 .NET \u5f00\u53d1\u8fc7\u53bb\uff0c\u64cd\u4f5c\u6570\u636e\u5e93\u5f80\u5f80\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"DataTable")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"DataSet")," \u6765\u63a5\u6536\u6570\u636e\u5e93\u8fd4\u56de\u7ed3\u679c\u96c6\uff0c\u800c\u64cd\u4f5c\u6570\u636e\u5e93\u4e5f\u79bb\u4e0d\u5f00\u624b\u5199 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u3002"),Object(r.b)("p",null,"\u5728\u8fc7\u53bb\u9762\u5411\u8fc7\u7a0b\u548c\u5e94\u7528\u4e0d\u53d1\u8fbe\u7684\u65f6\u4ee3\uff0c\u8fd9\u4e9b\u64cd\u4f5c\u786e\u5b9e\u597d\u4f7f\u3002\u7136\u540e\u968f\u7740\u4e2d\u56fd\u4e92\u8054\u7f51\u7f51\u6c11\u7684\u6fc0\u589e\uff0c\u7535\u5b50\u5316\u65f6\u4ee3\u7684\u5230\u6765\uff0c\u5404\u884c\u5404\u4e1a\u5bf9\u5e94\u7528\u9700\u6c42\u4e5f\u8fbe\u5230\u4e86\u524d\u6240\u672a\u6709\u7684\u91cf\u7ea7\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0c\u5728\u8fc7\u53bb\u624b\u5199 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u7684\u65f6\u4ee3\u5404\u79cd\u95ee\u9898\u663e\u9732\u65e0\u7591\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u7a0b\u5e8f\u5458\u80fd\u529b\u53c2\u5dee\u4e0d\u9f50\uff0c\u5199\u51fa\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u6027\u80fd\u81ea\u7136\u4e5f\u5929\u5dee\u5730\u522b"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u5c5e\u4e8e\u5b57\u7b26\u4e32\u786c\u7f16\u7a0b\uff0c\u540e\u671f\u7ef4\u62a4\u96be\u4e0a\u52a0\u96be"),Object(r.b)("li",{parentName:"ul"},"\u8bb8\u591a\u5355\u8868\u751a\u81f3\u591a\u8868\u7ed3\u6784\u4e00\u81f4\uff0c\u51fa\u73b0\u5927\u91cf\u91cd\u590d ",Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u4ee3\u7801"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u672c\u8eab\u5728\u4e0d\u540c\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u4e2d\u5199\u6cd5\u6709\u5dee\uff0c\u540e\u7eed\u8fc1\u79fb\u5934\u75db\u4e0d\u5df2")),Object(r.b)("p",null,"\u5f53\u7136\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u662f\u65f6\u4ee3\u7684\u4ea7\u7269\uff0c\u6211\u4eec\u4e5f\u79bb\u4e0d\u5f00 ",Object(r.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u4f46\u5bf9\u4e8e\u5927\u591a\u6570\u7a0b\u5e8f\u5458\u548c\u9879\u76ee\u6765\u8bf4\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u672a\u5fc5\u80fd\u591f\u5e26\u7ed9\u4ed6\u4eec\u591a\u5927\u7684\u6548\u76ca\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u5c31\u8bde\u751f\u4e86\uff0c\u6240\u8c13\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u5c31\u662f\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\uff0c\u82f1\u6587\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"Object Relational Mapping"),"\uff0c\u7b80\u5355\u70b9\u8bf4\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u6839\u636e\u7279\u6709\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"POCO \u8d2b\u8840\u6a21\u578b")," \u89c4\u5219\u751f\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u3002\u5927\u5927\u907f\u514d\u4e86\u91cd\u590d ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u80fd\u529b\u53c2\u5dee\u4e0d\u9f50\u7b49\u95ee\u9898\u3002\uff08\u5f53\u7136 ",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u4f5c\u8005 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u80fd\u529b\u4e5f\u4f1a\u5f71\u54cd\u6700\u7ec8\u6027\u80fd\uff09"),Object(r.b)("p",null,"\u4e0a\u9762\u6240\u8bf4\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"POCO")," \u8d2b\u8840\u6a21\u578b\u6b63\u662f\u6211\u4eec\u672c\u7ae0\u8282\u7684 ",Object(r.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u5b9e\u4f53"),"\u3002"),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u5b9e\u4f53\u5c31\u662f\u6570\u636e\u5e93\u8868\u7684\u7c7b\u8868\u73b0\uff0c\u901a\u8fc7\u4e00\u5b9a\u7684\u89c4\u5219\u4f7f\u8fd9\u4e2a\u7c7b\u80fd\u591f\u4e00\u4e00\u5bf9\u5e94\u8868\u7ed3\u6784\u3002\u901a\u5e38\u8fd9\u6837\u7684\u7c7b\u4e5f\u79f0\u4e3a\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"POCO")," \u8d2b\u8840\u6a21\u578b\uff0c\u4e5f\u5c31\u662f\u53ea\u6709\u5b9a\u4e49\uff0c\u6ca1\u6709\u884c\u4e3a\u3002"),Object(r.b)("h2",{id:"932-\u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53"},"9.3.2 \u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u591a\u79cd\u5b9a\u4e49\u5b9e\u4f53\u7684\u63a5\u53e3\u4f9d\u8d56\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IEntity"),"\uff1a\u5b9e\u4f53\u57fa\u63a5\u53e3\uff0c\u662f\u6240\u6709\u5b9e\u4f53\u7684\u57fa\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IEntityNotKey"),"\uff1a\u65e0\u952e\u5b9e\u4f53\u63a5\u53e3\uff0c\u4e5f\u5c31\u662f\u89c6\u56fe\u3001\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u4f9d\u8d56\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EntityBase"),"\uff1a\u5b9e\u4f53\u57fa\u62bd\u8c61\u7c7b\uff0c\u5185\u7f6e\u4e86 ",Object(r.b)("inlineCode",{parentName:"li"},"Id"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"TenantId")," \u5b57\u6bb5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Entity"),"\uff1a\u5b9e\u4f53\u901a\u7528\u62bd\u8c61\u7c7b\uff0c\u7ee7\u627f\u81ea ",Object(r.b)("inlineCode",{parentName:"li"},"EntityBase"),"\uff0c\u540c\u65f6\u5185\u7f6e ",Object(r.b)("inlineCode",{parentName:"li"},"CreatedTime"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"UpdatedTime"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"IsDeleted")," \u5b57\u6bb5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EntityNotKey"),"\uff1a\u65e0\u952e\u5b9e\u4f53\u62bd\u8c61\u7c7b\uff0c\u89c6\u56fe\u3001\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u4f9d\u8d56\u62bd\u8c61\u7c7b")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b9e\u4f53\u5b9a\u4e49\u4f4d\u7f6e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u6709\u7ea6\u5b9a\uff0c\u5b9e\u4f53\u7edf\u4e00\u5b9a\u4e49\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u3002"))),Object(r.b)("h3",{id:"9321-\u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219"},"9.3.2.1 \u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u4e0d\u9700\u8981 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion")," \u4e3a\u5b9e\u4f53\u6dfb\u52a0\u4efb\u4f55\u5185\u7f6e\u7279\u6027\uff0c\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"IEntity"),"\uff0c\u65e0\u952e\u5b9e\u4f53\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"IEntityNotKey")),Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u53ea\u9700\u8981 ",Object(r.b)("inlineCode",{parentName:"li"},"Id")," \u5c5e\u6027\uff0c\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"EntityBase")),Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u9700\u8981 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion")," \u4e3a\u4f60\u81ea\u52a8\u6dfb\u52a0\u5e38\u7528\u5b57\u6bb5\uff0c\u5219\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"Entity")),Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u9700\u8981\u89c6\u56fe\u3001\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"li"},"DbSet")," \u64cd\u4f5c\uff0c\u5219\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"li"},"EntityNotKey"))),Object(r.b)("h3",{id:"9322-ientity-\u793a\u8303\uff1a"},"9.3.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"IEntity")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class User : IEntity\n {\n /// \n /// \u624b\u5de5\u5b9a\u4e49 Id\n /// \n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"9322-entitybase-\u793a\u8303\uff1a"},"9.3.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"EntityBase")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class User : EntityBase\n {\n // \u65e0\u9700\u5b9a\u4e49 Id \u5c5e\u6027\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"9323-entity-\u793a\u8303\uff1a"},"9.3.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"Entity")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class User : Entity\n {\n // \u65e0\u9700\u5b9a\u4e49 Id \u5c5e\u6027\n // \u5e76\u81ea\u52a8\u6dfb\u52a0 CreatedTime\uff0cUpdateTime\uff0cIsDeleted \u5c5e\u6027\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"9324-entitynotkey-\u793a\u8303\uff1a"},"9.3.2.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"EntityNotKey")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7-9}","{1,5,7-9}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class UserView : EntityNotKey\n {\n public UserView() : base("\u89c6\u56fe\u540d\u79f0")\n {\n }\n\n /// \n /// Id\n /// \n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6570\u636e\u5e93\u5b9e\u4f53\u5fc5\u987b\u76f4\u63a5\u6216\u95f4\u63a5\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"p"},"IEntity")," \u624d\u80fd\u8fdb\u884c\u4ed3\u50a8\u7b49\u64cd\u4f5c\u3002"))),Object(r.b)("h2",{id:"933-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e"},"9.3.3 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e"),Object(r.b)("p",null,"\u5728\u8fc7\u53bb\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"EF Core")," \u9879\u76ee\u5f00\u53d1\u4e2d\uff0c\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating")," \u4e2d\u914d\u7f6e\u3002",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u4e3a\u4e86\u7b80\u5316\u914d\u7f6e\u548c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff0c\u62bd\u8c61\u51fa\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"IEntityTypeBuilder")," \u63a5\u53e3\u3002"),Object(r.b)("p",null,"\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"IEntityTypeBuilder")," \u63a5\u53e3\uff0c\u6211\u4eec\u65e0\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating")," \u4e2d\u914d\u7f6e\uff0c\u53ef\u5728\u4efb\u610f\u5730\u65b9\u914d\u7f6e\u3002"),Object(r.b)("h3",{id:"9331-\u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e"},"9.3.3.1 \u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,20-25}","{1,5,20-25}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.Core\n{\n public class User : Entity, IEntityTypeBuilder\n {\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n // \u914d\u7f6e\u6570\u636e\u5e93\u5b9e\u4f53\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasKey(u => u.Id);\n entityBuilder.HasIndex(u => u.Name);\n }\n }\n}\n")),Object(r.b)("h3",{id:"9332-\u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e"},"9.3.3.2 \u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,8,10-14}","{1,8,10-14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.Core\n{\n public class SomeClass : IEntityTypeBuilder\n {\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasKey(u => u.Id);\n entityBuilder.HasIndex(u => u.Name);\n }\n }\n}\n")),Object(r.b)("p",null,"\u5982\uff0c\u4e0a\u9762\u4f8b\u5b50\uff0c\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"SomeClass")," \u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"User")," \u6570\u636e\u5e93\u5b9e\u4f53\u3002"),Object(r.b)("h2",{id:"934-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e"},"9.3.4 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u81ea\u52a8\u626b\u63cf\u6240\u6709\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"p"},"IEntity")," \u63a5\u53e3\u7684\u7c7b\u8fdb\u884c ",Object(r.b)("inlineCode",{parentName:"p"},"DbSet")," \u6ce8\u518c\uff0c\u4e5f\u5c31\u662f\u5b9e\u73b0\u81ea\u52a8\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating"),"\u3002"),Object(r.b)("p",null,"\u5982\u679c\u9700\u8981\u8df3\u8fc7\u81ea\u52a8\u6ce8\u518c\uff0c\u53ea\u9700\u8981\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[NonAutomatic]")," \u6216 ",Object(r.b)("inlineCode",{parentName:"p"},"[SkipScan]")," \u7279\u6027\u5373\u53ef\u3002\u4e00\u65e6\u8d34\u4e86\u6b64\u7279\u6027\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u624b\u52a8\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating")),Object(r.b)("h2",{id:"935-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.3.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),i=t(191);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return u}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},m=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),s=p(t),m=a,u=s["".concat(c,".").concat(m)]||s[m]||d[m]||r;return t?i.a.createElement(u,b(b({ref:n},l),{},{components:t})):i.a.createElement(u,b({ref:n},l))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=m;var b={};for(var o in n)hasOwnProperty.call(n,o)&&(b[o]=n[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,c[1]=b;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{133:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return o})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return s}));var a=t(3),i=t(7),r=(t(0),t(196)),c=t(197),b={id:"entity",title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",sidebar_label:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53"},o={unversionedId:"entity",id:"entity",isDocsHomePage:!1,title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",description:"9.3.1 \u6570\u636e\u5e93\u5b9e\u4f53",source:"@site/docs\\entity.mdx",slug:"/entity",permalink:"/docs/entity",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/entity.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",sidebar:"docs",previous:{title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",permalink:"/docs/dbcontext-locator"},next:{title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",permalink:"/docs/dbcontext-repository"}},l=[{value:"9.3.1 \u6570\u636e\u5e93\u5b9e\u4f53",id:"931-\u6570\u636e\u5e93\u5b9e\u4f53",children:[]},{value:"9.3.2 \u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53",id:"932-\u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53",children:[{value:"9.3.2.1 \u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219",id:"9321-\u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219",children:[]},{value:"9.3.2.2 IEntity \u793a\u8303\uff1a",id:"9322-ientity-\u793a\u8303\uff1a",children:[]},{value:"9.3.2.2 EntityBase \u793a\u8303\uff1a",id:"9322-entitybase-\u793a\u8303\uff1a",children:[]},{value:"9.3.2.3 Entity \u793a\u8303\uff1a",id:"9323-entity-\u793a\u8303\uff1a",children:[]},{value:"9.3.2.4 EntityNotKey \u793a\u8303\uff1a",id:"9324-entitynotkey-\u793a\u8303\uff1a",children:[]}]},{value:"9.3.3 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e",id:"933-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e",children:[{value:"9.3.3.1 \u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e",id:"9331-\u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e",children:[]},{value:"9.3.3.2 \u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e",id:"9332-\u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e",children:[]}]},{value:"9.3.4 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e",id:"934-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e",children:[]},{value:"9.3.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"935-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function s(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"931-\u6570\u636e\u5e93\u5b9e\u4f53"},"9.3.1 \u6570\u636e\u5e93\u5b9e\u4f53"),Object(r.b)("p",null,"\u5728\u9762\u5411\u5bf9\u8c61\u5f00\u53d1\u601d\u60f3\u4e2d\uff0c\u6700\u91cd\u8981\u5c24\u4e3a",Object(r.b)("strong",{parentName:"p"},"\u5bf9\u8c61"),"\u4e8c\u5b57\uff0c\u5728 .NET \u5f00\u53d1\u8fc7\u53bb\uff0c\u64cd\u4f5c\u6570\u636e\u5e93\u5f80\u5f80\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"DataTable")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"DataSet")," \u6765\u63a5\u6536\u6570\u636e\u5e93\u8fd4\u56de\u7ed3\u679c\u96c6\uff0c\u800c\u64cd\u4f5c\u6570\u636e\u5e93\u4e5f\u79bb\u4e0d\u5f00\u624b\u5199 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u3002"),Object(r.b)("p",null,"\u5728\u8fc7\u53bb\u9762\u5411\u8fc7\u7a0b\u548c\u5e94\u7528\u4e0d\u53d1\u8fbe\u7684\u65f6\u4ee3\uff0c\u8fd9\u4e9b\u64cd\u4f5c\u786e\u5b9e\u597d\u4f7f\u3002\u7136\u540e\u968f\u7740\u4e2d\u56fd\u4e92\u8054\u7f51\u7f51\u6c11\u7684\u6fc0\u589e\uff0c\u7535\u5b50\u5316\u65f6\u4ee3\u7684\u5230\u6765\uff0c\u5404\u884c\u5404\u4e1a\u5bf9\u5e94\u7528\u9700\u6c42\u4e5f\u8fbe\u5230\u4e86\u524d\u6240\u672a\u6709\u7684\u91cf\u7ea7\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0c\u5728\u8fc7\u53bb\u624b\u5199 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u7684\u65f6\u4ee3\u5404\u79cd\u95ee\u9898\u663e\u9732\u65e0\u7591\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u7a0b\u5e8f\u5458\u80fd\u529b\u53c2\u5dee\u4e0d\u9f50\uff0c\u5199\u51fa\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u6027\u80fd\u81ea\u7136\u4e5f\u5929\u5dee\u5730\u522b"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u5c5e\u4e8e\u5b57\u7b26\u4e32\u786c\u7f16\u7a0b\uff0c\u540e\u671f\u7ef4\u62a4\u96be\u4e0a\u52a0\u96be"),Object(r.b)("li",{parentName:"ul"},"\u8bb8\u591a\u5355\u8868\u751a\u81f3\u591a\u8868\u7ed3\u6784\u4e00\u81f4\uff0c\u51fa\u73b0\u5927\u91cf\u91cd\u590d ",Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u4ee3\u7801"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"sql")," \u672c\u8eab\u5728\u4e0d\u540c\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u4e2d\u5199\u6cd5\u6709\u5dee\uff0c\u540e\u7eed\u8fc1\u79fb\u5934\u75db\u4e0d\u5df2")),Object(r.b)("p",null,"\u5f53\u7136\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u662f\u65f6\u4ee3\u7684\u4ea7\u7269\uff0c\u6211\u4eec\u4e5f\u79bb\u4e0d\u5f00 ",Object(r.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u4f46\u5bf9\u4e8e\u5927\u591a\u6570\u7a0b\u5e8f\u5458\u548c\u9879\u76ee\u6765\u8bf4\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u672a\u5fc5\u80fd\u591f\u5e26\u7ed9\u4ed6\u4eec\u591a\u5927\u7684\u6548\u76ca\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u5c31\u8bde\u751f\u4e86\uff0c\u6240\u8c13\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u5c31\u662f\u5bf9\u8c61\u5173\u7cfb\u6620\u5c04\uff0c\u82f1\u6587\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"Object Relational Mapping"),"\uff0c\u7b80\u5355\u70b9\u8bf4\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u6839\u636e\u7279\u6709\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"POCO \u8d2b\u8840\u6a21\u578b")," \u89c4\u5219\u751f\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u3002\u5927\u5927\u907f\u514d\u4e86\u91cd\u590d ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u80fd\u529b\u53c2\u5dee\u4e0d\u9f50\u7b49\u95ee\u9898\u3002\uff08\u5f53\u7136 ",Object(r.b)("inlineCode",{parentName:"p"},"ORM")," \u4f5c\u8005 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u80fd\u529b\u4e5f\u4f1a\u5f71\u54cd\u6700\u7ec8\u6027\u80fd\uff09"),Object(r.b)("p",null,"\u4e0a\u9762\u6240\u8bf4\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"POCO")," \u8d2b\u8840\u6a21\u578b\u6b63\u662f\u6211\u4eec\u672c\u7ae0\u8282\u7684 ",Object(r.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u5b9e\u4f53"),"\u3002"),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u5b9e\u4f53\u5c31\u662f\u6570\u636e\u5e93\u8868\u7684\u7c7b\u8868\u73b0\uff0c\u901a\u8fc7\u4e00\u5b9a\u7684\u89c4\u5219\u4f7f\u8fd9\u4e2a\u7c7b\u80fd\u591f\u4e00\u4e00\u5bf9\u5e94\u8868\u7ed3\u6784\u3002\u901a\u5e38\u8fd9\u6837\u7684\u7c7b\u4e5f\u79f0\u4e3a\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"POCO")," \u8d2b\u8840\u6a21\u578b\uff0c\u4e5f\u5c31\u662f\u53ea\u6709\u5b9a\u4e49\uff0c\u6ca1\u6709\u884c\u4e3a\u3002"),Object(r.b)("h2",{id:"932-\u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53"},"9.3.2 \u5982\u4f55\u5b9a\u4e49\u5b9e\u4f53"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u591a\u79cd\u5b9a\u4e49\u5b9e\u4f53\u7684\u63a5\u53e3\u4f9d\u8d56\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IEntity"),"\uff1a\u5b9e\u4f53\u57fa\u63a5\u53e3\uff0c\u662f\u6240\u6709\u5b9e\u4f53\u7684\u57fa\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IEntityNotKey"),"\uff1a\u65e0\u952e\u5b9e\u4f53\u63a5\u53e3\uff0c\u4e5f\u5c31\u662f\u89c6\u56fe\u3001\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u4f9d\u8d56\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EntityBase"),"\uff1a\u5b9e\u4f53\u57fa\u62bd\u8c61\u7c7b\uff0c\u5185\u7f6e\u4e86 ",Object(r.b)("inlineCode",{parentName:"li"},"Id"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"TenantId")," \u5b57\u6bb5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Entity"),"\uff1a\u5b9e\u4f53\u901a\u7528\u62bd\u8c61\u7c7b\uff0c\u7ee7\u627f\u81ea ",Object(r.b)("inlineCode",{parentName:"li"},"EntityBase"),"\uff0c\u540c\u65f6\u5185\u7f6e ",Object(r.b)("inlineCode",{parentName:"li"},"CreatedTime"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"UpdatedTime"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"IsDeleted")," \u5b57\u6bb5"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EntityNotKey"),"\uff1a\u65e0\u952e\u5b9e\u4f53\u62bd\u8c61\u7c7b\uff0c\u89c6\u56fe\u3001\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u4f9d\u8d56\u62bd\u8c61\u7c7b")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b9e\u4f53\u5b9a\u4e49\u4f4d\u7f6e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u6709\u7ea6\u5b9a\uff0c\u5b9e\u4f53\u7edf\u4e00\u5b9a\u4e49\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u3002"))),Object(r.b)("h3",{id:"9321-\u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219"},"9.3.2.1 \u5b9e\u4f53\u7ee7\u627f\u9009\u7528\u539f\u5219"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u4e0d\u9700\u8981 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion")," \u4e3a\u5b9e\u4f53\u6dfb\u52a0\u4efb\u4f55\u5185\u7f6e\u7279\u6027\uff0c\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"IEntity"),"\uff0c\u65e0\u952e\u5b9e\u4f53\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"IEntityNotKey")),Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u53ea\u9700\u8981 ",Object(r.b)("inlineCode",{parentName:"li"},"Id")," \u5c5e\u6027\uff0c\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"EntityBase")),Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u9700\u8981 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion")," \u4e3a\u4f60\u81ea\u52a8\u6dfb\u52a0\u5e38\u7528\u5b57\u6bb5\uff0c\u5219\u9009\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"Entity")),Object(r.b)("li",{parentName:"ul"},"\u5982\u679c\u4f60\u9700\u8981\u89c6\u56fe\u3001\u5b58\u50a8\u8fc7\u7a0b\u3001\u51fd\u6570\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"li"},"DbSet")," \u64cd\u4f5c\uff0c\u5219\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"li"},"EntityNotKey"))),Object(r.b)("h3",{id:"9322-ientity-\u793a\u8303\uff1a"},"9.3.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"IEntity")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class User : IEntity\n {\n /// \n /// \u624b\u5de5\u5b9a\u4e49 Id\n /// \n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"9322-entitybase-\u793a\u8303\uff1a"},"9.3.2.2 ",Object(r.b)("inlineCode",{parentName:"h3"},"EntityBase")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class User : EntityBase\n {\n // \u65e0\u9700\u5b9a\u4e49 Id \u5c5e\u6027\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"9323-entity-\u793a\u8303\uff1a"},"9.3.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"Entity")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class User : Entity\n {\n // \u65e0\u9700\u5b9a\u4e49 Id \u5c5e\u6027\n // \u5e76\u81ea\u52a8\u6dfb\u52a0 CreatedTime\uff0cUpdateTime\uff0cIsDeleted \u5c5e\u6027\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"9324-entitynotkey-\u793a\u8303\uff1a"},"9.3.2.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"EntityNotKey")," \u793a\u8303\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,7-9}","{1,5,7-9}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public class UserView : EntityNotKey\n {\n public UserView() : base("\u89c6\u56fe\u540d\u79f0")\n {\n }\n\n /// \n /// Id\n /// \n public int Id { get; set; }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n }\n}\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6570\u636e\u5e93\u5b9e\u4f53\u5fc5\u987b\u76f4\u63a5\u6216\u95f4\u63a5\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"p"},"IEntity")," \u624d\u80fd\u8fdb\u884c\u4ed3\u50a8\u7b49\u64cd\u4f5c\u3002"))),Object(r.b)("h2",{id:"933-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e"},"9.3.3 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e"),Object(r.b)("p",null,"\u5728\u8fc7\u53bb\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"EF Core")," \u9879\u76ee\u5f00\u53d1\u4e2d\uff0c\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating")," \u4e2d\u914d\u7f6e\u3002",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u4e3a\u4e86\u7b80\u5316\u914d\u7f6e\u548c\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff0c\u62bd\u8c61\u51fa\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"IEntityTypeBuilder")," \u63a5\u53e3\u3002"),Object(r.b)("p",null,"\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"IEntityTypeBuilder")," \u63a5\u53e3\uff0c\u6211\u4eec\u65e0\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating")," \u4e2d\u914d\u7f6e\uff0c\u53ef\u5728\u4efb\u610f\u5730\u65b9\u914d\u7f6e\u3002"),Object(r.b)("h3",{id:"9331-\u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e"},"9.3.3.1 \u5728\u6570\u636e\u5e93\u5b9e\u4f53\u4e2d\u914d\u7f6e"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5,20-25}","{1,5,20-25}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.Core\n{\n public class User : Entity, IEntityTypeBuilder\n {\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n // \u914d\u7f6e\u6570\u636e\u5e93\u5b9e\u4f53\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasKey(u => u.Id);\n entityBuilder.HasIndex(u => u.Name);\n }\n }\n}\n")),Object(r.b)("h3",{id:"9332-\u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e"},"9.3.3.2 \u5728\u4efb\u4f55\u5b9e\u4f8b\u7c7b\u4e2d\u914d\u7f6e"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,8,10-14}","{1,8,10-14}":!0}),"using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\n\nnamespace Furion.Core\n{\n public class SomeClass : IEntityTypeBuilder\n {\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasKey(u => u.Id);\n entityBuilder.HasIndex(u => u.Name);\n }\n }\n}\n")),Object(r.b)("p",null,"\u5982\uff0c\u4e0a\u9762\u4f8b\u5b50\uff0c\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"SomeClass")," \u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"User")," \u6570\u636e\u5e93\u5b9e\u4f53\u3002"),Object(r.b)("h2",{id:"934-\u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e"},"9.3.4 \u6570\u636e\u5e93\u5b9e\u4f53\u914d\u7f6e\u8bf4\u660e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u81ea\u52a8\u626b\u63cf\u6240\u6709\u7ee7\u627f ",Object(r.b)("inlineCode",{parentName:"p"},"IEntity")," \u63a5\u53e3\u7684\u7c7b\u8fdb\u884c ",Object(r.b)("inlineCode",{parentName:"p"},"DbSet")," \u6ce8\u518c\uff0c\u4e5f\u5c31\u662f\u5b9e\u73b0\u81ea\u52a8\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating"),"\u3002"),Object(r.b)("p",null,"\u5982\u679c\u9700\u8981\u8df3\u8fc7\u81ea\u52a8\u6ce8\u518c\uff0c\u53ea\u9700\u8981\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[NonAutomatic]")," \u6216 ",Object(r.b)("inlineCode",{parentName:"p"},"[SkipScan]")," \u7279\u6027\u5373\u53ef\u3002\u4e00\u65e6\u8d34\u4e86\u6b64\u7279\u6027\uff0c\u90a3\u4e48\u5c31\u9700\u8981\u624b\u52a8\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"OnModelCreating")),Object(r.b)("h2",{id:"935-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.3.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),i=t(195);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return u}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},m=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,l=o(e,["components","mdxType","originalType","parentName"]),s=p(t),m=a,u=s["".concat(c,".").concat(m)]||s[m]||d[m]||r;return t?i.a.createElement(u,b(b({ref:n},l),{},{components:t})):i.a.createElement(u,b({ref:n},l))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=m;var b={};for(var o in n)hasOwnProperty.call(n,o)&&(b[o]=n[o]);b.originalType=e,b.mdxType="string"==typeof e?e:a,c[1]=b;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/855780aa.92c5925e.js b/docs/855780aa.92c5925e.js new file mode 100644 index 00000000000..6e77495b292 --- /dev/null +++ b/docs/855780aa.92c5925e.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{134:function(t){t.exports=JSON.parse('{"title":"Recent posts","items":[{"title":"3. \u6587\u4ef6\u4e0a\u4f20\u4e0b\u8f7d","permalink":"/blog/fileupload-download"},{"title":"2. HttpContext \u5e94\u7528","permalink":"/blog/httpcontext"},{"title":"1. Furion \u4ecb\u7ecd","permalink":"/blog/welcome"}]}')}}]); \ No newline at end of file diff --git a/docs/855780aa.e0a1a652.js b/docs/855780aa.e0a1a652.js deleted file mode 100644 index f5a7466e72b..00000000000 --- a/docs/855780aa.e0a1a652.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[55],{131:function(e){e.exports=JSON.parse('{"title":"Recent posts","items":[{"title":"Furion \u4ecb\u7ecd","permalink":"/blog/welcome"}]}')}}]); \ No newline at end of file diff --git a/docs/87f1d242.eccc8ed5.js b/docs/87f1d242.2ca12578.js similarity index 90% rename from docs/87f1d242.eccc8ed5.js rename to docs/87f1d242.2ca12578.js index c056a1a4ba6..393706916f4 100644 --- a/docs/87f1d242.eccc8ed5.js +++ b/docs/87f1d242.2ca12578.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{132:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(192)),o=n(193),i={id:"messagecenter",title:"9. MessageCenter \u9759\u6001\u7c7b",sidebar_label:"9. MessageCenter \u9759\u6001\u7c7b"},s={unversionedId:"global/messagecenter",id:"global/messagecenter",isDocsHomePage:!1,title:"9. MessageCenter \u9759\u6001\u7c7b",description:"9.1 \u8ba2\u9605\u6d88\u606f",source:"@site/docs\\global\\messagecenter.mdx",slug:"/global/messagecenter",permalink:"/docs/global/messagecenter",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/messagecenter.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9. MessageCenter \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"8. L \u9759\u6001\u7c7b",permalink:"/docs/global/l"}},u=[{value:"9.1 \u8ba2\u9605\u6d88\u606f",id:"91-\u8ba2\u9605\u6d88\u606f",children:[]},{value:"9.2 \u53d1\u9001\u6d88\u606f",id:"92-\u53d1\u9001\u6d88\u606f",children:[]},{value:"9.3 \u53d6\u6d88\u8ba2\u9605",id:"93-\u53d6\u6d88\u8ba2\u9605",children:[]}],l={toc:u};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(o.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"91-\u8ba2\u9605\u6d88\u606f"},"9.1 \u8ba2\u9605\u6d88\u606f"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Subscribe("messageId", (i,p) => {\n\n});\n')),Object(c.b)("h2",{id:"92-\u53d1\u9001\u6d88\u606f"},"9.2 \u53d1\u9001\u6d88\u606f"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Send("messageId", new {});\n')),Object(c.b)("h2",{id:"93-\u53d6\u6d88\u8ba2\u9605"},"9.3 \u53d6\u6d88\u8ba2\u9605"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Unsubscribe("messageId");\n')))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return o}));var r=n(21),a=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),l=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},b=function(e){var t=l(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),b=l(n),d=r,f=b["".concat(o,".").concat(d)]||b[d]||p[d]||c;return n?a.a.createElement(f,i(i({ref:t},u),{},{components:n})):a.a.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,o=new Array(c);o[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:r,o[1]=i;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{135:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(196)),o=n(197),i={id:"messagecenter",title:"9. MessageCenter \u9759\u6001\u7c7b",sidebar_label:"9. MessageCenter \u9759\u6001\u7c7b"},s={unversionedId:"global/messagecenter",id:"global/messagecenter",isDocsHomePage:!1,title:"9. MessageCenter \u9759\u6001\u7c7b",description:"9.1 \u8ba2\u9605\u6d88\u606f",source:"@site/docs\\global\\messagecenter.mdx",slug:"/global/messagecenter",permalink:"/docs/global/messagecenter",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/messagecenter.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9. MessageCenter \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"8. L \u9759\u6001\u7c7b",permalink:"/docs/global/l"}},u=[{value:"9.1 \u8ba2\u9605\u6d88\u606f",id:"91-\u8ba2\u9605\u6d88\u606f",children:[]},{value:"9.2 \u53d1\u9001\u6d88\u606f",id:"92-\u53d1\u9001\u6d88\u606f",children:[]},{value:"9.3 \u53d6\u6d88\u8ba2\u9605",id:"93-\u53d6\u6d88\u8ba2\u9605",children:[]}],l={toc:u};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(o.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"91-\u8ba2\u9605\u6d88\u606f"},"9.1 \u8ba2\u9605\u6d88\u606f"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Subscribe("messageId", (i,p) => {\n\n});\n')),Object(c.b)("h2",{id:"92-\u53d1\u9001\u6d88\u606f"},"9.2 \u53d1\u9001\u6d88\u606f"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Send("messageId", new {});\n')),Object(c.b)("h2",{id:"93-\u53d6\u6d88\u8ba2\u9605"},"9.3 \u53d6\u6d88\u8ba2\u9605"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'MessageCenter.Unsubscribe("messageId");\n')))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return o}));var r=n(21),a=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var u=a.a.createContext({}),l=function(e){var t=a.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},b=function(e){var t=l(e.components);return a.a.createElement(u.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),b=l(n),d=r,f=b["".concat(o,".").concat(d)]||b[d]||p[d]||c;return n?a.a.createElement(f,i(i({ref:t},u),{},{components:n})):a.a.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,o=new Array(c);o[0]=d;var i={};for(var s in t)hasOwnProperty.call(t,s)&&(i[s]=t[s]);i.originalType=e,i.mdxType="string"==typeof e?e:r,o[1]=i;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/8bbf9761.e7bb2123.js b/docs/8bbf9761.f50eb991.js similarity index 94% rename from docs/8bbf9761.e7bb2123.js rename to docs/8bbf9761.f50eb991.js index b4beb7dc772..a2ee0586707 100644 --- a/docs/8bbf9761.e7bb2123.js +++ b/docs/8bbf9761.f50eb991.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[57],{133:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return u})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return s}));var r=t(3),i=t(7),a=(t(0),t(192)),o=t(193),c={id:"reference",title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",sidebar_label:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528"},u={unversionedId:"reference",id:"reference",isDocsHomePage:!1,title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",description:"2.3.1 \u5173\u4e8e\u9879\u76ee\u5f15\u7528",source:"@site/docs\\reference.mdx",slug:"/reference",permalink:"/docs/reference",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/reference.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",sidebar:"docs",previous:{title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",permalink:"/docs/template"},next:{title:"3. \u5e94\u7528\u542f\u52a8",permalink:"/docs/appstartup"}},l=[{value:"2.3.1 \u5173\u4e8e\u9879\u76ee\u5f15\u7528",id:"231-\u5173\u4e8e\u9879\u76ee\u5f15\u7528",children:[]},{value:"2.3.2 \u96c6\u6210 Furion \u529f\u80fd",id:"232-\u96c6\u6210-furion-\u529f\u80fd",children:[]},{value:"2.3.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"233-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:l};function s(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},b,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"231-\u5173\u4e8e\u9879\u76ee\u5f15\u7528"},"2.3.1 \u5173\u4e8e\u9879\u76ee\u5f15\u7528"),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9ed8\u8ba4\u91c7\u7528\u591a\u5c42\u9879\u76ee\u8bbe\u8ba1\u67b6\u6784\uff0c\u6bcf\u4e00\u4e2a\u9879\u76ee\u5c42\u7684\u4f9d\u8d56\u5206\u522b\u662f\uff1a"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion"),"\uff1a\u6838\u5fc3\u5c42\uff0c\u65e0\u9879\u76ee\u4f9d\u8d56"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Core")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},Object(a.b)("inlineCode",{parentName:"strong"},"Furion.Core"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"strong"},"Furion")," \u5f15\u7528")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.Database.Migrations"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.EntityFramework.Core")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.EntityFramework.Core"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Core")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.Web.Core"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Database.Migrations")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},Object(a.b)("inlineCode",{parentName:"strong"},"Furion.Web.Entry"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"strong"},"Furion.Web.Core")," \u5f15\u7528 \u548c ",Object(a.b)("inlineCode",{parentName:"strong"},"Microsoft.EntityFrameworkCore.Tools")," \u5305"))),Object(a.b)("p",null,"\u5982\u679c\u5f00\u53d1\u8005\u642d\u5efa\u81ea\u5df1\u7684\u9879\u76ee\uff0c\u5219\u53ea\u9700\u8981\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u5f15\u7528 ",Object(a.b)("inlineCode",{parentName:"p"},"Nuget")," \u4e2d\u6700\u65b0\u7684 ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u5305\u5373\u53ef\u3002"),Object(a.b)("h2",{id:"232-\u96c6\u6210-furion-\u529f\u80fd"},"2.3.2 \u96c6\u6210 ",Object(a.b)("inlineCode",{parentName:"h2"},"Furion")," \u529f\u80fd"),Object(a.b)("p",null,"\u9879\u76ee\u642d\u5efa\u597d\u4e4b\u540e\uff0c\u96c6\u6210 ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u53ea\u9700\u8981\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"Program.cs")," \u4e2d \u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"p"},"Inject()")," \u65b9\u6cd5\u5373\u53ef\uff1a"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{18}","{18}":!0}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.Inject()\n .UseStartup();\n });\n }\n }\n}\n")),Object(a.b)("h2",{id:"233-\u53cd\u9988\u4e0e\u5efa\u8bae"},"2.3.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(a.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(a.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(a.b)("h5",{parentName:"div"},Object(a.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(a.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(a.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(a.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(a.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}));var r=t(21),i=t(191);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(r)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+o:o}(n,e,t,r)}}function o(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},191:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return m}));var r=t(0),i=t.n(r);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),b=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=b(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=b(t),d=r,m=s["".concat(o,".").concat(d)]||s[d]||p[d]||a;return t?i.a.createElement(m,c(c({ref:n},l),{},{components:t})):i.a.createElement(m,c({ref:n},l))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var a=t.length,o=new Array(a);o[0]=d;var c={};for(var u in n)hasOwnProperty.call(n,u)&&(c[u]=n[u]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{136:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return u})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return s}));var r=t(3),i=t(7),a=(t(0),t(196)),o=t(197),c={id:"reference",title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",sidebar_label:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528"},u={unversionedId:"reference",id:"reference",isDocsHomePage:!1,title:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",description:"2.3.1 \u5173\u4e8e\u9879\u76ee\u5f15\u7528",source:"@site/docs\\reference.mdx",slug:"/reference",permalink:"/docs/reference",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/reference.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528",sidebar:"docs",previous:{title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",permalink:"/docs/template"},next:{title:"3. \u5e94\u7528\u542f\u52a8",permalink:"/docs/appstartup"}},l=[{value:"2.3.1 \u5173\u4e8e\u9879\u76ee\u5f15\u7528",id:"231-\u5173\u4e8e\u9879\u76ee\u5f15\u7528",children:[]},{value:"2.3.2 \u96c6\u6210 Furion \u529f\u80fd",id:"232-\u96c6\u6210-furion-\u529f\u80fd",children:[]},{value:"2.3.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"233-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:l};function s(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},b,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"231-\u5173\u4e8e\u9879\u76ee\u5f15\u7528"},"2.3.1 \u5173\u4e8e\u9879\u76ee\u5f15\u7528"),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9ed8\u8ba4\u91c7\u7528\u591a\u5c42\u9879\u76ee\u8bbe\u8ba1\u67b6\u6784\uff0c\u6bcf\u4e00\u4e2a\u9879\u76ee\u5c42\u7684\u4f9d\u8d56\u5206\u522b\u662f\uff1a"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion"),"\uff1a\u6838\u5fc3\u5c42\uff0c\u65e0\u9879\u76ee\u4f9d\u8d56"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Core")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},Object(a.b)("inlineCode",{parentName:"strong"},"Furion.Core"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"strong"},"Furion")," \u5f15\u7528")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.Database.Migrations"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.EntityFramework.Core")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.EntityFramework.Core"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Core")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Furion.Web.Core"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Database.Migrations")," \u5f15\u7528"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},Object(a.b)("inlineCode",{parentName:"strong"},"Furion.Web.Entry"),"\uff1a\u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"strong"},"Furion.Web.Core")," \u5f15\u7528 \u548c ",Object(a.b)("inlineCode",{parentName:"strong"},"Microsoft.EntityFrameworkCore.Tools")," \u5305"))),Object(a.b)("p",null,"\u5982\u679c\u5f00\u53d1\u8005\u642d\u5efa\u81ea\u5df1\u7684\u9879\u76ee\uff0c\u5219\u53ea\u9700\u8981\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u5f15\u7528 ",Object(a.b)("inlineCode",{parentName:"p"},"Nuget")," \u4e2d\u6700\u65b0\u7684 ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u5305\u5373\u53ef\u3002"),Object(a.b)("h2",{id:"232-\u96c6\u6210-furion-\u529f\u80fd"},"2.3.2 \u96c6\u6210 ",Object(a.b)("inlineCode",{parentName:"h2"},"Furion")," \u529f\u80fd"),Object(a.b)("p",null,"\u9879\u76ee\u642d\u5efa\u597d\u4e4b\u540e\uff0c\u96c6\u6210 ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u53ea\u9700\u8981\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"Program.cs")," \u4e2d \u6dfb\u52a0 ",Object(a.b)("inlineCode",{parentName:"p"},"Inject()")," \u65b9\u6cd5\u5373\u53ef\uff1a"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{18}","{18}":!0}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.Inject()\n .UseStartup();\n });\n }\n }\n}\n")),Object(a.b)("h2",{id:"233-\u53cd\u9988\u4e0e\u5efa\u8bae"},"2.3.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(a.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(a.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(a.b)("h5",{parentName:"div"},Object(a.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(a.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(a.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(a.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(a.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}));var r=t(21),i=t(195);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(r)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+o:o}(n,e,t,r)}}function o(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},195:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return m}));var r=t(0),i=t.n(r);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),b=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=b(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=b(t),d=r,m=s["".concat(o,".").concat(d)]||s[d]||p[d]||a;return t?i.a.createElement(m,c(c({ref:n},l),{},{components:t})):i.a.createElement(m,c({ref:n},l))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var a=t.length,o=new Array(a);o[0]=d;var c={};for(var u in n)hasOwnProperty.call(n,u)&&(c[u]=n[u]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/8e2b7b33.1564d27a.js b/docs/8e2b7b33.8ed4872b.js similarity index 89% rename from docs/8e2b7b33.1564d27a.js rename to docs/8e2b7b33.8ed4872b.js index f3ecb0f5b5c..d6291480798 100644 --- a/docs/8e2b7b33.1564d27a.js +++ b/docs/8e2b7b33.8ed4872b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[58],{134:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),c=(n(0),n(192)),i=n(193),a={id:"signalr",title:"25. \u5373\u65f6\u901a\u8baf",sidebar_label:"25. \u5373\u65f6\u901a\u8baf"},u={unversionedId:"signalr",id:"signalr",isDocsHomePage:!1,title:"25. \u5373\u65f6\u901a\u8baf",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1ahttps://docs.microsoft.com/zh-cn/aspnet/core/signalr/introduction?view=aspnetcore-5.0",source:"@site/docs\\signalr.mdx",slug:"/signalr",permalink:"/docs/signalr",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/signalr.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"25. \u5373\u65f6\u901a\u8baf",sidebar:"docs",previous:{title:"24. \u4efb\u52a1\u8c03\u5ea6",permalink:"/docs/job"},next:{title:"26. Grpc \u670d\u52a1",permalink:"/docs/grpc"}},s=[],l={toc:s};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1a",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/signalr/introduction?view=aspnetcore-5.0"}),"https://docs.microsoft.com/zh-cn/aspnet/core/signalr/introduction?view=aspnetcore-5.0")))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),o=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(n),d=r,b=p["".concat(i,".").concat(d)]||p[d]||f[d]||c;return n?o.a.createElement(b,a(a({ref:t},s),{},{components:n})):o.a.createElement(b,a({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=d;var a={};for(var u in t)hasOwnProperty.call(t,u)&&(a[u]=t[u]);a.originalType=e,a.mdxType="string"==typeof e?e:r,i[1]=a;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{137:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),c=(n(0),n(196)),i=n(197),a={id:"signalr",title:"25. \u5373\u65f6\u901a\u8baf",sidebar_label:"25. \u5373\u65f6\u901a\u8baf"},u={unversionedId:"signalr",id:"signalr",isDocsHomePage:!1,title:"25. \u5373\u65f6\u901a\u8baf",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1ahttps://docs.microsoft.com/zh-cn/aspnet/core/signalr/introduction?view=aspnetcore-5.0",source:"@site/docs\\signalr.mdx",slug:"/signalr",permalink:"/docs/signalr",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/signalr.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"25. \u5373\u65f6\u901a\u8baf",sidebar:"docs",previous:{title:"24. \u4efb\u52a1\u8c03\u5ea6",permalink:"/docs/job"},next:{title:"26. Grpc \u670d\u52a1",permalink:"/docs/grpc"}},s=[],l={toc:s};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1a",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/signalr/introduction?view=aspnetcore-5.0"}),"https://docs.microsoft.com/zh-cn/aspnet/core/signalr/introduction?view=aspnetcore-5.0")))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),o=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(n),d=r,b=p["".concat(i,".").concat(d)]||p[d]||f[d]||c;return n?o.a.createElement(b,a(a({ref:t},s),{},{components:n})):o.a.createElement(b,a({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=d;var a={};for(var u in t)hasOwnProperty.call(t,u)&&(a[u]=t[u]);a.originalType=e,a.mdxType="string"==typeof e?e:r,i[1]=a;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/902d8112.fa61d759.js b/docs/902d8112.a3425f91.js similarity index 98% rename from docs/902d8112.fa61d759.js rename to docs/902d8112.a3425f91.js index 6f39f9f0a0f..6ef7bf20c12 100644 --- a/docs/902d8112.fa61d759.js +++ b/docs/902d8112.a3425f91.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[59],{135:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return d}));var i=t(3),a=t(7),r=(t(0),t(192)),o=t(190),c=t(193),b={id:"dbcontext-db-first",title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",sidebar_label:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b"},l={unversionedId:"dbcontext-db-first",id:"dbcontext-db-first",isDocsHomePage:!1,title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",description:"\u5728\u9605\u8bfb\u4e0b\u9762\u6587\u6863\u4e4b\u524d\uff0c\u5fc5\u987b\u628aFurion \u6e90\u7801\u6587\u4ef6\u5939\u4e0b\u7684 tools/cli.ps1 \u6587\u4ef6\u62f7\u8d1d\u5230\u672c\u5730\u4e2d\u3002\u800c\u4e14 Fur.Web.Entry \u5c42\u9700\u8981\u5b89\u88c5 Microsoft.EntityFrameworkCore.Tools \u5305\u3002",source:"@site/docs\\dbcontext-db-first.mdx",slug:"/dbcontext-db-first",permalink:"/docs/dbcontext-db-first",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-db-first.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",sidebar:"docs",previous:{title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",permalink:"/docs/dbcontext-multi-database"},next:{title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",permalink:"/docs/dbcontext-code-first"}},s=[{value:"9.19.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",id:"9191-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",children:[]},{value:"9.19.2 \u64cd\u4f5c\u6307\u5357",id:"9192-\u64cd\u4f5c\u6307\u5357",children:[{value:"9.19.2.1 \u6253\u5f00 \u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",id:"91921-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",children:[]},{value:"9.19.2.2 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee",id:"91922-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee",children:[]},{value:"9.19.2.3 \u8f93\u5165 cli.ps1 \u547d\u4ee4",id:"91923-\u8f93\u5165-clips1-\u547d\u4ee4",children:[]}]},{value:"9.19.3 \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f",id:"9193-\u754c\u9762\u64cd\u4f5c\u6a21\u5f0f",children:[{value:"9.19.3.1 \u542f\u52a8\u754c\u9762\u64cd\u4f5c",id:"91931-\u542f\u52a8\u754c\u9762\u64cd\u4f5c",children:[]},{value:"9.19.3.2 \u52a0\u8f7d\u6570\u636e\u5e93\u8868",id:"91932-\u52a0\u8f7d\u6570\u636e\u5e93\u8868",children:[]},{value:"9.19.3.3 \u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210",id:"91933-\u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210",children:[]},{value:"9.19.3.4 \u9009\u62e9\u4fdd\u5b58\u76ee\u5f55",id:"91934-\u9009\u62e9\u4fdd\u5b58\u76ee\u5f55",children:[]},{value:"9.19.3.5 \u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801",id:"91935-\u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801",children:[]}]},{value:"9.19.4 \u547d\u4ee4\u53c2\u6570\u914d\u7f6e",id:"9194-\u547d\u4ee4\u53c2\u6570\u914d\u7f6e",children:[]},{value:"9.19.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9195-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:s};function d(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(r.b)("wrapper",Object(i.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5173\u4e8e\u811a\u672c")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5728\u9605\u8bfb\u4e0b\u9762\u6587\u6863\u4e4b\u524d\uff0c\u5fc5\u987b\u628a",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6e90\u7801\u6587\u4ef6\u5939\u4e0b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"tools/cli.ps1")," \u6587\u4ef6\u62f7\u8d1d\u5230\u672c\u5730\u4e2d\u3002\u800c\u4e14 ",Object(r.b)("inlineCode",{parentName:"p"},"Fur.Web.Entry")," \u5c42\u9700\u8981\u5b89\u88c5 ",Object(r.b)("inlineCode",{parentName:"p"},"Microsoft.EntityFrameworkCore.Tools")," \u5305\u3002"))),Object(r.b)("h2",{id:"9191-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"},"9.19.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\u6765 ",Object(r.b)("strong",{parentName:"p"},"\u4fdd\u6301\u5b9e\u4f53\u6a21\u578b\u548c\u6570\u636e\u5e93\u67b6\u6784\u540c\u6b65"),"\u3002"),Object(r.b)("p",null,"\u81f3\u4e8e\u6211\u4eec\u5e94\u8be5\u9009\u7528\u54ea\u4e2a\u65b9\u6cd5\uff0c\u8bf7\u786e\u5b9a\u4f60\u662f\u5e0c\u671b\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6\u8fd8\u662f\u4ee5\u6570\u636e\u5e93\u4e3a\u51c6\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(r.b)("strong",{parentName:"p"},"\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u6b63\u5411\u5de5\u7a0b\uff08Code First\uff09\u3002 \u5bf9\u5b9e\u4f53\u6a21\u578b\u8fdb\u884c\u66f4\u6539\u65f6\uff0c\u6b64\u65b9\u6cd5\u4f1a\u4ee5\u589e\u91cf\u65b9\u5f0f\u5c06\u76f8\u5e94\u67b6\u6784\u66f4\u6539\u5e94\u7528\u5230\u6570\u636e\u5e93\uff0c\u4ee5\u4f7f\u6570\u636e\u5e93\u4fdd\u6301\u4e0e\u5b9e\u4f53\u6a21\u578b\u517c\u5bb9\u3002")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(r.b)("strong",{parentName:"p"},"\u4ee5\u6570\u636e\u5e93\u67b6\u6784\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u53cd\u5411\u5de5\u7a0b\uff08Database First\uff09\u3002 \u4f7f\u7528\u6b64\u65b9\u6cd5\uff0c\u53ef\u901a\u8fc7\u5c06\u6570\u636e\u5e93\u67b6\u6784\u53cd\u5411\u5de5\u7a0b\u5230\u5b9e\u4f53\u6a21\u578b\u6765\u751f\u6210\u76f8\u5e94\u7684\u5b9e\u4f53\u7c7b\u578b\u3002"))),Object(r.b)("p",null,"\u672c\u7ae0\u8282\u662f ",Object(r.b)("strong",{parentName:"p"},"\u53cd\u5411\u5de5\u7a0b\uff08Database First\uff09")," \u7684\u76f8\u5173\u5185\u5bb9\u3002"),Object(r.b)("h2",{id:"9192-\u64cd\u4f5c\u6307\u5357"},"9.19.2 \u64cd\u4f5c\u6307\u5357"),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u64cd\u4f5c\u4e4b\u524d\u6ce8\u610f\u4e8b\u9879")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u76ee\u524d ",Object(r.b)("inlineCode",{parentName:"p"},"Furion Tools")," \u751f\u6210\u5de5\u5177",Object(r.b)("strong",{parentName:"p"},"\u9ed8\u8ba4\u4e0d\u652f\u6301\u4efb\u4f55\u6570\u636e\u5e93"),"\u751f\u6210\uff0c\u6240\u4ee5\u5982\u9700\u751f\u6210\u7279\u5b9a\u6570\u636e\u5e93\u7684\u4ee3\u7801\uff0c\u53ea\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.EntityFrameworkCore.Core")," \u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u5305\u5373\u53ef\uff1a"),Object(r.b)("p",{parentName:"div"},"\u5404\u4e2a\u6570\u636e\u5e93\u7684\u5305\u53ef\u67e5\u9605\uff1a",Object(r.b)("a",Object(i.a)({parentName:"p"},{href:"dbcontext-multi-database"}),"\u591a\u6570\u636e\u5e93\u64cd\u4f5c-\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305")),Object(r.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c\u53ea\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"SqlServer")," \u6570\u636e\u5e93\u652f\u6301\u53ef\u89c6\u5316 ",Object(r.b)("inlineCode",{parentName:"p"},"GUI")," \u64cd\u4f5c\uff0c\u5176\u4ed6\u7684\u53ea\u80fd\u547d\u4ee4\u884c\u64cd\u4f5c\u3002"))),Object(r.b)("h3",{id:"91921-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0"},"9.19.2.1 \u6253\u5f00 ",Object(r.b)("inlineCode",{parentName:"h3"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")),Object(r.b)("p",null,"\u6ce8\u610f\uff1a\u5f00\u59cb\u4e4b\u524d\u5148\u628a ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Entry")," \u8bbe\u4e3a\u542f\u52a8\u9879\u76ee\u3002"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst1.png")}),Object(r.b)("h3",{id:"91922-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee"},"9.19.2.2 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee"),Object(r.b)("p",null,"\u5c06 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")," \u9ed8\u8ba4\u9879\u76ee\u8bbe\u7f6e\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Core"),"\uff0c\u5982\u679c\u60a8\u662f\u5176\u4ed6\u540d\u5b57\uff0c\u5219\u5207\u6362\u5bf9\u5e94\u5373\u53ef\u3002"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst2.png")}),Object(r.b)("h3",{id:"91923-\u8f93\u5165-clips1-\u547d\u4ee4"},"9.19.2.3 \u8f93\u5165 ",Object(r.b)("inlineCode",{parentName:"h3"},"cli.ps1")," \u547d\u4ee4"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),' &"../tools/cli.ps1" -CoreProject "\u4f60\u7684Core\u5c42" -EntryProject "\u4f60\u7684\u542f\u52a8\u5c42"\n')),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u6570\u636e\u5e93\u547d\u540d")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c\u9700\u8981\u4fdd\u6301\u548c\u6570\u636e\u5e93\u4e00\u6a21\u4e00\u6837\u7684\u547d\u540d\uff0c\u5219\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"-UseDatabaseNames")," \u53c2\u6570\u6307\u5b9a\uff0c\u5982\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-cs"}),' &"../tools/cli.ps1" -UseDatabaseNames\n')))),Object(r.b)("img",{src:Object(o.a)("img/dbfirst3.png")}),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7b49\u5f85\u8f93\u5165")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u6267\u884c\u4e0a\u9762\u547d\u4ee4\u540e\uff0c\u6b64\u65f6\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Cli")," \u6709\u4e00\u4e2a\u7b49\u5f85\u8f93\u5165\u63d0\u793a\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),"Furion Tools v1.0.0 \u8bf7\u952e\u5165\u64cd\u4f5c\u7c7b\u578b\uff1a[G] \u754c\u9762\u64cd\u4f5c\uff0c[\u4efb\u610f\u5b57\u7b26] \u547d\u4ee4\u884c\u64cd\u4f5c\nFurion Tools v1.0.0 \u60a8\u7684\u8f93\u5165\u662f:\n")),Object(r.b)("p",{parentName:"div"},Object(r.b)("strong",{parentName:"p"},"\u8f93\u5165\u5927\u5199 ",Object(r.b)("inlineCode",{parentName:"strong"},"G")," \u8fdb\u5165\u754c\u9762\u64cd\u4f5c\u6a21\u5f0f\uff0c\u5176\u4ed6\u4efb\u610f\u5b57\u7b26\u8fdb\u5165\u547d\u4ee4\u884c\u64cd\u4f5c\u6a21\u5f0f\u3002")))),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u6ce8\u610f\u4e8b\u9879")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u76ee\u524d\u53ea\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"Sql Server")," \u6570\u636e\u5e93\u624d\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"GUI \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f"),"\uff0c\u5176\u4ed6\u6570\u636e\u5e93\u8bf7\u4f7f\u7528\u547d\u4ee4\u884c\u6a21\u5f0f\u3002"))),Object(r.b)("h2",{id:"9193-\u754c\u9762\u64cd\u4f5c\u6a21\u5f0f"},"9.19.3 \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f"),Object(r.b)("h3",{id:"91931-\u542f\u52a8\u754c\u9762\u64cd\u4f5c"},"9.19.3.1 \u542f\u52a8\u754c\u9762\u64cd\u4f5c"),Object(r.b)("p",null,"\u5f53\u6211\u4eec\u8f93\u5165 ",Object(r.b)("inlineCode",{parentName:"p"},"G")," \u65f6\uff0c\u5c06\u6253\u5f00 ",Object(r.b)("inlineCode",{parentName:"p"},"GUI")," \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f\uff0c\u5982\uff1a"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst4.png")}),Object(r.b)("p",null,"\u8fd9\u65f6\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion Tools")," \u4f1a\u81ea\u52a8\u67e5\u627e\u6240\u6709\u6570\u636e\u5e93\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json",metastring:"{12-13}","{12-13}":!0}),'{\n "Logging": {\n "LogLevel": {\n "Default": "Information",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n },\n "AllowedHosts": "*",\n "ConnectionStrings": {\n "DbConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;",\n "Sqlite3ConnectionString": "Data Source=./Furion.db"\n }\n}\n')),Object(r.b)("h3",{id:"91932-\u52a0\u8f7d\u6570\u636e\u5e93\u8868"},"9.19.3.2 \u52a0\u8f7d\u6570\u636e\u5e93\u8868"),Object(r.b)("p",null,"\u9009\u62e9\u8fde\u63a5\u5b57\u7b26\u4e32\u4e4b\u540e\uff0c\u70b9\u51fb ",Object(r.b)("inlineCode",{parentName:"p"},"\u52a0\u8f7d\u6570\u636e\u5e93\u8868\u548c\u89c6\u56fe")," \u6309\u94ae\u52a0\u8f7d\u3002"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst5.png")}),Object(r.b)("h3",{id:"91933-\u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210"},"9.19.3.3 \u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210"),Object(r.b)("p",null,"\u52a0\u8f7d\u8868\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u9009\u62e9\u60a8\u8981\u751f\u6210\u7684\u8868\u6216\u89c6\u56fe\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u591a\u9009")),Object(r.b)("img",{src:Object(o.a)("img/dbfirst6.png")}),Object(r.b)("p",null,"\u70b9\u51fb\u5e95\u90e8\u6309\u94ae ",Object(r.b)("inlineCode",{parentName:"p"},"\u7acb\u5373\u751f\u6210")),Object(r.b)("h3",{id:"91934-\u9009\u62e9\u4fdd\u5b58\u76ee\u5f55"},"9.19.3.4 \u9009\u62e9\u4fdd\u5b58\u76ee\u5f55"),Object(r.b)("p",null,"\u70b9\u51fb ",Object(r.b)("inlineCode",{parentName:"p"},"\u7acb\u5373\u751f\u6210")," \u6309\u94ae\u540e\uff0c\u4f1a\u5f39\u51fa\u5b9e\u4f53\u4fdd\u5b58\u9009\u62e9\u76ee\u5f55\u8d44\u6e90\u7ba1\u7406\u5668\uff0c\u9ed8\u8ba4\u5b9e\u4f53\u53ea\u80fd\u4fdd\u5b58\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\uff1a"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst7.png")}),Object(r.b)("p",null,"\u70b9\u51fb\u786e\u5b9a\u540e\u5c31\u53ef\u5b8c\u6210\u6240\u6709\u751f\u6210\u64cd\u4f5c\u3002"),Object(r.b)("h3",{id:"91935-\u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801"},"9.19.3.5 \u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst8.png")}),Object(r.b)("p",null,"\u6700\u7ec8\u811a\u672c\u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),'PM> &"../tools/cli.ps1"\n// -----------------------------------------------------------------------------\n// ______ _______ _\n// | ____| |__ __| | |\n// | |__ _ _ _ __ | | ___ ___ | |___\n// | __| | | | \'__| | |/ _ \\ / _ \\| / __|\n// | | | |_| | | | | (_) | (_) | \\__ \\\n// |_| \\__,_|_| |_|\\___/ \\___/|_|___/\n//\n// -----------------------------------------------------------------------------\n// \u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002\n// Copyright \xa9 2020 Furion, Baiqian Co.,Ltd.\n//\n// \u6846\u67b6\u540d\u79f0\uff1aFurion\n// \u6846\u67b6\u4f5c\u8005\uff1a\u767e\u5c0f\u50e7\n// \u6846\u67b6\u7248\u672c\uff1a1.0.0\n// \u6e90\u7801\u5730\u5740\uff1ahttps://gitee.com/monksoul/Furion\n// \u5f00\u6e90\u534f\u8bae\uff1aApache-2.0\uff08http://www.apache.org/licenses/LICENSE-2.0\uff09\n// -----------------------------------------------------------------------------\nFurion Tools v1.0.0 \u542f\u52a8\u4e2d......\nFurion Tools v1.0.0 \u542f\u52a8\u6210\u529f\uff01\nFurion Tools v1.0.0 \u8bf7\u952e\u5165\u64cd\u4f5c\u7c7b\u578b\uff1a[G] \u754c\u9762\u64cd\u4f5c\uff0c[\u4efb\u610f\u5b57\u7b26] \u547d\u4ee4\u884c\u64cd\u4f5c\nFurion Tools v1.0.0 \u60a8\u7684\u8f93\u5165\u662f: G\nFurion Tools v1.0.0 \u6b63\u5728\u52a0\u8f7d\u6570\u636e\u5e93\u8868\u548c\u89c6\u56fe......\nFurion Tools v1.0.0 \u52a0\u8f7d\u6210\u529f\uff01\nFurion Tools v1.0.0 \u6b63\u5728\u7f16\u8bd1\u89e3\u51b3\u65b9\u6848\u4ee3\u7801......\nBuild started...\nBuild succeeded.\nFor foreign key FK_PersonDetail_Person_PersonId on table dbo.PersonDetail, unable to model the end of the foreign key on principal table dbo.Person. This is usually because the principal table was not included in the selection set.\nFurion Tools v1.0.0 \u7f16\u8bd1\u6210\u529f\uff01\nFurion Tools v1.0.0 \u5f00\u59cb\u751f\u6210\u5b9e\u4f53\u6587\u4ef6......\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 City.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 City.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class City : IEntity, IEntityTypeBuilder\n {\n\n public City()\n {\n InverseParent = new HashSet();\n }\n\n public int Id { get; set; }\n public string Name { get; set; }\n public int? ParentId { get; set; }\n public DateTime CreatedTime { get; set; }\n public DateTime? UpdatedTime { get; set; }\n public bool IsDeleted { get; set; }\n\n public virtual City Parent { get; set; }\n public virtual ICollection InverseParent { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasIndex(e => e.ParentId, "IX_City_ParentId");\n\n entityBuilder.HasOne(d => d.Parent)\n .WithMany(p => p.InverseParent)\n .HasForeignKey(d => d.ParentId);\n\n }\n\n }\n}\n\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 PersonDetail.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 PersonDetail.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class PersonDetail : IEntity, IEntityTypeBuilder\n {\n\n public int Id { get; set; }\n public string PhoneNumber { get; set; }\n public string Qq { get; set; }\n public int PersonId { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasIndex(e => e.PersonId, "IX_PersonDetail_PersonId")\n .IsUnique();\n\n entityBuilder.Property(e => e.Qq).HasColumnName("QQ");\n\n }\n\n }\n}\n\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 Post.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 Post.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class Post : IEntity\n {\n\n public int Id { get; set; }\n public string Name { get; set; }\n public DateTime CreatedTime { get; set; }\n public DateTime? UpdatedTime { get; set; }\n public bool IsDeleted { get; set; }\n\n }\n}\n\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 VPerson.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 VPerson.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class VPerson : IEntity, IEntityTypeBuilder\n {\n\n public int Id { get; set; }\n public string Name { get; set; }\n public int Age { get; set; }\n public string Address { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasNoKey();\n\n entityBuilder.ToView("V_Person");\n\n entityBuilder.Property(e => e.Id).ValueGeneratedOnAdd();\n\n entityBuilder.Property(e => e.Name).HasMaxLength(32);\n\n }\n\n }\n}\n\nFurion Tools v1.0.0 \u5168\u90e8\u5b9e\u4f53\u751f\u6210\u6210\u529f\uff01\nPM>\n')),Object(r.b)("h2",{id:"9194-\u547d\u4ee4\u53c2\u6570\u914d\u7f6e"},"9.19.4 \u547d\u4ee4\u53c2\u6570\u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion Tools Cli")," \u652f\u6301\u591a\u4e2a\u53c2\u6570\u914d\u7f6e\uff0c\u4f7f\u7528\u65b9\u6cd5\u53ea\u9700\u8981\u5728\u547d\u4ee4\u540e\u9762\u6dfb\u52a0\u5373\u53ef\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),' &"../tools/cli.ps1" -Context \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u540d -ConnectionName \u8fde\u63a5\u5b57\u7b26\u4e32Key\n')),Object(r.b)("p",null,"\u652f\u6301\u53c2\u6570\u5982\u4e0b\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Tables"),"\uff1a\u914d\u7f6e\u8981\u751f\u6210\u7684\u6570\u636e\u5e93\u8868\uff0c\u6570\u7ec4\u7c7b\u578b\uff0c\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u751f\u6210\u6570\u636e\u5e93\u6240\u6709\u8868\u548c\u89c6\u56fe\u3002\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"-Tables Person,PersonDetails")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Context"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"FurDbContext"),"\uff0c\u5982\u679c\u6709\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u5219\u6b64\u53c2\u6570\u5fc5\u987b\u914d\u7f6e"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-ConnectionName"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u5bf9\u4e8e ",Object(r.b)("inlineCode",{parentName:"li"},"appsetting.json")," \u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Key")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-OutputDir"),"\uff1a\u751f\u6210\u5b9e\u4f53\u4ee3\u7801\u8f93\u51fa\u76ee\u5f55\uff0c\u9ed8\u8ba4\u4e3a\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"./Furion.Core/Entities/")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-DbProvider"),"\uff1a\u6570\u636e\u5e93\u63d0\u4f9b\u5668\uff0c\u9ed8\u8ba4\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.SqlServer"),"\uff0c\u5176\u4ed6\u6570\u636e\u5e93\u8bf7\u6307\u5b9a\u5bf9\u5e94\u7a0b\u5e8f\u96c6",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SqlServer"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.SqlServer")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Sqlite"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Sqlite")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Cosmos"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Cosmos")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"InMemoryDatabase"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.InMemory")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"MySql"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Pomelo.EntityFrameworkCore.MySql")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"PostgreSQL"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Npgsql.EntityFrameworkCore.PostgreSQL")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Oracle"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Citms.EntityFrameworkCore.Oracle")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Dm"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Dm")))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-EntryProject"),"\uff1aWeb \u542f\u7528\u9879\u76ee\u5c42\u540d\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Web.Entry")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-CoreProject"),"\uff1a\u5b9e\u4f53\u9879\u76ee\u5c42\u540d\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Core")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-DbContextLocators"),"\uff1a\u591a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"MasterDbContextLocator"),"\uff0c\u652f\u6301\u591a\u4e2a\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"MasterDbContextLocator,MySqlDbContextLocator")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Product"),"\uff1a\u89e3\u51b3\u65b9\u6848\u9ed8\u8ba4\u524d\u7f00\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-UseDatabaseNames"),"\uff1a\u662f\u5426\u4fdd\u6301\u751f\u6210\u548c\u6570\u636e\u5e93\u3001\u8868\u4e00\u81f4\u7684\u540d\u79f0"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Namespace"),"\uff1a\u6307\u5b9a\u5b9e\u4f53\u547d\u540d\u7a7a\u95f4")),Object(r.b)("h2",{id:"9195-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.19.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(i.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return o}));var i=t(21),a=t(191);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(i.default)();return{withBaseUrl:(t,i)=>function(e,n,t,{forcePrependBaseUrl:i=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(i)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+o:o}(n,e,t,i)}}function o(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},191:function(e,n,t){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!i(e)}t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return a}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return p})),t.d(n,"b",(function(){return u}));var i=t(0),a=t.n(i);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var l=a.a.createContext({}),s=function(e){var n=a.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},p=function(e){var n=s(e.components);return a.a.createElement(l.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},m=a.a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,r=e.originalType,o=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),p=s(t),m=i,u=p["".concat(o,".").concat(m)]||p[m]||d[m]||r;return t?a.a.createElement(u,c(c({ref:n},l),{},{components:t})):a.a.createElement(u,c({ref:n},l))}));function u(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var r=t.length,o=new Array(r);o[0]=m;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:i,o[1]=c;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{138:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return b})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return d}));var i=t(3),a=t(7),r=(t(0),t(196)),o=t(194),c=t(197),b={id:"dbcontext-db-first",title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",sidebar_label:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b"},l={unversionedId:"dbcontext-db-first",id:"dbcontext-db-first",isDocsHomePage:!1,title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",description:"\u5728\u9605\u8bfb\u4e0b\u9762\u6587\u6863\u4e4b\u524d\uff0c\u5fc5\u987b\u628aFurion \u6e90\u7801\u6587\u4ef6\u5939\u4e0b\u7684 tools/cli.ps1 \u6587\u4ef6\u62f7\u8d1d\u5230\u672c\u5730\u4e2d\u3002\u800c\u4e14 Fur.Web.Entry \u5c42\u9700\u8981\u5b89\u88c5 Microsoft.EntityFrameworkCore.Tools \u5305\u3002",source:"@site/docs\\dbcontext-db-first.mdx",slug:"/dbcontext-db-first",permalink:"/docs/dbcontext-db-first",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-db-first.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",sidebar:"docs",previous:{title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",permalink:"/docs/dbcontext-multi-database"},next:{title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",permalink:"/docs/dbcontext-code-first"}},s=[{value:"9.19.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",id:"9191-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",children:[]},{value:"9.19.2 \u64cd\u4f5c\u6307\u5357",id:"9192-\u64cd\u4f5c\u6307\u5357",children:[{value:"9.19.2.1 \u6253\u5f00 \u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",id:"91921-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",children:[]},{value:"9.19.2.2 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee",id:"91922-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee",children:[]},{value:"9.19.2.3 \u8f93\u5165 cli.ps1 \u547d\u4ee4",id:"91923-\u8f93\u5165-clips1-\u547d\u4ee4",children:[]}]},{value:"9.19.3 \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f",id:"9193-\u754c\u9762\u64cd\u4f5c\u6a21\u5f0f",children:[{value:"9.19.3.1 \u542f\u52a8\u754c\u9762\u64cd\u4f5c",id:"91931-\u542f\u52a8\u754c\u9762\u64cd\u4f5c",children:[]},{value:"9.19.3.2 \u52a0\u8f7d\u6570\u636e\u5e93\u8868",id:"91932-\u52a0\u8f7d\u6570\u636e\u5e93\u8868",children:[]},{value:"9.19.3.3 \u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210",id:"91933-\u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210",children:[]},{value:"9.19.3.4 \u9009\u62e9\u4fdd\u5b58\u76ee\u5f55",id:"91934-\u9009\u62e9\u4fdd\u5b58\u76ee\u5f55",children:[]},{value:"9.19.3.5 \u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801",id:"91935-\u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801",children:[]}]},{value:"9.19.4 \u547d\u4ee4\u53c2\u6570\u914d\u7f6e",id:"9194-\u547d\u4ee4\u53c2\u6570\u914d\u7f6e",children:[]},{value:"9.19.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9195-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:s};function d(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(r.b)("wrapper",Object(i.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(c.a,{mdxType:"JoinGroup"}),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5173\u4e8e\u811a\u672c")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5728\u9605\u8bfb\u4e0b\u9762\u6587\u6863\u4e4b\u524d\uff0c\u5fc5\u987b\u628a",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6e90\u7801\u6587\u4ef6\u5939\u4e0b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"tools/cli.ps1")," \u6587\u4ef6\u62f7\u8d1d\u5230\u672c\u5730\u4e2d\u3002\u800c\u4e14 ",Object(r.b)("inlineCode",{parentName:"p"},"Fur.Web.Entry")," \u5c42\u9700\u8981\u5b89\u88c5 ",Object(r.b)("inlineCode",{parentName:"p"},"Microsoft.EntityFrameworkCore.Tools")," \u5305\u3002"))),Object(r.b)("h2",{id:"9191-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"},"9.19.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\u6765 ",Object(r.b)("strong",{parentName:"p"},"\u4fdd\u6301\u5b9e\u4f53\u6a21\u578b\u548c\u6570\u636e\u5e93\u67b6\u6784\u540c\u6b65"),"\u3002"),Object(r.b)("p",null,"\u81f3\u4e8e\u6211\u4eec\u5e94\u8be5\u9009\u7528\u54ea\u4e2a\u65b9\u6cd5\uff0c\u8bf7\u786e\u5b9a\u4f60\u662f\u5e0c\u671b\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6\u8fd8\u662f\u4ee5\u6570\u636e\u5e93\u4e3a\u51c6\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(r.b)("strong",{parentName:"p"},"\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u6b63\u5411\u5de5\u7a0b\uff08Code First\uff09\u3002 \u5bf9\u5b9e\u4f53\u6a21\u578b\u8fdb\u884c\u66f4\u6539\u65f6\uff0c\u6b64\u65b9\u6cd5\u4f1a\u4ee5\u589e\u91cf\u65b9\u5f0f\u5c06\u76f8\u5e94\u67b6\u6784\u66f4\u6539\u5e94\u7528\u5230\u6570\u636e\u5e93\uff0c\u4ee5\u4f7f\u6570\u636e\u5e93\u4fdd\u6301\u4e0e\u5b9e\u4f53\u6a21\u578b\u517c\u5bb9\u3002")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(r.b)("strong",{parentName:"p"},"\u4ee5\u6570\u636e\u5e93\u67b6\u6784\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u53cd\u5411\u5de5\u7a0b\uff08Database First\uff09\u3002 \u4f7f\u7528\u6b64\u65b9\u6cd5\uff0c\u53ef\u901a\u8fc7\u5c06\u6570\u636e\u5e93\u67b6\u6784\u53cd\u5411\u5de5\u7a0b\u5230\u5b9e\u4f53\u6a21\u578b\u6765\u751f\u6210\u76f8\u5e94\u7684\u5b9e\u4f53\u7c7b\u578b\u3002"))),Object(r.b)("p",null,"\u672c\u7ae0\u8282\u662f ",Object(r.b)("strong",{parentName:"p"},"\u53cd\u5411\u5de5\u7a0b\uff08Database First\uff09")," \u7684\u76f8\u5173\u5185\u5bb9\u3002"),Object(r.b)("h2",{id:"9192-\u64cd\u4f5c\u6307\u5357"},"9.19.2 \u64cd\u4f5c\u6307\u5357"),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u64cd\u4f5c\u4e4b\u524d\u6ce8\u610f\u4e8b\u9879")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u76ee\u524d ",Object(r.b)("inlineCode",{parentName:"p"},"Furion Tools")," \u751f\u6210\u5de5\u5177",Object(r.b)("strong",{parentName:"p"},"\u9ed8\u8ba4\u4e0d\u652f\u6301\u4efb\u4f55\u6570\u636e\u5e93"),"\u751f\u6210\uff0c\u6240\u4ee5\u5982\u9700\u751f\u6210\u7279\u5b9a\u6570\u636e\u5e93\u7684\u4ee3\u7801\uff0c\u53ea\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.EntityFrameworkCore.Core")," \u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u5305\u5373\u53ef\uff1a"),Object(r.b)("p",{parentName:"div"},"\u5404\u4e2a\u6570\u636e\u5e93\u7684\u5305\u53ef\u67e5\u9605\uff1a",Object(r.b)("a",Object(i.a)({parentName:"p"},{href:"dbcontext-multi-database"}),"\u591a\u6570\u636e\u5e93\u64cd\u4f5c-\u6570\u636e\u5e93\u63d0\u4f9b\u5668\u5bf9\u5e94\u5305")),Object(r.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c\u53ea\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"SqlServer")," \u6570\u636e\u5e93\u652f\u6301\u53ef\u89c6\u5316 ",Object(r.b)("inlineCode",{parentName:"p"},"GUI")," \u64cd\u4f5c\uff0c\u5176\u4ed6\u7684\u53ea\u80fd\u547d\u4ee4\u884c\u64cd\u4f5c\u3002"))),Object(r.b)("h3",{id:"91921-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0"},"9.19.2.1 \u6253\u5f00 ",Object(r.b)("inlineCode",{parentName:"h3"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")),Object(r.b)("p",null,"\u6ce8\u610f\uff1a\u5f00\u59cb\u4e4b\u524d\u5148\u628a ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Entry")," \u8bbe\u4e3a\u542f\u52a8\u9879\u76ee\u3002"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst1.png")}),Object(r.b)("h3",{id:"91922-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee"},"9.19.2.2 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee"),Object(r.b)("p",null,"\u5c06 ",Object(r.b)("inlineCode",{parentName:"p"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")," \u9ed8\u8ba4\u9879\u76ee\u8bbe\u7f6e\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Core"),"\uff0c\u5982\u679c\u60a8\u662f\u5176\u4ed6\u540d\u5b57\uff0c\u5219\u5207\u6362\u5bf9\u5e94\u5373\u53ef\u3002"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst2.png")}),Object(r.b)("h3",{id:"91923-\u8f93\u5165-clips1-\u547d\u4ee4"},"9.19.2.3 \u8f93\u5165 ",Object(r.b)("inlineCode",{parentName:"h3"},"cli.ps1")," \u547d\u4ee4"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),' &"../tools/cli.ps1" -CoreProject "\u4f60\u7684Core\u5c42" -EntryProject "\u4f60\u7684\u542f\u52a8\u5c42"\n')),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u6570\u636e\u5e93\u547d\u540d")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c\u9700\u8981\u4fdd\u6301\u548c\u6570\u636e\u5e93\u4e00\u6a21\u4e00\u6837\u7684\u547d\u540d\uff0c\u5219\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"-UseDatabaseNames")," \u53c2\u6570\u6307\u5b9a\uff0c\u5982\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-cs"}),' &"../tools/cli.ps1" -UseDatabaseNames\n')))),Object(r.b)("img",{src:Object(o.a)("img/dbfirst3.png")}),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7b49\u5f85\u8f93\u5165")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u6267\u884c\u4e0a\u9762\u547d\u4ee4\u540e\uff0c\u6b64\u65f6\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Cli")," \u6709\u4e00\u4e2a\u7b49\u5f85\u8f93\u5165\u63d0\u793a\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),"Furion Tools v1.0.0 \u8bf7\u952e\u5165\u64cd\u4f5c\u7c7b\u578b\uff1a[G] \u754c\u9762\u64cd\u4f5c\uff0c[\u4efb\u610f\u5b57\u7b26] \u547d\u4ee4\u884c\u64cd\u4f5c\nFurion Tools v1.0.0 \u60a8\u7684\u8f93\u5165\u662f:\n")),Object(r.b)("p",{parentName:"div"},Object(r.b)("strong",{parentName:"p"},"\u8f93\u5165\u5927\u5199 ",Object(r.b)("inlineCode",{parentName:"strong"},"G")," \u8fdb\u5165\u754c\u9762\u64cd\u4f5c\u6a21\u5f0f\uff0c\u5176\u4ed6\u4efb\u610f\u5b57\u7b26\u8fdb\u5165\u547d\u4ee4\u884c\u64cd\u4f5c\u6a21\u5f0f\u3002")))),Object(r.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u6ce8\u610f\u4e8b\u9879")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u76ee\u524d\u53ea\u6709 ",Object(r.b)("inlineCode",{parentName:"p"},"Sql Server")," \u6570\u636e\u5e93\u624d\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"GUI \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f"),"\uff0c\u5176\u4ed6\u6570\u636e\u5e93\u8bf7\u4f7f\u7528\u547d\u4ee4\u884c\u6a21\u5f0f\u3002"))),Object(r.b)("h2",{id:"9193-\u754c\u9762\u64cd\u4f5c\u6a21\u5f0f"},"9.19.3 \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f"),Object(r.b)("h3",{id:"91931-\u542f\u52a8\u754c\u9762\u64cd\u4f5c"},"9.19.3.1 \u542f\u52a8\u754c\u9762\u64cd\u4f5c"),Object(r.b)("p",null,"\u5f53\u6211\u4eec\u8f93\u5165 ",Object(r.b)("inlineCode",{parentName:"p"},"G")," \u65f6\uff0c\u5c06\u6253\u5f00 ",Object(r.b)("inlineCode",{parentName:"p"},"GUI")," \u754c\u9762\u64cd\u4f5c\u6a21\u5f0f\uff0c\u5982\uff1a"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst4.png")}),Object(r.b)("p",null,"\u8fd9\u65f6\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion Tools")," \u4f1a\u81ea\u52a8\u67e5\u627e\u6240\u6709\u6570\u636e\u5e93\u914d\u7f6e\u8fde\u63a5\u5b57\u7b26\u4e32\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json",metastring:"{12-13}","{12-13}":!0}),'{\n "Logging": {\n "LogLevel": {\n "Default": "Information",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n },\n "AllowedHosts": "*",\n "ConnectionStrings": {\n "DbConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;",\n "Sqlite3ConnectionString": "Data Source=./Furion.db"\n }\n}\n')),Object(r.b)("h3",{id:"91932-\u52a0\u8f7d\u6570\u636e\u5e93\u8868"},"9.19.3.2 \u52a0\u8f7d\u6570\u636e\u5e93\u8868"),Object(r.b)("p",null,"\u9009\u62e9\u8fde\u63a5\u5b57\u7b26\u4e32\u4e4b\u540e\uff0c\u70b9\u51fb ",Object(r.b)("inlineCode",{parentName:"p"},"\u52a0\u8f7d\u6570\u636e\u5e93\u8868\u548c\u89c6\u56fe")," \u6309\u94ae\u52a0\u8f7d\u3002"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst5.png")}),Object(r.b)("h3",{id:"91933-\u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210"},"9.19.3.3 \u9009\u62e9\u8868\u6216\u89c6\u56fe\u751f\u6210"),Object(r.b)("p",null,"\u52a0\u8f7d\u8868\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u9009\u62e9\u60a8\u8981\u751f\u6210\u7684\u8868\u6216\u89c6\u56fe\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u591a\u9009")),Object(r.b)("img",{src:Object(o.a)("img/dbfirst6.png")}),Object(r.b)("p",null,"\u70b9\u51fb\u5e95\u90e8\u6309\u94ae ",Object(r.b)("inlineCode",{parentName:"p"},"\u7acb\u5373\u751f\u6210")),Object(r.b)("h3",{id:"91934-\u9009\u62e9\u4fdd\u5b58\u76ee\u5f55"},"9.19.3.4 \u9009\u62e9\u4fdd\u5b58\u76ee\u5f55"),Object(r.b)("p",null,"\u70b9\u51fb ",Object(r.b)("inlineCode",{parentName:"p"},"\u7acb\u5373\u751f\u6210")," \u6309\u94ae\u540e\uff0c\u4f1a\u5f39\u51fa\u5b9e\u4f53\u4fdd\u5b58\u9009\u62e9\u76ee\u5f55\u8d44\u6e90\u7ba1\u7406\u5668\uff0c\u9ed8\u8ba4\u5b9e\u4f53\u53ea\u80fd\u4fdd\u5b58\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\uff1a"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst7.png")}),Object(r.b)("p",null,"\u70b9\u51fb\u786e\u5b9a\u540e\u5c31\u53ef\u5b8c\u6210\u6240\u6709\u751f\u6210\u64cd\u4f5c\u3002"),Object(r.b)("h3",{id:"91935-\u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801"},"9.19.3.5 \u751f\u6210\u6700\u7ec8\u5b9e\u4f53\u4ee3\u7801"),Object(r.b)("img",{src:Object(o.a)("img/dbfirst8.png")}),Object(r.b)("p",null,"\u6700\u7ec8\u811a\u672c\u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),'PM> &"../tools/cli.ps1"\n// -----------------------------------------------------------------------------\n// ______ _______ _\n// | ____| |__ __| | |\n// | |__ _ _ _ __ | | ___ ___ | |___\n// | __| | | | \'__| | |/ _ \\ / _ \\| / __|\n// | | | |_| | | | | (_) | (_) | \\__ \\\n// |_| \\__,_|_| |_|\\___/ \\___/|_|___/\n//\n// -----------------------------------------------------------------------------\n// \u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002\n// Copyright \xa9 2020 Furion, Baiqian Co.,Ltd.\n//\n// \u6846\u67b6\u540d\u79f0\uff1aFurion\n// \u6846\u67b6\u4f5c\u8005\uff1a\u767e\u5c0f\u50e7\n// \u6846\u67b6\u7248\u672c\uff1a1.0.0\n// \u6e90\u7801\u5730\u5740\uff1ahttps://gitee.com/monksoul/Furion\n// \u5f00\u6e90\u534f\u8bae\uff1aApache-2.0\uff08http://www.apache.org/licenses/LICENSE-2.0\uff09\n// -----------------------------------------------------------------------------\nFurion Tools v1.0.0 \u542f\u52a8\u4e2d......\nFurion Tools v1.0.0 \u542f\u52a8\u6210\u529f\uff01\nFurion Tools v1.0.0 \u8bf7\u952e\u5165\u64cd\u4f5c\u7c7b\u578b\uff1a[G] \u754c\u9762\u64cd\u4f5c\uff0c[\u4efb\u610f\u5b57\u7b26] \u547d\u4ee4\u884c\u64cd\u4f5c\nFurion Tools v1.0.0 \u60a8\u7684\u8f93\u5165\u662f: G\nFurion Tools v1.0.0 \u6b63\u5728\u52a0\u8f7d\u6570\u636e\u5e93\u8868\u548c\u89c6\u56fe......\nFurion Tools v1.0.0 \u52a0\u8f7d\u6210\u529f\uff01\nFurion Tools v1.0.0 \u6b63\u5728\u7f16\u8bd1\u89e3\u51b3\u65b9\u6848\u4ee3\u7801......\nBuild started...\nBuild succeeded.\nFor foreign key FK_PersonDetail_Person_PersonId on table dbo.PersonDetail, unable to model the end of the foreign key on principal table dbo.Person. This is usually because the principal table was not included in the selection set.\nFurion Tools v1.0.0 \u7f16\u8bd1\u6210\u529f\uff01\nFurion Tools v1.0.0 \u5f00\u59cb\u751f\u6210\u5b9e\u4f53\u6587\u4ef6......\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 City.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 City.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class City : IEntity, IEntityTypeBuilder\n {\n\n public City()\n {\n InverseParent = new HashSet();\n }\n\n public int Id { get; set; }\n public string Name { get; set; }\n public int? ParentId { get; set; }\n public DateTime CreatedTime { get; set; }\n public DateTime? UpdatedTime { get; set; }\n public bool IsDeleted { get; set; }\n\n public virtual City Parent { get; set; }\n public virtual ICollection InverseParent { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasIndex(e => e.ParentId, "IX_City_ParentId");\n\n entityBuilder.HasOne(d => d.Parent)\n .WithMany(p => p.InverseParent)\n .HasForeignKey(d => d.ParentId);\n\n }\n\n }\n}\n\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 PersonDetail.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 PersonDetail.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class PersonDetail : IEntity, IEntityTypeBuilder\n {\n\n public int Id { get; set; }\n public string PhoneNumber { get; set; }\n public string Qq { get; set; }\n public int PersonId { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasIndex(e => e.PersonId, "IX_PersonDetail_PersonId")\n .IsUnique();\n\n entityBuilder.Property(e => e.Qq).HasColumnName("QQ");\n\n }\n\n }\n}\n\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 Post.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 Post.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class Post : IEntity\n {\n\n public int Id { get; set; }\n public string Name { get; set; }\n public DateTime CreatedTime { get; set; }\n public DateTime? UpdatedTime { get; set; }\n public bool IsDeleted { get; set; }\n\n }\n}\n\nFurion Tools v1.0.0 \u6b63\u5728\u751f\u6210 VPerson.cs \u5b9e\u4f53\u4ee3\u7801......\nFurion Tools v1.0.0 \u6210\u529f\u751f\u6210 VPerson.cs \u5b9e\u4f53\u4ee3\u7801\n// -----------------------------------------------------------------------------\n// \u4ee5\u4e0b\u4ee3\u7801\u7531 Furion Tools v1.0.0 \u751f\u6210\n// -----------------------------------------------------------------------------\n\nusing Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore.Metadata.Builders;\nusing System;\nusing System.Collections.Generic;\n\n#nullable disable\n\nnamespace Furion.Core\n{\n public partial class VPerson : IEntity, IEntityTypeBuilder\n {\n\n public int Id { get; set; }\n public string Name { get; set; }\n public int Age { get; set; }\n public string Address { get; set; }\n\n public void Configure(EntityTypeBuilder entityBuilder, DbContext dbContext, Type dbContextLocator)\n {\n entityBuilder.HasNoKey();\n\n entityBuilder.ToView("V_Person");\n\n entityBuilder.Property(e => e.Id).ValueGeneratedOnAdd();\n\n entityBuilder.Property(e => e.Name).HasMaxLength(32);\n\n }\n\n }\n}\n\nFurion Tools v1.0.0 \u5168\u90e8\u5b9e\u4f53\u751f\u6210\u6210\u529f\uff01\nPM>\n')),Object(r.b)("h2",{id:"9194-\u547d\u4ee4\u53c2\u6570\u914d\u7f6e"},"9.19.4 \u547d\u4ee4\u53c2\u6570\u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion Tools Cli")," \u652f\u6301\u591a\u4e2a\u53c2\u6570\u914d\u7f6e\uff0c\u4f7f\u7528\u65b9\u6cd5\u53ea\u9700\u8981\u5728\u547d\u4ee4\u540e\u9762\u6dfb\u52a0\u5373\u53ef\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(i.a)({parentName:"pre"},{className:"language-shell"}),' &"../tools/cli.ps1" -Context \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u540d -ConnectionName \u8fde\u63a5\u5b57\u7b26\u4e32Key\n')),Object(r.b)("p",null,"\u652f\u6301\u53c2\u6570\u5982\u4e0b\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Tables"),"\uff1a\u914d\u7f6e\u8981\u751f\u6210\u7684\u6570\u636e\u5e93\u8868\uff0c\u6570\u7ec4\u7c7b\u578b\uff0c\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u751f\u6210\u6570\u636e\u5e93\u6240\u6709\u8868\u548c\u89c6\u56fe\u3002\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"-Tables Person,PersonDetails")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Context"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"FurDbContext"),"\uff0c\u5982\u679c\u6709\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u5219\u6b64\u53c2\u6570\u5fc5\u987b\u914d\u7f6e"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-ConnectionName"),"\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32\uff0c\u5bf9\u4e8e ",Object(r.b)("inlineCode",{parentName:"li"},"appsetting.json")," \u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Key")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-OutputDir"),"\uff1a\u751f\u6210\u5b9e\u4f53\u4ee3\u7801\u8f93\u51fa\u76ee\u5f55\uff0c\u9ed8\u8ba4\u4e3a\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"./Furion.Core/Entities/")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-DbProvider"),"\uff1a\u6570\u636e\u5e93\u63d0\u4f9b\u5668\uff0c\u9ed8\u8ba4\u662f ",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.SqlServer"),"\uff0c\u5176\u4ed6\u6570\u636e\u5e93\u8bf7\u6307\u5b9a\u5bf9\u5e94\u7a0b\u5e8f\u96c6",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SqlServer"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.SqlServer")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Sqlite"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Sqlite")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Cosmos"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Cosmos")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"InMemoryDatabase"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.InMemory")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"MySql"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Pomelo.EntityFrameworkCore.MySql")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"PostgreSQL"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Npgsql.EntityFrameworkCore.PostgreSQL")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Oracle"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Citms.EntityFrameworkCore.Oracle")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Dm"),"\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Microsoft.EntityFrameworkCore.Dm")))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-EntryProject"),"\uff1aWeb \u542f\u7528\u9879\u76ee\u5c42\u540d\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Web.Entry")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-CoreProject"),"\uff1a\u5b9e\u4f53\u9879\u76ee\u5c42\u540d\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Core")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-DbContextLocators"),"\uff1a\u591a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"MasterDbContextLocator"),"\uff0c\u652f\u6301\u591a\u4e2a\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"MasterDbContextLocator,MySqlDbContextLocator")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Product"),"\uff1a\u89e3\u51b3\u65b9\u6848\u9ed8\u8ba4\u524d\u7f00\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-UseDatabaseNames"),"\uff1a\u662f\u5426\u4fdd\u6301\u751f\u6210\u548c\u6570\u636e\u5e93\u3001\u8868\u4e00\u81f4\u7684\u540d\u79f0"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"-Namespace"),"\uff1a\u6307\u5b9a\u5b9e\u4f53\u547d\u540d\u7a7a\u95f4")),Object(r.b)("h2",{id:"9195-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.19.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(i.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(i.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(i.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(i.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(i.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return o}));var i=t(21),a=t(195);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(i.default)();return{withBaseUrl:(t,i)=>function(e,n,t,{forcePrependBaseUrl:i=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(i)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+o:o}(n,e,t,i)}}function o(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},195:function(e,n,t){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!i(e)}t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return a}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return p})),t.d(n,"b",(function(){return u}));var i=t(0),a=t.n(i);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var l=a.a.createContext({}),s=function(e){var n=a.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},p=function(e){var n=s(e.components);return a.a.createElement(l.Provider,{value:n},e.children)},d={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},m=a.a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,r=e.originalType,o=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),p=s(t),m=i,u=p["".concat(o,".").concat(m)]||p[m]||d[m]||r;return t?a.a.createElement(u,c(c({ref:n},l),{},{components:t})):a.a.createElement(u,c({ref:n},l))}));function u(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var r=t.length,o=new Array(r);o[0]=m;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:i,o[1]=c;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/904cf40b.cea81b35.js b/docs/904cf40b.25030f12.js similarity index 98% rename from docs/904cf40b.cea81b35.js rename to docs/904cf40b.25030f12.js index 8ddd6124cbd..9bfa8a8cb40 100644 --- a/docs/904cf40b.cea81b35.js +++ b/docs/904cf40b.25030f12.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[60],{136:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return p}));var a=t(3),r=t(7),i=(t(0),t(192)),c=t(193),o={id:"auth-control",title:"15. \u5b89\u5168\u9274\u6743",sidebar_label:"15. \u5b89\u5168\u9274\u6743"},b={unversionedId:"auth-control",id:"auth-control",isDocsHomePage:!1,title:"15. \u5b89\u5168\u9274\u6743",description:"15.1 \u4ec0\u4e48\u662f\u9274\u6743",source:"@site/docs\\auth-control.mdx",slug:"/auth-control",permalink:"/docs/auth-control",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/auth-control.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"15. \u5b89\u5168\u9274\u6743",sidebar:"docs",previous:{title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",permalink:"/docs/cache"},next:{title:"16. CORS \u8de8\u57df",permalink:"/docs/cors"}},l=[{value:"15.1 \u4ec0\u4e48\u662f\u9274\u6743",id:"151-\u4ec0\u4e48\u662f\u9274\u6743",children:[{value:"15.1.1 \u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f",id:"1511-\u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f",children:[]}]},{value:"15.2 \u5982\u4f55\u4f7f\u7528",id:"152-\u5982\u4f55\u4f7f\u7528",children:[{value:"15.2.1 \u6dfb\u52a0 Cookie \u6388\u6743",id:"1521-\u6dfb\u52a0-cookie-\u6388\u6743",children:[]},{value:"15.2.2 \u6dfb\u52a0 Jwt \u6388\u6743",id:"1522-\u6dfb\u52a0-jwt-\u6388\u6743",children:[]},{value:"15.2.3 \u6df7\u5408\u6388\u6743",id:"1523-\u6df7\u5408\u6388\u6743",children:[]}]},{value:"15.3 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743",id:"153-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743",children:[{value:"15.3.1 AppAuthorizeHandler",id:"1531-appauthorizehandler",children:[]}]},{value:"15.4 \u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743",id:"154-\u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743",children:[{value:"15.4.1 \u5168\u5c40\u6388\u6743",id:"1541-\u5168\u5c40\u6388\u6743",children:[]},{value:"15.4.2 \u533f\u540d\u8bbf\u95ee",id:"1542-\u533f\u540d\u8bbf\u95ee",children:[]}]},{value:"15.5 \u81ea\u52a8\u5237\u65b0 Token",id:"155-\u81ea\u52a8\u5237\u65b0-token",children:[{value:"15.5.1 \u540e\u7aef\u767b\u5f55\u90e8\u5206",id:"1551-\u540e\u7aef\u767b\u5f55\u90e8\u5206",children:[]},{value:"15.5.2 \u540e\u7aef\u6388\u6743 Handler \u90e8\u5206",id:"1552-\u540e\u7aef\u6388\u6743-handler-\u90e8\u5206",children:[]},{value:"15.5.3 \u5ba2\u6237\u7aef\u90e8\u5206",id:"1553-\u5ba2\u6237\u7aef\u90e8\u5206",children:[]}]},{value:"15.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"156-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function p(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"151-\u4ec0\u4e48\u662f\u9274\u6743"},"15.1 \u4ec0\u4e48\u662f\u9274\u6743"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u9274\u6743\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u79cd\u8eab\u4efd\u8ba4\u8bc1"),"\u3002"),Object(i.b)("p",null,"\u7531\u7528\u6237\u63d0\u4f9b\u51ed\u636e\uff0c\u7136\u540e\u5c06\u5176\u4e0e\u5b58\u50a8\u5728\u64cd\u4f5c\u7cfb\u7edf\u3001\u6570\u636e\u5e93\u3001\u5e94\u7528\u6216\u8d44\u6e90\u4e2d\u7684\u51ed\u636e\u8fdb\u884c\u6bd4\u8f83\u3002 \u5728\u6388\u6743\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u51ed\u636e\u5339\u914d\uff0c\u5219\u7528\u6237\u8eab\u4efd\u9a8c\u8bc1\u6210\u529f\uff0c\u53ef\u6267\u884c\u5df2\u5411\u5176\u6388\u6743\u7684\u64cd\u4f5c\u3002 \u6388\u6743\u6307\u5224\u65ad\u5141\u8bb8\u7528\u6237\u6267\u884c\u7684\u64cd\u4f5c\u7684\u8fc7\u7a0b\u3002\n\u4e5f\u53ef\u4ee5\u5c06\u8eab\u4efd\u9a8c\u8bc1\u7406\u89e3\u4e3a\u8fdb\u5165\u7a7a\u95f4\uff08\u4f8b\u5982\u670d\u52a1\u5668\u3001\u6570\u636e\u5e93\u3001\u5e94\u7528\u6216\u8d44\u6e90\uff09\u7684\u4e00\u79cd\u65b9\u5f0f\uff0c\u800c\u6388\u6743\u662f\u7528\u6237\u53ef\u4ee5\u5bf9\u8be5\u7a7a\u95f4\uff08\u670d\u52a1\u5668\u3001\u6570\u636e\u5e93\u6216\u5e94\u7528\uff09\u5185\u7684\u54ea\u4e9b\u5bf9\u8c61\u6267\u884c\u54ea\u4e9b\u64cd\u4f5c\u3002"),Object(i.b)("h3",{id:"1511-\u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f"},"15.1.1 \u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"HTTP Basic Authentication"))),Object(i.b)("p",null,"\u8fd9\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"HTTP")," \u534f\u8bae\u5b9e\u73b0\u7684\u57fa\u672c\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u6211\u4eec\u5728\u6d4f\u89c8\u7f51\u9875\u65f6\uff0c\u4ece\u6d4f\u89c8\u5668\u6b63\u4e0a\u65b9\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u8981\u6c42\u6211\u4eec\u8f93\u5165\u8d26\u53f7\u5bc6\u7801\uff0c\u6b63\u662f\u4f7f\u7528\u4e86\u8fd9\u79cd\u8ba4\u8bc1\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Session + Cookie"))),Object(i.b)("p",null,"\u5229\u7528\u670d\u52a1\u5668\u7aef\u7684 session\uff08\u4f1a\u8bdd\uff09\u548c\u6d4f\u89c8\u5668\u7aef\u7684 cookie \u6765\u5b9e\u73b0\u524d\u540e\u7aef\u7684\u8ba4\u8bc1\uff0c\u7531\u4e8e http \u8bf7\u6c42\u65f6\u662f\u65e0\u72b6\u6001\u7684\uff0c\u670d\u52a1\u5668\u6b63\u5e38\u60c5\u51b5\u4e0b\u662f\u4e0d\u77e5\u9053\u5f53\u524d\u8bf7\u6c42\u4e4b\u524d\u6709\u6ca1\u6709\u6765\u8fc7\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5982\u679c\u8981\u8bb0\u5f55\u72b6\u6001\uff0c\u5c31\u9700\u8981\u5728\u670d\u52a1\u5668\u7aef\u521b\u5efa\u4e00\u4e2a\u4f1a\u8bdd(seesion),\u5c06\u540c\u4e00\u4e2a\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u90fd\u7ef4\u62a4\u5728\u5404\u81ea\u5f97\u4f1a\u4f1a\u8bdd\u4e2d\uff0c\u6bcf\u5f53\u8bf7\u6c42\u5230\u8fbe\u670d\u52a1\u5668\u7aef\u7684\u65f6\u5019\uff0c\u5148\u53bb\u67e5\u4e00\u4e0b\u8be5\u5ba2\u6237\u7aef\u6709\u6ca1\u6709\u5728\u670d\u52a1\u5668\u7aef\u521b\u5efa seesion\uff0c\u5982\u679c\u6709\u5219\u5df2\u7ecf\u8ba4\u8bc1\u6210\u529f\u4e86\uff0c\u5426\u5219\u5c31\u6ca1\u6709\u8ba4\u8bc1\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Token"))),Object(i.b)("p",null,"\u5ba2\u6237\u7aef\u5728\u9996\u6b21\u767b\u9646\u4ee5\u540e\uff0c\u670d\u52a1\u7aef\u518d\u6b21\u63a5\u6536 ",Object(i.b)("inlineCode",{parentName:"p"},"HTTP")," \u8bf7\u6c42\u7684\u65f6\u5019\uff0c\u5c31\u53ea\u8ba4 ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u4e86\uff0c\u8bf7\u6c42\u53ea\u8981\u6bcf\u6b21\u628a ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u5e26\u4e0a\u5c31\u884c\u4e86\uff0c\u670d\u52a1\u5668\u7aef\u4f1a\u62e6\u622a\u6240\u6709\u7684\u8bf7\u6c42\uff0c\u7136\u540e\u6821\u9a8c ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u7684\u5408\u6cd5\u6027\uff0c\u5408\u6cd5\u5c31\u653e\u884c\uff0c\u4e0d\u5408\u6cd5\u5c31\u8fd4\u56de 401\uff08\u9274\u6743\u5931\u8d25\uff09"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Token"),"\u9a8c\u8bc1\u6bd4\u8f83\u7075\u6d3b\uff0c\u9002\u7528\u4e8e\u5927\u90e8\u5206\u573a\u666f\u3002\u5e38\u7528\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u9274\u6743\u65b9\u5f0f\u7684\u89e3\u51b3\u65b9\u6848\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"JWT"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"JWT")," \u662f\u901a\u8fc7\u5bf9\u5e26\u6709\u76f8\u5173\u7528\u6237\u4fe1\u606f\u7684\u8fdb\u884c\u52a0\u5bc6\uff0c\u52a0\u5bc6\u7684\u65b9\u5f0f\u6bd4\u8f83\u7075\u6d3b\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u5177\u4f53\u8bbe\u8ba1\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OAuth"))),Object(i.b)("p",null,"OAuth\uff08\u5f00\u653e\u6388\u6743\uff09\u662f\u4e00\u4e2a\u5f00\u653e\u6807\u51c6\uff0c\u5141\u8bb8\u7528\u6237\u6388\u6743\u7b2c\u4e09\u65b9\u7f51\u7ad9\u8bbf\u95ee\u4ed6\u4eec\u5b58\u50a8\u5728\u53e6\u5916\u7684\u670d\u52a1\u63d0\u4f9b\u8005\u4e0a\u7684\u4fe1\u606f\uff0c\u800c\u4e0d\u9700\u8981\u5c06\u7528\u6237\u540d\u548c\u5bc6\u7801\u63d0\u4f9b\u7ed9\u7b2c\u4e09\u65b9\u7f51\u7ad9\u6216\u5206\u4eab\u4ed6\u4eec\u6570\u636e\u7684\u6240\u6709\u5185\u5bb9\uff0c\u4e3a\u4e86\u4fdd\u62a4\u7528\u6237\u6570\u636e\u7684\u5b89\u5168\u548c\u9690\u79c1\uff0c\u7b2c\u4e09\u65b9\u7f51\u7ad9\u8bbf\u95ee\u7528\u6237\u6570\u636e\u524d\u90fd\u9700\u8981\u663e\u5f0f\u7684\u5411\u7528\u6237\u5f81\u6c42\u6388\u6743\u3002\u6211\u4eec\u5e38\u89c1\u7684\u63d0\u4f9b OAuth \u8ba4\u8bc1\u670d\u52a1\u7684\u5382\u5546\u6709\u652f\u4ed8\u5b9d\uff0cQQ,\u5fae\u4fe1\u3002"),Object(i.b)("p",null,"OAuth \u534f\u8bae\u53c8\u6709 1.0 \u548c 2.0 \u4e24\u4e2a\u7248\u672c\u3002\u76f8\u6bd4\u8f83 1.0 \u7248\uff0c2.0 \u7248\u6574\u4e2a\u6388\u6743\u9a8c\u8bc1\u6d41\u7a0b\u66f4\u7b80\u5355\u66f4\u5b89\u5168\uff0c\u4e5f\u662f\u76ee\u524d\u6700\u4e3b\u8981\u7684\u7528\u6237\u8eab\u4efd\u9a8c\u8bc1\u548c\u6388\u6743\u65b9\u5f0f\u3002"),Object(i.b)("h2",{id:"152-\u5982\u4f55\u4f7f\u7528"},"15.2 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("div",{className:"admonition admonition-info alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u914d\u7f6e\u4e4b\u524d")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728\u6dfb\u52a0\u6388\u6743\u670d\u52a1\u4e4b\u524d\uff0c\u8bf7\u5148\u786e\u4fdd ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d ",Object(i.b)("inlineCode",{parentName:"p"},"Configure")," \u662f\u5426\u6dfb\u52a0\u4e86\u4ee5\u4e0b\u4e24\u4e2a\u4e2d\u95f4\u4ef6\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"app.UseAuthentication();\napp.UseAuthorization();\n")))),Object(i.b)("h3",{id:"1521-\u6dfb\u52a0-cookie-\u6388\u6743"},"15.2.1 \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h3"},"Cookie")," \u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// Cookies\u5355\u72ec\u6388\u6743\nservices.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)\n .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, b =>\n {\n b.LoginPath = "/Home/Login";\n });\n')),Object(i.b)("h3",{id:"1522-\u6dfb\u52a0-jwt-\u6388\u6743"},"15.2.2 \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h3"},"Jwt")," \u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddJwt();\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"JWT")," \u9274\u6743\u5e76\u672a\u5305\u542b\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9700\u8981\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Extras.Authentication.JwtBearer")," \u62d3\u5c55\u5305\u3002"))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u81ea\u5b9a\u4e49 ",Object(i.b)("inlineCode",{parentName:"li"},"Jwt")," \u914d\u7f6e\uff08\u9ed8\u8ba4\u65e0\u9700\u914d\u7f6e\uff09")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "JWTSettings": {\n "ValidateIssuerSigningKey": true, // \u662f\u5426\u9a8c\u8bc1\u5bc6\u94a5\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\n "IssuerSigningKey": "\u4f60\u7684\u5bc6\u94a5", // \u5bc6\u94a5\uff0cstring \u7c7b\u578b\uff0c\u5fc5\u987b\u662f\u590d\u6742\u5bc6\u94a5\uff0c\u957f\u5ea6\u5927\u4e8e16\n "ValidateIssuer": true, // \u662f\u5426\u9a8c\u8bc1\u7b7e\u53d1\u65b9\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\n "ValidIssuer": "\u7b7e\u53d1\u65b9", // \u7b7e\u53d1\u65b9\uff0cstring \u7c7b\u578b\n "ValidateAudience": true, // \u662f\u5426\u9a8c\u8bc1\u7b7e\u6536\u65b9\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\n "ValidAudience": "\u7b7e\u6536\u65b9", // \u7b7e\u6536\u65b9\uff0cstring \u7c7b\u578b\n "ValidateLifetime": true, // \u662f\u5426\u9a8c\u8bc1\u8fc7\u671f\u65f6\u95f4\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\uff0c\u5efa\u8baetrue\n "ExpiredTime": 20, // \u8fc7\u671f\u65f6\u95f4\uff0clong \u7c7b\u578b\uff0c\u5355\u4f4d\u5206\u949f\uff0c\u9ed8\u8ba420\u5206\u949f\n "ClockSkew": 5 // \u8fc7\u671f\u65f6\u95f4\u5bb9\u9519\u503c\uff0clong \u7c7b\u578b\uff0c\u5355\u4f4d\u79d2\uff0c\u9ed8\u8ba4 5\u79d2\n }\n}\n')),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"li"},"Token"))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u751f\u6210 token\nvar accessToken = JWTEncryption.Encrypt(new Dictionary()\n {\n { "UserId", user.Id }, // \u5b58\u50a8Id\n { "Account",user.Account }, // \u5b58\u50a8\u7528\u6237\u540d\n });\n')),Object(i.b)("h3",{id:"1523-\u6df7\u5408\u6388\u6743"},"15.2.3 \u6df7\u5408\u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// JWT \u548c Cookies \u540c\u65f6\u6388\u6743\nservices.AddJwt(options =>\n{\n options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;\n options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;\n})\n.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, b =>\n{\n b.LoginPath = "/Home/Login";\n});\n')),Object(i.b)("h2",{id:"153-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743"},"15.3 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u9ad8\u7ea7\u7b56\u7565\u9274\u6743\u548c\u6388\u6743\u65b9\u5f0f\uff0c\u901a\u8fc7\u8be5\u7b56\u7565\u6388\u6743\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u4efb\u4f55\u81ea\u5b9a\u4e49\u6388\u6743\u3002"),Object(i.b)("h3",{id:"1531-appauthorizehandler"},"15.3.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"AppAuthorizeHandler")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"AppAuthorizeHandler")," \u7b56\u7565\u6388\u6743\u5904\u7406\u7a0b\u5e8f\u63d0\u4f9b\u57fa\u7c7b\uff0c\u53ea\u9700\u8981\u521b\u5efa\u81ea\u5df1\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Handler")," \u7ee7\u627f\u5b83\u5373\u53ef\u3002\u5982\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"JwtHandler"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{20,12}","{20,12}":!0}),'using Furion.Authorization;\nusing Furion.Core;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.IdentityModel.JsonWebTokens;\n\nnamespace Furion.Web.Core\n{\n /// \n /// JWT \u6388\u6743\u81ea\u5b9a\u4e49\u5904\u7406\u7a0b\u5e8f\n /// \n public class JwtHandler : AppAuthorizeHandler\n {\n /// \n /// \u8bf7\u6c42\u7ba1\u9053\n /// \n /// \n /// \n /// \n public override Task PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)\n {\n // \u6b64\u5904\u5df2\u7ecf\u81ea\u52a8\u9a8c\u8bc1 Jwt token\u7684\u6709\u6548\u6027\u4e86\uff0c\u65e0\u9700\u624b\u52a8\u9a8c\u8bc1\n\n // \u68c0\u67e5\u6743\u9650\uff0c\u5982\u679c\u65b9\u6cd5\u65f6\u5f02\u6b65\u7684\u5c31\u4e0d\u7528 Task.FromResult \u5305\u88f9\uff0c\u76f4\u63a5\u4f7f\u7528 async/await \u5373\u53ef\n return Task.FromResult(CheckAuthorzie(httpContext));\n }\n\n /// \n /// \u68c0\u67e5\u6743\u9650\n /// \n /// \n /// \n private static bool CheckAuthorzie(DefaultHttpContext httpContext)\n {\n // \u83b7\u53d6\u6743\u9650\u7279\u6027\n var securityDefineAttribute = httpContext.GetMetadata();\n if (securityDefineAttribute == null) return true;\n\n return App.GetService().CheckSecurity(securityDefineAttribute.ResourceId);\n }\n }\n}\n')),Object(i.b)("p",null,"\u4e4b\u540e\u6ce8\u518c ",Object(i.b)("inlineCode",{parentName:"p"},"JwtHandler")," \u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddJwt();\n")),Object(i.b)("h2",{id:"154-\u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743"},"15.4 \u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743"),Object(i.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u7684\u8def\u7531\u90fd\u662f\u5141\u8bb8\u533f\u540d\u8bbf\u95ee\u7684\uff0c\u6240\u4ee5\u5982\u679c\u9700\u8981\u5bf9\u67d0\u4e2a ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u8bbe\u5b9a\u6388\u6743\u8bbf\u95ee\uff0c\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[AppAuthorize]")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"[Authorize]")," \u7279\u6027\u5373\u53ef\u3002"),Object(i.b)("p",null,"\u5982\u679c\u9700\u8981\u5bf9\u7279\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u5141\u8bb8\u533f\u540d\u8bbf\u95ee\uff0c\u5219\u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[AllowAnonymous]")," \u5373\u53ef\u3002"),Object(i.b)("h3",{id:"1541-\u5168\u5c40\u6388\u6743"},"15.4.1 \u5168\u5c40\u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddJwt(enableGlobalAuthorize:true);\n")),Object(i.b)("h3",{id:"1542-\u533f\u540d\u8bbf\u95ee"},"15.4.2 \u533f\u540d\u8bbf\u95ee"),Object(i.b)("p",null,"\u5982\u679c\u9700\u8981\u5bf9\u7279\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u5141\u8bb8\u533f\u540d\u8bbf\u95ee\uff0c\u5219\u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[AllowAnonymous]")," \u5373\u53ef\u3002"),Object(i.b)("h2",{id:"155-\u81ea\u52a8\u5237\u65b0-token"},"15.5 \u81ea\u52a8\u5237\u65b0 Token"),Object(i.b)("h3",{id:"1551-\u540e\u7aef\u767b\u5f55\u90e8\u5206"},"15.5.1 \u540e\u7aef\u767b\u5f55\u90e8\u5206"),Object(i.b)("p",null,"\u5f53\u7528\u6237\u767b\u5f55\u6210\u529f\u4e4b\u540e\uff0c\u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u5b57\u7b26\u4e32\uff0c\u4e4b\u540e\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"JWTEncryption.GenerateRefreshToken()")," \u83b7\u53d6 ",Object(i.b)("inlineCode",{parentName:"p"},"\u5237\u65b0Token"),"\uff0c\u5e76\u901a\u8fc7\u54cd\u5e94\u62a5\u6587\u5934\u8fd4\u56de\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9}","{9}":!0}),'// token\nvar accessToken = JWTEncryption.Encrypt(new Dictionary()\n {\n { "UserId", user.Id }, // \u5b58\u50a8Id\n { "Account",user.Account }, // \u5b58\u50a8\u7528\u6237\u540d\n });\n\n// \u83b7\u53d6\u5237\u65b0 token\nvar refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, 30); // \u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u5237\u65b0 token \u7684\u6709\u6548\u671f\uff0c\u9ed8\u8ba4\u4e09\u5341\u5929\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nhttpContextAccessor.HttpContext.Response.Headers["access-token"] = accessToken;\nhttpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;\n')),Object(i.b)("p",null,"\u7528\u6237\u767b\u5f55\u6210\u529f\u4e4b\u540e\u628a ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u4e00\u8d77\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u5b58\u50a8\u8d77\u6765\u3002"),Object(i.b)("h3",{id:"1552-\u540e\u7aef\u6388\u6743-handler-\u90e8\u5206"},"15.5.2 \u540e\u7aef\u6388\u6743 ",Object(i.b)("inlineCode",{parentName:"h3"},"Handler")," \u90e8\u5206"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16-27}","{16-27}":!0}),'using Furion.Authorization;\nusing Furion.Core;\nusing Furion.DataEncryption;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.Extensions.DependencyInjection;\nusing System.Threading.Tasks;\n\nnamespace Furion.Web.Core\n{\n /// \n /// JWT \u6388\u6743\u81ea\u5b9a\u4e49\u5904\u7406\u7a0b\u5e8f\n /// \n public class JwtHandler : AppAuthorizeHandler\n {\n /// \n /// \u91cd\u5199 Handler \u6dfb\u52a0\u81ea\u52a8\u5237\u65b0\u6536\u53d6\u903b\u8f91\n /// \n /// \n /// \n public override async Task HandleAsync(AuthorizationHandlerContext context)\n {\n // \u81ea\u52a8\u5237\u65b0 token\n if (JWTEncryption.AutoRefreshToken(context, context.GetCurrentHttpContext()))\n {\n await AuthorizeHandleAsync(context);\n }\n }\n\n /// \n /// \u9a8c\u8bc1\u7ba1\u9053\uff0c\u4e5f\u5c31\u662f\u9a8c\u8bc1\u6838\u5fc3\u4ee3\u7801\n /// \n /// \n /// \n /// \n public override Task PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)\n {\n // \u68c0\u67e5\u6743\u9650\uff0c\u5982\u679c\u65b9\u6cd5\u65f6\u5f02\u6b65\u7684\u5c31\u4e0d\u7528 Task.FromResult \u5305\u88f9\uff0c\u76f4\u63a5\u4f7f\u7528 async/await \u5373\u53ef\n return Task.FromResult(true);\n }\n }\n}\n')),Object(i.b)("h3",{id:"1553-\u5ba2\u6237\u7aef\u90e8\u5206"},"15.5.3 \u5ba2\u6237\u7aef\u90e8\u5206"),Object(i.b)("p",null,"\u5ba2\u6237\u7aef\u6bcf\u6b21\u8bf7\u6c42\u9700\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u653e\u5230\u8bf7\u6c42\u62a5\u6587\u5934\u4e2d\u4f20\u9001\u5230\u670d\u52a1\u7aef\uff0c\u683c\u5f0f\u4e3a\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),"Authorization: Bearer \u4f60\u7684token\nX-Authorization: Bearer \u4f60\u7684\u5237\u65b0token\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728\u6b63\u5e38\u5f00\u53d1\u4e2d\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u65e0\u9700\u6bcf\u6b21\u8bf7\u6c42\u643a\u5e26\uff0c\u800c\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u5373\u5c06\u8fc7\u671f\u4e4b\u540e\u643a\u5e26\u5373\u53ef\u3002\u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u81ea\u884c\u5224\u65ad ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u662f\u5426\u5373\u5c06\u8fc7\u671f\u3002"))),Object(i.b)("p",null,"\u5982\u679c ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u8fc7\u671f\uff0c\u90a3\u4e48 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5c06\u81ea\u52a8\u6839\u636e\u6709\u6548\u671f\u5185\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u81ea\u52a8\u751f\u6210\u65b0\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"AceessToken"),"\uff0c\u5e76\u5728 ",Object(i.b)("strong",{parentName:"p"},"\u54cd\u5e94\u62a5\u6587")," \u4e2d\u8fd4\u56de\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),"access-token: \u65b0\u7684token\nx-access-token: \u65b0\u7684\u5237\u65b0token\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5b58\u50a8\u65b0\u7684 Token")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u524d\u7aef\u9700\u8981\u83b7\u53d6 ",Object(i.b)("strong",{parentName:"p"},"\u54cd\u5e94\u62a5\u6587")," \u65b0\u7684 token \u548c\u5237\u65b0 token \u66ff\u6362\u4e4b\u524d\u5728\u5ba2\u6237\u5904\u5b58\u50a8\u65e7\u7684 token \u548c\u5237\u65b0 token\u3002"))),Object(i.b)("h2",{id:"156-\u53cd\u9988\u4e0e\u5efa\u8bae"},"15.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u9274\u6743\u6388\u6743")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/security/?view=aspnetcore-5.0"}),"ASP.NET Core - \u5b89\u5168\u548c\u6807\u8bc6")," \u7ae0\u8282\u3002"))))}p.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return c}));var a=t(21),r=t(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return p})),t.d(n,"b",(function(){return m}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=r.a.createContext({}),s=function(e){var n=r.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},p=function(e){var n=s(e.components);return r.a.createElement(l.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},d=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),p=s(t),d=a,m=p["".concat(c,".").concat(d)]||p[d]||u[d]||i;return t?r.a.createElement(m,o(o({ref:n},l),{},{components:t})):r.a.createElement(m,o({ref:n},l))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,c=new Array(i);c[0]=d;var o={};for(var b in n)hasOwnProperty.call(n,b)&&(o[b]=n[b]);o.originalType=e,o.mdxType="string"==typeof e?e:a,c[1]=o;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{139:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return p}));var a=t(3),r=t(7),i=(t(0),t(196)),c=t(197),o={id:"auth-control",title:"15. \u5b89\u5168\u9274\u6743",sidebar_label:"15. \u5b89\u5168\u9274\u6743"},b={unversionedId:"auth-control",id:"auth-control",isDocsHomePage:!1,title:"15. \u5b89\u5168\u9274\u6743",description:"15.1 \u4ec0\u4e48\u662f\u9274\u6743",source:"@site/docs\\auth-control.mdx",slug:"/auth-control",permalink:"/docs/auth-control",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/auth-control.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"15. \u5b89\u5168\u9274\u6743",sidebar:"docs",previous:{title:"14. \u5206\u5e03\u5f0f\u7f13\u5b58",permalink:"/docs/cache"},next:{title:"16. CORS \u8de8\u57df",permalink:"/docs/cors"}},l=[{value:"15.1 \u4ec0\u4e48\u662f\u9274\u6743",id:"151-\u4ec0\u4e48\u662f\u9274\u6743",children:[{value:"15.1.1 \u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f",id:"1511-\u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f",children:[]}]},{value:"15.2 \u5982\u4f55\u4f7f\u7528",id:"152-\u5982\u4f55\u4f7f\u7528",children:[{value:"15.2.1 \u6dfb\u52a0 Cookie \u6388\u6743",id:"1521-\u6dfb\u52a0-cookie-\u6388\u6743",children:[]},{value:"15.2.2 \u6dfb\u52a0 Jwt \u6388\u6743",id:"1522-\u6dfb\u52a0-jwt-\u6388\u6743",children:[]},{value:"15.2.3 \u6df7\u5408\u6388\u6743",id:"1523-\u6df7\u5408\u6388\u6743",children:[]}]},{value:"15.3 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743",id:"153-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743",children:[{value:"15.3.1 AppAuthorizeHandler",id:"1531-appauthorizehandler",children:[]}]},{value:"15.4 \u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743",id:"154-\u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743",children:[{value:"15.4.1 \u5168\u5c40\u6388\u6743",id:"1541-\u5168\u5c40\u6388\u6743",children:[]},{value:"15.4.2 \u533f\u540d\u8bbf\u95ee",id:"1542-\u533f\u540d\u8bbf\u95ee",children:[]}]},{value:"15.5 \u81ea\u52a8\u5237\u65b0 Token",id:"155-\u81ea\u52a8\u5237\u65b0-token",children:[{value:"15.5.1 \u540e\u7aef\u767b\u5f55\u90e8\u5206",id:"1551-\u540e\u7aef\u767b\u5f55\u90e8\u5206",children:[]},{value:"15.5.2 \u540e\u7aef\u6388\u6743 Handler \u90e8\u5206",id:"1552-\u540e\u7aef\u6388\u6743-handler-\u90e8\u5206",children:[]},{value:"15.5.3 \u5ba2\u6237\u7aef\u90e8\u5206",id:"1553-\u5ba2\u6237\u7aef\u90e8\u5206",children:[]}]},{value:"15.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"156-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:l};function p(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},s,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"151-\u4ec0\u4e48\u662f\u9274\u6743"},"15.1 \u4ec0\u4e48\u662f\u9274\u6743"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u9274\u6743\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u79cd\u8eab\u4efd\u8ba4\u8bc1"),"\u3002"),Object(i.b)("p",null,"\u7531\u7528\u6237\u63d0\u4f9b\u51ed\u636e\uff0c\u7136\u540e\u5c06\u5176\u4e0e\u5b58\u50a8\u5728\u64cd\u4f5c\u7cfb\u7edf\u3001\u6570\u636e\u5e93\u3001\u5e94\u7528\u6216\u8d44\u6e90\u4e2d\u7684\u51ed\u636e\u8fdb\u884c\u6bd4\u8f83\u3002 \u5728\u6388\u6743\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u51ed\u636e\u5339\u914d\uff0c\u5219\u7528\u6237\u8eab\u4efd\u9a8c\u8bc1\u6210\u529f\uff0c\u53ef\u6267\u884c\u5df2\u5411\u5176\u6388\u6743\u7684\u64cd\u4f5c\u3002 \u6388\u6743\u6307\u5224\u65ad\u5141\u8bb8\u7528\u6237\u6267\u884c\u7684\u64cd\u4f5c\u7684\u8fc7\u7a0b\u3002\n\u4e5f\u53ef\u4ee5\u5c06\u8eab\u4efd\u9a8c\u8bc1\u7406\u89e3\u4e3a\u8fdb\u5165\u7a7a\u95f4\uff08\u4f8b\u5982\u670d\u52a1\u5668\u3001\u6570\u636e\u5e93\u3001\u5e94\u7528\u6216\u8d44\u6e90\uff09\u7684\u4e00\u79cd\u65b9\u5f0f\uff0c\u800c\u6388\u6743\u662f\u7528\u6237\u53ef\u4ee5\u5bf9\u8be5\u7a7a\u95f4\uff08\u670d\u52a1\u5668\u3001\u6570\u636e\u5e93\u6216\u5e94\u7528\uff09\u5185\u7684\u54ea\u4e9b\u5bf9\u8c61\u6267\u884c\u54ea\u4e9b\u64cd\u4f5c\u3002"),Object(i.b)("h3",{id:"1511-\u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f"},"15.1.1 \u5e38\u89c1\u7684\u9274\u6743\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"HTTP Basic Authentication"))),Object(i.b)("p",null,"\u8fd9\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"HTTP")," \u534f\u8bae\u5b9e\u73b0\u7684\u57fa\u672c\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u6211\u4eec\u5728\u6d4f\u89c8\u7f51\u9875\u65f6\uff0c\u4ece\u6d4f\u89c8\u5668\u6b63\u4e0a\u65b9\u5f39\u51fa\u7684\u5bf9\u8bdd\u6846\u8981\u6c42\u6211\u4eec\u8f93\u5165\u8d26\u53f7\u5bc6\u7801\uff0c\u6b63\u662f\u4f7f\u7528\u4e86\u8fd9\u79cd\u8ba4\u8bc1\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Session + Cookie"))),Object(i.b)("p",null,"\u5229\u7528\u670d\u52a1\u5668\u7aef\u7684 session\uff08\u4f1a\u8bdd\uff09\u548c\u6d4f\u89c8\u5668\u7aef\u7684 cookie \u6765\u5b9e\u73b0\u524d\u540e\u7aef\u7684\u8ba4\u8bc1\uff0c\u7531\u4e8e http \u8bf7\u6c42\u65f6\u662f\u65e0\u72b6\u6001\u7684\uff0c\u670d\u52a1\u5668\u6b63\u5e38\u60c5\u51b5\u4e0b\u662f\u4e0d\u77e5\u9053\u5f53\u524d\u8bf7\u6c42\u4e4b\u524d\u6709\u6ca1\u6709\u6765\u8fc7\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5982\u679c\u8981\u8bb0\u5f55\u72b6\u6001\uff0c\u5c31\u9700\u8981\u5728\u670d\u52a1\u5668\u7aef\u521b\u5efa\u4e00\u4e2a\u4f1a\u8bdd(seesion),\u5c06\u540c\u4e00\u4e2a\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u90fd\u7ef4\u62a4\u5728\u5404\u81ea\u5f97\u4f1a\u4f1a\u8bdd\u4e2d\uff0c\u6bcf\u5f53\u8bf7\u6c42\u5230\u8fbe\u670d\u52a1\u5668\u7aef\u7684\u65f6\u5019\uff0c\u5148\u53bb\u67e5\u4e00\u4e0b\u8be5\u5ba2\u6237\u7aef\u6709\u6ca1\u6709\u5728\u670d\u52a1\u5668\u7aef\u521b\u5efa seesion\uff0c\u5982\u679c\u6709\u5219\u5df2\u7ecf\u8ba4\u8bc1\u6210\u529f\u4e86\uff0c\u5426\u5219\u5c31\u6ca1\u6709\u8ba4\u8bc1\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Token"))),Object(i.b)("p",null,"\u5ba2\u6237\u7aef\u5728\u9996\u6b21\u767b\u9646\u4ee5\u540e\uff0c\u670d\u52a1\u7aef\u518d\u6b21\u63a5\u6536 ",Object(i.b)("inlineCode",{parentName:"p"},"HTTP")," \u8bf7\u6c42\u7684\u65f6\u5019\uff0c\u5c31\u53ea\u8ba4 ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u4e86\uff0c\u8bf7\u6c42\u53ea\u8981\u6bcf\u6b21\u628a ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u5e26\u4e0a\u5c31\u884c\u4e86\uff0c\u670d\u52a1\u5668\u7aef\u4f1a\u62e6\u622a\u6240\u6709\u7684\u8bf7\u6c42\uff0c\u7136\u540e\u6821\u9a8c ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u7684\u5408\u6cd5\u6027\uff0c\u5408\u6cd5\u5c31\u653e\u884c\uff0c\u4e0d\u5408\u6cd5\u5c31\u8fd4\u56de 401\uff08\u9274\u6743\u5931\u8d25\uff09"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Token"),"\u9a8c\u8bc1\u6bd4\u8f83\u7075\u6d3b\uff0c\u9002\u7528\u4e8e\u5927\u90e8\u5206\u573a\u666f\u3002\u5e38\u7528\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u9274\u6743\u65b9\u5f0f\u7684\u89e3\u51b3\u65b9\u6848\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"JWT"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"JWT")," \u662f\u901a\u8fc7\u5bf9\u5e26\u6709\u76f8\u5173\u7528\u6237\u4fe1\u606f\u7684\u8fdb\u884c\u52a0\u5bc6\uff0c\u52a0\u5bc6\u7684\u65b9\u5f0f\u6bd4\u8f83\u7075\u6d3b\uff0c\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u5177\u4f53\u8bbe\u8ba1\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"OAuth"))),Object(i.b)("p",null,"OAuth\uff08\u5f00\u653e\u6388\u6743\uff09\u662f\u4e00\u4e2a\u5f00\u653e\u6807\u51c6\uff0c\u5141\u8bb8\u7528\u6237\u6388\u6743\u7b2c\u4e09\u65b9\u7f51\u7ad9\u8bbf\u95ee\u4ed6\u4eec\u5b58\u50a8\u5728\u53e6\u5916\u7684\u670d\u52a1\u63d0\u4f9b\u8005\u4e0a\u7684\u4fe1\u606f\uff0c\u800c\u4e0d\u9700\u8981\u5c06\u7528\u6237\u540d\u548c\u5bc6\u7801\u63d0\u4f9b\u7ed9\u7b2c\u4e09\u65b9\u7f51\u7ad9\u6216\u5206\u4eab\u4ed6\u4eec\u6570\u636e\u7684\u6240\u6709\u5185\u5bb9\uff0c\u4e3a\u4e86\u4fdd\u62a4\u7528\u6237\u6570\u636e\u7684\u5b89\u5168\u548c\u9690\u79c1\uff0c\u7b2c\u4e09\u65b9\u7f51\u7ad9\u8bbf\u95ee\u7528\u6237\u6570\u636e\u524d\u90fd\u9700\u8981\u663e\u5f0f\u7684\u5411\u7528\u6237\u5f81\u6c42\u6388\u6743\u3002\u6211\u4eec\u5e38\u89c1\u7684\u63d0\u4f9b OAuth \u8ba4\u8bc1\u670d\u52a1\u7684\u5382\u5546\u6709\u652f\u4ed8\u5b9d\uff0cQQ,\u5fae\u4fe1\u3002"),Object(i.b)("p",null,"OAuth \u534f\u8bae\u53c8\u6709 1.0 \u548c 2.0 \u4e24\u4e2a\u7248\u672c\u3002\u76f8\u6bd4\u8f83 1.0 \u7248\uff0c2.0 \u7248\u6574\u4e2a\u6388\u6743\u9a8c\u8bc1\u6d41\u7a0b\u66f4\u7b80\u5355\u66f4\u5b89\u5168\uff0c\u4e5f\u662f\u76ee\u524d\u6700\u4e3b\u8981\u7684\u7528\u6237\u8eab\u4efd\u9a8c\u8bc1\u548c\u6388\u6743\u65b9\u5f0f\u3002"),Object(i.b)("h2",{id:"152-\u5982\u4f55\u4f7f\u7528"},"15.2 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("div",{className:"admonition admonition-info alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u914d\u7f6e\u4e4b\u524d")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728\u6dfb\u52a0\u6388\u6743\u670d\u52a1\u4e4b\u524d\uff0c\u8bf7\u5148\u786e\u4fdd ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d ",Object(i.b)("inlineCode",{parentName:"p"},"Configure")," \u662f\u5426\u6dfb\u52a0\u4e86\u4ee5\u4e0b\u4e24\u4e2a\u4e2d\u95f4\u4ef6\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"app.UseAuthentication();\napp.UseAuthorization();\n")))),Object(i.b)("h3",{id:"1521-\u6dfb\u52a0-cookie-\u6388\u6743"},"15.2.1 \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h3"},"Cookie")," \u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// Cookies\u5355\u72ec\u6388\u6743\nservices.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)\n .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, b =>\n {\n b.LoginPath = "/Home/Login";\n });\n')),Object(i.b)("h3",{id:"1522-\u6dfb\u52a0-jwt-\u6388\u6743"},"15.2.2 \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h3"},"Jwt")," \u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddJwt();\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"JWT")," \u9274\u6743\u5e76\u672a\u5305\u542b\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9700\u8981\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Extras.Authentication.JwtBearer")," \u62d3\u5c55\u5305\u3002"))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u81ea\u5b9a\u4e49 ",Object(i.b)("inlineCode",{parentName:"li"},"Jwt")," \u914d\u7f6e\uff08\u9ed8\u8ba4\u65e0\u9700\u914d\u7f6e\uff09")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "JWTSettings": {\n "ValidateIssuerSigningKey": true, // \u662f\u5426\u9a8c\u8bc1\u5bc6\u94a5\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\n "IssuerSigningKey": "\u4f60\u7684\u5bc6\u94a5", // \u5bc6\u94a5\uff0cstring \u7c7b\u578b\uff0c\u5fc5\u987b\u662f\u590d\u6742\u5bc6\u94a5\uff0c\u957f\u5ea6\u5927\u4e8e16\n "ValidateIssuer": true, // \u662f\u5426\u9a8c\u8bc1\u7b7e\u53d1\u65b9\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\n "ValidIssuer": "\u7b7e\u53d1\u65b9", // \u7b7e\u53d1\u65b9\uff0cstring \u7c7b\u578b\n "ValidateAudience": true, // \u662f\u5426\u9a8c\u8bc1\u7b7e\u6536\u65b9\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\n "ValidAudience": "\u7b7e\u6536\u65b9", // \u7b7e\u6536\u65b9\uff0cstring \u7c7b\u578b\n "ValidateLifetime": true, // \u662f\u5426\u9a8c\u8bc1\u8fc7\u671f\u65f6\u95f4\uff0cbool \u7c7b\u578b\uff0c\u9ed8\u8ba4true\uff0c\u5efa\u8baetrue\n "ExpiredTime": 20, // \u8fc7\u671f\u65f6\u95f4\uff0clong \u7c7b\u578b\uff0c\u5355\u4f4d\u5206\u949f\uff0c\u9ed8\u8ba420\u5206\u949f\n "ClockSkew": 5 // \u8fc7\u671f\u65f6\u95f4\u5bb9\u9519\u503c\uff0clong \u7c7b\u578b\uff0c\u5355\u4f4d\u79d2\uff0c\u9ed8\u8ba4 5\u79d2\n }\n}\n')),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"li"},"Token"))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u751f\u6210 token\nvar accessToken = JWTEncryption.Encrypt(new Dictionary()\n {\n { "UserId", user.Id }, // \u5b58\u50a8Id\n { "Account",user.Account }, // \u5b58\u50a8\u7528\u6237\u540d\n });\n')),Object(i.b)("h3",{id:"1523-\u6df7\u5408\u6388\u6743"},"15.2.3 \u6df7\u5408\u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// JWT \u548c Cookies \u540c\u65f6\u6388\u6743\nservices.AddJwt(options =>\n{\n options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;\n options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;\n})\n.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, b =>\n{\n b.LoginPath = "/Home/Login";\n});\n')),Object(i.b)("h2",{id:"153-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743"},"15.3 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u6388\u6743"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u9ad8\u7ea7\u7b56\u7565\u9274\u6743\u548c\u6388\u6743\u65b9\u5f0f\uff0c\u901a\u8fc7\u8be5\u7b56\u7565\u6388\u6743\u65b9\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u4efb\u4f55\u81ea\u5b9a\u4e49\u6388\u6743\u3002"),Object(i.b)("h3",{id:"1531-appauthorizehandler"},"15.3.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"AppAuthorizeHandler")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"AppAuthorizeHandler")," \u7b56\u7565\u6388\u6743\u5904\u7406\u7a0b\u5e8f\u63d0\u4f9b\u57fa\u7c7b\uff0c\u53ea\u9700\u8981\u521b\u5efa\u81ea\u5df1\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Handler")," \u7ee7\u627f\u5b83\u5373\u53ef\u3002\u5982\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"JwtHandler"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{20,12}","{20,12}":!0}),'using Furion.Authorization;\nusing Furion.Core;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.IdentityModel.JsonWebTokens;\n\nnamespace Furion.Web.Core\n{\n /// \n /// JWT \u6388\u6743\u81ea\u5b9a\u4e49\u5904\u7406\u7a0b\u5e8f\n /// \n public class JwtHandler : AppAuthorizeHandler\n {\n /// \n /// \u8bf7\u6c42\u7ba1\u9053\n /// \n /// \n /// \n /// \n public override Task PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)\n {\n // \u6b64\u5904\u5df2\u7ecf\u81ea\u52a8\u9a8c\u8bc1 Jwt token\u7684\u6709\u6548\u6027\u4e86\uff0c\u65e0\u9700\u624b\u52a8\u9a8c\u8bc1\n\n // \u68c0\u67e5\u6743\u9650\uff0c\u5982\u679c\u65b9\u6cd5\u65f6\u5f02\u6b65\u7684\u5c31\u4e0d\u7528 Task.FromResult \u5305\u88f9\uff0c\u76f4\u63a5\u4f7f\u7528 async/await \u5373\u53ef\n return Task.FromResult(CheckAuthorzie(httpContext));\n }\n\n /// \n /// \u68c0\u67e5\u6743\u9650\n /// \n /// \n /// \n private static bool CheckAuthorzie(DefaultHttpContext httpContext)\n {\n // \u83b7\u53d6\u6743\u9650\u7279\u6027\n var securityDefineAttribute = httpContext.GetMetadata();\n if (securityDefineAttribute == null) return true;\n\n return App.GetService().CheckSecurity(securityDefineAttribute.ResourceId);\n }\n }\n}\n')),Object(i.b)("p",null,"\u4e4b\u540e\u6ce8\u518c ",Object(i.b)("inlineCode",{parentName:"p"},"JwtHandler")," \u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddJwt();\n")),Object(i.b)("h2",{id:"154-\u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743"},"15.4 \u6388\u6743\u7279\u6027\u53ca\u5168\u5c40\u6388\u6743"),Object(i.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u7684\u8def\u7531\u90fd\u662f\u5141\u8bb8\u533f\u540d\u8bbf\u95ee\u7684\uff0c\u6240\u4ee5\u5982\u679c\u9700\u8981\u5bf9\u67d0\u4e2a ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u8bbe\u5b9a\u6388\u6743\u8bbf\u95ee\uff0c\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[AppAuthorize]")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"[Authorize]")," \u7279\u6027\u5373\u53ef\u3002"),Object(i.b)("p",null,"\u5982\u679c\u9700\u8981\u5bf9\u7279\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u5141\u8bb8\u533f\u540d\u8bbf\u95ee\uff0c\u5219\u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[AllowAnonymous]")," \u5373\u53ef\u3002"),Object(i.b)("h3",{id:"1541-\u5168\u5c40\u6388\u6743"},"15.4.1 \u5168\u5c40\u6388\u6743"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddJwt(enableGlobalAuthorize:true);\n")),Object(i.b)("h3",{id:"1542-\u533f\u540d\u8bbf\u95ee"},"15.4.2 \u533f\u540d\u8bbf\u95ee"),Object(i.b)("p",null,"\u5982\u679c\u9700\u8981\u5bf9\u7279\u5b9a\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Action")," \u6216 ",Object(i.b)("inlineCode",{parentName:"p"},"Controller")," \u5141\u8bb8\u533f\u540d\u8bbf\u95ee\uff0c\u5219\u8d34 ",Object(i.b)("inlineCode",{parentName:"p"},"[AllowAnonymous]")," \u5373\u53ef\u3002"),Object(i.b)("h2",{id:"155-\u81ea\u52a8\u5237\u65b0-token"},"15.5 \u81ea\u52a8\u5237\u65b0 Token"),Object(i.b)("h3",{id:"1551-\u540e\u7aef\u767b\u5f55\u90e8\u5206"},"15.5.1 \u540e\u7aef\u767b\u5f55\u90e8\u5206"),Object(i.b)("p",null,"\u5f53\u7528\u6237\u767b\u5f55\u6210\u529f\u4e4b\u540e\uff0c\u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u5b57\u7b26\u4e32\uff0c\u4e4b\u540e\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"JWTEncryption.GenerateRefreshToken()")," \u83b7\u53d6 ",Object(i.b)("inlineCode",{parentName:"p"},"\u5237\u65b0Token"),"\uff0c\u5e76\u901a\u8fc7\u54cd\u5e94\u62a5\u6587\u5934\u8fd4\u56de\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9}","{9}":!0}),'// token\nvar accessToken = JWTEncryption.Encrypt(new Dictionary()\n {\n { "UserId", user.Id }, // \u5b58\u50a8Id\n { "Account",user.Account }, // \u5b58\u50a8\u7528\u6237\u540d\n });\n\n// \u83b7\u53d6\u5237\u65b0 token\nvar refreshToken = JWTEncryption.GenerateRefreshToken(accessToken, 30); // \u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u5237\u65b0 token \u7684\u6709\u6548\u671f\uff0c\u9ed8\u8ba4\u4e09\u5341\u5929\n\n// \u8bbe\u7f6e\u8bf7\u6c42\u62a5\u6587\u5934\nhttpContextAccessor.HttpContext.Response.Headers["access-token"] = accessToken;\nhttpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;\n')),Object(i.b)("p",null,"\u7528\u6237\u767b\u5f55\u6210\u529f\u4e4b\u540e\u628a ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u4e00\u8d77\u8fd4\u56de\u7ed9\u5ba2\u6237\u7aef\u5b58\u50a8\u8d77\u6765\u3002"),Object(i.b)("h3",{id:"1552-\u540e\u7aef\u6388\u6743-handler-\u90e8\u5206"},"15.5.2 \u540e\u7aef\u6388\u6743 ",Object(i.b)("inlineCode",{parentName:"h3"},"Handler")," \u90e8\u5206"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16-27}","{16-27}":!0}),'using Furion.Authorization;\nusing Furion.Core;\nusing Furion.DataEncryption;\nusing Microsoft.AspNetCore.Authorization;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.Extensions.DependencyInjection;\nusing System.Threading.Tasks;\n\nnamespace Furion.Web.Core\n{\n /// \n /// JWT \u6388\u6743\u81ea\u5b9a\u4e49\u5904\u7406\u7a0b\u5e8f\n /// \n public class JwtHandler : AppAuthorizeHandler\n {\n /// \n /// \u91cd\u5199 Handler \u6dfb\u52a0\u81ea\u52a8\u5237\u65b0\u6536\u53d6\u903b\u8f91\n /// \n /// \n /// \n public override async Task HandleAsync(AuthorizationHandlerContext context)\n {\n // \u81ea\u52a8\u5237\u65b0 token\n if (JWTEncryption.AutoRefreshToken(context, context.GetCurrentHttpContext()))\n {\n await AuthorizeHandleAsync(context);\n }\n }\n\n /// \n /// \u9a8c\u8bc1\u7ba1\u9053\uff0c\u4e5f\u5c31\u662f\u9a8c\u8bc1\u6838\u5fc3\u4ee3\u7801\n /// \n /// \n /// \n /// \n public override Task PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)\n {\n // \u68c0\u67e5\u6743\u9650\uff0c\u5982\u679c\u65b9\u6cd5\u65f6\u5f02\u6b65\u7684\u5c31\u4e0d\u7528 Task.FromResult \u5305\u88f9\uff0c\u76f4\u63a5\u4f7f\u7528 async/await \u5373\u53ef\n return Task.FromResult(true);\n }\n }\n}\n')),Object(i.b)("h3",{id:"1553-\u5ba2\u6237\u7aef\u90e8\u5206"},"15.5.3 \u5ba2\u6237\u7aef\u90e8\u5206"),Object(i.b)("p",null,"\u5ba2\u6237\u7aef\u6bcf\u6b21\u8bf7\u6c42\u9700\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u653e\u5230\u8bf7\u6c42\u62a5\u6587\u5934\u4e2d\u4f20\u9001\u5230\u670d\u52a1\u7aef\uff0c\u683c\u5f0f\u4e3a\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),"Authorization: Bearer \u4f60\u7684token\nX-Authorization: Bearer \u4f60\u7684\u5237\u65b0token\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5728\u6b63\u5e38\u5f00\u53d1\u4e2d\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u65e0\u9700\u6bcf\u6b21\u8bf7\u6c42\u643a\u5e26\uff0c\u800c\u662f ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u5373\u5c06\u8fc7\u671f\u4e4b\u540e\u643a\u5e26\u5373\u53ef\u3002\u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u81ea\u884c\u5224\u65ad ",Object(i.b)("inlineCode",{parentName:"p"},"accessToken")," \u662f\u5426\u5373\u5c06\u8fc7\u671f\u3002"))),Object(i.b)("p",null,"\u5982\u679c ",Object(i.b)("inlineCode",{parentName:"p"},"Token")," \u8fc7\u671f\uff0c\u90a3\u4e48 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5c06\u81ea\u52a8\u6839\u636e\u6709\u6548\u671f\u5185\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"refreshToken")," \u81ea\u52a8\u751f\u6210\u65b0\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"AceessToken"),"\uff0c\u5e76\u5728 ",Object(i.b)("strong",{parentName:"p"},"\u54cd\u5e94\u62a5\u6587")," \u4e2d\u8fd4\u56de\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),"access-token: \u65b0\u7684token\nx-access-token: \u65b0\u7684\u5237\u65b0token\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5b58\u50a8\u65b0\u7684 Token")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u524d\u7aef\u9700\u8981\u83b7\u53d6 ",Object(i.b)("strong",{parentName:"p"},"\u54cd\u5e94\u62a5\u6587")," \u65b0\u7684 token \u548c\u5237\u65b0 token \u66ff\u6362\u4e4b\u524d\u5728\u5ba2\u6237\u5904\u5b58\u50a8\u65e7\u7684 token \u548c\u5237\u65b0 token\u3002"))),Object(i.b)("h2",{id:"156-\u53cd\u9988\u4e0e\u5efa\u8bae"},"15.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u9274\u6743\u6388\u6743")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/security/?view=aspnetcore-5.0"}),"ASP.NET Core - \u5b89\u5168\u548c\u6807\u8bc6")," \u7ae0\u8282\u3002"))))}p.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return c}));var a=t(21),r=t(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return p})),t.d(n,"b",(function(){return m}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var l=r.a.createContext({}),s=function(e){var n=r.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},p=function(e){var n=s(e.components);return r.a.createElement(l.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},d=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),p=s(t),d=a,m=p["".concat(c,".").concat(d)]||p[d]||u[d]||i;return t?r.a.createElement(m,o(o({ref:n},l),{},{components:t})):r.a.createElement(m,o({ref:n},l))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,c=new Array(i);c[0]=d;var o={};for(var b in n)hasOwnProperty.call(n,b)&&(o[b]=n[b]);o.originalType=e,o.mdxType="string"==typeof e?e:a,c[1]=o;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/97c3ef29.047892a0.js b/docs/97c3ef29.ec23f51c.js similarity index 89% rename from docs/97c3ef29.047892a0.js rename to docs/97c3ef29.ec23f51c.js index 0c38f6db2f9..7e4f936f5b5 100644 --- a/docs/97c3ef29.047892a0.js +++ b/docs/97c3ef29.ec23f51c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[61],{137:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),a=(n(0),n(192)),c=n(193),i={id:"job",title:"24. \u4efb\u52a1\u8c03\u5ea6",sidebar_label:"24. \u4efb\u52a1\u8c03\u5ea6"},u={unversionedId:"job",id:"job",isDocsHomePage:!1,title:"24. \u4efb\u52a1\u8c03\u5ea6",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\job.mdx",slug:"/job",permalink:"/docs/job",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/job.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"24. \u4efb\u52a1\u8c03\u5ea6",sidebar:"docs",previous:{title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",permalink:"/docs/process-service"},next:{title:"25. \u5373\u65f6\u901a\u8baf",permalink:"/docs/signalr"}},s=[],l={toc:s};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(n),b=r,d=p["".concat(c,".").concat(b)]||p[b]||f[b]||a;return n?o.a.createElement(d,i(i({ref:t},s),{},{components:n})):o.a.createElement(d,i({ref:t},s))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=b;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[64],{140:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),a=(n(0),n(196)),c=n(197),i={id:"job",title:"24. \u4efb\u52a1\u8c03\u5ea6",sidebar_label:"24. \u4efb\u52a1\u8c03\u5ea6"},u={unversionedId:"job",id:"job",isDocsHomePage:!1,title:"24. \u4efb\u52a1\u8c03\u5ea6",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\job.mdx",slug:"/job",permalink:"/docs/job",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/job.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"24. \u4efb\u52a1\u8c03\u5ea6",sidebar:"docs",previous:{title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",permalink:"/docs/process-service"},next:{title:"25. \u5373\u65f6\u901a\u8baf",permalink:"/docs/signalr"}},s=[],l={toc:s};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(n),b=r,d=p["".concat(c,".").concat(b)]||p[b]||f[b]||a;return n?o.a.createElement(d,i(i({ref:t},s),{},{components:n})):o.a.createElement(d,i({ref:t},s))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=b;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/9958fd43.b00ead63.js b/docs/9958fd43.b00ead63.js deleted file mode 100644 index fc993b6beef..00000000000 --- a/docs/9958fd43.b00ead63.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[62],{138:function(a){a.exports=JSON.parse('{"furion":{"allTagsPath":"/blog/tags","slug":"furion","name":"furion","count":1,"permalink":"/blog/tags/furion"},"furos":{"allTagsPath":"/blog/tags","slug":"furos","name":"furos","count":1,"permalink":"/blog/tags/furos"},"net":{"allTagsPath":"/blog/tags","slug":"net","name":".net","count":1,"permalink":"/blog/tags/net"},"netcore":{"allTagsPath":"/blog/tags","slug":"netcore","name":".netcore","count":1,"permalink":"/blog/tags/netcore"},"net-5":{"allTagsPath":"/blog/tags","slug":"net-5","name":".net5","count":1,"permalink":"/blog/tags/net-5"}}')}}]); \ No newline at end of file diff --git a/docs/9958fd43.c13e5282.js b/docs/9958fd43.c13e5282.js new file mode 100644 index 00000000000..2ddcc4015a4 --- /dev/null +++ b/docs/9958fd43.c13e5282.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{141:function(a){a.exports=JSON.parse('{"furion":{"allTagsPath":"/blog/tags","slug":"furion","name":"furion","count":3,"permalink":"/blog/tags/furion"},"furos":{"allTagsPath":"/blog/tags","slug":"furos","name":"furos","count":3,"permalink":"/blog/tags/furos"},"net":{"allTagsPath":"/blog/tags","slug":"net","name":".net","count":3,"permalink":"/blog/tags/net"},"netcore":{"allTagsPath":"/blog/tags","slug":"netcore","name":".netcore","count":3,"permalink":"/blog/tags/netcore"},"net-5":{"allTagsPath":"/blog/tags","slug":"net-5","name":".net5","count":3,"permalink":"/blog/tags/net-5"},"upload":{"allTagsPath":"/blog/tags","slug":"upload","name":"upload","count":1,"permalink":"/blog/tags/upload"},"download":{"allTagsPath":"/blog/tags","slug":"download","name":"download","count":1,"permalink":"/blog/tags/download"},"httpcontext":{"allTagsPath":"/blog/tags","slug":"httpcontext","name":"httpcontext","count":1,"permalink":"/blog/tags/httpcontext"}}')}}]); \ No newline at end of file diff --git a/docs/99f08781.ac72c0df.js b/docs/99f08781.a17f9e0f.js similarity index 91% rename from docs/99f08781.ac72c0df.js rename to docs/99f08781.a17f9e0f.js index f57b2628bca..31331c48c1f 100644 --- a/docs/99f08781.ac72c0df.js +++ b/docs/99f08781.a17f9e0f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[63],{139:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return l})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return p}));var n=r(3),i=r(7),o=(r(0),r(192)),a=r(193),c={id:"jsonserializer",title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",sidebar_label:"7. JsonSerializerUtility \u9759\u6001\u7c7b"},l={unversionedId:"global/jsonserializer",id:"global/jsonserializer",isDocsHomePage:!1,title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",description:"7.1 \u5e8f\u5217\u5316",source:"@site/docs\\global\\jsonserializer.mdx",slug:"/global/jsonserializer",permalink:"/docs/global/jsonserializer",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/jsonserializer.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"7. JsonSerializerUtility \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"6. Http \u9759\u6001\u7c7b",permalink:"/docs/global/shttp"},next:{title:"8. L \u9759\u6001\u7c7b",permalink:"/docs/global/l"}},s=[{value:"7.1 \u5e8f\u5217\u5316",id:"71-\u5e8f\u5217\u5316",children:[]},{value:"7.3 \u53cd\u5e8f\u5217\u5316",id:"73-\u53cd\u5e8f\u5217\u5316",children:[]},{value:"7.4 \u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e",id:"74-\u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e",children:[]}],u={toc:s};function p(e){var t=e.components,r=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)(a.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"71-\u5e8f\u5217\u5316"},"7.1 \u5e8f\u5217\u5316"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var str = JsonSerializerUtility.Serialize(obj, [options]);\n")),Object(o.b)("h2",{id:"73-\u53cd\u5e8f\u5217\u5316"},"7.3 \u53cd\u5e8f\u5217\u5316"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var obj = JsonSerializerUtility.Deserialize(str, [options]);\n")),Object(o.b)("h2",{id:"74-\u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e"},"7.4 \u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var options = JsonSerializerUtility.GetDefaultJsonSerializerOptionss);\n")))}p.isMDXComponent=!0},190:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(21),i=r(191);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:o=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(i.b)(r))return r;if(n)return t+r;const a=r.startsWith(t)?r:t+r.replace(/^\//,"");return o?e+a:a}(t,e,r,n)}}function a(e,t={}){const{withBaseUrl:r}=o();return r(e,t)}},191:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return i}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return d}));var n=r(0),i=r.n(n);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=i.a.createContext({}),u=function(e){var t=i.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},p=function(e){var t=u(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},f=i.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,a=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=u(r),f=n,d=p["".concat(a,".").concat(f)]||p[f]||b[f]||o;return r?i.a.createElement(d,c(c({ref:t},s),{},{components:r})):i.a.createElement(d,c({ref:t},s))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,a=new Array(o);a[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:n,a[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{142:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return c})),r.d(t,"metadata",(function(){return l})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return p}));var n=r(3),i=r(7),o=(r(0),r(196)),a=r(197),c={id:"jsonserializer",title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",sidebar_label:"7. JsonSerializerUtility \u9759\u6001\u7c7b"},l={unversionedId:"global/jsonserializer",id:"global/jsonserializer",isDocsHomePage:!1,title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",description:"7.1 \u5e8f\u5217\u5316",source:"@site/docs\\global\\jsonserializer.mdx",slug:"/global/jsonserializer",permalink:"/docs/global/jsonserializer",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/jsonserializer.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"7. JsonSerializerUtility \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"6. Http \u9759\u6001\u7c7b",permalink:"/docs/global/shttp"},next:{title:"8. L \u9759\u6001\u7c7b",permalink:"/docs/global/l"}},s=[{value:"7.1 \u5e8f\u5217\u5316",id:"71-\u5e8f\u5217\u5316",children:[]},{value:"7.3 \u53cd\u5e8f\u5217\u5316",id:"73-\u53cd\u5e8f\u5217\u5316",children:[]},{value:"7.4 \u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e",id:"74-\u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e",children:[]}],u={toc:s};function p(e){var t=e.components,r=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(n.a)({},u,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)(a.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"71-\u5e8f\u5217\u5316"},"7.1 \u5e8f\u5217\u5316"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var str = JsonSerializerUtility.Serialize(obj, [options]);\n")),Object(o.b)("h2",{id:"73-\u53cd\u5e8f\u5217\u5316"},"7.3 \u53cd\u5e8f\u5217\u5316"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var obj = JsonSerializerUtility.Deserialize(str, [options]);\n")),Object(o.b)("h2",{id:"74-\u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e"},"7.4 \u83b7\u53d6\u9ed8\u8ba4\u5e8f\u5217\u5316\u914d\u7f6e"),Object(o.b)("pre",null,Object(o.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var options = JsonSerializerUtility.GetDefaultJsonSerializerOptionss);\n")))}p.isMDXComponent=!0},194:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return a}));var n=r(21),i=r(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:o=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(i.b)(r))return r;if(n)return t+r;const a=r.startsWith(t)?r:t+r.replace(/^\//,"");return o?e+a:a}(t,e,r,n)}}function a(e,t={}){const{withBaseUrl:r}=o();return r(e,t)}},195:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return i}))},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return d}));var n=r(0),i=r.n(n);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s=i.a.createContext({}),u=function(e){var t=i.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},p=function(e){var t=u(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},f=i.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,o=e.originalType,a=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),p=u(r),f=n,d=p["".concat(a,".").concat(f)]||p[f]||b[f]||o;return r?i.a.createElement(d,c(c({ref:t},s),{},{components:r})):i.a.createElement(d,c({ref:t},s))}));function d(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var o=r.length,a=new Array(o);a[0]=f;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:n,a[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/9bdac8f0.adf41eaa.js b/docs/9bdac8f0.aeed0269.js similarity index 97% rename from docs/9bdac8f0.adf41eaa.js rename to docs/9bdac8f0.aeed0269.js index 80423c7df64..b71374b4562 100644 --- a/docs/9bdac8f0.adf41eaa.js +++ b/docs/9bdac8f0.aeed0269.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[64],{140:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return b}));var a=n(3),r=n(7),i=(n(0),n(192)),o=n(193),c={id:"dbcontext-audit",title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",sidebar_label:"9.22 \u5ba1\u8ba1\u65e5\u5fd7"},l={unversionedId:"dbcontext-audit",id:"dbcontext-audit",isDocsHomePage:!1,title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",description:"9.22.1 \u5ba1\u8ba1\u65e5\u5fd7",source:"@site/docs\\dbcontext-audit.mdx",slug:"/dbcontext-audit",permalink:"/docs/dbcontext-audit",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-audit.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",sidebar:"docs",previous:{title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",permalink:"/docs/dbcontext-seed-data"},next:{title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",permalink:"/docs/dbcontext-filter"}},s=[{value:"9.22.1 \u5ba1\u8ba1\u65e5\u5fd7",id:"9221-\u5ba1\u8ba1\u65e5\u5fd7",children:[]},{value:"9.22.2 \u5173\u4e8e SaveChanges \u4e8b\u4ef6",id:"9222-\u5173\u4e8e-savechanges-\u4e8b\u4ef6",children:[]},{value:"9.22.3 \u5982\u4f55\u4f7f\u7528",id:"9223-\u5982\u4f55\u4f7f\u7528",children:[]},{value:"9.22.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9224-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:s};function b(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9221-\u5ba1\u8ba1\u65e5\u5fd7"},"9.22.1 \u5ba1\u8ba1\u65e5\u5fd7"),Object(i.b)("p",null,"\u5728\u4e00\u4e2a\u4f01\u4e1a\u5e94\u7528\u7cfb\u7edf\u4e2d\uff0c\u7528\u6237\u5bf9\u7cfb\u7edf\u6240\u6709\u7684\u64cd\u4f5c\u5305\u62ec\u8bf7\u6c42\uff0c\u6570\u636e\u5e93\u64cd\u4f5c\u7b49\u7b49\u90fd\u5e94\u8be5\u8bb0\u5f55\u8d77\u6765\uff0c\u90a3\u4e48\u8fd9\u4e9b\u65e5\u5fd7\u6211\u4eec\u6210\u4e3a\u64cd\u4f5c\u65e5\u5fd7\uff0c\u4e5f\u53ef\u4ee5\u8bf4\u5ba1\u8ba1\u65e5\u5fd7\u3002"),Object(i.b)("p",null,"\u901a\u5e38\u6765\u8bf4\uff0c\u6211\u4eec\u5ba1\u8ba1\u65e5\u5fd7\u66f4\u591a\u6307\u7684\u662f\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u8bb0\u5f55\u3002"),Object(i.b)("p",null,"\u5ba1\u8ba1\u65e5\u5fd7\u4e00\u822c\u4f1a\u8bb0\u5f55\u4ee5\u4e0b\u4e09\u4e2a\u64cd\u4f5c\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u65b0\u589e\u64cd\u4f5c"),"\uff1a\u8bb0\u5f55\u67d0\u67d0\u4eba\u5728\u67d0\u67d0\u65f6\u95f4\u5bf9\u54ea\u4e2a\u8868\u65b0\u589e\u4e86\u4ec0\u4e48\u6570\u636e"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u66f4\u65b0\u64cd\u4f5c"),"\uff1a\u8bb0\u5f55\u67d0\u67d0\u4eba\u5728\u67d0\u67d0\u65f6\u95f4\u5bf9\u54ea\u4e2a\u8868\u7684\u54ea\u4e9b\u6570\u636e\u505a\u4e86\u66f4\u6539\uff0c\u8bb0\u5f55\u66f4\u6539\u524d\u7684\u503c\u548c\u66f4\u6539\u540e\u7684\u503c"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u5220\u9664\u64cd\u4f5c"),"\uff1a\u8bb0\u5f55\u67d0\u67d0\u4eba\u5728\u67d0\u67d0\u65f6\u95f4\u5bf9\u54ea\u4e2a\u8868\u5220\u9664\u4e86\u4ec0\u4e48\u6570\u636e")),Object(i.b)("h2",{id:"9222-\u5173\u4e8e-savechanges-\u4e8b\u4ef6"},"9.22.2 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"SaveChanges")," \u4e8b\u4ef6"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e3a\u6240\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b50\u7c7b\u90fd\u63d0\u4f9b\u4e86\u4e09\u4e2a\u53ef\u91cd\u5199\u7684\u65b9\u6cd5\uff0c\u8fd9\u4e09\u4e2a\u65b9\u6cd5\u5206\u522b\u7531\u4e09\u4e2a\u4e8b\u4ef6\u89e6\u53d1\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u524d SavingChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(i.b)("inlineCode",{parentName:"li"},"void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)")," \u65b9\u6cd5"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u540e SavedChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(i.b)("inlineCode",{parentName:"li"},"void SavedChangesEvent(SaveChangesCompletedEventData eventData, int result)")," \u65b9\u6cd5"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u5931\u8d25 SaveChangesFailed \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(i.b)("inlineCode",{parentName:"li"},"void SaveChangesFailedEvent(DbContextErrorEventData eventData)")," \u65b9\u6cd5")),Object(i.b)("p",null,"\u901a\u8fc7\u8fd9\u4e09\u4e2a\u4e8b\u4ef6\u6211\u4eec\u5c31\u53ef\u4ee5\u6355\u83b7\u6240\u6709\u66f4\u6539\u7684\u5b9e\u4f53\u7136\u540e\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u5ba1\u8ba1\u65e5\u5fd7\u4e2d\u3002"),Object(i.b)("h2",{id:"9223-\u5982\u4f55\u4f7f\u7528"},"9.22.3 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("p",null,"\u6211\u4eec\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b50\u7c7b\u4e2d\u91cd\u5199 ",Object(i.b)("inlineCode",{parentName:"p"},"SavingChanges")," \u4e8b\u4ef6\u5bf9\u5e94\u65b9\u6cd5\u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{23}","{23}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastructure;\nusing System;\nusing System.Linq;\nusing System.Security.AccessControl;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n /// \n /// \u91cd\u5199\u4fdd\u5b58\u4e4b\u524d\u4e8b\u4ef6\n /// \n /// \n /// \n protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)\n {\n // \u83b7\u53d6\u5f53\u524d\u4e8b\u4ef6\u5bf9\u5e94\u4e0a\u4e0b\u6587\n var dbContext = eventData.Context;\n\n // \u5f3a\u5236\u91cd\u65b0\u68c0\u67e5\u4e00\u8fb9\u5b9e\u4f53\u66f4\u6539\u4fe1\u606f\n // dbContext.ChangeTracker.DetectChanges();\n\n // \u83b7\u53d6\u6240\u6709\u66f4\u6539\uff0c\u5220\u9664\uff0c\u65b0\u589e\u7684\u5b9e\u4f53\uff0c\u4f46\u6392\u9664\u5ba1\u8ba1\u5b9e\u4f53\uff08\u907f\u514d\u6b7b\u5faa\u73af\uff09\n var entities = dbContext.ChangeTracker.Entries()\n .Where(u => u.Entity.GetType() != typeof(Audit) && (u.State == EntityState.Modified || u.State == EntityState.Deleted || u.State == EntityState.Added))\n .ToList();\n\n // \u901a\u8fc7\u8bf7\u6c42\u4e2d\u83b7\u53d6\u5f53\u524d\u64cd\u4f5c\u4eba\n var userId = App.GetService().HttpContext.Items["UserId"];\n\n // \u83b7\u53d6\u6240\u6709\u5df2\u66f4\u6539\u7684\u5b9e\u4f53\n foreach (var entity in entities)\n {\n // \u83b7\u53d6\u5b9e\u4f53\u7c7b\u578b\n var entityType = entity.Entity.GetType();\n\n // \u83b7\u53d6\u6240\u6709\u5b9e\u4f53\u6709\u6548\u5c5e\u6027\uff0c\u6392\u9664 [NotMapper] \u5c5e\u6027\n var props = entity.OriginalValues.Properties;\n\n // \u83b7\u53d6\u5b9e\u4f53\u5f53\u524d\uff08\u73b0\u5728\uff09\u7684\u503c\n var currentValues = entity.CurrentValues;\n\n // \u83b7\u53d6\u6570\u636e\u5e93\u4e2d\u5b9e\u4f53\u7684\u503c\n var databaseValues = entity.GetDatabaseValues();\n\n // \u904d\u5386\u6240\u6709\u5c5e\u6027\n foreach (var prop in props)\n {\n // \u83b7\u53d6\u5c5e\u6027\u540d\n var propName = prop.Name;\n\n // \u83b7\u53d6\u73b0\u5728\u7684\u5b9e\u4f53\u503c\n var newValue = currentValues[propName];\n\n object oldValue = null;\n // \u5982\u679c\u662f\u65b0\u589e\u6570\u636e\uff0c\u5219 databaseValues \u4e3a\u7a7a\uff0c\u6240\u4ee5\u9700\u8981\u5224\u65ad\u4e00\u4e0b\n if (databaseValues != null)\n {\n oldValue = databaseValues[propName];\n }\n\n // \u63d2\u5165\u5ba1\u8ba1\u65e5\u5fd7\u8868\n dbContext.Audits.Add(new Audit\n {\n Table = entityType.Name, // \u8868\u540d\n Column = propName, // \u66f4\u65b0\u7684\u5217\n NewValue = newValue, // \u65b0\u503c\n OldValue = oldValue, // \u65e7\u503c\n CreatedTime = DateTime.Now, // \u64cd\u4f5c\u65f6\u95f4\n UserId = userId, // \u64cd\u4f5c\u4eba\n Operate = entity.State.ToString(); // \u64cd\u4f5c\u65b9\u5f0f\uff1a\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\n });\n }\n }\n }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u5bf9\u6027\u80fd\u6709\u6240\u8981\u6c42\uff0c\u90a3\u4e48\u5efa\u8bae\u5ba1\u8ba1\u65e5\u5fd7\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7ec4\u4ef6")," \u5199\u5165\u6570\u636e\u5e93\uff0c\u5982\uff0c\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Nlog\u3001Log4Net")," \u8fd9\u4e9b\u7b49\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u63d2\u5165\u5ba1\u8ba1\u65e5\u5fd7\u8868\ndbContext.Audits.Add(new Audit\n{\n Table = entityType.Name, // \u8868\u540d\n Column = propName, // \u66f4\u65b0\u7684\u5217\n newValue = newValue, // \u65b0\u503c\n OldValue = oldValue, // \u65e7\u503c\n CreatedTime = DateTime.Now, // \u64cd\u4f5c\u65f6\u95f4\n UserId = userId, // \u64cd\u4f5c\u4eba\n Operate = entity.State.ToString(); // \u64cd\u4f5c\u65b9\u5f0f\uff1a\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\n});\n")),Object(i.b)("p",{parentName:"div"},"\u66ff\u6362\u4e3a\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"logger.Information(JsonConvert.SerializeObject(new Audit\n{\n Table = entityType.Name, // \u8868\u540d\n Column = propName, // \u66f4\u65b0\u7684\u5217\n newValue = newValue, // \u65b0\u503c\n OldValue = oldValue, // \u65e7\u503c\n CreatedTime = DateTime.Now, // \u64cd\u4f5c\u65f6\u95f4\n UserId = userId, // \u64cd\u4f5c\u4eba\n Operate = entity.State.ToString(); // \u64cd\u4f5c\u65b9\u5f0f\uff1a\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\n}));\n")))),Object(i.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u4f8b\u5b50\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5bf9\u6570\u636e\u5e93\u6240\u6709\u7684\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\u8fdb\u884c\u76d1\u63a7\u4e86\u3002"),Object(i.b)("h2",{id:"9224-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.22.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var a=n(21),r=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=r.a.createContext({}),u=function(e){var t=r.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return r.a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),b=u(n),d=a,m=b["".concat(o,".").concat(d)]||b[d]||p[d]||i;return n?r.a.createElement(m,c(c({ref:t},s),{},{components:n})):r.a.createElement(m,c({ref:t},s))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[67],{143:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return b}));var a=n(3),r=n(7),i=(n(0),n(196)),o=n(197),c={id:"dbcontext-audit",title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",sidebar_label:"9.22 \u5ba1\u8ba1\u65e5\u5fd7"},l={unversionedId:"dbcontext-audit",id:"dbcontext-audit",isDocsHomePage:!1,title:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",description:"9.22.1 \u5ba1\u8ba1\u65e5\u5fd7",source:"@site/docs\\dbcontext-audit.mdx",slug:"/dbcontext-audit",permalink:"/docs/dbcontext-audit",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-audit.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.22 \u5ba1\u8ba1\u65e5\u5fd7",sidebar:"docs",previous:{title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",permalink:"/docs/dbcontext-seed-data"},next:{title:"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668",permalink:"/docs/dbcontext-filter"}},s=[{value:"9.22.1 \u5ba1\u8ba1\u65e5\u5fd7",id:"9221-\u5ba1\u8ba1\u65e5\u5fd7",children:[]},{value:"9.22.2 \u5173\u4e8e SaveChanges \u4e8b\u4ef6",id:"9222-\u5173\u4e8e-savechanges-\u4e8b\u4ef6",children:[]},{value:"9.22.3 \u5982\u4f55\u4f7f\u7528",id:"9223-\u5982\u4f55\u4f7f\u7528",children:[]},{value:"9.22.4 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9224-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:s};function b(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9221-\u5ba1\u8ba1\u65e5\u5fd7"},"9.22.1 \u5ba1\u8ba1\u65e5\u5fd7"),Object(i.b)("p",null,"\u5728\u4e00\u4e2a\u4f01\u4e1a\u5e94\u7528\u7cfb\u7edf\u4e2d\uff0c\u7528\u6237\u5bf9\u7cfb\u7edf\u6240\u6709\u7684\u64cd\u4f5c\u5305\u62ec\u8bf7\u6c42\uff0c\u6570\u636e\u5e93\u64cd\u4f5c\u7b49\u7b49\u90fd\u5e94\u8be5\u8bb0\u5f55\u8d77\u6765\uff0c\u90a3\u4e48\u8fd9\u4e9b\u65e5\u5fd7\u6211\u4eec\u6210\u4e3a\u64cd\u4f5c\u65e5\u5fd7\uff0c\u4e5f\u53ef\u4ee5\u8bf4\u5ba1\u8ba1\u65e5\u5fd7\u3002"),Object(i.b)("p",null,"\u901a\u5e38\u6765\u8bf4\uff0c\u6211\u4eec\u5ba1\u8ba1\u65e5\u5fd7\u66f4\u591a\u6307\u7684\u662f\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u8bb0\u5f55\u3002"),Object(i.b)("p",null,"\u5ba1\u8ba1\u65e5\u5fd7\u4e00\u822c\u4f1a\u8bb0\u5f55\u4ee5\u4e0b\u4e09\u4e2a\u64cd\u4f5c\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u65b0\u589e\u64cd\u4f5c"),"\uff1a\u8bb0\u5f55\u67d0\u67d0\u4eba\u5728\u67d0\u67d0\u65f6\u95f4\u5bf9\u54ea\u4e2a\u8868\u65b0\u589e\u4e86\u4ec0\u4e48\u6570\u636e"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u66f4\u65b0\u64cd\u4f5c"),"\uff1a\u8bb0\u5f55\u67d0\u67d0\u4eba\u5728\u67d0\u67d0\u65f6\u95f4\u5bf9\u54ea\u4e2a\u8868\u7684\u54ea\u4e9b\u6570\u636e\u505a\u4e86\u66f4\u6539\uff0c\u8bb0\u5f55\u66f4\u6539\u524d\u7684\u503c\u548c\u66f4\u6539\u540e\u7684\u503c"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u5220\u9664\u64cd\u4f5c"),"\uff1a\u8bb0\u5f55\u67d0\u67d0\u4eba\u5728\u67d0\u67d0\u65f6\u95f4\u5bf9\u54ea\u4e2a\u8868\u5220\u9664\u4e86\u4ec0\u4e48\u6570\u636e")),Object(i.b)("h2",{id:"9222-\u5173\u4e8e-savechanges-\u4e8b\u4ef6"},"9.22.2 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"SaveChanges")," \u4e8b\u4ef6"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e3a\u6240\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b50\u7c7b\u90fd\u63d0\u4f9b\u4e86\u4e09\u4e2a\u53ef\u91cd\u5199\u7684\u65b9\u6cd5\uff0c\u8fd9\u4e09\u4e2a\u65b9\u6cd5\u5206\u522b\u7531\u4e09\u4e2a\u4e8b\u4ef6\u89e6\u53d1\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u524d SavingChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(i.b)("inlineCode",{parentName:"li"},"void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)")," \u65b9\u6cd5"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u4e4b\u540e SavedChanges \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(i.b)("inlineCode",{parentName:"li"},"void SavedChangesEvent(SaveChangesCompletedEventData eventData, int result)")," \u65b9\u6cd5"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"\u63d0\u4ea4\u66f4\u6539\u5931\u8d25 SaveChangesFailed \u4e8b\u4ef6"),"\uff1a\u89e6\u53d1 ",Object(i.b)("inlineCode",{parentName:"li"},"void SaveChangesFailedEvent(DbContextErrorEventData eventData)")," \u65b9\u6cd5")),Object(i.b)("p",null,"\u901a\u8fc7\u8fd9\u4e09\u4e2a\u4e8b\u4ef6\u6211\u4eec\u5c31\u53ef\u4ee5\u6355\u83b7\u6240\u6709\u66f4\u6539\u7684\u5b9e\u4f53\u7136\u540e\u4fdd\u5b58\u5230\u6570\u636e\u5e93\u5ba1\u8ba1\u65e5\u5fd7\u4e2d\u3002"),Object(i.b)("h2",{id:"9223-\u5982\u4f55\u4f7f\u7528"},"9.22.3 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("p",null,"\u6211\u4eec\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5b50\u7c7b\u4e2d\u91cd\u5199 ",Object(i.b)("inlineCode",{parentName:"p"},"SavingChanges")," \u4e8b\u4ef6\u5bf9\u5e94\u65b9\u6cd5\u5373\u53ef\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{23}","{23}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.EntityFrameworkCore.Infrastructure;\nusing System;\nusing System.Linq;\nusing System.Security.AccessControl;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext\n {\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n /// \n /// \u91cd\u5199\u4fdd\u5b58\u4e4b\u524d\u4e8b\u4ef6\n /// \n /// \n /// \n protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult result)\n {\n // \u83b7\u53d6\u5f53\u524d\u4e8b\u4ef6\u5bf9\u5e94\u4e0a\u4e0b\u6587\n var dbContext = eventData.Context;\n\n // \u5f3a\u5236\u91cd\u65b0\u68c0\u67e5\u4e00\u8fb9\u5b9e\u4f53\u66f4\u6539\u4fe1\u606f\n // dbContext.ChangeTracker.DetectChanges();\n\n // \u83b7\u53d6\u6240\u6709\u66f4\u6539\uff0c\u5220\u9664\uff0c\u65b0\u589e\u7684\u5b9e\u4f53\uff0c\u4f46\u6392\u9664\u5ba1\u8ba1\u5b9e\u4f53\uff08\u907f\u514d\u6b7b\u5faa\u73af\uff09\n var entities = dbContext.ChangeTracker.Entries()\n .Where(u => u.Entity.GetType() != typeof(Audit) && (u.State == EntityState.Modified || u.State == EntityState.Deleted || u.State == EntityState.Added))\n .ToList();\n\n // \u901a\u8fc7\u8bf7\u6c42\u4e2d\u83b7\u53d6\u5f53\u524d\u64cd\u4f5c\u4eba\n var userId = App.GetService().HttpContext.Items["UserId"];\n\n // \u83b7\u53d6\u6240\u6709\u5df2\u66f4\u6539\u7684\u5b9e\u4f53\n foreach (var entity in entities)\n {\n // \u83b7\u53d6\u5b9e\u4f53\u7c7b\u578b\n var entityType = entity.Entity.GetType();\n\n // \u83b7\u53d6\u6240\u6709\u5b9e\u4f53\u6709\u6548\u5c5e\u6027\uff0c\u6392\u9664 [NotMapper] \u5c5e\u6027\n var props = entity.OriginalValues.Properties;\n\n // \u83b7\u53d6\u5b9e\u4f53\u5f53\u524d\uff08\u73b0\u5728\uff09\u7684\u503c\n var currentValues = entity.CurrentValues;\n\n // \u83b7\u53d6\u6570\u636e\u5e93\u4e2d\u5b9e\u4f53\u7684\u503c\n var databaseValues = entity.GetDatabaseValues();\n\n // \u904d\u5386\u6240\u6709\u5c5e\u6027\n foreach (var prop in props)\n {\n // \u83b7\u53d6\u5c5e\u6027\u540d\n var propName = prop.Name;\n\n // \u83b7\u53d6\u73b0\u5728\u7684\u5b9e\u4f53\u503c\n var newValue = currentValues[propName];\n\n object oldValue = null;\n // \u5982\u679c\u662f\u65b0\u589e\u6570\u636e\uff0c\u5219 databaseValues \u4e3a\u7a7a\uff0c\u6240\u4ee5\u9700\u8981\u5224\u65ad\u4e00\u4e0b\n if (databaseValues != null)\n {\n oldValue = databaseValues[propName];\n }\n\n // \u63d2\u5165\u5ba1\u8ba1\u65e5\u5fd7\u8868\n dbContext.Audits.Add(new Audit\n {\n Table = entityType.Name, // \u8868\u540d\n Column = propName, // \u66f4\u65b0\u7684\u5217\n NewValue = newValue, // \u65b0\u503c\n OldValue = oldValue, // \u65e7\u503c\n CreatedTime = DateTime.Now, // \u64cd\u4f5c\u65f6\u95f4\n UserId = userId, // \u64cd\u4f5c\u4eba\n Operate = entity.State.ToString(); // \u64cd\u4f5c\u65b9\u5f0f\uff1a\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\n });\n }\n }\n }\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c\u5bf9\u6027\u80fd\u6709\u6240\u8981\u6c42\uff0c\u90a3\u4e48\u5efa\u8bae\u5ba1\u8ba1\u65e5\u5fd7\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7ec4\u4ef6")," \u5199\u5165\u6570\u636e\u5e93\uff0c\u5982\uff0c\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Nlog\u3001Log4Net")," \u8fd9\u4e9b\u7b49\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u63d2\u5165\u5ba1\u8ba1\u65e5\u5fd7\u8868\ndbContext.Audits.Add(new Audit\n{\n Table = entityType.Name, // \u8868\u540d\n Column = propName, // \u66f4\u65b0\u7684\u5217\n newValue = newValue, // \u65b0\u503c\n OldValue = oldValue, // \u65e7\u503c\n CreatedTime = DateTime.Now, // \u64cd\u4f5c\u65f6\u95f4\n UserId = userId, // \u64cd\u4f5c\u4eba\n Operate = entity.State.ToString(); // \u64cd\u4f5c\u65b9\u5f0f\uff1a\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\n});\n")),Object(i.b)("p",{parentName:"div"},"\u66ff\u6362\u4e3a\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"logger.Information(JsonConvert.SerializeObject(new Audit\n{\n Table = entityType.Name, // \u8868\u540d\n Column = propName, // \u66f4\u65b0\u7684\u5217\n newValue = newValue, // \u65b0\u503c\n OldValue = oldValue, // \u65e7\u503c\n CreatedTime = DateTime.Now, // \u64cd\u4f5c\u65f6\u95f4\n UserId = userId, // \u64cd\u4f5c\u4eba\n Operate = entity.State.ToString(); // \u64cd\u4f5c\u65b9\u5f0f\uff1a\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\n}));\n")))),Object(i.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u4f8b\u5b50\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u5bf9\u6570\u636e\u5e93\u6240\u6709\u7684\u65b0\u589e\u3001\u66f4\u65b0\u3001\u5220\u9664\u8fdb\u884c\u76d1\u63a7\u4e86\u3002"),Object(i.b)("h2",{id:"9224-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.22.4 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var a=n(21),r=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=r.a.createContext({}),u=function(e){var t=r.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return r.a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),b=u(n),d=a,m=b["".concat(o,".").concat(d)]||b[d]||p[d]||i;return n?r.a.createElement(m,c(c({ref:t},s),{},{components:n})):r.a.createElement(m,c({ref:t},s))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/9c917987.39d7d64e.js b/docs/9c917987.4affae59.js similarity index 92% rename from docs/9c917987.39d7d64e.js rename to docs/9c917987.4affae59.js index 5557fa56717..5949e9a136f 100644 --- a/docs/9c917987.39d7d64e.js +++ b/docs/9c917987.4affae59.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[65],{141:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return p}));var r=n(3),i=n(7),a=(n(0),n(192)),o=n(193),c={id:"validationTypemessagesettings",title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",sidebar_label:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e"},s={unversionedId:"settings/validationTypemessagesettings",id:"settings/validationTypemessagesettings",isDocsHomePage:!1,title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",description:"3.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\validationTypemessagesettings.mdx",slug:"/settings/validationTypemessagesettings",permalink:"/docs/settings/validationTypemessagesettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/validationTypemessagesettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",sidebar:"settings",previous:{title:"2. \u8de8\u57df\u914d\u7f6e",permalink:"/docs/settings/corsaccessorsettings"},next:{title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",permalink:"/docs/settings/dependencyinjectionsettings"}},u=[{value:"3.1 \u5173\u4e8e\u914d\u7f6e",id:"31-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"3.2 \u914d\u7f6e\u4fe1\u606f",id:"32-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"3.3 \u914d\u7f6e\u793a\u4f8b",id:"33-\u914d\u7f6e\u793a\u4f8b",children:[]}],l={toc:u};function p(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"31-\u5173\u4e8e\u914d\u7f6e"},"3.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6570\u636e\u6821\u9a8c\u4e2d\u9a8c\u8bc1\u7c7b\u578b\u9ed8\u8ba4\u6d88\u606f\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"32-\u914d\u7f6e\u4fe1\u606f"},"3.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ValidationTypeMessageSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u914d\u7f6e\u9a8c\u8bc1\u7c7b\u578b\u5bf9\u5e94\u7684\u6d88\u606f\u7c7b\u578b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"[\u7c7b\u578b\u540d\u79f0\uff0c\u7c7b\u578b\u6d88\u606f][]")," \u7c7b\u578b\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},'["Required", "\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null"]'))))),Object(a.b)("h2",{id:"33-\u914d\u7f6e\u793a\u4f8b"},"3.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "ValidationTypeMessageSettings": {\n "Definitions": [\n ["Required", "\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null"],\n ["Numeric", "\u5fc5\u987b\u662f\u6570\u503c\u7c7b\u578b"],\n ["StrongPassword", "\u5bc6\u7801\u592a\u7b80\u5355\u4e86!!!"]\n ]\n }\n}\n')))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var u=i.a.createContext({}),l=function(e){var t=i.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=l(e.components);return i.a.createElement(u.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},b=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=l(n),b=r,f=p["".concat(o,".").concat(b)]||p[b]||d[b]||a;return n?i.a.createElement(f,c(c({ref:t},u),{},{components:n})):i.a.createElement(f,c({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=b;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{144:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return p}));var r=n(3),i=n(7),a=(n(0),n(196)),o=n(197),c={id:"validationTypemessagesettings",title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",sidebar_label:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e"},s={unversionedId:"settings/validationTypemessagesettings",id:"settings/validationTypemessagesettings",isDocsHomePage:!1,title:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",description:"3.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\validationTypemessagesettings.mdx",slug:"/settings/validationTypemessagesettings",permalink:"/docs/settings/validationTypemessagesettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/validationTypemessagesettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e",sidebar:"settings",previous:{title:"2. \u8de8\u57df\u914d\u7f6e",permalink:"/docs/settings/corsaccessorsettings"},next:{title:"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e",permalink:"/docs/settings/dependencyinjectionsettings"}},u=[{value:"3.1 \u5173\u4e8e\u914d\u7f6e",id:"31-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"3.2 \u914d\u7f6e\u4fe1\u606f",id:"32-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"3.3 \u914d\u7f6e\u793a\u4f8b",id:"33-\u914d\u7f6e\u793a\u4f8b",children:[]}],l={toc:u};function p(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"31-\u5173\u4e8e\u914d\u7f6e"},"3.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6570\u636e\u6821\u9a8c\u4e2d\u9a8c\u8bc1\u7c7b\u578b\u9ed8\u8ba4\u6d88\u606f\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"32-\u914d\u7f6e\u4fe1\u606f"},"3.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ValidationTypeMessageSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u914d\u7f6e\u9a8c\u8bc1\u7c7b\u578b\u5bf9\u5e94\u7684\u6d88\u606f\u7c7b\u578b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"[\u7c7b\u578b\u540d\u79f0\uff0c\u7c7b\u578b\u6d88\u606f][]")," \u7c7b\u578b\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},'["Required", "\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null"]'))))),Object(a.b)("h2",{id:"33-\u914d\u7f6e\u793a\u4f8b"},"3.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "ValidationTypeMessageSettings": {\n "Definitions": [\n ["Required", "\u503c\u4e0d\u80fd\u4e3a\u7a7a\u6216Null"],\n ["Numeric", "\u5fc5\u987b\u662f\u6570\u503c\u7c7b\u578b"],\n ["StrongPassword", "\u5bc6\u7801\u592a\u7b80\u5355\u4e86!!!"]\n ]\n }\n}\n')))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var u=i.a.createContext({}),l=function(e){var t=i.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=l(e.components);return i.a.createElement(u.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},b=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),p=l(n),b=r,f=p["".concat(o,".").concat(b)]||p[b]||d[b]||a;return n?i.a.createElement(f,c(c({ref:t},u),{},{components:n})):i.a.createElement(f,c({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=b;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/9d6065c2.342e3fb1.js b/docs/9d6065c2.c909f756.js similarity index 97% rename from docs/9d6065c2.342e3fb1.js rename to docs/9d6065c2.c909f756.js index bbf5821c6a6..a27e50cef7f 100644 --- a/docs/9d6065c2.342e3fb1.js +++ b/docs/9d6065c2.c909f756.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[66],{142:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return c})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),p=(n(0),n(192)),i=n(193),o={id:"dapper",title:"10.2. Dapper \u96c6\u6210",sidebar_label:"10.2. Dapper \u96c6\u6210"},c={unversionedId:"dapper",id:"dapper",isDocsHomePage:!1,title:"10.2. Dapper \u96c6\u6210",description:"10.2.1 \u5173\u4e8e Dapper",source:"@site/docs\\dapper.mdx",slug:"/dapper",permalink:"/docs/dapper",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dapper.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"10.2. Dapper \u96c6\u6210",sidebar:"docs",previous:{title:"10.1. SqlSugar \u96c6\u6210",permalink:"/docs/sqlsugar"},next:{title:"11. SaaS \u591a\u79df\u6237",permalink:"/docs/saas"}},s=[{value:"10.2.1 \u5173\u4e8e Dapper",id:"1021-\u5173\u4e8e-dapper",children:[]},{value:"10.2.2 \u5982\u4f55\u96c6\u6210",id:"1022-\u5982\u4f55\u96c6\u6210",children:[{value:"10.2.2.1 \u6ce8\u518c Dapper \u670d\u52a1",id:"10221-\u6ce8\u518c-dapper-\u670d\u52a1",children:[]},{value:"10.2.2.2 \u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668",id:"10222-\u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668",children:[]}]},{value:"10.2.3 \u57fa\u672c\u4f7f\u7528",id:"1023-\u57fa\u672c\u4f7f\u7528",children:[{value:"10.2.3.1 sql \u64cd\u4f5c",id:"10231-sql-\u64cd\u4f5c",children:[]},{value:"10.2.3.2 <TEntity> \u64cd\u4f5c",id:"10232-tentity-\u64cd\u4f5c",children:[]}]},{value:"10.2.4 \u9ad8\u7ea7\u4f7f\u7528",id:"1024-\u9ad8\u7ea7\u4f7f\u7528",children:[{value:"10.2.4.1 \u67e5\u8be2\u4e00\u5bf9\u4e00",id:"10241-\u67e5\u8be2\u4e00\u5bf9\u4e00",children:[]},{value:"10.2.4.2 \u67e5\u8be2\u591a\u4e2a\u7ed3\u679c",id:"10242-\u67e5\u8be2\u591a\u4e2a\u7ed3\u679c",children:[]},{value:"10.2.4.3 \u66f4\u591a\u64cd\u4f5c",id:"10243-\u66f4\u591a\u64cd\u4f5c",children:[]}]},{value:"10.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"1025-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:s};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(p.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(p.b)(i.a,{mdxType:"JoinGroup"}),Object(p.b)("h2",{id:"1021-\u5173\u4e8e-dapper"},"10.2.1 \u5173\u4e8e Dapper"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u662f .NET/C# \u5e73\u53f0\u975e\u5e38\u4f18\u79c0\u7684 ",Object(p.b)("inlineCode",{parentName:"p"},"\u5fae\u578b ORM")," \u6846\u67b6\uff0c\u4e3b\u8981\u662f\u4e3a ",Object(p.b)("inlineCode",{parentName:"p"},"ADO.NET")," \u64cd\u4f5c\u5bf9\u8c61\u63d0\u4f9b\u62d3\u5c55\u80fd\u529b\uff0c\u63a8\u5d07\u539f\u751f ",Object(p.b)("inlineCode",{parentName:"p"},"sql")," \u64cd\u4f5c\u6cd5\u3002"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u5b98\u65b9\u4ed3\u5e93\u5730\u5740\uff1a",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/StackExchange/Dapper"}),"https://github.com/StackExchange/Dapper")),Object(p.b)("h2",{id:"1022-\u5982\u4f55\u96c6\u6210"},"10.2.2 \u5982\u4f55\u96c6\u6210"),Object(p.b)("p",null,"\u5728 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5df2\u7ecf\u63a8\u51fa ",Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u62d3\u5c55\u5305 ",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://www.nuget.org/packages/Furion.Extras.DatabaseAccessor.Dapper"}),"Furion.Extras.DatabaseAccessor.Dapper"),"\u3002"),Object(p.b)("h3",{id:"10221-\u6ce8\u518c-dapper-\u670d\u52a1"},"10.2.2.1 \u6ce8\u518c ",Object(p.b)("inlineCode",{parentName:"h3"},"Dapper")," \u670d\u52a1"),Object(p.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728 ",Object(p.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6dfb\u52a0 ",Object(p.b)("inlineCode",{parentName:"p"},"services.AddDapper(connStr, SqlProvider)")," \u5373\u53ef\u3002\u5982\uff1a"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDapper("Data Source=./Furion.db", SqlProvider.Sqlite);\n')),Object(p.b)("h3",{id:"10222-\u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668"},"10.2.2.2 \u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668"),Object(p.b)("ul",null,Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"SqlServer"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Microsoft.Data.SqlClient")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Sqlite"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Microsoft.Data.Sqlite")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"MySql"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"MySql.Data")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Npgsql"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Npgsql")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Oracle"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Oracle.ManagedDataAccess.Core")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Firebird"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"FirebirdSql.Data.FirebirdClient"))),Object(p.b)("div",{className:"admonition admonition-important alert alert--info"},Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(p.b)("h5",{parentName:"div"},Object(p.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(p.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(p.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b89\u88c5\u62d3\u5c55\u5305\u4f4d\u7f6e")),Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(p.b)("p",{parentName:"div"},"\u5728 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63a8\u8350\u5c06\u62d3\u5c55\u5305 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion.Extras.DatabaseAccessor.Dapper")," \u5b89\u88c5\u5230 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u4e2d\u3002"))),Object(p.b)("h2",{id:"1023-\u57fa\u672c\u4f7f\u7528"},"10.2.3 \u57fa\u672c\u4f7f\u7528"),Object(p.b)("p",null,"\u5728\u4f7f\u7528\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u6216 ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(p.b)("ul",null,Object(p.b)("li",{parentName:"ul"},"\u975e\u6cdb\u578b\u7248\u672c")),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"private readonly IDapperRepository _dapperRepository;\npublic PersonService(IDapperRepository dapperRepository)\n{\n _dapperRepository = dapperRepository;\n}\n")),Object(p.b)("ul",null,Object(p.b)("li",{parentName:"ul"},"\u6cdb\u578b\u7248\u672c")),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"private readonly IDapperRepository _personRepository;\npublic PersonService(IDapperRepository personRepository)\n{\n _personRepository = personRepository;\n}\n")),Object(p.b)("h3",{id:"10231-sql-\u64cd\u4f5c"},"10.2.3.1 ",Object(p.b)("inlineCode",{parentName:"h3"},"sql")," \u64cd\u4f5c"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var data = _dapperRepository.Query("select * from person");\nvar data = await _dapperRepository.QueryAsync("select * from person");\n\nvar data = _dapperRepository.Query("select * from person");\n\nvar guid = Guid.NewGuid();\nvar dog = _dapperRepository.Query("select Age = @Age, Id = @Id", new { Age = (int?)null, Id = guid });\n')),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var count = _dapperRepository.Execute(@"insert MyTable(colA, colB) values (@a, @b)",\n new[] { new { a=1, b=1 }, new { a=2, b=2 }, new { a=3, b=3 } }\n );\n\nvar user = _dapperRepository.Query("spGetUser", new {Id = 1},\n commandType: CommandType.StoredProcedure).SingleOrDefault();\n')),Object(p.b)("p",null,"\u7528\u6cd5\u548c\u5b98\u65b9\u4e00\u81f4\uff0c\u6b64\u5904\u4e0d\u518d\u4e3e\u66f4\u591a\u4f8b\u5b50\u3002"),Object(p.b)("h3",{id:"10232-tentity-\u64cd\u4f5c"},"10.2.3.2 ",Object(p.b)("inlineCode",{parentName:"h3"},"")," \u64cd\u4f5c"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u548c ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u4e24\u4e2a\u64cd\u4f5c\u4ed3\u50a8\uff0c\u540e\u8005\u7ee7\u627f\u524d\u8005\u3002\u4f7f\u7528\u5982\u4e0b\uff1a"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var person = personRepository.Get(1);\nvar persons = personRepository.GetAll();\n\nvar effects = personRepository.Insert(person);\nvar effects = personRepository.Update(person);\nvar effects = personRepository.Delete(person);\n\nvar effects = personRepository.Insert(persons); // \u63d2\u5165\u591a\u4e2a\nvar effects = personRepository.Update(persons); // \u66f4\u65b0\u591a\u4e2a\nvar effects = personRepository.Delete(persons); // \u5220\u9664\u591a\u4e2a\n\nvar effects = await personRepository.InsertAsync(person);\n")),Object(p.b)("h2",{id:"1024-\u9ad8\u7ea7\u4f7f\u7528"},"10.2.4 \u9ad8\u7ea7\u4f7f\u7528"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u548c ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u4ed3\u50a8\u63d0\u4f9b\u4e86 ",Object(p.b)("inlineCode",{parentName:"p"},"Context")," \u548c ",Object(p.b)("inlineCode",{parentName:"p"},"DynamicContext")," \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u8fd4\u56de ",Object(p.b)("inlineCode",{parentName:"p"},"IDbConnection")," \u5bf9\u8c61\u3002"),Object(p.b)("p",null,"\u62ff\u5230\u8be5\u5bf9\u8c61\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u64cd\u4f5c ",Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u63d0\u4f9b\u7684\u6240\u6709\u64cd\u4f5c\u4e86\uff0c\u5982\uff1a"),Object(p.b)("h3",{id:"10241-\u67e5\u8be2\u4e00\u5bf9\u4e00"},"10.2.4.1 \u67e5\u8be2\u4e00\u5bf9\u4e00"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var sql =\n@"select * from #Posts p\nleft join #Users u on u.Id = p.OwnerId\nOrder by p.Id";\n\nvar data = dapperRepository.Context.Query(sql, (post, user) => { post.Owner = user; return post;});\nvar post = data.First();\n')),Object(p.b)("h3",{id:"10242-\u67e5\u8be2\u591a\u4e2a\u7ed3\u679c"},"10.2.4.2 \u67e5\u8be2\u591a\u4e2a\u7ed3\u679c"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var sql =\n@"\nselect * from Customers where CustomerId = @id\nselect * from Orders where CustomerId = @id\nselect * from Returns where CustomerId = @id";\n\nusing (var multi = dapperRepository.Context.QueryMultiple(sql, new {id=selectedId}))\n{\n var customer = multi.Read().Single();\n var orders = multi.Read().ToList();\n var returns = multi.Read().ToList();\n // ...\n}\n')),Object(p.b)("h3",{id:"10243-\u66f4\u591a\u64cd\u4f5c"},"10.2.4.3 \u66f4\u591a\u64cd\u4f5c"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var shapes = new List();\nusing (var reader = dapperRepository.Context.ExecuteReader("select * from Shapes"))\n{\n var circleParser = reader.GetRowParser(typeof(Circle));\n var squareParser = reader.GetRowParser(typeof(Square));\n var triangleParser = reader.GetRowParser(typeof(Triangle));\n\n var typeColumnIndex = reader.GetOrdinal("Type");\n\n while (reader.Read())\n {\n IShape shape;\n var type = (ShapeType)reader.GetInt32(typeColumnIndex);\n switch (type)\n {\n case ShapeType.Circle:\n shape = circleParser(reader);\n break;\n case ShapeType.Square:\n shape = squareParser(reader);\n break;\n case ShapeType.Triangle:\n shape = triangleParser(reader);\n break;\n default:\n throw new NotImplementedException();\n }\n\n shapes.Add(shape);\n }\n}\n')),Object(p.b)("h2",{id:"1025-\u53cd\u9988\u4e0e\u5efa\u8bae"},"10.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(p.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(p.b)("h5",{parentName:"div"},Object(p.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(p.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(p.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(p.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(p.b)("hr",null),Object(p.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(p.b)("h5",{parentName:"div"},Object(p.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(p.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(p.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(p.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/StackExchange/Dapper"}),"Dapper \u5b98\u7f51"),"\u3002"))))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(191);function p(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:p=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return p?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=p();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},b=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},u=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,p=e.originalType,i=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),b=l(n),u=r,m=b["".concat(i,".").concat(u)]||b[u]||d[u]||p;return n?a.a.createElement(m,o(o({ref:t},s),{},{components:n})):a.a.createElement(m,o({ref:t},s))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var p=n.length,i=new Array(p);i[0]=u;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{145:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return c})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),p=(n(0),n(196)),i=n(197),o={id:"dapper",title:"10.2. Dapper \u96c6\u6210",sidebar_label:"10.2. Dapper \u96c6\u6210"},c={unversionedId:"dapper",id:"dapper",isDocsHomePage:!1,title:"10.2. Dapper \u96c6\u6210",description:"10.2.1 \u5173\u4e8e Dapper",source:"@site/docs\\dapper.mdx",slug:"/dapper",permalink:"/docs/dapper",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dapper.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"10.2. Dapper \u96c6\u6210",sidebar:"docs",previous:{title:"10.1. SqlSugar \u96c6\u6210",permalink:"/docs/sqlsugar"},next:{title:"11. SaaS \u591a\u79df\u6237",permalink:"/docs/saas"}},s=[{value:"10.2.1 \u5173\u4e8e Dapper",id:"1021-\u5173\u4e8e-dapper",children:[]},{value:"10.2.2 \u5982\u4f55\u96c6\u6210",id:"1022-\u5982\u4f55\u96c6\u6210",children:[{value:"10.2.2.1 \u6ce8\u518c Dapper \u670d\u52a1",id:"10221-\u6ce8\u518c-dapper-\u670d\u52a1",children:[]},{value:"10.2.2.2 \u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668",id:"10222-\u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668",children:[]}]},{value:"10.2.3 \u57fa\u672c\u4f7f\u7528",id:"1023-\u57fa\u672c\u4f7f\u7528",children:[{value:"10.2.3.1 sql \u64cd\u4f5c",id:"10231-sql-\u64cd\u4f5c",children:[]},{value:"10.2.3.2 <TEntity> \u64cd\u4f5c",id:"10232-tentity-\u64cd\u4f5c",children:[]}]},{value:"10.2.4 \u9ad8\u7ea7\u4f7f\u7528",id:"1024-\u9ad8\u7ea7\u4f7f\u7528",children:[{value:"10.2.4.1 \u67e5\u8be2\u4e00\u5bf9\u4e00",id:"10241-\u67e5\u8be2\u4e00\u5bf9\u4e00",children:[]},{value:"10.2.4.2 \u67e5\u8be2\u591a\u4e2a\u7ed3\u679c",id:"10242-\u67e5\u8be2\u591a\u4e2a\u7ed3\u679c",children:[]},{value:"10.2.4.3 \u66f4\u591a\u64cd\u4f5c",id:"10243-\u66f4\u591a\u64cd\u4f5c",children:[]}]},{value:"10.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"1025-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:s};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(p.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(p.b)(i.a,{mdxType:"JoinGroup"}),Object(p.b)("h2",{id:"1021-\u5173\u4e8e-dapper"},"10.2.1 \u5173\u4e8e Dapper"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u662f .NET/C# \u5e73\u53f0\u975e\u5e38\u4f18\u79c0\u7684 ",Object(p.b)("inlineCode",{parentName:"p"},"\u5fae\u578b ORM")," \u6846\u67b6\uff0c\u4e3b\u8981\u662f\u4e3a ",Object(p.b)("inlineCode",{parentName:"p"},"ADO.NET")," \u64cd\u4f5c\u5bf9\u8c61\u63d0\u4f9b\u62d3\u5c55\u80fd\u529b\uff0c\u63a8\u5d07\u539f\u751f ",Object(p.b)("inlineCode",{parentName:"p"},"sql")," \u64cd\u4f5c\u6cd5\u3002"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u5b98\u65b9\u4ed3\u5e93\u5730\u5740\uff1a",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/StackExchange/Dapper"}),"https://github.com/StackExchange/Dapper")),Object(p.b)("h2",{id:"1022-\u5982\u4f55\u96c6\u6210"},"10.2.2 \u5982\u4f55\u96c6\u6210"),Object(p.b)("p",null,"\u5728 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5df2\u7ecf\u63a8\u51fa ",Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u62d3\u5c55\u5305 ",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://www.nuget.org/packages/Furion.Extras.DatabaseAccessor.Dapper"}),"Furion.Extras.DatabaseAccessor.Dapper"),"\u3002"),Object(p.b)("h3",{id:"10221-\u6ce8\u518c-dapper-\u670d\u52a1"},"10.2.2.1 \u6ce8\u518c ",Object(p.b)("inlineCode",{parentName:"h3"},"Dapper")," \u670d\u52a1"),Object(p.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u5728 ",Object(p.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6dfb\u52a0 ",Object(p.b)("inlineCode",{parentName:"p"},"services.AddDapper(connStr, SqlProvider)")," \u5373\u53ef\u3002\u5982\uff1a"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'services.AddDapper("Data Source=./Furion.db", SqlProvider.Sqlite);\n')),Object(p.b)("h3",{id:"10222-\u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668"},"10.2.2.2 \u5b89\u88c5\u5bf9\u5e94\u7684\u6570\u636e\u5e93\u63d0\u4f9b\u5668"),Object(p.b)("ul",null,Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"SqlServer"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Microsoft.Data.SqlClient")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Sqlite"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Microsoft.Data.Sqlite")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"MySql"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"MySql.Data")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Npgsql"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Npgsql")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Oracle"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"Oracle.ManagedDataAccess.Core")),Object(p.b)("li",{parentName:"ul"},Object(p.b)("inlineCode",{parentName:"li"},"Firebird"),"\uff1a",Object(p.b)("inlineCode",{parentName:"li"},"FirebirdSql.Data.FirebirdClient"))),Object(p.b)("div",{className:"admonition admonition-important alert alert--info"},Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(p.b)("h5",{parentName:"div"},Object(p.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(p.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(p.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b89\u88c5\u62d3\u5c55\u5305\u4f4d\u7f6e")),Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(p.b)("p",{parentName:"div"},"\u5728 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63a8\u8350\u5c06\u62d3\u5c55\u5305 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion.Extras.DatabaseAccessor.Dapper")," \u5b89\u88c5\u5230 ",Object(p.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u4e2d\u3002"))),Object(p.b)("h2",{id:"1023-\u57fa\u672c\u4f7f\u7528"},"10.2.3 \u57fa\u672c\u4f7f\u7528"),Object(p.b)("p",null,"\u5728\u4f7f\u7528\u4e4b\u524d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u6216 ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u63a5\u53e3\uff0c\u5982\uff1a"),Object(p.b)("ul",null,Object(p.b)("li",{parentName:"ul"},"\u975e\u6cdb\u578b\u7248\u672c")),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"private readonly IDapperRepository _dapperRepository;\npublic PersonService(IDapperRepository dapperRepository)\n{\n _dapperRepository = dapperRepository;\n}\n")),Object(p.b)("ul",null,Object(p.b)("li",{parentName:"ul"},"\u6cdb\u578b\u7248\u672c")),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"private readonly IDapperRepository _personRepository;\npublic PersonService(IDapperRepository personRepository)\n{\n _personRepository = personRepository;\n}\n")),Object(p.b)("h3",{id:"10231-sql-\u64cd\u4f5c"},"10.2.3.1 ",Object(p.b)("inlineCode",{parentName:"h3"},"sql")," \u64cd\u4f5c"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var data = _dapperRepository.Query("select * from person");\nvar data = await _dapperRepository.QueryAsync("select * from person");\n\nvar data = _dapperRepository.Query("select * from person");\n\nvar guid = Guid.NewGuid();\nvar dog = _dapperRepository.Query("select Age = @Age, Id = @Id", new { Age = (int?)null, Id = guid });\n')),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var count = _dapperRepository.Execute(@"insert MyTable(colA, colB) values (@a, @b)",\n new[] { new { a=1, b=1 }, new { a=2, b=2 }, new { a=3, b=3 } }\n );\n\nvar user = _dapperRepository.Query("spGetUser", new {Id = 1},\n commandType: CommandType.StoredProcedure).SingleOrDefault();\n')),Object(p.b)("p",null,"\u7528\u6cd5\u548c\u5b98\u65b9\u4e00\u81f4\uff0c\u6b64\u5904\u4e0d\u518d\u4e3e\u66f4\u591a\u4f8b\u5b50\u3002"),Object(p.b)("h3",{id:"10232-tentity-\u64cd\u4f5c"},"10.2.3.2 ",Object(p.b)("inlineCode",{parentName:"h3"},"")," \u64cd\u4f5c"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u548c ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u4e24\u4e2a\u64cd\u4f5c\u4ed3\u50a8\uff0c\u540e\u8005\u7ee7\u627f\u524d\u8005\u3002\u4f7f\u7528\u5982\u4e0b\uff1a"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var person = personRepository.Get(1);\nvar persons = personRepository.GetAll();\n\nvar effects = personRepository.Insert(person);\nvar effects = personRepository.Update(person);\nvar effects = personRepository.Delete(person);\n\nvar effects = personRepository.Insert(persons); // \u63d2\u5165\u591a\u4e2a\nvar effects = personRepository.Update(persons); // \u66f4\u65b0\u591a\u4e2a\nvar effects = personRepository.Delete(persons); // \u5220\u9664\u591a\u4e2a\n\nvar effects = await personRepository.InsertAsync(person);\n")),Object(p.b)("h2",{id:"1024-\u9ad8\u7ea7\u4f7f\u7528"},"10.2.4 \u9ad8\u7ea7\u4f7f\u7528"),Object(p.b)("p",null,Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u548c ",Object(p.b)("inlineCode",{parentName:"p"},"IDapperRepository")," \u4ed3\u50a8\u63d0\u4f9b\u4e86 ",Object(p.b)("inlineCode",{parentName:"p"},"Context")," \u548c ",Object(p.b)("inlineCode",{parentName:"p"},"DynamicContext")," \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u8fd4\u56de ",Object(p.b)("inlineCode",{parentName:"p"},"IDbConnection")," \u5bf9\u8c61\u3002"),Object(p.b)("p",null,"\u62ff\u5230\u8be5\u5bf9\u8c61\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u64cd\u4f5c ",Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u63d0\u4f9b\u7684\u6240\u6709\u64cd\u4f5c\u4e86\uff0c\u5982\uff1a"),Object(p.b)("h3",{id:"10241-\u67e5\u8be2\u4e00\u5bf9\u4e00"},"10.2.4.1 \u67e5\u8be2\u4e00\u5bf9\u4e00"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var sql =\n@"select * from #Posts p\nleft join #Users u on u.Id = p.OwnerId\nOrder by p.Id";\n\nvar data = dapperRepository.Context.Query(sql, (post, user) => { post.Owner = user; return post;});\nvar post = data.First();\n')),Object(p.b)("h3",{id:"10242-\u67e5\u8be2\u591a\u4e2a\u7ed3\u679c"},"10.2.4.2 \u67e5\u8be2\u591a\u4e2a\u7ed3\u679c"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var sql =\n@"\nselect * from Customers where CustomerId = @id\nselect * from Orders where CustomerId = @id\nselect * from Returns where CustomerId = @id";\n\nusing (var multi = dapperRepository.Context.QueryMultiple(sql, new {id=selectedId}))\n{\n var customer = multi.Read().Single();\n var orders = multi.Read().ToList();\n var returns = multi.Read().ToList();\n // ...\n}\n')),Object(p.b)("h3",{id:"10243-\u66f4\u591a\u64cd\u4f5c"},"10.2.4.3 \u66f4\u591a\u64cd\u4f5c"),Object(p.b)("pre",null,Object(p.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var shapes = new List();\nusing (var reader = dapperRepository.Context.ExecuteReader("select * from Shapes"))\n{\n var circleParser = reader.GetRowParser(typeof(Circle));\n var squareParser = reader.GetRowParser(typeof(Square));\n var triangleParser = reader.GetRowParser(typeof(Triangle));\n\n var typeColumnIndex = reader.GetOrdinal("Type");\n\n while (reader.Read())\n {\n IShape shape;\n var type = (ShapeType)reader.GetInt32(typeColumnIndex);\n switch (type)\n {\n case ShapeType.Circle:\n shape = circleParser(reader);\n break;\n case ShapeType.Square:\n shape = squareParser(reader);\n break;\n case ShapeType.Triangle:\n shape = triangleParser(reader);\n break;\n default:\n throw new NotImplementedException();\n }\n\n shapes.Add(shape);\n }\n}\n')),Object(p.b)("h2",{id:"1025-\u53cd\u9988\u4e0e\u5efa\u8bae"},"10.2.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(p.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(p.b)("h5",{parentName:"div"},Object(p.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(p.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(p.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(p.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(p.b)("hr",null),Object(p.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(p.b)("h5",{parentName:"div"},Object(p.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(p.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(p.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(p.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(p.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(p.b)("inlineCode",{parentName:"p"},"Dapper")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(p.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/StackExchange/Dapper"}),"Dapper \u5b98\u7f51"),"\u3002"))))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return p})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(195);function p(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:p=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return p?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=p();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=a.a.createContext({}),l=function(e){var t=a.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},b=function(e){var t=l(e.components);return a.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},u=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,p=e.originalType,i=e.parentName,s=c(e,["components","mdxType","originalType","parentName"]),b=l(n),u=r,m=b["".concat(i,".").concat(u)]||b[u]||d[u]||p;return n?a.a.createElement(m,o(o({ref:t},s),{},{components:n})):a.a.createElement(m,o({ref:t},s))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var p=n.length,i=new Array(p);i[0]=u;var o={};for(var c in t)hasOwnProperty.call(t,c)&&(o[c]=t[c]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/a133dc31.7c2f7978.js b/docs/a133dc31.1e4f7a7c.js similarity index 98% rename from docs/a133dc31.7c2f7978.js rename to docs/a133dc31.1e4f7a7c.js index f25278f6ae7..68665a3a2c9 100644 --- a/docs/a133dc31.7c2f7978.js +++ b/docs/a133dc31.1e4f7a7c.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[67],{143:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return l})),n.d(t,"metadata",(function(){return o})),n.d(t,"toc",(function(){return d})),n.d(t,"default",(function(){return p}));var a=n(3),c=n(7),r=(n(0),n(192)),b=n(193),i=n(190),l={id:"dbcontext-function",title:"9.14 \u51fd\u6570\u64cd\u4f5c",sidebar_label:"9.14 \u51fd\u6570\u64cd\u4f5c"},o={unversionedId:"dbcontext-function",id:"dbcontext-function",isDocsHomePage:!1,title:"9.14 \u51fd\u6570\u64cd\u4f5c",description:"\u63a8\u8350\u4f7f\u7528 \u300a9.17 Sql \u9ad8\u7ea7\u4ee3\u7406\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002Sql \u9ad8\u7ea7\u4ee3\u7406 \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002",source:"@site/docs\\dbcontext-function.mdx",slug:"/dbcontext-function",permalink:"/docs/dbcontext-function",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-function.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.14 \u51fd\u6570\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",permalink:"/docs/dbcontext-proc"},next:{title:"9.15 Sql \u64cd\u4f5c",permalink:"/docs/dbcontext-sql"}},d=[{value:"9.14.1 \u6570\u636e\u5e93\u51fd\u6570",id:"9141-\u6570\u636e\u5e93\u51fd\u6570",children:[{value:"9.14.1.1 \u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93",id:"91411-\u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93",children:[]},{value:"9.14.1.2 \u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93",id:"91412-\u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93",children:[]}]},{value:"9.14.2 \u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b",id:"9142-\u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b",children:[]},{value:"9.14.3 \u51fd\u6570\u7684\u4f7f\u7528",id:"9143-\u51fd\u6570\u7684\u4f7f\u7528",children:[{value:"9.14.3.1 \u6807\u91cf\u51fd\u6570\u8fd4\u56de object",id:"91431-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-object",children:[]},{value:"9.14.3.2 \u6807\u91cf\u51fd\u6570\u8fd4\u56de T",id:"91432-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-t",children:[]},{value:"9.14.3.3 \u8868\u503c\u51fd\u6570\u8fd4\u56de DataTable",id:"91433-\u8868\u503c\u51fd\u6570\u8fd4\u56de-datatable",children:[]},{value:"9.14.3.4 \u8868\u503c\u51fd\u6570\u8fd4\u56de List<T>",id:"91434-\u8868\u503c\u51fd\u6570\u8fd4\u56de-listt",children:[]}]},{value:"9.14.4 \u5728 Linq \u4e2d\u4f7f\u7528 \u6807\u91cf\u51fd\u6570",id:"9144-\u5728-linq-\u4e2d\u4f7f\u7528-\u6807\u91cf\u51fd\u6570",children:[{value:"9.14.4.1 \u521b\u5efa\u6807\u91cf\u51fd\u6570",id:"91441-\u521b\u5efa\u6807\u91cf\u51fd\u6570",children:[]},{value:"9.14.4.2 \u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5",id:"91442-\u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5",children:[]},{value:"9.14.4.3 \u5728 Linq \u4e2d\u4f7f\u7528",id:"91443-\u5728-linq-\u4e2d\u4f7f\u7528",children:[]}]},{value:"9.14.5 \u5728 Linq \u4e2d\u4f7f\u7528 \u8868\u503c\u51fd\u6570",id:"9145-\u5728-linq-\u4e2d\u4f7f\u7528-\u8868\u503c\u51fd\u6570",children:[{value:"9.14.5.1 \u521b\u5efa\u8868\u503c\u51fd\u6570",id:"91451-\u521b\u5efa\u8868\u503c\u51fd\u6570",children:[]},{value:"9.14.5.2 \u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b",id:"91452-\u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b",children:[]},{value:"9.14.5.3 \u8868\u503c\u51fd\u6570\u914d\u7f6e",id:"91453-\u8868\u503c\u51fd\u6570\u914d\u7f6e",children:[]},{value:"9.14.5.4 \u5728 Linq \u4e2d\u4f7f\u7528",id:"91454-\u5728-linq-\u4e2d\u4f7f\u7528",children:[]}]},{value:"9.14.6 \u5728 EF Core \u5185\u7f6e\u51fd\u6570",id:"9146-\u5728-ef-core-\u5185\u7f6e\u51fd\u6570",children:[]},{value:"9.14.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9147-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:d};function p(e){var t=e.components,n=Object(c.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)(b.a,{mdxType:"JoinGroup"}),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/dbcontext-sql-proxy"}),"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002",Object(r.b)("inlineCode",{parentName:"p"},"Sql \u9ad8\u7ea7\u4ee3\u7406")," \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002"))),Object(r.b)("h2",{id:"9141-\u6570\u636e\u5e93\u51fd\u6570"},"9.14.1 \u6570\u636e\u5e93\u51fd\u6570"),Object(r.b)("p",null,"\u5f15\u7528\u767e\u5ea6\u767e\u79d1\uff1a"),Object(r.b)("blockquote",null,Object(r.b)("p",{parentName:"blockquote"},"\u6570\u636e\u5e93\u51fd\u6570\u662f\u6307\u5f53\u9700\u8981\u5206\u6790\u6570\u636e\u6e05\u5355\u4e2d\u7684\u6570\u503c\u662f\u5426\u7b26\u5408\u7279\u5b9a\u6761\u4ef6\u65f6\uff0c\u4f7f\u7528\u6570\u636e\u5e93\u5de5\u4f5c\u8868\u51fd\u6570\u3002")),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u51fd\u6570\u5c31\u662f\u7528\u4e8e\u5b50\u8ba1\u7b97\u7684\u51fd\u6570\u3002\u5176\u8ba1\u7b97\u7684\u7ed3\u679c\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u3002"),Object(r.b)("h3",{id:"91411-\u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93"},"9.14.1.1 \u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}))))),Object(r.b)("h3",{id:"91412-\u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93"},"9.14.1.2 \u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}))))),Object(r.b)("h2",{id:"9142-\u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b"},"9.14.2 \u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b"),Object(r.b)("p",null,"\u5728\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\uff0c\u6570\u636e\u5e93\u51fd\u6570\u6709\u8fd9\u4e24\u79cd\u7c7b\u578b\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u6807\u91cf\u51fd\u6570"),"\uff1a\u53ea\u80fd\u8fd4\u56de\u5355\u4e2a\u503c"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8868\u503c\u51fd\u6570"),"\uff1a\u53ea\u80fd\u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6")),Object(r.b)("h2",{id:"9143-\u51fd\u6570\u7684\u4f7f\u7528"},"9.14.3 \u51fd\u6570\u7684\u4f7f\u7528"),Object(r.b)("h3",{id:"91431-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-object"},"9.14.3.1 \u6807\u91cf\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"object")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionScalar("func_GetValue");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetValue(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionScalar("func_GetValue");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionScalar("func_GetValue");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetValue".SqlFunctionScalar();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h3",{id:"91432-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-t"},"9.14.3.2 \u6807\u91cf\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"T")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionScalar("func_GetValue");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetValue(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionScalar("func_GetValue");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionScalar("func_GetValue");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetValue".SqlFunctionScalar();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h3",{id:"91433-\u8868\u503c\u51fd\u6570\u8fd4\u56de-datatable"},"9.14.3.3 \u8868\u503c\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionQuery("func_GetTable");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetTable(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionQuery("func_GetTable");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionQuery("func_GetTable");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetTable".SqlFunctionQuery();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h3",{id:"91434-\u8868\u503c\u51fd\u6570\u8fd4\u56de-listt"},"9.14.3.4 \u8868\u503c\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"List")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionQuery("func_GetTable");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetTable(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionQuery("func_GetTable");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionQuery("func_GetTable");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetTable".SqlFunctionQuery();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h2",{id:"9144-\u5728-linq-\u4e2d\u4f7f\u7528-\u6807\u91cf\u51fd\u6570"},"9.14.4 \u5728 ",Object(r.b)("inlineCode",{parentName:"h2"},"Linq")," \u4e2d\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"h2"},"\u6807\u91cf\u51fd\u6570")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u7075\u6d3b\u7684\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u4e2d\u4f7f\u7528\u6807\u91cf\u51fd\u6570\u7684\u65b9\u6cd5\u3002\u5982\u679c\u50cf\u4f7f\u7528\u8fd9\u6837\u7684\u65b9\u5f0f\uff0c\u9700\u8981\u6ee1\u8db3\u4ee5\u4e0b\u4e24\u4e2a\u6761\u4ef6\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u6807\u91cf\u51fd\u6570\u5fc5\u987b\u5b9a\u4e49\u5728",Object(r.b)("strong",{parentName:"li"},"\u516c\u5f00\u9759\u6001\u7c7b"),"\u4e2d\uff0c\u4e14\u81ea\u5df1\u4e5f\u662f",Object(r.b)("strong",{parentName:"li"},"\u516c\u5f00\u9759\u6001\u65b9\u6cd5")),Object(r.b)("li",{parentName:"ul"},"\u8be5",Object(r.b)("strong",{parentName:"li"},"\u516c\u5f00\u9759\u6001\u65b9\u6cd5"),"\u5fc5\u987b\u8d34\u6709 ",Object(r.b)("inlineCode",{parentName:"li"},"[QueryableFunction]")," \u7279\u6027")),Object(r.b)("p",null,"\u793a\u4f8b\u5982\u4e0b\uff1a"),Object(r.b)("h3",{id:"91441-\u521b\u5efa\u6807\u91cf\u51fd\u6570"},"9.14.4.1 \u521b\u5efa\u6807\u91cf\u51fd\u6570"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"CREATE FUNCTION FN_GetId\n(\n @id INT\n)\nRETURNS INT\nAS\nBEGIN\n RETURN @id + 1;\nEND;\n")),Object(r.b)("h3",{id:"91442-\u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5"},"9.14.4.2 \u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5"),Object(r.b)("p",null,"\u521b\u5efa\u9759\u6001\u7c7b\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"p"},"QueryFunctions"),"\uff0c\u5c06\u8be5 ",Object(r.b)("inlineCode",{parentName:"p"},"\u6807\u91cf\u51fd\u6570")," \u653e\u5728\u9759\u6001\u7c7b\u4e2d\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1, 7, 10-11}","{1,":!0,"7,":!0,"10-11}":!0}),'using Furion.DatabaseAccessor;\nusing System;\n\nnamespace Furion.Application\n{\n // \u5fc5\u987b\u662f\u516c\u5f00\u9759\u6001\u7684\n public static class QueryFunctions\n {\n // \u5fc5\u987b\u662f\u9759\u6001\u65b9\u6cd5\n [QueryableFunction("FN_GetId", "dbo")] // \u914d\u7f6e\u6807\u91cf\u51fd\u6570\n public static int GetId(int id) => throw new NotSupportedException();\n }\n}\n')),Object(r.b)("h3",{id:"91443-\u5728-linq-\u4e2d\u4f7f\u7528"},"9.14.4.3 \u5728 ",Object(r.b)("inlineCode",{parentName:"h3"},"Linq")," \u4e2d\u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_personRepository.Where(u => u.Id > QueryFunctions.GetId(1)).ToList();\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"SELECT [p].[Id], [p].[Address], [p].[Age], [p].[CreatedTime], [p].[IsDeleted], [p].[Name], [p].[UpdatedTime]\nFROM [Person] AS [p]\nWHERE [p].[Id] > [dbo].[FN_GetId](1) // \ud83d\udca5 \u6ce8\u610f\u8fd9\u91cc\n")),Object(r.b)("img",{src:Object(i.a)("img/fn1.png")}),Object(r.b)("h2",{id:"9145-\u5728-linq-\u4e2d\u4f7f\u7528-\u8868\u503c\u51fd\u6570"},"9.14.5 \u5728 ",Object(r.b)("inlineCode",{parentName:"h2"},"Linq")," \u4e2d\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"h2"},"\u8868\u503c\u51fd\u6570")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"EF Core 5.0")," \u7248\u672c\u652f\u6301\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u4e2d\u64cd\u4f5c ",Object(r.b)("inlineCode",{parentName:"p"},"\u8868\u503c\u51fd\u6570"),"\uff0c\u64cd\u4f5c\u6709\u70b9\u7c7b\u4f3c ",Object(r.b)("inlineCode",{parentName:"p"},"\u89c6\u56fe\u64cd\u4f5c")),Object(r.b)("p",null,"\u793a\u4f8b\u5982\u4e0b\uff1a"),Object(r.b)("h3",{id:"91451-\u521b\u5efa\u8868\u503c\u51fd\u6570"},"9.14.5.1 \u521b\u5efa\u8868\u503c\u51fd\u6570"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"CREATE FUNCTION dbo.GetPersons\n(\n @id INT\n)\nRETURNS TABLE\nAS\nRETURN\n(\n SELECT Id,\n Name,\n Age,\n Address\n FROM dbo.Person\n WHERE Id > @id\n);\n")),Object(r.b)("h3",{id:"91452-\u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b"},"9.14.5.2 \u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"namespace Furion.Core\n{\n public class F_Person\n {\n /// \n /// \u4e3b\u952eId\n /// \n public int Id { get; set; }\n\n /// \n /// \u59d3\u540d\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"91453-\u8868\u503c\u51fd\u6570\u914d\u7f6e"},"9.14.5.3 \u8868\u503c\u51fd\u6570\u914d\u7f6e"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7c7b\u4e2d\u5b9a\u4e49\u65b9\u6cd5\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3,10,20-21}","{3,10,20-21}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System.Linq;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext\n {\n public IQueryable GetPersons(int id) => FromExpression(() => GetPersons(id));\n\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n protected override void OnModelCreating(ModelBuilder modelBuilder)\n {\n base.OnModelCreating(modelBuilder);\n\n modelBuilder.Entity(typeof(F_Person)).HasNoKey();\n modelBuilder.HasDbFunction(() => GetPersons(default));\n }\n }\n}\n')),Object(r.b)("h3",{id:"91454-\u5728-linq-\u4e2d\u4f7f\u7528"},"9.14.5.4 \u5728 ",Object(r.b)("inlineCode",{parentName:"h3"},"Linq")," \u4e2d\u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'IQueryable query = _repository.DynamicDbContext.GetPersons(1);\nvar result = query.Where(u => u.Name.Equals("Furion")).ToList();\n')),Object(r.b)("p",null,"\u6700\u7ec8\u751f\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"Sql")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"SELECT [g].Id, [g].Name, [g].Age, [g].Address\nFROM dbo.GetPersons(1) AS [g]\nWHERE [g].Name == N'Furion';\n")),Object(r.b)("h2",{id:"9146-\u5728-ef-core-\u5185\u7f6e\u51fd\u6570"},"9.14.6 \u5728 ",Object(r.b)("inlineCode",{parentName:"h2"},"EF Core")," \u5185\u7f6e\u51fd\u6570"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"EF Core")," \u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u5f88\u591a\u5e38\u7528\u7684\u5185\u7f6e\u51fd\u6570\uff0c\u53ef\u4ee5\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Lambda")," \u6761\u4ef6\u4e2d\u4f7f\u7528\uff0c\u4e3b\u8981\u662f\u901a\u8fc7 EF.Functions \u8c03\u7528\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_repository.Where(u => EF.Functions.DateDiffHour(u.CreatedDt, DateTime.Now) > 8).FirstOrDefault();\n")),Object(r.b)("p",null,"\u8fd9\u4e2a\u8bed\u53e5\u4f7f\u7528\u4e86 EF.Functions.DateDiffHour \u6700\u7ec8\u751f\u6210\u7684 Sql \u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"SELECT TOP(1) [a].*\nFROM [dbo].[TEST] AS [a]\nWHERE DATEDIFF(HOUR, [a].[CREATED_DT], GETDATE()) > 8\n")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"EF Core")," \u5185\u7f6e\u51fd\u6570\u5c31\u4e0d\u4e00\u4e00\u5217\u51fa\u4e86\uff0c\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"EF.Functions")," \u67e5\u770b\u66f4\u591a\uff0c\u5982\u679c\u4e0d\u80fd\u6ee1\u8db3\u81ea\u5df1\u7684\u9700\u6c42\uff0c\u90a3\u4e48\u53ef\u4ee5\u81ea\u5b9a\u4e49 ",Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u6807\u91cf\u51fd\u6570"),Object(r.b)("h2",{id:"9147-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.14.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return b}));var a=n(21),c=n(191);function r(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(c.b)(n))return n;if(a)return t+n;const b=n.startsWith(t)?n:t+n.replace(/^\//,"");return r?e+b:b}(t,e,n,a)}}function b(e,t={}){const{withBaseUrl:n}=r();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return O}));var a=n(0),c=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var o=c.a.createContext({}),d=function(e){var t=c.a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=d(e.components);return c.a.createElement(o.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},u=c.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,b=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=d(n),u=a,O=s["".concat(b,".").concat(u)]||s[u]||p[u]||r;return n?c.a.createElement(O,i(i({ref:t},o),{},{components:n})):c.a.createElement(O,i({ref:t},o))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,b=new Array(r);b[0]=u;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,b[1]=i;for(var o=2;ot(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{146:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return l})),n.d(t,"metadata",(function(){return o})),n.d(t,"toc",(function(){return d})),n.d(t,"default",(function(){return p}));var a=n(3),c=n(7),r=(n(0),n(196)),b=n(197),i=n(194),l={id:"dbcontext-function",title:"9.14 \u51fd\u6570\u64cd\u4f5c",sidebar_label:"9.14 \u51fd\u6570\u64cd\u4f5c"},o={unversionedId:"dbcontext-function",id:"dbcontext-function",isDocsHomePage:!1,title:"9.14 \u51fd\u6570\u64cd\u4f5c",description:"\u63a8\u8350\u4f7f\u7528 \u300a9.17 Sql \u9ad8\u7ea7\u4ee3\u7406\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002Sql \u9ad8\u7ea7\u4ee3\u7406 \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002",source:"@site/docs\\dbcontext-function.mdx",slug:"/dbcontext-function",permalink:"/docs/dbcontext-function",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-function.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.14 \u51fd\u6570\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c",permalink:"/docs/dbcontext-proc"},next:{title:"9.15 Sql \u64cd\u4f5c",permalink:"/docs/dbcontext-sql"}},d=[{value:"9.14.1 \u6570\u636e\u5e93\u51fd\u6570",id:"9141-\u6570\u636e\u5e93\u51fd\u6570",children:[{value:"9.14.1.1 \u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93",id:"91411-\u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93",children:[]},{value:"9.14.1.2 \u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93",id:"91412-\u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93",children:[]}]},{value:"9.14.2 \u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b",id:"9142-\u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b",children:[]},{value:"9.14.3 \u51fd\u6570\u7684\u4f7f\u7528",id:"9143-\u51fd\u6570\u7684\u4f7f\u7528",children:[{value:"9.14.3.1 \u6807\u91cf\u51fd\u6570\u8fd4\u56de object",id:"91431-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-object",children:[]},{value:"9.14.3.2 \u6807\u91cf\u51fd\u6570\u8fd4\u56de T",id:"91432-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-t",children:[]},{value:"9.14.3.3 \u8868\u503c\u51fd\u6570\u8fd4\u56de DataTable",id:"91433-\u8868\u503c\u51fd\u6570\u8fd4\u56de-datatable",children:[]},{value:"9.14.3.4 \u8868\u503c\u51fd\u6570\u8fd4\u56de List<T>",id:"91434-\u8868\u503c\u51fd\u6570\u8fd4\u56de-listt",children:[]}]},{value:"9.14.4 \u5728 Linq \u4e2d\u4f7f\u7528 \u6807\u91cf\u51fd\u6570",id:"9144-\u5728-linq-\u4e2d\u4f7f\u7528-\u6807\u91cf\u51fd\u6570",children:[{value:"9.14.4.1 \u521b\u5efa\u6807\u91cf\u51fd\u6570",id:"91441-\u521b\u5efa\u6807\u91cf\u51fd\u6570",children:[]},{value:"9.14.4.2 \u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5",id:"91442-\u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5",children:[]},{value:"9.14.4.3 \u5728 Linq \u4e2d\u4f7f\u7528",id:"91443-\u5728-linq-\u4e2d\u4f7f\u7528",children:[]}]},{value:"9.14.5 \u5728 Linq \u4e2d\u4f7f\u7528 \u8868\u503c\u51fd\u6570",id:"9145-\u5728-linq-\u4e2d\u4f7f\u7528-\u8868\u503c\u51fd\u6570",children:[{value:"9.14.5.1 \u521b\u5efa\u8868\u503c\u51fd\u6570",id:"91451-\u521b\u5efa\u8868\u503c\u51fd\u6570",children:[]},{value:"9.14.5.2 \u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b",id:"91452-\u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b",children:[]},{value:"9.14.5.3 \u8868\u503c\u51fd\u6570\u914d\u7f6e",id:"91453-\u8868\u503c\u51fd\u6570\u914d\u7f6e",children:[]},{value:"9.14.5.4 \u5728 Linq \u4e2d\u4f7f\u7528",id:"91454-\u5728-linq-\u4e2d\u4f7f\u7528",children:[]}]},{value:"9.14.6 \u5728 EF Core \u5185\u7f6e\u51fd\u6570",id:"9146-\u5728-ef-core-\u5185\u7f6e\u51fd\u6570",children:[]},{value:"9.14.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9147-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:d};function p(e){var t=e.components,n=Object(c.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)(b.a,{mdxType:"JoinGroup"}),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/dbcontext-sql-proxy"}),"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002",Object(r.b)("inlineCode",{parentName:"p"},"Sql \u9ad8\u7ea7\u4ee3\u7406")," \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002"))),Object(r.b)("h2",{id:"9141-\u6570\u636e\u5e93\u51fd\u6570"},"9.14.1 \u6570\u636e\u5e93\u51fd\u6570"),Object(r.b)("p",null,"\u5f15\u7528\u767e\u5ea6\u767e\u79d1\uff1a"),Object(r.b)("blockquote",null,Object(r.b)("p",{parentName:"blockquote"},"\u6570\u636e\u5e93\u51fd\u6570\u662f\u6307\u5f53\u9700\u8981\u5206\u6790\u6570\u636e\u6e05\u5355\u4e2d\u7684\u6570\u503c\u662f\u5426\u7b26\u5408\u7279\u5b9a\u6761\u4ef6\u65f6\uff0c\u4f7f\u7528\u6570\u636e\u5e93\u5de5\u4f5c\u8868\u51fd\u6570\u3002")),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u6570\u636e\u5e93\u51fd\u6570\u5c31\u662f\u7528\u4e8e\u5b50\u8ba1\u7b97\u7684\u51fd\u6570\u3002\u5176\u8ba1\u7b97\u7684\u7ed3\u679c\u53ef\u4ee5\u7528\u4e8e\u6784\u5efa ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u3002"),Object(r.b)("h3",{id:"91411-\u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93"},"9.14.1.1 \u652f\u6301\u6807\u91cf\u51fd\u6570\u7684\u6570\u636e\u5e93"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}))))),Object(r.b)("h3",{id:"91412-\u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93"},"9.14.1.2 \u652f\u6301\u8868\u503c\u51fd\u6570\u7684\u6570\u636e\u5e93"),Object(r.b)("table",null,Object(r.b)("thead",{parentName:"table"},Object(r.b)("tr",{parentName:"thead"},Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"SqlServer"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Sqlite"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Cosmos"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"InMemoryDatabase"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"MySql"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"PostgreSQL"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Oracle"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Firebird"),Object(r.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"Dm"))),Object(r.b)("tbody",{parentName:"table"},Object(r.b)("tr",{parentName:"tbody"},Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u2714"),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null})),Object(r.b)("td",Object(a.a)({parentName:"tr"},{align:null}))))),Object(r.b)("h2",{id:"9142-\u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b"},"9.14.2 \u6570\u636e\u5e93\u51fd\u6570\u7c7b\u578b"),Object(r.b)("p",null,"\u5728\u5173\u7cfb\u578b\u6570\u636e\u5e93\u4e2d\uff0c\u6570\u636e\u5e93\u51fd\u6570\u6709\u8fd9\u4e24\u79cd\u7c7b\u578b\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u6807\u91cf\u51fd\u6570"),"\uff1a\u53ea\u80fd\u8fd4\u56de\u5355\u4e2a\u503c"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8868\u503c\u51fd\u6570"),"\uff1a\u53ea\u80fd\u8fd4\u56de\u4e00\u4e2a\u7ed3\u679c\u96c6")),Object(r.b)("h2",{id:"9143-\u51fd\u6570\u7684\u4f7f\u7528"},"9.14.3 \u51fd\u6570\u7684\u4f7f\u7528"),Object(r.b)("h3",{id:"91431-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-object"},"9.14.3.1 \u6807\u91cf\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"object")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionScalar("func_GetValue");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetValue(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionScalar("func_GetValue");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionScalar("func_GetValue");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetValue".SqlFunctionScalar();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h3",{id:"91432-\u6807\u91cf\u51fd\u6570\u8fd4\u56de-t"},"9.14.3.2 \u6807\u91cf\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"T")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionScalar("func_GetValue");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetValue(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionScalar("func_GetValue");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionScalar("func_GetValue");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetValue".SqlFunctionScalar();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h3",{id:"91433-\u8868\u503c\u51fd\u6570\u8fd4\u56de-datatable"},"9.14.3.3 \u8868\u503c\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionQuery("func_GetTable");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetTable(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionQuery("func_GetTable");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionQuery("func_GetTable");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetTable".SqlFunctionQuery();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h3",{id:"91434-\u8868\u503c\u51fd\u6570\u8fd4\u56de-listt"},"9.14.3.4 \u8868\u503c\u51fd\u6570\u8fd4\u56de ",Object(r.b)("inlineCode",{parentName:"h3"},"List")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// ISqlRepository \u65b9\u6cd5\nvar value = _sqlRepository.SqlFunctionQuery("func_GetTable");\n\n// ISqlDispatchProxy \u65b9\u5f0f\nvar value = _sqlExecuteProxy.GetTable(); // \u63a8\u8350\u65b9\u5f0f\n\n// \u5b9e\u4f53\u4ed3\u50a8\u65b9\u5f0f\nvar value = _personRepository.SqlFunctionQuery("func_GetTable");\n\n// IRepository \u975e\u6cdb\u578b\u65b9\u5f0f\nvar value = _repository.Sql().SqlFunctionQuery("func_GetTable");\n\n// \u53d8\u6001\u61d2\u4eba\u65b9\u5f0f\uff0c\u76f4\u63a5\u901a\u8fc7\u51fd\u6570\u540d\u6267\u884c\nvar value = "func_GetTable".SqlFunctionQuery();\n')),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5173\u4e8e\u5f02\u6b65")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u6bcf\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u90fd\u652f\u6301\u5f02\u6b65\u65b9\u5f0f\uff0c\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u5c31\u4e0d\u5217\u4e3e\u5f02\u6b65\u65b9\u5f0f\u4e86\u3002"))),Object(r.b)("h2",{id:"9144-\u5728-linq-\u4e2d\u4f7f\u7528-\u6807\u91cf\u51fd\u6570"},"9.14.4 \u5728 ",Object(r.b)("inlineCode",{parentName:"h2"},"Linq")," \u4e2d\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"h2"},"\u6807\u91cf\u51fd\u6570")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u7075\u6d3b\u7684\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u4e2d\u4f7f\u7528\u6807\u91cf\u51fd\u6570\u7684\u65b9\u6cd5\u3002\u5982\u679c\u50cf\u4f7f\u7528\u8fd9\u6837\u7684\u65b9\u5f0f\uff0c\u9700\u8981\u6ee1\u8db3\u4ee5\u4e0b\u4e24\u4e2a\u6761\u4ef6\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u6807\u91cf\u51fd\u6570\u5fc5\u987b\u5b9a\u4e49\u5728",Object(r.b)("strong",{parentName:"li"},"\u516c\u5f00\u9759\u6001\u7c7b"),"\u4e2d\uff0c\u4e14\u81ea\u5df1\u4e5f\u662f",Object(r.b)("strong",{parentName:"li"},"\u516c\u5f00\u9759\u6001\u65b9\u6cd5")),Object(r.b)("li",{parentName:"ul"},"\u8be5",Object(r.b)("strong",{parentName:"li"},"\u516c\u5f00\u9759\u6001\u65b9\u6cd5"),"\u5fc5\u987b\u8d34\u6709 ",Object(r.b)("inlineCode",{parentName:"li"},"[QueryableFunction]")," \u7279\u6027")),Object(r.b)("p",null,"\u793a\u4f8b\u5982\u4e0b\uff1a"),Object(r.b)("h3",{id:"91441-\u521b\u5efa\u6807\u91cf\u51fd\u6570"},"9.14.4.1 \u521b\u5efa\u6807\u91cf\u51fd\u6570"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"CREATE FUNCTION FN_GetId\n(\n @id INT\n)\nRETURNS INT\nAS\nBEGIN\n RETURN @id + 1;\nEND;\n")),Object(r.b)("h3",{id:"91442-\u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5"},"9.14.4.2 \u521b\u5efa\u9759\u6001\u7c7b\u548c\u9759\u6001\u65b9\u6cd5"),Object(r.b)("p",null,"\u521b\u5efa\u9759\u6001\u7c7b\uff0c\u5982 ",Object(r.b)("inlineCode",{parentName:"p"},"QueryFunctions"),"\uff0c\u5c06\u8be5 ",Object(r.b)("inlineCode",{parentName:"p"},"\u6807\u91cf\u51fd\u6570")," \u653e\u5728\u9759\u6001\u7c7b\u4e2d\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1, 7, 10-11}","{1,":!0,"7,":!0,"10-11}":!0}),'using Furion.DatabaseAccessor;\nusing System;\n\nnamespace Furion.Application\n{\n // \u5fc5\u987b\u662f\u516c\u5f00\u9759\u6001\u7684\n public static class QueryFunctions\n {\n // \u5fc5\u987b\u662f\u9759\u6001\u65b9\u6cd5\n [QueryableFunction("FN_GetId", "dbo")] // \u914d\u7f6e\u6807\u91cf\u51fd\u6570\n public static int GetId(int id) => throw new NotSupportedException();\n }\n}\n')),Object(r.b)("h3",{id:"91443-\u5728-linq-\u4e2d\u4f7f\u7528"},"9.14.4.3 \u5728 ",Object(r.b)("inlineCode",{parentName:"h3"},"Linq")," \u4e2d\u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_personRepository.Where(u => u.Id > QueryFunctions.GetId(1)).ToList();\n")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"SELECT [p].[Id], [p].[Address], [p].[Age], [p].[CreatedTime], [p].[IsDeleted], [p].[Name], [p].[UpdatedTime]\nFROM [Person] AS [p]\nWHERE [p].[Id] > [dbo].[FN_GetId](1) // \ud83d\udca5 \u6ce8\u610f\u8fd9\u91cc\n")),Object(r.b)("img",{src:Object(i.a)("img/fn1.png")}),Object(r.b)("h2",{id:"9145-\u5728-linq-\u4e2d\u4f7f\u7528-\u8868\u503c\u51fd\u6570"},"9.14.5 \u5728 ",Object(r.b)("inlineCode",{parentName:"h2"},"Linq")," \u4e2d\u4f7f\u7528 ",Object(r.b)("inlineCode",{parentName:"h2"},"\u8868\u503c\u51fd\u6570")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"EF Core 5.0")," \u7248\u672c\u652f\u6301\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u4e2d\u64cd\u4f5c ",Object(r.b)("inlineCode",{parentName:"p"},"\u8868\u503c\u51fd\u6570"),"\uff0c\u64cd\u4f5c\u6709\u70b9\u7c7b\u4f3c ",Object(r.b)("inlineCode",{parentName:"p"},"\u89c6\u56fe\u64cd\u4f5c")),Object(r.b)("p",null,"\u793a\u4f8b\u5982\u4e0b\uff1a"),Object(r.b)("h3",{id:"91451-\u521b\u5efa\u8868\u503c\u51fd\u6570"},"9.14.5.1 \u521b\u5efa\u8868\u503c\u51fd\u6570"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"CREATE FUNCTION dbo.GetPersons\n(\n @id INT\n)\nRETURNS TABLE\nAS\nRETURN\n(\n SELECT Id,\n Name,\n Age,\n Address\n FROM dbo.Person\n WHERE Id > @id\n);\n")),Object(r.b)("h3",{id:"91452-\u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b"},"9.14.5.2 \u521b\u5efa\u8868\u503c\u51fd\u6570\u6a21\u578b"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"namespace Furion.Core\n{\n public class F_Person\n {\n /// \n /// \u4e3b\u952eId\n /// \n public int Id { get; set; }\n\n /// \n /// \u59d3\u540d\n /// \n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n }\n}\n")),Object(r.b)("h3",{id:"91453-\u8868\u503c\u51fd\u6570\u914d\u7f6e"},"9.14.5.3 \u8868\u503c\u51fd\u6570\u914d\u7f6e"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContext")," \u7c7b\u4e2d\u5b9a\u4e49\u65b9\u6cd5\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3,10,20-21}","{3,10,20-21}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing System.Linq;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class FurDbContext : AppDbContext\n {\n public IQueryable GetPersons(int id) => FromExpression(() => GetPersons(id));\n\n public FurDbContext(DbContextOptions options) : base(options)\n {\n }\n\n protected override void OnModelCreating(ModelBuilder modelBuilder)\n {\n base.OnModelCreating(modelBuilder);\n\n modelBuilder.Entity(typeof(F_Person)).HasNoKey();\n modelBuilder.HasDbFunction(() => GetPersons(default));\n }\n }\n}\n')),Object(r.b)("h3",{id:"91454-\u5728-linq-\u4e2d\u4f7f\u7528"},"9.14.5.4 \u5728 ",Object(r.b)("inlineCode",{parentName:"h3"},"Linq")," \u4e2d\u4f7f\u7528"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'IQueryable query = _repository.DynamicDbContext.GetPersons(1);\nvar result = query.Where(u => u.Name.Equals("Furion")).ToList();\n')),Object(r.b)("p",null,"\u6700\u7ec8\u751f\u6210 ",Object(r.b)("inlineCode",{parentName:"p"},"Sql")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"SELECT [g].Id, [g].Name, [g].Age, [g].Address\nFROM dbo.GetPersons(1) AS [g]\nWHERE [g].Name == N'Furion';\n")),Object(r.b)("h2",{id:"9146-\u5728-ef-core-\u5185\u7f6e\u51fd\u6570"},"9.14.6 \u5728 ",Object(r.b)("inlineCode",{parentName:"h2"},"EF Core")," \u5185\u7f6e\u51fd\u6570"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"EF Core")," \u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u5f88\u591a\u5e38\u7528\u7684\u5185\u7f6e\u51fd\u6570\uff0c\u53ef\u4ee5\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Lambda")," \u6761\u4ef6\u4e2d\u4f7f\u7528\uff0c\u4e3b\u8981\u662f\u901a\u8fc7 EF.Functions \u8c03\u7528\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"_repository.Where(u => EF.Functions.DateDiffHour(u.CreatedDt, DateTime.Now) > 8).FirstOrDefault();\n")),Object(r.b)("p",null,"\u8fd9\u4e2a\u8bed\u53e5\u4f7f\u7528\u4e86 EF.Functions.DateDiffHour \u6700\u7ec8\u751f\u6210\u7684 Sql \u5982\u4e0b\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"SELECT TOP(1) [a].*\nFROM [dbo].[TEST] AS [a]\nWHERE DATEDIFF(HOUR, [a].[CREATED_DT], GETDATE()) > 8\n")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"EF Core")," \u5185\u7f6e\u51fd\u6570\u5c31\u4e0d\u4e00\u4e00\u5217\u51fa\u4e86\uff0c\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"EF.Functions")," \u67e5\u770b\u66f4\u591a\uff0c\u5982\u679c\u4e0d\u80fd\u6ee1\u8db3\u81ea\u5df1\u7684\u9700\u6c42\uff0c\u90a3\u4e48\u53ef\u4ee5\u81ea\u5b9a\u4e49 ",Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u6807\u91cf\u51fd\u6570"),Object(r.b)("h2",{id:"9147-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.14.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return b}));var a=n(21),c=n(195);function r(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(c.b)(n))return n;if(a)return t+n;const b=n.startsWith(t)?n:t+n.replace(/^\//,"");return r?e+b:b}(t,e,n,a)}}function b(e,t={}){const{withBaseUrl:n}=r();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return O}));var a=n(0),c=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function i(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var o=c.a.createContext({}),d=function(e){var t=c.a.useContext(o),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=d(e.components);return c.a.createElement(o.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},u=c.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,b=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=d(n),u=a,O=s["".concat(b,".").concat(u)]||s[u]||p[u]||r;return n?c.a.createElement(O,i(i({ref:t},o),{},{components:n})):c.a.createElement(O,i({ref:t},o))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,b=new Array(r);b[0]=u;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:a,b[1]=i;for(var o=2;ot(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/a60e04e4.cba14b2a.js b/docs/a60e04e4.cba14b2a.js new file mode 100644 index 00000000000..2664a59fc9d --- /dev/null +++ b/docs/a60e04e4.cba14b2a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{147:function(a){a.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"upload","name":"upload","count":1,"permalink":"/blog/tags/upload"}')}}]); \ No newline at end of file diff --git a/docs/a650eb61.9351d71c.js b/docs/a650eb61.478a170e.js similarity index 92% rename from docs/a650eb61.9351d71c.js rename to docs/a650eb61.478a170e.js index f53a6d2fff1..13ea5b1211d 100644 --- a/docs/a650eb61.9351d71c.js +++ b/docs/a650eb61.478a170e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[68],{144:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return p}));var r=n(3),i=n(7),a=(n(0),n(192)),o=n(193),c={id:"localizationsettings",title:"8. \u591a\u8bed\u8a00\u914d\u7f6e",sidebar_label:"8. \u591a\u8bed\u8a00\u914d\u7f6e"},u={unversionedId:"settings/localizationsettings",id:"settings/localizationsettings",isDocsHomePage:!1,title:"8. \u591a\u8bed\u8a00\u914d\u7f6e",description:"8.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\localizationsettings.mdx",slug:"/settings/localizationsettings",permalink:"/docs/settings/localizationsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/localizationsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"8. \u591a\u8bed\u8a00\u914d\u7f6e",sidebar:"settings",previous:{title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",permalink:"/docs/settings/specificationdocumentsettings"}},l=[{value:"8.1 \u5173\u4e8e\u914d\u7f6e",id:"81-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"8.2 \u914d\u7f6e\u4fe1\u606f",id:"82-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"8.3 \u914d\u7f6e\u793a\u4f8b",id:"83-\u914d\u7f6e\u793a\u4f8b",children:[]}],s={toc:l};function p(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"81-\u5173\u4e8e\u914d\u7f6e"},"8.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u591a\u8bed\u8a00\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5168\u7403\u5316\u548c\u672c\u5730\u5316\u9009\u9879\u3002"),Object(a.b)("h2",{id:"82-\u914d\u7f6e\u4fe1\u606f"},"8.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"LocalizationSettings")," \u591a\u8bed\u8a00\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ResourcesPath"),"\uff1a\u8d44\u6e90\u76ee\u5f55\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Resources")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SupportedCultures"),"\uff1a\u652f\u6301\u7684\u8bed\u8a00\u533a\u57df\u7801\u7c7b\u522b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultCulture"),"\uff1a\u9ed8\u8ba4\u8bed\u8a00\u533a\u57df\u7801\uff0c\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u53d6 ",Object(a.b)("inlineCode",{parentName:"li"},"SupportedCultures")," \u7b2c\u4e00\u9879")))),Object(a.b)("h2",{id:"83-\u914d\u7f6e\u793a\u4f8b"},"8.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json",metastring:"{2,3}","{2,3}":!0}),'{\n "LocalizationSettings": {\n "SupportedCultures": ["zh-CN", "en-US"], // \u914d\u7f6e\u652f\u6301\u7684\u8bed\u8a00\u5217\u8868\n "DefaultCulture": "zh-CN" // \u914d\u7f6e\u9ed8\u8ba4\u8bed\u8a00\uff0c\u5982\u679c\u4e0d\u914d\u7f6e\uff0c\u53d6 SupportedCultures \u7684\u7b2c\u4e00\u9879\n }\n}\n')))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=i.a.createContext({}),s=function(e){var t=i.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=s(e.components);return i.a.createElement(l.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),p=s(n),d=r,f=p["".concat(o,".").concat(d)]||p[d]||b[d]||a;return n?i.a.createElement(f,c(c({ref:t},l),{},{components:n})):i.a.createElement(f,c({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var u in t)hasOwnProperty.call(t,u)&&(c[u]=t[u]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{148:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return p}));var r=n(3),i=n(7),a=(n(0),n(196)),o=n(197),c={id:"localizationsettings",title:"8. \u591a\u8bed\u8a00\u914d\u7f6e",sidebar_label:"8. \u591a\u8bed\u8a00\u914d\u7f6e"},u={unversionedId:"settings/localizationsettings",id:"settings/localizationsettings",isDocsHomePage:!1,title:"8. \u591a\u8bed\u8a00\u914d\u7f6e",description:"8.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\localizationsettings.mdx",slug:"/settings/localizationsettings",permalink:"/docs/settings/localizationsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/localizationsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"8. \u591a\u8bed\u8a00\u914d\u7f6e",sidebar:"settings",previous:{title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",permalink:"/docs/settings/specificationdocumentsettings"}},l=[{value:"8.1 \u5173\u4e8e\u914d\u7f6e",id:"81-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"8.2 \u914d\u7f6e\u4fe1\u606f",id:"82-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"8.3 \u914d\u7f6e\u793a\u4f8b",id:"83-\u914d\u7f6e\u793a\u4f8b",children:[]}],s={toc:l};function p(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"81-\u5173\u4e8e\u914d\u7f6e"},"8.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u591a\u8bed\u8a00\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5168\u7403\u5316\u548c\u672c\u5730\u5316\u9009\u9879\u3002"),Object(a.b)("h2",{id:"82-\u914d\u7f6e\u4fe1\u606f"},"8.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"LocalizationSettings")," \u591a\u8bed\u8a00\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ResourcesPath"),"\uff1a\u8d44\u6e90\u76ee\u5f55\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Resources")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SupportedCultures"),"\uff1a\u652f\u6301\u7684\u8bed\u8a00\u533a\u57df\u7801\u7c7b\u522b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string[]")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultCulture"),"\uff1a\u9ed8\u8ba4\u8bed\u8a00\u533a\u57df\u7801\uff0c\u5982\u679c\u4e3a\u7a7a\uff0c\u5219\u53d6 ",Object(a.b)("inlineCode",{parentName:"li"},"SupportedCultures")," \u7b2c\u4e00\u9879")))),Object(a.b)("h2",{id:"83-\u914d\u7f6e\u793a\u4f8b"},"8.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json",metastring:"{2,3}","{2,3}":!0}),'{\n "LocalizationSettings": {\n "SupportedCultures": ["zh-CN", "en-US"], // \u914d\u7f6e\u652f\u6301\u7684\u8bed\u8a00\u5217\u8868\n "DefaultCulture": "zh-CN" // \u914d\u7f6e\u9ed8\u8ba4\u8bed\u8a00\uff0c\u5982\u679c\u4e0d\u914d\u7f6e\uff0c\u53d6 SupportedCultures \u7684\u7b2c\u4e00\u9879\n }\n}\n')))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var l=i.a.createContext({}),s=function(e){var t=i.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},p=function(e){var t=s(e.components);return i.a.createElement(l.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),p=s(n),d=r,f=p["".concat(o,".").concat(d)]||p[d]||b[d]||a;return n?i.a.createElement(f,c(c({ref:t},l),{},{components:n})):i.a.createElement(f,c({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var u in t)hasOwnProperty.call(t,u)&&(c[u]=t[u]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/a688d5cc.51b5e80d.js b/docs/a688d5cc.4c0b15a0.js similarity index 90% rename from docs/a688d5cc.51b5e80d.js rename to docs/a688d5cc.4c0b15a0.js index ac35d38ebe2..6fde7917261 100644 --- a/docs/a688d5cc.51b5e80d.js +++ b/docs/a688d5cc.4c0b15a0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[69],{145:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(3),o=n(7),a=(n(0),n(192)),c=n(193),i={id:"devops",title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",sidebar_label:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210"},u={unversionedId:"devops",id:"devops",isDocsHomePage:!1,title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863",source:"@site/docs\\devops.mdx",slug:"/devops",permalink:"/docs/devops",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/devops.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",sidebar:"docs",previous:{title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",permalink:"/docs/virtual-deploy"},next:{title:"29.1 \u5355\u5143\u6d4b\u8bd5",permalink:"/docs/unittest"}},s=[],p={toc:s};function l(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("p",{parentName:"li"},"docker\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/dockerrongqihua"}),"https://monksoul.gitbook.io/hoa/dockerrongqihua"))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("p",{parentName:"li"},"Jenkins\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/devopschixubushujicheng"}),"https://monksoul.gitbook.io/hoa/devopschixubushujicheng")))))}l.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(n),b=r,d=l["".concat(c,".").concat(b)]||l[b]||f[b]||a;return n?o.a.createElement(d,i(i({ref:t},s),{},{components:n})):o.a.createElement(d,i({ref:t},s))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=b;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{149:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(3),o=n(7),a=(n(0),n(196)),c=n(197),i={id:"devops",title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",sidebar_label:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210"},u={unversionedId:"devops",id:"devops",isDocsHomePage:!1,title:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863",source:"@site/docs\\devops.mdx",slug:"/devops",permalink:"/docs/devops",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/devops.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210",sidebar:"docs",previous:{title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",permalink:"/docs/virtual-deploy"},next:{title:"29.1 \u5355\u5143\u6d4b\u8bd5",permalink:"/docs/unittest"}},s=[],p={toc:s};function l(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("p",{parentName:"li"},"docker\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/dockerrongqihua"}),"https://monksoul.gitbook.io/hoa/dockerrongqihua"))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("p",{parentName:"li"},"Jenkins\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/devopschixubushujicheng"}),"https://monksoul.gitbook.io/hoa/devopschixubushujicheng")))))}l.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},b=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(n),b=r,d=l["".concat(c,".").concat(b)]||l[b]||f[b]||a;return n?o.a.createElement(d,i(i({ref:t},s),{},{components:n})):o.a.createElement(d,i({ref:t},s))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=b;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/a6aa9e1f.e19e9c1e.js b/docs/a6aa9e1f.c130c57b.js similarity index 87% rename from docs/a6aa9e1f.e19e9c1e.js rename to docs/a6aa9e1f.c130c57b.js index 3542b3d5842..6c15d8b5b93 100644 --- a/docs/a6aa9e1f.e19e9c1e.js +++ b/docs/a6aa9e1f.c130c57b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[70],{187:function(a,e,t){"use strict";t.r(e);var n=t(0),i=t.n(n),l=t(21),r=t(203),c=t(230),m=t(198);var s=function(a){const{metadata:e}=a,{previousPage:t,nextPage:n}=e;return i.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog list page navigation"},i.a.createElement("div",{className:"pagination-nav__item"},t&&i.a.createElement(m.a,{className:"pagination-nav__link",to:t},i.a.createElement("div",{className:"pagination-nav__label"},"\xab Newer Entries"))),i.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},n&&i.a.createElement(m.a,{className:"pagination-nav__link",to:n},i.a.createElement("div",{className:"pagination-nav__label"},"Older Entries \xbb"))))},o=t(210);e.default=function(a){const{metadata:e,items:t,sidebar:n}=a,{siteConfig:{title:m}}=Object(l.default)(),{blogDescription:d,blogTitle:p,permalink:v}=e,g="/"===v?m:p;return i.a.createElement(r.a,{title:g,description:d,wrapperClassName:"blog-wrapper"},i.a.createElement("div",{className:"container margin-vert--lg"},i.a.createElement("div",{className:"row"},i.a.createElement("div",{className:"col col--2"},i.a.createElement(o.a,{sidebar:n})),i.a.createElement("main",{className:"col col--8"},t.map(({content:a})=>i.a.createElement(c.a,{key:a.metadata.permalink,frontMatter:a.frontMatter,metadata:a.metadata,truncated:a.metadata.truncated},i.a.createElement(a,null))),i.a.createElement(s,{metadata:e})))))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{191:function(a,e,t){"use strict";t.r(e);var n=t(0),i=t.n(n),l=t(21),r=t(207),c=t(234),m=t(202);var s=function(a){const{metadata:e}=a,{previousPage:t,nextPage:n}=e;return i.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog list page navigation"},i.a.createElement("div",{className:"pagination-nav__item"},t&&i.a.createElement(m.a,{className:"pagination-nav__link",to:t},i.a.createElement("div",{className:"pagination-nav__label"},"\xab Newer Entries"))),i.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},n&&i.a.createElement(m.a,{className:"pagination-nav__link",to:n},i.a.createElement("div",{className:"pagination-nav__label"},"Older Entries \xbb"))))},o=t(214);e.default=function(a){const{metadata:e,items:t,sidebar:n}=a,{siteConfig:{title:m}}=Object(l.default)(),{blogDescription:d,blogTitle:p,permalink:v}=e,g="/"===v?m:p;return i.a.createElement(r.a,{title:g,description:d,wrapperClassName:"blog-wrapper"},i.a.createElement("div",{className:"container margin-vert--lg"},i.a.createElement("div",{className:"row"},i.a.createElement("div",{className:"col col--2"},i.a.createElement(o.a,{sidebar:n})),i.a.createElement("main",{className:"col col--8"},t.map(({content:a})=>i.a.createElement(c.a,{key:a.metadata.permalink,frontMatter:a.frontMatter,metadata:a.metadata,truncated:a.metadata.truncated},i.a.createElement(a,null))),i.a.createElement(s,{metadata:e})))))}}}]); \ No newline at end of file diff --git a/docs/a74774ac.e3ffc641.js b/docs/a74774ac.6999095f.js similarity index 98% rename from docs/a74774ac.e3ffc641.js rename to docs/a74774ac.6999095f.js index d39f0241e2c..0c5cdcfb880 100644 --- a/docs/a74774ac.e3ffc641.js +++ b/docs/a74774ac.6999095f.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{146:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),i=(n(0),n(192)),o=n(193),c={id:"logging",title:"18. \u65e5\u5fd7\u8bb0\u5f55",sidebar_label:"18. \u65e5\u5fd7\u8bb0\u5f55"},l={unversionedId:"logging",id:"logging",isDocsHomePage:!1,title:"18. \u65e5\u5fd7\u8bb0\u5f55",description:"18.1 \u5173\u4e8e\u65e5\u5fd7",source:"@site/docs\\logging.mdx",slug:"/logging",permalink:"/docs/logging",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/logging.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"18. \u65e5\u5fd7\u8bb0\u5f55",sidebar:"docs",previous:{title:"17. \u89c6\u56fe\u5f15\u64ce",permalink:"/docs/view-engine"},next:{title:"19. \u8fdc\u7a0b\u8bf7\u6c42",permalink:"/docs/http"}},b=[{value:"18.1 \u5173\u4e8e\u65e5\u5fd7",id:"181-\u5173\u4e8e\u65e5\u5fd7",children:[]},{value:"18.2 \u65e5\u5fd7\u4f5c\u7528",id:"182-\u65e5\u5fd7\u4f5c\u7528",children:[]},{value:"18.3 \u65e5\u5fd7\u7ea7\u522b",id:"183-\u65e5\u5fd7\u7ea7\u522b",children:[]},{value:"18.4 \u5982\u4f55\u4f7f\u7528",id:"184-\u5982\u4f55\u4f7f\u7528",children:[{value:"18.4.1 ILogger<T> \u6cdb\u578b\u65b9\u5f0f",id:"1841-iloggert-\u6cdb\u578b\u65b9\u5f0f",children:[]},{value:"18.4.2 ILoggerFactory \u5de5\u5382\u65b9\u5f0f",id:"1842-iloggerfactory-\u5de5\u5382\u65b9\u5f0f",children:[]},{value:"18.4.3 \u61d2\u4eba\u6a21\u5f0f \ud83d\ude01",id:"1843-\u61d2\u4eba\u6a21\u5f0f-",children:[]}]},{value:"18.5 \u5199\u5165\u5176\u4ed6\u4ecb\u8d28",id:"185-\u5199\u5165\u5176\u4ed6\u4ecb\u8d28",children:[{value:"18.5.1 Serilog \u62d3\u5c55\u5305\u4f7f\u7528",id:"1851-serilog-\u62d3\u5c55\u5305\u4f7f\u7528",children:[]},{value:"18.5.2 \u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7",id:"1852-\u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7",children:[]}]},{value:"18.6 \u65e5\u5fd7\u793a\u4f8b",id:"186-\u65e5\u5fd7\u793a\u4f8b",children:[]},{value:"18.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"187-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:b};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"181-\u5173\u4e8e\u65e5\u5fd7"},"18.1 \u5173\u4e8e\u65e5\u5fd7"),Object(i.b)("p",null,"\u901a\u5e38\u65e5\u5fd7\u6307\u7684\u662f",Object(i.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u65e5\u5fd7"),"\u548c",Object(i.b)("strong",{parentName:"p"},"\u7a0b\u5e8f\u65e5\u5fd7"),"\u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u65e5\u5fd7")," \u662f\u8bb0\u5f55\u7cfb\u7edf\u4e2d\u786c\u4ef6\u3001\u8f6f\u4ef6\u548c\u7cfb\u7edf\u95ee\u9898\u7684\u4fe1\u606f\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u76d1\u89c6\u7cfb\u7edf\u4e2d\u53d1\u751f\u7684\u4e8b\u4ef6\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b83\u6765\u68c0\u67e5\u9519\u8bef\u53d1\u751f\u7684\u539f\u56e0\uff0c\u6216\u8005\u5bfb\u627e\u53d7\u5230\u653b\u51fb\u65f6\u653b\u51fb\u8005\u7559\u4e0b\u7684\u75d5\u8ff9\u3002\u7cfb\u7edf\u65e5\u5fd7\u5305\u62ec\u7cfb\u7edf\u65e5\u5fd7\u3001\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7\u548c\u5b89\u5168\u65e5\u5fd7\u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u7a0b\u5e8f\u65e5\u5fd7")," \u662f\u7a0b\u5e8f\u8fd0\u884c\u4e2d\u4ea7\u751f\u7684\u65e5\u5fd7\uff0c\u901a\u5e38\u7531\u6846\u67b6\u8fd0\u884c\u65f6\u6216\u5f00\u53d1\u8005\u63d0\u4f9b\u7684\u65e5\u5fd7\u3002\u5305\u62ec\u8bf7\u6c42\u65e5\u5fd7\uff0c\u5f02\u5e38\u65e5\u5fd7\u3001\u5ba1\u8ba1\u65e5\u5fd7\u3001\u884c\u4e3a\u65e5\u5fd7\u7b49\u3002"),Object(i.b)("h2",{id:"182-\u65e5\u5fd7\u4f5c\u7528"},"18.2 \u65e5\u5fd7\u4f5c\u7528"),Object(i.b)("p",null,"\u5728\u9879\u76ee\u5f00\u53d1\u4e2d\uff0c\u90fd\u4e0d\u53ef\u907f\u514d\u7684\u4f7f\u7528\u5230\u65e5\u5fd7\u3002\u6ca1\u6709\u65e5\u5fd7\u867d\u7136\u4e0d\u4f1a\u5f71\u54cd\u9879\u76ee\u7684\u6b63\u786e\u8fd0\u884c\uff0c\u4f46\u662f\u6ca1\u6709\u65e5\u5fd7\u7684\u9879\u76ee\u53ef\u4ee5\u8bf4\u662f\u4e0d\u5b8c\u6574\u7684\u3002\u65e5\u5fd7\u5728\u8c03\u8bd5\uff0c\u9519\u8bef\u6216\u8005\u5f02\u5e38\u5b9a\u4f4d\uff0c\u6570\u636e\u5206\u6790\u4e2d\u7684\u4f5c\u7528\u662f\u4e0d\u8a00\u800c\u55bb\u7684\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u8c03\u8bd5")),Object(i.b)("p",null,"\u5728\u9879\u76ee\u8c03\u8bd5\u65f6\uff0c\u67e5\u770b\u6808\u4fe1\u606f\u53ef\u4ee5\u65b9\u4fbf\u5730\u77e5\u9053\u5f53\u524d\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u6001\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u4fbf\u4e8e\u8bb0\u5f55\u7a0b\u5e8f\u5728\u4e4b\u524d\u7684\u8fd0\u884c\u7ed3\u679c\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u9519\u8bef\u5b9a\u4f4d")),Object(i.b)("p",null,"\u4e0d\u8981\u4ee5\u4e3a\u9879\u76ee\u80fd\u6b63\u786e\u8dd1\u8d77\u6765\u5c31\u53ef\u4ee5\u9ad8\u6795\u65e0\u5fe7\uff0c\u9879\u76ee\u5728\u8fd0\u884c\u4e00\u6bb5\u65f6\u5019\u540e\uff0c\u53ef\u80fd\u7531\u4e8e\u6570\u636e\u95ee\u9898\uff0c\u7f51\u7edc\u95ee\u9898\uff0c\u5185\u5b58\u95ee\u9898\u7b49\u51fa\u73b0\u5f02\u5e38\u3002\u8fd9\u65f6\u65e5\u5fd7\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u6216\u8005\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u5b9a\u4f4d\u9519\u8bef\u4f4d\u7f6e\uff0c\u63d0\u51fa\u89e3\u51b3\u65b9\u6848\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u6570\u636e\u5206\u6790")),Object(i.b)("p",null,"\u5927\u6570\u636e\u7684\u5174\u8d77\uff0c\u4f7f\u5f97\u5927\u91cf\u7684\u65e5\u5fd7\u5206\u6790\u6210\u4e3a\u53ef\u80fd\uff0cELK \u4e5f\u8ba9\u65e5\u5fd7\u5206\u6790\u95e8\u69db\u964d\u4f4e\u4e86\u5f88\u591a\u3002\u65e5\u5fd7\u4e2d\u8574\u542b\u4e86\u5927\u91cf\u7684\u7528\u6237\u6570\u636e\uff0c\u5305\u62ec\u70b9\u51fb\u884c\u4e3a\uff0c\u5174\u8da3\u504f\u597d\u7b49\uff0c\u7528\u6237\u753b\u50cf\u5bf9\u4e8e\u516c\u53f8\u4e0b\u4e00\u6b65\u7684\u6218\u7565\u65b9\u5411\u6709\u4e00\u5b9a\u6307\u5f15\u4f5c\u7528\u3002"),Object(i.b)("h2",{id:"183-\u65e5\u5fd7\u7ea7\u522b"},"18.3 \u65e5\u5fd7\u7ea7\u522b"),Object(i.b)("p",null,"\u65e5\u5fd7\u7ea7\u522b\u53ef\u4ee5\u6709\u6548\u7684\u5bf9\u65e5\u5fd7\u4fe1\u606f\u8fdb\u884c\u5f52\u7c7b\uff0c\u65b9\u4fbf\u51c6\u786e\u7684\u67e5\u770b\u7279\u5b9a\u65e5\u5fd7\u5185\u5bb9\u3002\u901a\u5e38\u65e5\u5fd7\u7c7b\u522b\u6709\u4ee5\u4e0b\u7ea7\u522b\uff1a"),Object(i.b)("table",null,Object(i.b)("thead",{parentName:"table"},Object(i.b)("tr",{parentName:"thead"},Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u7ea7\u522b"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u503c"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u65b9\u6cd5"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u63cf\u8ff0"))),Object(i.b)("tbody",{parentName:"table"},Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Trace"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"0"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogTrace"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5305\u542b\u6700\u8be6\u7ec6\u7684\u6d88\u606f\u3002 \u8fd9\u4e9b\u6d88\u606f\u53ef\u80fd\u5305\u542b\u654f\u611f\u7684\u5e94\u7528\u6570\u636e\u3002 \u8fd9\u4e9b\u6d88\u606f\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5904\u4e8e\u7981\u7528\u72b6\u6001\uff0c\u5e76\u4e14\u4e0d\u5e94\u5728\u751f\u4ea7\u4e2d\u542f\u7528\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8c03\u8bd5"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"1"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogDebug"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u7528\u4e8e\u8c03\u8bd5\u548c\u5f00\u53d1\u3002 \u7531\u4e8e\u91cf\u5927\uff0c\u8bf7\u5728\u751f\u4ea7\u4e2d\u5c0f\u5fc3\u4f7f\u7528\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u4fe1\u606f"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"2"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogInformation"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8ddf\u8e2a\u5e94\u7528\u7684\u5e38\u89c4\u6d41\u3002 \u53ef\u80fd\u5177\u6709\u957f\u671f\u503c\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8b66\u544a"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"3"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogWarning"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5bf9\u4e8e\u5f02\u5e38\u4e8b\u4ef6\u6216\u610f\u5916\u4e8b\u4ef6\u3002 \u901a\u5e38\u5305\u62ec\u4e0d\u4f1a\u5bfc\u81f4\u5e94\u7528\u5931\u8d25\u7684\u9519\u8bef\u6216\u60c5\u51b5\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u9519\u8bef"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"4"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogError"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8868\u793a\u65e0\u6cd5\u5904\u7406\u7684\u9519\u8bef\u548c\u5f02\u5e38\u3002 \u8fd9\u4e9b\u6d88\u606f\u8868\u793a\u5f53\u524d\u64cd\u4f5c\u6216\u8bf7\u6c42\u5931\u8d25\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u5e94\u7528\u5931\u8d25\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u4e25\u91cd"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"5"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogCritical"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u9700\u8981\u7acb\u5373\u5173\u6ce8\u7684\u5931\u8d25\u3002 \u4f8b\u5982\u6570\u636e\u4e22\u5931\u3001\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u52a8\u6001"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"-"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogDynamic"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8fd0\u884c\u65f6\u52a8\u6001\u65e5\u5fd7\u57fa\u672c\uff0c\u7531 ",Object(i.b)("inlineCode",{parentName:"td"},"AppSettings:DynamicLogLevel")," \u914d\u7f6e\u51b3\u5b9a")))),Object(i.b)("h2",{id:"184-\u5982\u4f55\u4f7f\u7528"},"18.4 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},".NET 5")," \u6846\u67b6\u4e2d\uff0c\u5fae\u8f6f\u5df2\u7ecf\u4e3a\u6211\u4eec\u5185\u7f6e\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7ec4\u4ef6"),"\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u65e0\u9700\u6211\u4eec\u5f15\u7528\u7b2c\u4e09\u65b9\u5305\u8fdb\u884c\u65e5\u5fd7\u8bb0\u5f55\u3002",Object(i.b)("inlineCode",{parentName:"p"},".NET 5")," \u6846\u67b6\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4e24\u79cd\u65e5\u5fd7\u5bf9\u8c61\u521b\u5efa\u65b9\u5f0f\u3002"),Object(i.b)("h3",{id:"1841-iloggert-\u6cdb\u578b\u65b9\u5f0f"},"18.4.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"ILogger")," \u6cdb\u578b\u65b9\u5f0f"),Object(i.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ef\u4ee5\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"ILogger")," \u5bf9\u8c61\u8fdb\u884c\u6ce8\u5165\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),'public class PrivacyModel : PageModel\n{\n private readonly ILogger _logger;\n\n public PrivacyModel(ILogger logger)\n {\n _logger = logger;\n }\n\n public void OnGet()\n {\n _logger.LogInformation("GET Pages.PrivacyModel called.");\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u901a\u8fc7\u6cdb\u578b ",Object(i.b)("inlineCode",{parentName:"p"},"ILogger")," \u65b9\u5f0f\u5199\u5165\u65e5\u5fd7\uff0c\u90a3\u4e48\u9ed8\u8ba4\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"T")," \u7c7b\u578b\u5b8c\u6574\u7c7b\u578b\u540d\u79f0\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7c7b\u522b"),"\u3002"))),Object(i.b)("h3",{id:"1842-iloggerfactory-\u5de5\u5382\u65b9\u5f0f"},"18.4.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"ILoggerFactory")," \u5de5\u5382\u65b9\u5f0f"),Object(i.b)("p",null,"\u4f7f\u7528\u5de5\u5382\u65b9\u5f0f\uff0c\u9700\u624b\u52a8\u4f20\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7c7b\u522b"),"\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,7}","{5,7}":!0}),'public class ContactModel : PageModel\n{\n private readonly ILogger _logger;\n\n public ContactModel(ILoggerFactory logger)\n {\n _logger = logger.CreateLogger("MyCategory");\n }\n\n public void OnGet()\n {\n _logger.LogInformation("GET Pages.ContactModel called.");\n }\n}\n')),Object(i.b)("h3",{id:"1843-\u61d2\u4eba\u6a21\u5f0f-"},"18.4.3 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u61d2\u4eba\u6a21\u5f0f")," \ud83d\ude01"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u66f4\u61d2\u7684\u65b9\u5f0f\u5199\u5165\u65e5\u5fd7\uff0c\u4e5f\u5c31\u662f\u901a\u8fc7\u5b57\u7b26\u4e32\u62d3\u5c55\u7684\u65b9\u5f0f\u5199\u5165\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"\u767e\u5c0f\u50e7 \u65b0\u589e\u4e86\u4e00\u6761\u8bb0\u5f55".LogInformation();\n\n"\u7a0b\u5e8f\u51fa\u73b0\u5f02\u5e38\u5566".LogError();\n\n"\u8fd9\u662f\u81ea\u5b9a\u4e49\u7c7b\u522b\u65e5\u5fd7".LogInformation("\u7c7b\u522b");\n')),Object(i.b)("p",null,"\u901a\u8fc7\u5b57\u7b26\u4e32\u62d3\u5c55\u65b9\u5f0f\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u65b9\u4fbf\u8bb0\u5f55\u65e5\u5fd7\uff0c\u4e13\u95e8\u4e3a\u61d2\u4eba\u63d0\u4f9b\u7684\u3002"),Object(i.b)("h2",{id:"185-\u5199\u5165\u5176\u4ed6\u4ecb\u8d28"},"18.5 \u5199\u5165\u5176\u4ed6\u4ecb\u8d28"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},".NET 5")," \u6846\u67b6\u4e2d\u5e76\u672a\u63d0\u4f9b\u5199\u5165",Object(i.b)("inlineCode",{parentName:"p"},"\u6587\u4ef6\u3001\u6570\u636e\u5e93")," \u6216\u5176\u4ed6\u4ecb\u8d28\u7684\u63d0\u4f9b\u5668\uff0c\u9ed8\u8ba4\u53ea\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Debug\u3001Console")," \u4e24\u79cd\u65b9\u5f0f\u3002\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u9700\u8981\u5f15\u7528\u7b2c\u4e09\u65b9\u65e5\u5fd7\u7ec4\u4ef6\uff0c\u65b9\u4fbf\u6211\u4eec\u5199\u5165\u5230\u591a\u4e2a\u4ecb\u8d28\u4e2d\u3002"),Object(i.b)("p",null,"\u5728\u8fd9\u91cc\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5b98\u65b9\u63a8\u8350\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"Serilog")," \u65e5\u5fd7\u7ec4\u4ef6\uff0c\u4e3a\u6b64\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Extras.Logging.Serilog")," \u62d3\u5c55\u5305\uff0c\u65b9\u4fbf\u5feb\u901f\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u7ed3\u5408\u3002"),Object(i.b)("h3",{id:"1851-serilog-\u62d3\u5c55\u5305\u4f7f\u7528"},"18.5.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"Serilog")," \u62d3\u5c55\u5305\u4f7f\u7528"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"li"},"Furion.Extras.Logging.Serilog")," \u62d3\u5c55\u5305")),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Extras.Logging.Serilog")," \u62d3\u5c55\u5305"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5728 ",Object(i.b)("inlineCode",{parentName:"li"},"Program.cs")," \u4e2d\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"UseSerilogDefault()"))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{21}","{21}":!0}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.Inject()\n .UseStartup();\n })\n .UseSerilogDefault();\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},".UseSerilogDefault()")," \u9ed8\u8ba4\u96c6\u6210\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u53f0")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u6587\u4ef6")," \u65b9\u5f0f\u3002\u5982\u9700\u81ea\u5b9a\u4e49\u5199\u5165\uff0c\u5219\u4f20\u5165\u9700\u8981\u5199\u5165\u7684\u4ecb\u8d28\u5373\u53ef\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'.UseSerilogDefault(config =>\n{\n config.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}")\n .WriteTo.File("log.txt", rollingInterval: RollingInterval.Day, rollOnFileSizeLimit: true);\n});\n')))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u66ff\u6362 ",Object(i.b)("inlineCode",{parentName:"li"},"appsetting.json")," \u9ed8\u8ba4\u65e5\u5fd7\u5185\u5bb9")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"Logging": {\n "LogLevel": {\n "Default": "Information",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n }\n')),Object(i.b)("p",null,"\u66ff\u6362\u4e3a\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"Serilog": {\n "MinimumLevel": {\n "Default": "Information",\n "Override": {\n "System": "Warning",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n }\n }\n')),Object(i.b)("h3",{id:"1852-\u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7"},"18.5.2 \u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Serilog")," \u65e5\u5fd7\u7ec4\u4ef6\u4e5f\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u5feb\u6377\u7684\u8bf7\u6c42\u65e5\u5fd7\u4e2d\u95f4\u4ef6\uff0c\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u542f\u7528\u5373\u53ef\u3002\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n app.UseStaticFiles();\n app.UseSerilogRequestLogging(); // \u5fc5\u987b\u5728 UseStaticFiles \u548c UseRouting \u4e4b\u95f4\n app.UseRouting();\n }\n")),Object(i.b)("h2",{id:"186-\u65e5\u5fd7\u793a\u4f8b"},"18.6 \u65e5\u5fd7\u793a\u4f8b"),Object(i.b)("p",null,"\u4e0b\u9762\u4fbf\u662f\u65e5\u5fd7\u8f93\u51fa\u65e5\u5fd7\u7684\u6a21\u677f\uff0c\u652f\u6301\u5404\u79cd\u81ea\u5b9a\u4e49\u65b9\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),'2020-12-21 15:54:43.775 +08:00 [INF] Application started. Press Ctrl+C to shut down.\n2020-12-21 15:54:43.897 +08:00 [INF] Hosting environment: Development\n2020-12-21 15:54:43.899 +08:00 [INF] Content root path: D:\\MONK\\Furion\\samples\\Furion.Web.Entry\n2020-12-21 15:55:00.651 +08:00 [WRN] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development.\n2020-12-21 15:55:00.817 +08:00 [INF] Entity Framework Core 5.0.1 initialized \'DefaultDbContext\' using provider \'Microsoft.EntityFrameworkCore.Sqlite\' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled MaxPoolSize=100 MigrationsAssembly=Furion.Database.Migrations\n2020-12-21 15:55:01.711 +08:00 [WRN] Compiling a query which loads related collections for more than one collection navigation either via \'Include\' or through projection but no \'QuerySplittingBehavior\' has been configured. By default Entity Framework will use \'QuerySplittingBehavior.SingleQuery\' which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that\'s triggering this warning call \'ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning))\'\n2020-12-21 15:55:01.919 +08:00 [INF] Executed DbCommand (31ms) [Parameters=[], CommandType=\'"Text"\', CommandTimeout=\'30\']\nSELECT "p"."Id", "p"."Name", "p"."Age", "p"."Address", "p0"."PhoneNumber", "p0"."QQ", "p"."CreatedTime", "p0"."Id", "c"."Id", "c"."Name", "c"."Gender", "t"."Id", "t"."Name", "t"."PersonsId", "t"."PostsId"\nFROM "Person" AS "p"\nLEFT JOIN "PersonDetail" AS "p0" ON "p"."Id" = "p0"."PersonId"\nLEFT JOIN "Children" AS "c" ON "p"."Id" = "c"."PersonId"\nLEFT JOIN (\n SELECT "p2"."Id", "p2"."Name", "p1"."PersonsId", "p1"."PostsId"\n FROM "PersonPost" AS "p1"\n INNER JOIN "Post" AS "p2" ON "p1"."PostsId" = "p2"."Id"\n) AS "t" ON "p"."Id" = "t"."PersonsId"\nORDER BY "p"."Id", "p0"."Id", "c"."Id", "t"."PersonsId", "t"."PostsId", "t"."Id"\n2020-12-21 15:55:25.354 +08:00 [INF] Executed DbCommand (3ms) [Parameters=[], CommandType=\'"Text"\', CommandTimeout=\'30\']\nSELECT "p"."Id", "p"."Name", "p"."Age", "p"."Address", "p0"."PhoneNumber", "p0"."QQ", "p"."CreatedTime", "p0"."Id", "c"."Id", "c"."Name", "c"."Gender", "t"."Id", "t"."Name", "t"."PersonsId", "t"."PostsId"\nFROM "Person" AS "p"\nLEFT JOIN "PersonDetail" AS "p0" ON "p"."Id" = "p0"."PersonId"\nLEFT JOIN "Children" AS "c" ON "p"."Id" = "c"."PersonId"\nLEFT JOIN (\n SELECT "p2"."Id", "p2"."Name", "p1"."PersonsId", "p1"."PostsId"\n FROM "PersonPost" AS "p1"\n INNER JOIN "Post" AS "p2" ON "p1"."PostsId" = "p2"."Id"\n) AS "t" ON "p"."Id" = "t"."PersonsId"\nORDER BY "p"."Id", "p0"."Id", "c"."Id", "t"."PersonsId", "t"."PostsId", "t"."Id"\n2020-12-21 15:58:27.328 +08:00 [INF] Application started. Press Ctrl+C to shut down.\n2020-12-21 15:58:27.442 +08:00 [INF] Hosting environment: Development\n2020-12-21 15:58:27.444 +08:00 [INF] Content root path: D:\\MONK\\Furion\\samples\\Furion.Web.Entry\n2020-12-21 15:58:27.909 +08:00 [INF] HTTP GET / responded 200 in 457.0657 ms\n2020-12-21 15:58:33.336 +08:00 [INF] HTTP GET /api/index.html responded 200 in 95.9277 ms\n2020-12-21 15:58:34.187 +08:00 [INF] HTTP GET /swagger/Default/swagger.json responded 200 in 674.9800 ms\n')),Object(i.b)("h2",{id:"187-\u53cd\u9988\u4e0e\u5efa\u8bae"},"18.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/logging/?view=aspnetcore-5.0"}),"ASP.NET Core - \u65e5\u5fd7")," \u7ae0\u8282 \u548c ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://serilog.net/"}),"Serilog")," \u6587\u6863\u3002"))))}d.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var a=n(21),r=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return O}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),p=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},d=function(e){var t=p(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),d=p(n),m=a,O=d["".concat(o,".").concat(m)]||d[m]||s[m]||i;return n?r.a.createElement(O,c(c({ref:t},b),{},{components:n})):r.a.createElement(O,c({ref:t},b))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=m;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{150:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),i=(n(0),n(196)),o=n(197),c={id:"logging",title:"18. \u65e5\u5fd7\u8bb0\u5f55",sidebar_label:"18. \u65e5\u5fd7\u8bb0\u5f55"},l={unversionedId:"logging",id:"logging",isDocsHomePage:!1,title:"18. \u65e5\u5fd7\u8bb0\u5f55",description:"18.1 \u5173\u4e8e\u65e5\u5fd7",source:"@site/docs\\logging.mdx",slug:"/logging",permalink:"/docs/logging",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/logging.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"18. \u65e5\u5fd7\u8bb0\u5f55",sidebar:"docs",previous:{title:"17. \u89c6\u56fe\u5f15\u64ce",permalink:"/docs/view-engine"},next:{title:"19. \u8fdc\u7a0b\u8bf7\u6c42",permalink:"/docs/http"}},b=[{value:"18.1 \u5173\u4e8e\u65e5\u5fd7",id:"181-\u5173\u4e8e\u65e5\u5fd7",children:[]},{value:"18.2 \u65e5\u5fd7\u4f5c\u7528",id:"182-\u65e5\u5fd7\u4f5c\u7528",children:[]},{value:"18.3 \u65e5\u5fd7\u7ea7\u522b",id:"183-\u65e5\u5fd7\u7ea7\u522b",children:[]},{value:"18.4 \u5982\u4f55\u4f7f\u7528",id:"184-\u5982\u4f55\u4f7f\u7528",children:[{value:"18.4.1 ILogger<T> \u6cdb\u578b\u65b9\u5f0f",id:"1841-iloggert-\u6cdb\u578b\u65b9\u5f0f",children:[]},{value:"18.4.2 ILoggerFactory \u5de5\u5382\u65b9\u5f0f",id:"1842-iloggerfactory-\u5de5\u5382\u65b9\u5f0f",children:[]},{value:"18.4.3 \u61d2\u4eba\u6a21\u5f0f \ud83d\ude01",id:"1843-\u61d2\u4eba\u6a21\u5f0f-",children:[]}]},{value:"18.5 \u5199\u5165\u5176\u4ed6\u4ecb\u8d28",id:"185-\u5199\u5165\u5176\u4ed6\u4ecb\u8d28",children:[{value:"18.5.1 Serilog \u62d3\u5c55\u5305\u4f7f\u7528",id:"1851-serilog-\u62d3\u5c55\u5305\u4f7f\u7528",children:[]},{value:"18.5.2 \u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7",id:"1852-\u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7",children:[]}]},{value:"18.6 \u65e5\u5fd7\u793a\u4f8b",id:"186-\u65e5\u5fd7\u793a\u4f8b",children:[]},{value:"18.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"187-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:b};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"181-\u5173\u4e8e\u65e5\u5fd7"},"18.1 \u5173\u4e8e\u65e5\u5fd7"),Object(i.b)("p",null,"\u901a\u5e38\u65e5\u5fd7\u6307\u7684\u662f",Object(i.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u65e5\u5fd7"),"\u548c",Object(i.b)("strong",{parentName:"p"},"\u7a0b\u5e8f\u65e5\u5fd7"),"\u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u65e5\u5fd7")," \u662f\u8bb0\u5f55\u7cfb\u7edf\u4e2d\u786c\u4ef6\u3001\u8f6f\u4ef6\u548c\u7cfb\u7edf\u95ee\u9898\u7684\u4fe1\u606f\uff0c\u540c\u65f6\u8fd8\u53ef\u4ee5\u76d1\u89c6\u7cfb\u7edf\u4e2d\u53d1\u751f\u7684\u4e8b\u4ef6\u3002\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b83\u6765\u68c0\u67e5\u9519\u8bef\u53d1\u751f\u7684\u539f\u56e0\uff0c\u6216\u8005\u5bfb\u627e\u53d7\u5230\u653b\u51fb\u65f6\u653b\u51fb\u8005\u7559\u4e0b\u7684\u75d5\u8ff9\u3002\u7cfb\u7edf\u65e5\u5fd7\u5305\u62ec\u7cfb\u7edf\u65e5\u5fd7\u3001\u5e94\u7528\u7a0b\u5e8f\u65e5\u5fd7\u548c\u5b89\u5168\u65e5\u5fd7\u3002"),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u7a0b\u5e8f\u65e5\u5fd7")," \u662f\u7a0b\u5e8f\u8fd0\u884c\u4e2d\u4ea7\u751f\u7684\u65e5\u5fd7\uff0c\u901a\u5e38\u7531\u6846\u67b6\u8fd0\u884c\u65f6\u6216\u5f00\u53d1\u8005\u63d0\u4f9b\u7684\u65e5\u5fd7\u3002\u5305\u62ec\u8bf7\u6c42\u65e5\u5fd7\uff0c\u5f02\u5e38\u65e5\u5fd7\u3001\u5ba1\u8ba1\u65e5\u5fd7\u3001\u884c\u4e3a\u65e5\u5fd7\u7b49\u3002"),Object(i.b)("h2",{id:"182-\u65e5\u5fd7\u4f5c\u7528"},"18.2 \u65e5\u5fd7\u4f5c\u7528"),Object(i.b)("p",null,"\u5728\u9879\u76ee\u5f00\u53d1\u4e2d\uff0c\u90fd\u4e0d\u53ef\u907f\u514d\u7684\u4f7f\u7528\u5230\u65e5\u5fd7\u3002\u6ca1\u6709\u65e5\u5fd7\u867d\u7136\u4e0d\u4f1a\u5f71\u54cd\u9879\u76ee\u7684\u6b63\u786e\u8fd0\u884c\uff0c\u4f46\u662f\u6ca1\u6709\u65e5\u5fd7\u7684\u9879\u76ee\u53ef\u4ee5\u8bf4\u662f\u4e0d\u5b8c\u6574\u7684\u3002\u65e5\u5fd7\u5728\u8c03\u8bd5\uff0c\u9519\u8bef\u6216\u8005\u5f02\u5e38\u5b9a\u4f4d\uff0c\u6570\u636e\u5206\u6790\u4e2d\u7684\u4f5c\u7528\u662f\u4e0d\u8a00\u800c\u55bb\u7684\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u8c03\u8bd5")),Object(i.b)("p",null,"\u5728\u9879\u76ee\u8c03\u8bd5\u65f6\uff0c\u67e5\u770b\u6808\u4fe1\u606f\u53ef\u4ee5\u65b9\u4fbf\u5730\u77e5\u9053\u5f53\u524d\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u6001\uff0c\u8f93\u51fa\u7684\u65e5\u5fd7\u4fbf\u4e8e\u8bb0\u5f55\u7a0b\u5e8f\u5728\u4e4b\u524d\u7684\u8fd0\u884c\u7ed3\u679c\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u9519\u8bef\u5b9a\u4f4d")),Object(i.b)("p",null,"\u4e0d\u8981\u4ee5\u4e3a\u9879\u76ee\u80fd\u6b63\u786e\u8dd1\u8d77\u6765\u5c31\u53ef\u4ee5\u9ad8\u6795\u65e0\u5fe7\uff0c\u9879\u76ee\u5728\u8fd0\u884c\u4e00\u6bb5\u65f6\u5019\u540e\uff0c\u53ef\u80fd\u7531\u4e8e\u6570\u636e\u95ee\u9898\uff0c\u7f51\u7edc\u95ee\u9898\uff0c\u5185\u5b58\u95ee\u9898\u7b49\u51fa\u73b0\u5f02\u5e38\u3002\u8fd9\u65f6\u65e5\u5fd7\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u6216\u8005\u8fd0\u7ef4\u4eba\u5458\u5feb\u901f\u5b9a\u4f4d\u9519\u8bef\u4f4d\u7f6e\uff0c\u63d0\u51fa\u89e3\u51b3\u65b9\u6848\u3002"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u6570\u636e\u5206\u6790")),Object(i.b)("p",null,"\u5927\u6570\u636e\u7684\u5174\u8d77\uff0c\u4f7f\u5f97\u5927\u91cf\u7684\u65e5\u5fd7\u5206\u6790\u6210\u4e3a\u53ef\u80fd\uff0cELK \u4e5f\u8ba9\u65e5\u5fd7\u5206\u6790\u95e8\u69db\u964d\u4f4e\u4e86\u5f88\u591a\u3002\u65e5\u5fd7\u4e2d\u8574\u542b\u4e86\u5927\u91cf\u7684\u7528\u6237\u6570\u636e\uff0c\u5305\u62ec\u70b9\u51fb\u884c\u4e3a\uff0c\u5174\u8da3\u504f\u597d\u7b49\uff0c\u7528\u6237\u753b\u50cf\u5bf9\u4e8e\u516c\u53f8\u4e0b\u4e00\u6b65\u7684\u6218\u7565\u65b9\u5411\u6709\u4e00\u5b9a\u6307\u5f15\u4f5c\u7528\u3002"),Object(i.b)("h2",{id:"183-\u65e5\u5fd7\u7ea7\u522b"},"18.3 \u65e5\u5fd7\u7ea7\u522b"),Object(i.b)("p",null,"\u65e5\u5fd7\u7ea7\u522b\u53ef\u4ee5\u6709\u6548\u7684\u5bf9\u65e5\u5fd7\u4fe1\u606f\u8fdb\u884c\u5f52\u7c7b\uff0c\u65b9\u4fbf\u51c6\u786e\u7684\u67e5\u770b\u7279\u5b9a\u65e5\u5fd7\u5185\u5bb9\u3002\u901a\u5e38\u65e5\u5fd7\u7c7b\u522b\u6709\u4ee5\u4e0b\u7ea7\u522b\uff1a"),Object(i.b)("table",null,Object(i.b)("thead",{parentName:"table"},Object(i.b)("tr",{parentName:"thead"},Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u7ea7\u522b"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u503c"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:"center"}),"\u65b9\u6cd5"),Object(i.b)("th",Object(a.a)({parentName:"tr"},{align:null}),"\u63cf\u8ff0"))),Object(i.b)("tbody",{parentName:"table"},Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"Trace"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"0"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogTrace"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5305\u542b\u6700\u8be6\u7ec6\u7684\u6d88\u606f\u3002 \u8fd9\u4e9b\u6d88\u606f\u53ef\u80fd\u5305\u542b\u654f\u611f\u7684\u5e94\u7528\u6570\u636e\u3002 \u8fd9\u4e9b\u6d88\u606f\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5904\u4e8e\u7981\u7528\u72b6\u6001\uff0c\u5e76\u4e14\u4e0d\u5e94\u5728\u751f\u4ea7\u4e2d\u542f\u7528\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8c03\u8bd5"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"1"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogDebug"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u7528\u4e8e\u8c03\u8bd5\u548c\u5f00\u53d1\u3002 \u7531\u4e8e\u91cf\u5927\uff0c\u8bf7\u5728\u751f\u4ea7\u4e2d\u5c0f\u5fc3\u4f7f\u7528\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u4fe1\u606f"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"2"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogInformation"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8ddf\u8e2a\u5e94\u7528\u7684\u5e38\u89c4\u6d41\u3002 \u53ef\u80fd\u5177\u6709\u957f\u671f\u503c\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u8b66\u544a"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"3"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogWarning"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u5bf9\u4e8e\u5f02\u5e38\u4e8b\u4ef6\u6216\u610f\u5916\u4e8b\u4ef6\u3002 \u901a\u5e38\u5305\u62ec\u4e0d\u4f1a\u5bfc\u81f4\u5e94\u7528\u5931\u8d25\u7684\u9519\u8bef\u6216\u60c5\u51b5\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u9519\u8bef"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"4"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogError"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8868\u793a\u65e0\u6cd5\u5904\u7406\u7684\u9519\u8bef\u548c\u5f02\u5e38\u3002 \u8fd9\u4e9b\u6d88\u606f\u8868\u793a\u5f53\u524d\u64cd\u4f5c\u6216\u8bf7\u6c42\u5931\u8d25\uff0c\u800c\u4e0d\u662f\u6574\u4e2a\u5e94\u7528\u5931\u8d25\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u4e25\u91cd"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"5"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogCritical"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u9700\u8981\u7acb\u5373\u5173\u6ce8\u7684\u5931\u8d25\u3002 \u4f8b\u5982\u6570\u636e\u4e22\u5931\u3001\u78c1\u76d8\u7a7a\u95f4\u4e0d\u8db3\u3002")),Object(i.b)("tr",{parentName:"tbody"},Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"\u52a8\u6001"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"-"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:"center"}),"LogDynamic"),Object(i.b)("td",Object(a.a)({parentName:"tr"},{align:null}),"\u8fd0\u884c\u65f6\u52a8\u6001\u65e5\u5fd7\u57fa\u672c\uff0c\u7531 ",Object(i.b)("inlineCode",{parentName:"td"},"AppSettings:DynamicLogLevel")," \u914d\u7f6e\u51b3\u5b9a")))),Object(i.b)("h2",{id:"184-\u5982\u4f55\u4f7f\u7528"},"18.4 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},".NET 5")," \u6846\u67b6\u4e2d\uff0c\u5fae\u8f6f\u5df2\u7ecf\u4e3a\u6211\u4eec\u5185\u7f6e\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7ec4\u4ef6"),"\uff0c\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u65e0\u9700\u6211\u4eec\u5f15\u7528\u7b2c\u4e09\u65b9\u5305\u8fdb\u884c\u65e5\u5fd7\u8bb0\u5f55\u3002",Object(i.b)("inlineCode",{parentName:"p"},".NET 5")," \u6846\u67b6\u4e3a\u6211\u4eec\u63d0\u4f9b\u4e86\u4e24\u79cd\u65e5\u5fd7\u5bf9\u8c61\u521b\u5efa\u65b9\u5f0f\u3002"),Object(i.b)("h3",{id:"1841-iloggert-\u6cdb\u578b\u65b9\u5f0f"},"18.4.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"ILogger")," \u6cdb\u578b\u65b9\u5f0f"),Object(i.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ef\u4ee5\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"ILogger")," \u5bf9\u8c61\u8fdb\u884c\u6ce8\u5165\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5}","{5}":!0}),'public class PrivacyModel : PageModel\n{\n private readonly ILogger _logger;\n\n public PrivacyModel(ILogger logger)\n {\n _logger = logger;\n }\n\n public void OnGet()\n {\n _logger.LogInformation("GET Pages.PrivacyModel called.");\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u901a\u8fc7\u6cdb\u578b ",Object(i.b)("inlineCode",{parentName:"p"},"ILogger")," \u65b9\u5f0f\u5199\u5165\u65e5\u5fd7\uff0c\u90a3\u4e48\u9ed8\u8ba4\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"T")," \u7c7b\u578b\u5b8c\u6574\u7c7b\u578b\u540d\u79f0\u4f5c\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7c7b\u522b"),"\u3002"))),Object(i.b)("h3",{id:"1842-iloggerfactory-\u5de5\u5382\u65b9\u5f0f"},"18.4.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"ILoggerFactory")," \u5de5\u5382\u65b9\u5f0f"),Object(i.b)("p",null,"\u4f7f\u7528\u5de5\u5382\u65b9\u5f0f\uff0c\u9700\u624b\u52a8\u4f20\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7\u7c7b\u522b"),"\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,7}","{5,7}":!0}),'public class ContactModel : PageModel\n{\n private readonly ILogger _logger;\n\n public ContactModel(ILoggerFactory logger)\n {\n _logger = logger.CreateLogger("MyCategory");\n }\n\n public void OnGet()\n {\n _logger.LogInformation("GET Pages.ContactModel called.");\n }\n}\n')),Object(i.b)("h3",{id:"1843-\u61d2\u4eba\u6a21\u5f0f-"},"18.4.3 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u61d2\u4eba\u6a21\u5f0f")," \ud83d\ude01"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u66f4\u61d2\u7684\u65b9\u5f0f\u5199\u5165\u65e5\u5fd7\uff0c\u4e5f\u5c31\u662f\u901a\u8fc7\u5b57\u7b26\u4e32\u62d3\u5c55\u7684\u65b9\u5f0f\u5199\u5165\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"\u767e\u5c0f\u50e7 \u65b0\u589e\u4e86\u4e00\u6761\u8bb0\u5f55".LogInformation();\n\n"\u7a0b\u5e8f\u51fa\u73b0\u5f02\u5e38\u5566".LogError();\n\n"\u8fd9\u662f\u81ea\u5b9a\u4e49\u7c7b\u522b\u65e5\u5fd7".LogInformation("\u7c7b\u522b");\n')),Object(i.b)("p",null,"\u901a\u8fc7\u5b57\u7b26\u4e32\u62d3\u5c55\u65b9\u5f0f\u53ef\u4ee5\u5728\u4efb\u4f55\u65f6\u5019\u65b9\u4fbf\u8bb0\u5f55\u65e5\u5fd7\uff0c\u4e13\u95e8\u4e3a\u61d2\u4eba\u63d0\u4f9b\u7684\u3002"),Object(i.b)("h2",{id:"185-\u5199\u5165\u5176\u4ed6\u4ecb\u8d28"},"18.5 \u5199\u5165\u5176\u4ed6\u4ecb\u8d28"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},".NET 5")," \u6846\u67b6\u4e2d\u5e76\u672a\u63d0\u4f9b\u5199\u5165",Object(i.b)("inlineCode",{parentName:"p"},"\u6587\u4ef6\u3001\u6570\u636e\u5e93")," \u6216\u5176\u4ed6\u4ecb\u8d28\u7684\u63d0\u4f9b\u5668\uff0c\u9ed8\u8ba4\u53ea\u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Debug\u3001Console")," \u4e24\u79cd\u65b9\u5f0f\u3002\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u9700\u8981\u5f15\u7528\u7b2c\u4e09\u65b9\u65e5\u5fd7\u7ec4\u4ef6\uff0c\u65b9\u4fbf\u6211\u4eec\u5199\u5165\u5230\u591a\u4e2a\u4ecb\u8d28\u4e2d\u3002"),Object(i.b)("p",null,"\u5728\u8fd9\u91cc\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5b98\u65b9\u63a8\u8350\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"Serilog")," \u65e5\u5fd7\u7ec4\u4ef6\uff0c\u4e3a\u6b64\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Extras.Logging.Serilog")," \u62d3\u5c55\u5305\uff0c\u65b9\u4fbf\u5feb\u901f\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u7ed3\u5408\u3002"),Object(i.b)("h3",{id:"1851-serilog-\u62d3\u5c55\u5305\u4f7f\u7528"},"18.5.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"Serilog")," \u62d3\u5c55\u5305\u4f7f\u7528"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"li"},"Furion.Extras.Logging.Serilog")," \u62d3\u5c55\u5305")),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Core")," \u5c42\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Extras.Logging.Serilog")," \u62d3\u5c55\u5305"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5728 ",Object(i.b)("inlineCode",{parentName:"li"},"Program.cs")," \u4e2d\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"li"},"UseSerilogDefault()"))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{21}","{21}":!0}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Entry\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args)\n {\n return Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.Inject()\n .UseStartup();\n })\n .UseSerilogDefault();\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},".UseSerilogDefault()")," \u9ed8\u8ba4\u96c6\u6210\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"\u63a7\u5236\u53f0")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u6587\u4ef6")," \u65b9\u5f0f\u3002\u5982\u9700\u81ea\u5b9a\u4e49\u5199\u5165\uff0c\u5219\u4f20\u5165\u9700\u8981\u5199\u5165\u7684\u4ecb\u8d28\u5373\u53ef\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'.UseSerilogDefault(config =>\n{\n config.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}")\n .WriteTo.File("log.txt", rollingInterval: RollingInterval.Day, rollOnFileSizeLimit: true);\n});\n')))),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u66ff\u6362 ",Object(i.b)("inlineCode",{parentName:"li"},"appsetting.json")," \u9ed8\u8ba4\u65e5\u5fd7\u5185\u5bb9")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"Logging": {\n "LogLevel": {\n "Default": "Information",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n }\n')),Object(i.b)("p",null,"\u66ff\u6362\u4e3a\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'"Serilog": {\n "MinimumLevel": {\n "Default": "Information",\n "Override": {\n "System": "Warning",\n "Microsoft": "Warning",\n "Microsoft.Hosting.Lifetime": "Information",\n "Microsoft.EntityFrameworkCore": "Information"\n }\n }\n }\n')),Object(i.b)("h3",{id:"1852-\u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7"},"18.5.2 \u8bb0\u5f55\u8bf7\u6c42\u65e5\u5fd7"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Serilog")," \u65e5\u5fd7\u7ec4\u4ef6\u4e5f\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u5feb\u6377\u7684\u8bf7\u6c42\u65e5\u5fd7\u4e2d\u95f4\u4ef6\uff0c\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u542f\u7528\u5373\u53ef\u3002\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n app.UseStaticFiles();\n app.UseSerilogRequestLogging(); // \u5fc5\u987b\u5728 UseStaticFiles \u548c UseRouting \u4e4b\u95f4\n app.UseRouting();\n }\n")),Object(i.b)("h2",{id:"186-\u65e5\u5fd7\u793a\u4f8b"},"18.6 \u65e5\u5fd7\u793a\u4f8b"),Object(i.b)("p",null,"\u4e0b\u9762\u4fbf\u662f\u65e5\u5fd7\u8f93\u51fa\u65e5\u5fd7\u7684\u6a21\u677f\uff0c\u652f\u6301\u5404\u79cd\u81ea\u5b9a\u4e49\u65b9\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),'2020-12-21 15:54:43.775 +08:00 [INF] Application started. Press Ctrl+C to shut down.\n2020-12-21 15:54:43.897 +08:00 [INF] Hosting environment: Development\n2020-12-21 15:54:43.899 +08:00 [INF] Content root path: D:\\MONK\\Furion\\samples\\Furion.Web.Entry\n2020-12-21 15:55:00.651 +08:00 [WRN] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development.\n2020-12-21 15:55:00.817 +08:00 [INF] Entity Framework Core 5.0.1 initialized \'DefaultDbContext\' using provider \'Microsoft.EntityFrameworkCore.Sqlite\' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled MaxPoolSize=100 MigrationsAssembly=Furion.Database.Migrations\n2020-12-21 15:55:01.711 +08:00 [WRN] Compiling a query which loads related collections for more than one collection navigation either via \'Include\' or through projection but no \'QuerySplittingBehavior\' has been configured. By default Entity Framework will use \'QuerySplittingBehavior.SingleQuery\' which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that\'s triggering this warning call \'ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning))\'\n2020-12-21 15:55:01.919 +08:00 [INF] Executed DbCommand (31ms) [Parameters=[], CommandType=\'"Text"\', CommandTimeout=\'30\']\nSELECT "p"."Id", "p"."Name", "p"."Age", "p"."Address", "p0"."PhoneNumber", "p0"."QQ", "p"."CreatedTime", "p0"."Id", "c"."Id", "c"."Name", "c"."Gender", "t"."Id", "t"."Name", "t"."PersonsId", "t"."PostsId"\nFROM "Person" AS "p"\nLEFT JOIN "PersonDetail" AS "p0" ON "p"."Id" = "p0"."PersonId"\nLEFT JOIN "Children" AS "c" ON "p"."Id" = "c"."PersonId"\nLEFT JOIN (\n SELECT "p2"."Id", "p2"."Name", "p1"."PersonsId", "p1"."PostsId"\n FROM "PersonPost" AS "p1"\n INNER JOIN "Post" AS "p2" ON "p1"."PostsId" = "p2"."Id"\n) AS "t" ON "p"."Id" = "t"."PersonsId"\nORDER BY "p"."Id", "p0"."Id", "c"."Id", "t"."PersonsId", "t"."PostsId", "t"."Id"\n2020-12-21 15:55:25.354 +08:00 [INF] Executed DbCommand (3ms) [Parameters=[], CommandType=\'"Text"\', CommandTimeout=\'30\']\nSELECT "p"."Id", "p"."Name", "p"."Age", "p"."Address", "p0"."PhoneNumber", "p0"."QQ", "p"."CreatedTime", "p0"."Id", "c"."Id", "c"."Name", "c"."Gender", "t"."Id", "t"."Name", "t"."PersonsId", "t"."PostsId"\nFROM "Person" AS "p"\nLEFT JOIN "PersonDetail" AS "p0" ON "p"."Id" = "p0"."PersonId"\nLEFT JOIN "Children" AS "c" ON "p"."Id" = "c"."PersonId"\nLEFT JOIN (\n SELECT "p2"."Id", "p2"."Name", "p1"."PersonsId", "p1"."PostsId"\n FROM "PersonPost" AS "p1"\n INNER JOIN "Post" AS "p2" ON "p1"."PostsId" = "p2"."Id"\n) AS "t" ON "p"."Id" = "t"."PersonsId"\nORDER BY "p"."Id", "p0"."Id", "c"."Id", "t"."PersonsId", "t"."PostsId", "t"."Id"\n2020-12-21 15:58:27.328 +08:00 [INF] Application started. Press Ctrl+C to shut down.\n2020-12-21 15:58:27.442 +08:00 [INF] Hosting environment: Development\n2020-12-21 15:58:27.444 +08:00 [INF] Content root path: D:\\MONK\\Furion\\samples\\Furion.Web.Entry\n2020-12-21 15:58:27.909 +08:00 [INF] HTTP GET / responded 200 in 457.0657 ms\n2020-12-21 15:58:33.336 +08:00 [INF] HTTP GET /api/index.html responded 200 in 95.9277 ms\n2020-12-21 15:58:34.187 +08:00 [INF] HTTP GET /swagger/Default/swagger.json responded 200 in 674.9800 ms\n')),Object(i.b)("h2",{id:"187-\u53cd\u9988\u4e0e\u5efa\u8bae"},"18.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u65e5\u5fd7")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/logging/?view=aspnetcore-5.0"}),"ASP.NET Core - \u65e5\u5fd7")," \u7ae0\u8282 \u548c ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://serilog.net/"}),"Serilog")," \u6587\u6863\u3002"))))}d.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var a=n(21),r=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return O}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var b=r.a.createContext({}),p=function(e){var t=r.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},d=function(e){var t=p(e.components);return r.a.createElement(b.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},m=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),d=p(n),m=a,O=d["".concat(o,".").concat(m)]||d[m]||s[m]||i;return n?r.a.createElement(O,c(c({ref:t},b),{},{components:n})):r.a.createElement(O,c({ref:t},b))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=m;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/a92410d5.e03f7eb0.js b/docs/a92410d5.bab585b1.js similarity index 89% rename from docs/a92410d5.e03f7eb0.js rename to docs/a92410d5.bab585b1.js index 90f831d4b95..b004ac1e7b4 100644 --- a/docs/a92410d5.e03f7eb0.js +++ b/docs/a92410d5.bab585b1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[72],{147:function(t,e,r){"use strict";r.r(e),r.d(e,"frontMatter",(function(){return c})),r.d(e,"metadata",(function(){return u})),r.d(e,"toc",(function(){return l})),r.d(e,"default",(function(){return p}));var n=r(3),o=r(7),a=(r(0),r(192)),i=r(193),c={id:"shttp",title:"6. Http \u9759\u6001\u7c7b",sidebar_label:"6. Http \u9759\u6001\u7c7b"},u={unversionedId:"global/shttp",id:"global/shttp",isDocsHomePage:!1,title:"6. Http \u9759\u6001\u7c7b",description:"6.1 \u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1",source:"@site/docs\\global\\shttp.mdx",slug:"/global/shttp",permalink:"/docs/global/shttp",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/shttp.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"6. Http \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"5. LinqExpression \u9759\u6001\u7c7b",permalink:"/docs/global/linqexpression"},next:{title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",permalink:"/docs/global/jsonserializer"}},l=[{value:"6.1 \u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1",id:"61-\u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1",children:[]}],s={toc:l};function p(t){var e=t.components,r=Object(o.a)(t,["components"]);return Object(a.b)("wrapper",Object(n.a)({},s,r,{components:e,mdxType:"MDXLayout"}),Object(a.b)(i.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"61-\u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1"},"6.1 \u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1"),Object(a.b)("pre",null,Object(a.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var http = Http.GetHttpProxy();\n")))}p.isMDXComponent=!0},190:function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return i}));var n=r(21),o=r(191);function a(){const{siteConfig:{baseUrl:t="/",url:e}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(t,e,r,{forcePrependBaseUrl:n=!1,absolute:a=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return e+r;const i=r.startsWith(e)?r:e+r.replace(/^\//,"");return a?t+i:i}(e,t,r,n)}}function i(t,e={}){const{withBaseUrl:r}=a();return r(t,e)}},191:function(t,e,r){"use strict";function n(t){return!0===/^(\w*:|\/\/)/.test(t)}function o(t){return void 0!==t&&!n(t)}r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return o}))},192:function(t,e,r){"use strict";r.d(e,"a",(function(){return p})),r.d(e,"b",(function(){return d}));var n=r(0),o=r.n(n);function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var l=o.a.createContext({}),s=function(t){var e=o.a.useContext(l),r=e;return t&&(r="function"==typeof t?t(e):c(c({},e),t)),r},p=function(t){var e=s(t.components);return o.a.createElement(l.Provider,{value:e},t.children)},f={inlineCode:"code",wrapper:function(t){var e=t.children;return o.a.createElement(o.a.Fragment,{},e)}},b=o.a.forwardRef((function(t,e){var r=t.components,n=t.mdxType,a=t.originalType,i=t.parentName,l=u(t,["components","mdxType","originalType","parentName"]),p=s(r),b=n,d=p["".concat(i,".").concat(b)]||p[b]||f[b]||a;return r?o.a.createElement(d,c(c({ref:e},l),{},{components:r})):o.a.createElement(d,c({ref:e},l))}));function d(t,e){var r=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var a=r.length,i=new Array(a);i[0]=b;var c={};for(var u in e)hasOwnProperty.call(e,u)&&(c[u]=e[u]);c.originalType=t,c.mdxType="string"==typeof t?t:n,i[1]=c;for(var l=2;le(!t)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{151:function(t,e,r){"use strict";r.r(e),r.d(e,"frontMatter",(function(){return c})),r.d(e,"metadata",(function(){return u})),r.d(e,"toc",(function(){return l})),r.d(e,"default",(function(){return p}));var n=r(3),o=r(7),a=(r(0),r(196)),i=r(197),c={id:"shttp",title:"6. Http \u9759\u6001\u7c7b",sidebar_label:"6. Http \u9759\u6001\u7c7b"},u={unversionedId:"global/shttp",id:"global/shttp",isDocsHomePage:!1,title:"6. Http \u9759\u6001\u7c7b",description:"6.1 \u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1",source:"@site/docs\\global\\shttp.mdx",slug:"/global/shttp",permalink:"/docs/global/shttp",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/shttp.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"6. Http \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"5. LinqExpression \u9759\u6001\u7c7b",permalink:"/docs/global/linqexpression"},next:{title:"7. JsonSerializerUtility \u9759\u6001\u7c7b",permalink:"/docs/global/jsonserializer"}},l=[{value:"6.1 \u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1",id:"61-\u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1",children:[]}],s={toc:l};function p(t){var e=t.components,r=Object(o.a)(t,["components"]);return Object(a.b)("wrapper",Object(n.a)({},s,r,{components:e,mdxType:"MDXLayout"}),Object(a.b)(i.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"61-\u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1"},"6.1 \u83b7\u53d6\u8fdc\u7a0b\u4ee3\u7406\u670d\u52a1"),Object(a.b)("pre",null,Object(a.b)("code",Object(n.a)({parentName:"pre"},{className:"language-cs"}),"var http = Http.GetHttpProxy();\n")))}p.isMDXComponent=!0},194:function(t,e,r){"use strict";r.d(e,"b",(function(){return a})),r.d(e,"a",(function(){return i}));var n=r(21),o=r(195);function a(){const{siteConfig:{baseUrl:t="/",url:e}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(t,e,r,{forcePrependBaseUrl:n=!1,absolute:a=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return e+r;const i=r.startsWith(e)?r:e+r.replace(/^\//,"");return a?t+i:i}(e,t,r,n)}}function i(t,e={}){const{withBaseUrl:r}=a();return r(t,e)}},195:function(t,e,r){"use strict";function n(t){return!0===/^(\w*:|\/\/)/.test(t)}function o(t){return void 0!==t&&!n(t)}r.d(e,"b",(function(){return n})),r.d(e,"a",(function(){return o}))},196:function(t,e,r){"use strict";r.d(e,"a",(function(){return p})),r.d(e,"b",(function(){return d}));var n=r(0),o=r.n(n);function a(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function c(t){for(var e=1;e=0||(o[r]=t[r]);return o}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}var l=o.a.createContext({}),s=function(t){var e=o.a.useContext(l),r=e;return t&&(r="function"==typeof t?t(e):c(c({},e),t)),r},p=function(t){var e=s(t.components);return o.a.createElement(l.Provider,{value:e},t.children)},f={inlineCode:"code",wrapper:function(t){var e=t.children;return o.a.createElement(o.a.Fragment,{},e)}},b=o.a.forwardRef((function(t,e){var r=t.components,n=t.mdxType,a=t.originalType,i=t.parentName,l=u(t,["components","mdxType","originalType","parentName"]),p=s(r),b=n,d=p["".concat(i,".").concat(b)]||p[b]||f[b]||a;return r?o.a.createElement(d,c(c({ref:e},l),{},{components:r})):o.a.createElement(d,c({ref:e},l))}));function d(t,e){var r=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var a=r.length,i=new Array(a);i[0]=b;var c={};for(var u in e)hasOwnProperty.call(e,u)&&(c[u]=e[u]);c.originalType=t,c.mdxType="string"==typeof t?t:n,i[1]=c;for(var l=2;le(!t)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/af3e9b99.a0fe82ba.js b/docs/af3e9b99.88865a16.js similarity index 97% rename from docs/af3e9b99.a0fe82ba.js rename to docs/af3e9b99.88865a16.js index fc95213dc42..25c9a09625d 100644 --- a/docs/af3e9b99.a0fe82ba.js +++ b/docs/af3e9b99.88865a16.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[73],{148:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return d})),n.d(t,"default",(function(){return p}));var a=n(3),c=n(7),i=(n(0),n(192)),r=n(190),o=n(193),b={id:"dbcontext-code-first",title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",sidebar_label:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93"},s={unversionedId:"dbcontext-code-first",id:"dbcontext-code-first",isDocsHomePage:!1,title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",description:"Fur.Web.Entry \u5c42\u9700\u8981\u5b89\u88c5 Microsoft.EntityFrameworkCore.Tools \u5305\u3002",source:"@site/docs\\dbcontext-code-first.mdx",slug:"/dbcontext-code-first",permalink:"/docs/dbcontext-code-first",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-code-first.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",sidebar:"docs",previous:{title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",permalink:"/docs/dbcontext-db-first"},next:{title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",permalink:"/docs/dbcontext-seed-data"}},d=[{value:"9.20.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",id:"9201-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",children:[]},{value:"9.20.2 \u64cd\u4f5c\u6307\u5357",id:"9202-\u64cd\u4f5c\u6307\u5357",children:[{value:"9.20.2.1 \u521b\u5efa\u5b9e\u4f53\u6a21\u578b Person",id:"92021-\u521b\u5efa\u5b9e\u4f53\u6a21\u578b-person",children:[]},{value:"9.20.2.2 \u6253\u5f00 \u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",id:"92022-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",children:[]},{value:"9.20.2.3 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee",id:"92023-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee",children:[]},{value:"9.20.2.4 \u521b\u5efa\u6a21\u578b\u7248\u672c",id:"92024-\u521b\u5efa\u6a21\u578b\u7248\u672c",children:[]},{value:"9.20.2.5 \u66f4\u65b0\u5230\u6570\u636e\u5e93",id:"92025-\u66f4\u65b0\u5230\u6570\u636e\u5e93",children:[]}]},{value:"9.20.3 \u66f4\u65b0\u6a21\u578b",id:"9203-\u66f4\u65b0\u6a21\u578b",children:[]},{value:"9.20.4 \u5bfc\u51fa Sql",id:"9204-\u5bfc\u51fa-sql",children:[]},{value:"9.20.5 VS Code \u65b9\u5f0f",id:"9205-vs-code-\u65b9\u5f0f",children:[{value:"9.20.5.1 \u5b89\u88c5 dotnet ef",id:"92051-\u5b89\u88c5-dotnet-ef",children:[]},{value:"9.20.5.2 cd \u76ee\u5f55",id:"92052-cd-\u76ee\u5f55",children:[]},{value:"9.20.5.3 \u6267\u884c\u547d\u4ee4",id:"92053-\u6267\u884c\u547d\u4ee4",children:[]}]},{value:"9.20.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9206-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:d};function p(e){var t=e.components,n=Object(c.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5f00\u59cb\u4e4b\u524d")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Fur.Web.Entry")," \u5c42\u9700\u8981\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"Microsoft.EntityFrameworkCore.Tools")," \u5305\u3002"))),Object(i.b)("h2",{id:"9201-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"},"9.20.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\u6765 ",Object(i.b)("strong",{parentName:"p"},"\u4fdd\u6301\u5b9e\u4f53\u6a21\u578b\u548c\u6570\u636e\u5e93\u67b6\u6784\u540c\u6b65"),"\u3002"),Object(i.b)("p",null,"\u81f3\u4e8e\u6211\u4eec\u5e94\u8be5\u9009\u7528\u54ea\u4e2a\u65b9\u6cd5\uff0c\u8bf7\u786e\u5b9a\u4f60\u662f\u5e0c\u671b\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6\u8fd8\u662f\u4ee5\u6570\u636e\u5e93\u4e3a\u51c6\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(i.b)("strong",{parentName:"p"},"\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u6b63\u5411\u5de5\u7a0b\uff08Code First\uff09\u3002 \u5bf9\u5b9e\u4f53\u6a21\u578b\u8fdb\u884c\u66f4\u6539\u65f6\uff0c\u6b64\u65b9\u6cd5\u4f1a\u4ee5\u589e\u91cf\u65b9\u5f0f\u5c06\u76f8\u5e94\u67b6\u6784\u66f4\u6539\u5e94\u7528\u5230\u6570\u636e\u5e93\uff0c\u4ee5\u4f7f\u6570\u636e\u5e93\u4fdd\u6301\u4e0e\u5b9e\u4f53\u6a21\u578b\u517c\u5bb9\u3002")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(i.b)("strong",{parentName:"p"},"\u4ee5\u6570\u636e\u5e93\u67b6\u6784\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u53cd\u5411\u5de5\u7a0b\uff08Database First\uff09\u3002 \u4f7f\u7528\u6b64\u65b9\u6cd5\uff0c\u53ef\u901a\u8fc7\u5c06\u6570\u636e\u5e93\u67b6\u6784\u53cd\u5411\u5de5\u7a0b\u5230\u5b9e\u4f53\u6a21\u578b\u6765\u751f\u6210\u76f8\u5e94\u7684\u5b9e\u4f53\u7c7b\u578b\u3002"))),Object(i.b)("p",null,"\u672c\u7ae0\u8282\u662f ",Object(i.b)("strong",{parentName:"p"},"\u6b63\u5411\u5de5\u7a0b\uff08Code First\uff09")," \u7684\u76f8\u5173\u5185\u5bb9\u3002"),Object(i.b)("h2",{id:"9202-\u64cd\u4f5c\u6307\u5357"},"9.20.2 \u64cd\u4f5c\u6307\u5357"),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9ed8\u8ba4\u6570\u636e\u8fc1\u79fb\u7684\u7a0b\u5e8f\u96c6\u4e3a\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations"),"\uff0c\u6240\u4ee5\u5982\u679c\u60a8\u6539\u4e86\u7a0b\u5e8f\u96c6\u540d\u79f0\u6216\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Nuget")," \u65b9\u5f0f\u5b89\u88c5\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5305\uff0c\u5219\u9700\u8981\u914d\u7f6e\u8fc1\u79fb\u7a0b\u5e8f\u96c6\u540d\u79f0\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4}","{4}":!0}),'services.AddDatabaseAccessor(options =>\n{\n options.AddDbPool(DbProvider.Sqlite);\n}, "\u81ea\u5b9a\u4e49\u8fc1\u79fb\u540d\u79f0");\n')),Object(i.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c\u5982\u679c\u5e94\u7528\u4e2d\u914d\u7f6e\u4e86\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u90a3\u4e48\u6240\u6709\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u8fc1\u79fb\u547d\u4ee4")," \u90fd\u9700\u8981\u6307\u5b9a ",Object(i.b)("inlineCode",{parentName:"p"},"-Context \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u540d\u79f0")," \u53c2\u6570\u3002\u5982\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v1.0.0 -Context FurDbContext\n")))),Object(i.b)("h3",{id:"92021-\u521b\u5efa\u5b9e\u4f53\u6a21\u578b-person"},"9.20.2.1 \u521b\u5efa\u5b9e\u4f53\u6a21\u578b ",Object(i.b)("inlineCode",{parentName:"h3"},"Person")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,8}","{1,6,8}":!0}),"using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Core\n{\n public class Person : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Person()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u59d3\u540d\n /// \n [MaxLength(32)]\n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b9e\u4f53\u7ea6\u5b9a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u6240\u6709\u6570\u636e\u5e93\u5b9e\u4f53\u5fc5\u987b\u76f4\u63a5\u6216\u95f4\u63a5\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"IEntity")," \u63a5\u53e3\u3002"))),Object(i.b)("h3",{id:"92022-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0"},"9.20.2.2 \u6253\u5f00 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")),Object(i.b)("img",{src:Object(r.a)("img/dbfirst1.png")}),Object(i.b)("h3",{id:"92023-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee"},"9.20.2.3 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee"),Object(i.b)("p",null,"\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")," \u9ed8\u8ba4\u9879\u76ee\u8bbe\u7f6e\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")),Object(i.b)("img",{src:Object(r.a)("img/codefirst1.png")}),Object(i.b)("h3",{id:"92024-\u521b\u5efa\u6a21\u578b\u7248\u672c"},"9.20.2.4 \u521b\u5efa\u6a21\u578b\u7248\u672c"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v1.0.0\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("strong",{parentName:"p"},"v1.0.0")," \u662f\u6b64\u5904\u6570\u636e\u5e93\u66f4\u6539\u7684\u7248\u672c\u53f7\uff0c\u53ef\u4ee5\u5199\u4efb\u4f55\u5b57\u7b26\u4e32\uff0c\u4f46\u63a8\u8350\u5199\u7248\u672c\u53f7\uff0c\u6bcf\u6b21 ",Object(i.b)("strong",{parentName:"p"},"+1"),"\u3002"))),Object(i.b)("p",null,"\u6700\u7ec8\u547d\u4ee4\u5982\u4e0b\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"PM> Add-Migration v1.0.0\nBuild started...\nBuild succeeded.\nMicrosoft.EntityFrameworkCore.Model.Validation[10400]\n Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data, this mode should only be enabled during development.\nMicrosoft.EntityFrameworkCore.Infrastructure[10403]\n Entity Framework Core 5.0.0-rc.1.20451.13 initialized 'FurDbContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled MaxPoolSize=100 MigrationsAssembly=Furion.Database.Migrations\nTo undo this action, use Remove-Migration.\nPM>\n")),Object(i.b)("p",null,"\u751f\u6210\u6210\u529f\u540e\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")," \u9879\u76ee\u4e0b\u4f1a\u65b0\u589e ",Object(i.b)("inlineCode",{parentName:"p"},"Migrations")," \u6587\u4ef6\u5939\uff08\u5982\u679c\u6ca1\u6709\uff09\uff0c\u540c\u65f6\u672c\u6b21\u7684\u67b6\u6784\u751f\u6210\u6587\u4ef6\uff0c\u5982\uff1a"),Object(i.b)("img",{src:Object(r.a)("img/codefirst3.png")}),Object(i.b)("h3",{id:"92025-\u66f4\u65b0\u5230\u6570\u636e\u5e93"},"9.20.2.5 \u66f4\u65b0\u5230\u6570\u636e\u5e93"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database\n")),Object(i.b)("p",null,"\u6267\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u6570\u636e\u5e93\u5c31\u4f1a\u81ea\u52a8\u6839\u636e\u6a21\u578b\u751f\u6210\u5bf9\u4e8e\u7684\u8868\u3002"),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c ",Object(i.b)("inlineCode",{parentName:"p"},"Update-Database")," \u540e\u9762\u5e26\u5b57\u7b26\u4e32\u53c2\u6570\uff0c\u5219\u4f1a\u81ea\u52a8\u8fd8\u539f\u6570\u636e\u5e93\u5230\u6307\u5b9a\u7248\u672c\uff0c\u5982\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database v0.0.3\n")),Object(i.b)("p",{parentName:"div"},"\u5c06\u6570\u636e\u5e93\u8fd8\u539f\u5230 ",Object(i.b)("inlineCode",{parentName:"p"},"v0.0.3")," \u7248\u672c"))),Object(i.b)("h2",{id:"9203-\u66f4\u65b0\u6a21\u578b"},"9.20.3 \u66f4\u65b0\u6a21\u578b"),Object(i.b)("p",null,"\u5982\u679c\u6a21\u578b\u6539\u53d8\u4e86\uff0c\u91cd\u590d\u4e0a\u9762\u64cd\u4f5c\u5373\u53ef\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v1.0.1\n")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database\n")),Object(i.b)("h2",{id:"9204-\u5bfc\u51fa-sql"},"9.20.4 \u5bfc\u51fa ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")),Object(i.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u6ca1\u6709\u76f4\u63a5\u66f4\u65b0\u6570\u636e\u5e93\u7684\u6743\u9650\uff0c\u6216\u8005\u6015\u51fa\u95ee\u9898\uff0c\u6211\u4eec\u90fd\u4f1a\u5148\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \u770b\u770b\uff0c\u8fd9\u65f6\u5019\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Script-Migration")," \u5bfc\u51fa\u5373\u53ef\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Script-Migration\n")),Object(i.b)("img",{src:Object(r.a)("img/codefirst2.png")}),Object(i.b)("h2",{id:"9205-vs-code-\u65b9\u5f0f"},"9.20.5 ",Object(i.b)("inlineCode",{parentName:"h2"},"VS Code")," \u65b9\u5f0f"),Object(i.b)("h3",{id:"92051-\u5b89\u88c5-dotnet-ef"},"9.20.5.1 \u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"h3"},"dotnet ef")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"dotnet tool install --global dotnet-ef --version 5.0.0-rc.2.20475.6\n")),Object(i.b)("h3",{id:"92052-cd-\u76ee\u5f55"},"9.20.5.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"cd")," \u76ee\u5f55"),Object(i.b)("p",null,"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"VS Code")," \u6253\u5f00 ",Object(i.b)("inlineCode",{parentName:"p"},".sln")," \u6240\u5728\u7684\u76ee\u5f55\uff0c\u5982\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"framework"),"\u3002"),Object(i.b)("p",null,"\u4e4b\u540e\u8fdb\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")," \u76ee\u5f55"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"cd Furion.Database.Migrations\n")),Object(i.b)("h3",{id:"92053-\u6267\u884c\u547d\u4ee4"},"9.20.5.3 \u6267\u884c\u547d\u4ee4"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),'dotnet ef migrations add v1.0.0 -s "../Furion.Web.Entry"\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),'dotnet ef database update -s "../Furion.Web.Entry"\n')),Object(i.b)("h2",{id:"9206-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.20.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u6b63\u5411\u5de5\u5382")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli"}),"EF Core - \u7ba1\u7406\u6570\u636e\u5e93\u67b6\u6784")," \u7ae0\u8282\u3002"))))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r}));var a=n(21),c=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(c.b)(n))return n;if(a)return t+n;const r=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+r:r}(t,e,n,a)}}function r(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return O}));var a=n(0),c=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var s=c.a.createContext({}),d=function(e){var t=c.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},l=function(e){var t=d(e.components);return c.a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},m=c.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,r=e.parentName,s=b(e,["components","mdxType","originalType","parentName"]),l=d(n),m=a,O=l["".concat(r,".").concat(m)]||l[m]||p[m]||i;return n?c.a.createElement(O,o(o({ref:t},s),{},{components:n})):c.a.createElement(O,o({ref:t},s))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,r=new Array(i);r[0]=m;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:a,r[1]=o;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{152:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return d})),n.d(t,"default",(function(){return p}));var a=n(3),c=n(7),i=(n(0),n(196)),r=n(194),o=n(197),b={id:"dbcontext-code-first",title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",sidebar_label:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93"},s={unversionedId:"dbcontext-code-first",id:"dbcontext-code-first",isDocsHomePage:!1,title:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",description:"Fur.Web.Entry \u5c42\u9700\u8981\u5b89\u88c5 Microsoft.EntityFrameworkCore.Tools \u5305\u3002",source:"@site/docs\\dbcontext-code-first.mdx",slug:"/dbcontext-code-first",permalink:"/docs/dbcontext-code-first",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-code-first.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93",sidebar:"docs",previous:{title:"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b",permalink:"/docs/dbcontext-db-first"},next:{title:"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e",permalink:"/docs/dbcontext-seed-data"}},d=[{value:"9.20.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",id:"9201-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f",children:[]},{value:"9.20.2 \u64cd\u4f5c\u6307\u5357",id:"9202-\u64cd\u4f5c\u6307\u5357",children:[{value:"9.20.2.1 \u521b\u5efa\u5b9e\u4f53\u6a21\u578b Person",id:"92021-\u521b\u5efa\u5b9e\u4f53\u6a21\u578b-person",children:[]},{value:"9.20.2.2 \u6253\u5f00 \u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",id:"92022-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0",children:[]},{value:"9.20.2.3 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee",id:"92023-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee",children:[]},{value:"9.20.2.4 \u521b\u5efa\u6a21\u578b\u7248\u672c",id:"92024-\u521b\u5efa\u6a21\u578b\u7248\u672c",children:[]},{value:"9.20.2.5 \u66f4\u65b0\u5230\u6570\u636e\u5e93",id:"92025-\u66f4\u65b0\u5230\u6570\u636e\u5e93",children:[]}]},{value:"9.20.3 \u66f4\u65b0\u6a21\u578b",id:"9203-\u66f4\u65b0\u6a21\u578b",children:[]},{value:"9.20.4 \u5bfc\u51fa Sql",id:"9204-\u5bfc\u51fa-sql",children:[]},{value:"9.20.5 VS Code \u65b9\u5f0f",id:"9205-vs-code-\u65b9\u5f0f",children:[{value:"9.20.5.1 \u5b89\u88c5 dotnet ef",id:"92051-\u5b89\u88c5-dotnet-ef",children:[]},{value:"9.20.5.2 cd \u76ee\u5f55",id:"92052-cd-\u76ee\u5f55",children:[]},{value:"9.20.5.3 \u6267\u884c\u547d\u4ee4",id:"92053-\u6267\u884c\u547d\u4ee4",children:[]}]},{value:"9.20.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9206-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],l={toc:d};function p(e){var t=e.components,n=Object(c.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5f00\u59cb\u4e4b\u524d")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Fur.Web.Entry")," \u5c42\u9700\u8981\u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"p"},"Microsoft.EntityFrameworkCore.Tools")," \u5305\u3002"))),Object(i.b)("h2",{id:"9201-\u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"},"9.20.1 \u6570\u636e\u5e93\u5f00\u53d1\u65b9\u5f0f"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e24\u79cd\u4e3b\u8981\u65b9\u6cd5\u6765 ",Object(i.b)("strong",{parentName:"p"},"\u4fdd\u6301\u5b9e\u4f53\u6a21\u578b\u548c\u6570\u636e\u5e93\u67b6\u6784\u540c\u6b65"),"\u3002"),Object(i.b)("p",null,"\u81f3\u4e8e\u6211\u4eec\u5e94\u8be5\u9009\u7528\u54ea\u4e2a\u65b9\u6cd5\uff0c\u8bf7\u786e\u5b9a\u4f60\u662f\u5e0c\u671b\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6\u8fd8\u662f\u4ee5\u6570\u636e\u5e93\u4e3a\u51c6\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(i.b)("strong",{parentName:"p"},"\u4ee5\u5b9e\u4f53\u6a21\u578b\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u6b63\u5411\u5de5\u7a0b\uff08Code First\uff09\u3002 \u5bf9\u5b9e\u4f53\u6a21\u578b\u8fdb\u884c\u66f4\u6539\u65f6\uff0c\u6b64\u65b9\u6cd5\u4f1a\u4ee5\u589e\u91cf\u65b9\u5f0f\u5c06\u76f8\u5e94\u67b6\u6784\u66f4\u6539\u5e94\u7528\u5230\u6570\u636e\u5e93\uff0c\u4ee5\u4f7f\u6570\u636e\u5e93\u4fdd\u6301\u4e0e\u5b9e\u4f53\u6a21\u578b\u517c\u5bb9\u3002")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},"\u5982\u679c\u5e0c\u671b ",Object(i.b)("strong",{parentName:"p"},"\u4ee5\u6570\u636e\u5e93\u67b6\u6784\u4e3a\u51c6"),"\uff0c\u8bf7\u4f7f\u7528\u53cd\u5411\u5de5\u7a0b\uff08Database First\uff09\u3002 \u4f7f\u7528\u6b64\u65b9\u6cd5\uff0c\u53ef\u901a\u8fc7\u5c06\u6570\u636e\u5e93\u67b6\u6784\u53cd\u5411\u5de5\u7a0b\u5230\u5b9e\u4f53\u6a21\u578b\u6765\u751f\u6210\u76f8\u5e94\u7684\u5b9e\u4f53\u7c7b\u578b\u3002"))),Object(i.b)("p",null,"\u672c\u7ae0\u8282\u662f ",Object(i.b)("strong",{parentName:"p"},"\u6b63\u5411\u5de5\u7a0b\uff08Code First\uff09")," \u7684\u76f8\u5173\u5185\u5bb9\u3002"),Object(i.b)("h2",{id:"9202-\u64cd\u4f5c\u6307\u5357"},"9.20.2 \u64cd\u4f5c\u6307\u5357"),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u9ed8\u8ba4\u6570\u636e\u8fc1\u79fb\u7684\u7a0b\u5e8f\u96c6\u4e3a\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations"),"\uff0c\u6240\u4ee5\u5982\u679c\u60a8\u6539\u4e86\u7a0b\u5e8f\u96c6\u540d\u79f0\u6216\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Nuget")," \u65b9\u5f0f\u5b89\u88c5\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5305\uff0c\u5219\u9700\u8981\u914d\u7f6e\u8fc1\u79fb\u7a0b\u5e8f\u96c6\u540d\u79f0\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4}","{4}":!0}),'services.AddDatabaseAccessor(options =>\n{\n options.AddDbPool(DbProvider.Sqlite);\n}, "\u81ea\u5b9a\u4e49\u8fc1\u79fb\u540d\u79f0");\n')),Object(i.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c\u5982\u679c\u5e94\u7528\u4e2d\u914d\u7f6e\u4e86\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u90a3\u4e48\u6240\u6709\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"\u8fc1\u79fb\u547d\u4ee4")," \u90fd\u9700\u8981\u6307\u5b9a ",Object(i.b)("inlineCode",{parentName:"p"},"-Context \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u540d\u79f0")," \u53c2\u6570\u3002\u5982\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v1.0.0 -Context FurDbContext\n")))),Object(i.b)("h3",{id:"92021-\u521b\u5efa\u5b9e\u4f53\u6a21\u578b-person"},"9.20.2.1 \u521b\u5efa\u5b9e\u4f53\u6a21\u578b ",Object(i.b)("inlineCode",{parentName:"h3"},"Person")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,8}","{1,6,8}":!0}),"using Furion.DatabaseAccessor;\nusing System;\nusing System.Collections.Generic;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Core\n{\n public class Person : Entity\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Person()\n {\n CreatedTime = DateTime.Now;\n IsDeleted = false;\n }\n\n /// \n /// \u59d3\u540d\n /// \n [MaxLength(32)]\n public string Name { get; set; }\n\n /// \n /// \u5e74\u9f84\n /// \n public int Age { get; set; }\n\n /// \n /// \u4f4f\u5740\n /// \n public string Address { get; set; }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5b9e\u4f53\u7ea6\u5b9a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u6240\u6709\u6570\u636e\u5e93\u5b9e\u4f53\u5fc5\u987b\u76f4\u63a5\u6216\u95f4\u63a5\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"IEntity")," \u63a5\u53e3\u3002"))),Object(i.b)("h3",{id:"92022-\u6253\u5f00-\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0"},"9.20.2.2 \u6253\u5f00 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")),Object(i.b)("img",{src:Object(r.a)("img/dbfirst1.png")}),Object(i.b)("h3",{id:"92023-\u5207\u6362\u9ed8\u8ba4\u9879\u76ee"},"9.20.2.3 \u5207\u6362\u9ed8\u8ba4\u9879\u76ee"),Object(i.b)("p",null,"\u5c06 ",Object(i.b)("inlineCode",{parentName:"p"},"\u7a0b\u5e8f\u5305\u7ba1\u7406\u63a7\u5236\u53f0")," \u9ed8\u8ba4\u9879\u76ee\u8bbe\u7f6e\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")),Object(i.b)("img",{src:Object(r.a)("img/codefirst1.png")}),Object(i.b)("h3",{id:"92024-\u521b\u5efa\u6a21\u578b\u7248\u672c"},"9.20.2.4 \u521b\u5efa\u6a21\u578b\u7248\u672c"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v1.0.0\n")),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("strong",{parentName:"p"},"v1.0.0")," \u662f\u6b64\u5904\u6570\u636e\u5e93\u66f4\u6539\u7684\u7248\u672c\u53f7\uff0c\u53ef\u4ee5\u5199\u4efb\u4f55\u5b57\u7b26\u4e32\uff0c\u4f46\u63a8\u8350\u5199\u7248\u672c\u53f7\uff0c\u6bcf\u6b21 ",Object(i.b)("strong",{parentName:"p"},"+1"),"\u3002"))),Object(i.b)("p",null,"\u6700\u7ec8\u547d\u4ee4\u5982\u4e0b\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"PM> Add-Migration v1.0.0\nBuild started...\nBuild succeeded.\nMicrosoft.EntityFrameworkCore.Model.Validation[10400]\n Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data, this mode should only be enabled during development.\nMicrosoft.EntityFrameworkCore.Infrastructure[10403]\n Entity Framework Core 5.0.0-rc.1.20451.13 initialized 'FurDbContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled MaxPoolSize=100 MigrationsAssembly=Furion.Database.Migrations\nTo undo this action, use Remove-Migration.\nPM>\n")),Object(i.b)("p",null,"\u751f\u6210\u6210\u529f\u540e\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")," \u9879\u76ee\u4e0b\u4f1a\u65b0\u589e ",Object(i.b)("inlineCode",{parentName:"p"},"Migrations")," \u6587\u4ef6\u5939\uff08\u5982\u679c\u6ca1\u6709\uff09\uff0c\u540c\u65f6\u672c\u6b21\u7684\u67b6\u6784\u751f\u6210\u6587\u4ef6\uff0c\u5982\uff1a"),Object(i.b)("img",{src:Object(r.a)("img/codefirst3.png")}),Object(i.b)("h3",{id:"92025-\u66f4\u65b0\u5230\u6570\u636e\u5e93"},"9.20.2.5 \u66f4\u65b0\u5230\u6570\u636e\u5e93"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database\n")),Object(i.b)("p",null,"\u6267\u884c\u8be5\u547d\u4ee4\u540e\uff0c\u6570\u636e\u5e93\u5c31\u4f1a\u81ea\u52a8\u6839\u636e\u6a21\u578b\u751f\u6210\u5bf9\u4e8e\u7684\u8868\u3002"),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c ",Object(i.b)("inlineCode",{parentName:"p"},"Update-Database")," \u540e\u9762\u5e26\u5b57\u7b26\u4e32\u53c2\u6570\uff0c\u5219\u4f1a\u81ea\u52a8\u8fd8\u539f\u6570\u636e\u5e93\u5230\u6307\u5b9a\u7248\u672c\uff0c\u5982\uff1a"),Object(i.b)("pre",{parentName:"div"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database v0.0.3\n")),Object(i.b)("p",{parentName:"div"},"\u5c06\u6570\u636e\u5e93\u8fd8\u539f\u5230 ",Object(i.b)("inlineCode",{parentName:"p"},"v0.0.3")," \u7248\u672c"))),Object(i.b)("h2",{id:"9203-\u66f4\u65b0\u6a21\u578b"},"9.20.3 \u66f4\u65b0\u6a21\u578b"),Object(i.b)("p",null,"\u5982\u679c\u6a21\u578b\u6539\u53d8\u4e86\uff0c\u91cd\u590d\u4e0a\u9762\u64cd\u4f5c\u5373\u53ef\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Add-Migration v1.0.1\n")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Update-Database\n")),Object(i.b)("h2",{id:"9204-\u5bfc\u51fa-sql"},"9.20.4 \u5bfc\u51fa ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")),Object(i.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u6ca1\u6709\u76f4\u63a5\u66f4\u65b0\u6570\u636e\u5e93\u7684\u6743\u9650\uff0c\u6216\u8005\u6015\u51fa\u95ee\u9898\uff0c\u6211\u4eec\u90fd\u4f1a\u5148\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \u770b\u770b\uff0c\u8fd9\u65f6\u5019\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Script-Migration")," \u5bfc\u51fa\u5373\u53ef\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"Script-Migration\n")),Object(i.b)("img",{src:Object(r.a)("img/codefirst2.png")}),Object(i.b)("h2",{id:"9205-vs-code-\u65b9\u5f0f"},"9.20.5 ",Object(i.b)("inlineCode",{parentName:"h2"},"VS Code")," \u65b9\u5f0f"),Object(i.b)("h3",{id:"92051-\u5b89\u88c5-dotnet-ef"},"9.20.5.1 \u5b89\u88c5 ",Object(i.b)("inlineCode",{parentName:"h3"},"dotnet ef")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"dotnet tool install --global dotnet-ef --version 5.0.0-rc.2.20475.6\n")),Object(i.b)("h3",{id:"92052-cd-\u76ee\u5f55"},"9.20.5.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"cd")," \u76ee\u5f55"),Object(i.b)("p",null,"\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"VS Code")," \u6253\u5f00 ",Object(i.b)("inlineCode",{parentName:"p"},".sln")," \u6240\u5728\u7684\u76ee\u5f55\uff0c\u5982\uff1a",Object(i.b)("inlineCode",{parentName:"p"},"framework"),"\u3002"),Object(i.b)("p",null,"\u4e4b\u540e\u8fdb\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion.Database.Migrations")," \u76ee\u5f55"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),"cd Furion.Database.Migrations\n")),Object(i.b)("h3",{id:"92053-\u6267\u884c\u547d\u4ee4"},"9.20.5.3 \u6267\u884c\u547d\u4ee4"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),'dotnet ef migrations add v1.0.0 -s "../Furion.Web.Entry"\n')),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-shell"}),'dotnet ef database update -s "../Furion.Web.Entry"\n')),Object(i.b)("h2",{id:"9206-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.20.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(i.b)("hr",null),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(i.b)("inlineCode",{parentName:"p"},"\u6b63\u5411\u5de5\u5382")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/managing-schemas/migrations/?tabs=dotnet-core-cli"}),"EF Core - \u7ba1\u7406\u6570\u636e\u5e93\u67b6\u6784")," \u7ae0\u8282\u3002"))))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return r}));var a=n(21),c=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(c.b)(n))return n;if(a)return t+n;const r=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+r:r}(t,e,n,a)}}function r(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function c(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return O}));var a=n(0),c=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(c[n]=e[n]);return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(c[n]=e[n])}return c}var s=c.a.createContext({}),d=function(e){var t=c.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},l=function(e){var t=d(e.components);return c.a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return c.a.createElement(c.a.Fragment,{},t)}},m=c.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,r=e.parentName,s=b(e,["components","mdxType","originalType","parentName"]),l=d(n),m=a,O=l["".concat(r,".").concat(m)]||l[m]||p[m]||i;return n?c.a.createElement(O,o(o({ref:t},s),{},{components:n})):c.a.createElement(O,o({ref:t},s))}));function O(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,r=new Array(i);r[0]=m;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:a,r[1]=o;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/b2d72f25.f12145cd.js b/docs/b2d72f25.8b639c87.js similarity index 95% rename from docs/b2d72f25.f12145cd.js rename to docs/b2d72f25.8b639c87.js index 360850c97c9..57646220875 100644 --- a/docs/b2d72f25.f12145cd.js +++ b/docs/b2d72f25.8b639c87.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[74],{149:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return u}));var i=t(3),r=t(7),a=(t(0),t(192)),o=t(193),c={id:"specificationdocumentsettings",title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",sidebar_label:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e"},l={unversionedId:"settings/specificationdocumentsettings",id:"settings/specificationdocumentsettings",isDocsHomePage:!1,title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",description:"7.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\specificationdocumentsettings.mdx",slug:"/settings/specificationdocumentsettings",permalink:"/docs/settings/specificationdocumentsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/specificationdocumentsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",sidebar:"settings",previous:{title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",permalink:"/docs/settings/friendlyexceptionsettings"},next:{title:"8. \u591a\u8bed\u8a00\u914d\u7f6e",permalink:"/docs/settings/localizationsettings"}},b=[{value:"7.1 \u5173\u4e8e\u914d\u7f6e",id:"71-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"7.2 \u914d\u7f6e\u4fe1\u606f",id:"72-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"7.3 \u914d\u7f6e\u793a\u4f8b",id:"73-\u914d\u7f6e\u793a\u4f8b",children:[]}],p={toc:b};function u(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(a.b)("wrapper",Object(i.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"71-\u5173\u4e8e\u914d\u7f6e"},"7.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6Swagger\u6587\u6863\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"72-\u914d\u7f6e\u4fe1\u606f"},"7.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SpecificationDocumentSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DocumentTitle"),"\uff1a\u6587\u6863\u6807\u9898\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Specification Api Document")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultGroupName"),"\uff1a\u9ed8\u8ba4\u5206\u7ec4\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Default")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"EnableAuthorized"),"\uff1a\u662f\u5426\u542f\u7528\u6743\u9650\u63a7\u5236\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"FormatAsV2"),"\uff1a\u91c7\u7528 ",Object(a.b)("inlineCode",{parentName:"li"},"Swagger 2.0")," \u7248\u672c\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"RoutePrefix"),"\uff1a\u89c4\u8303\u5316\u6587\u6863\u5730\u5740\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"api"),"\uff0c",Object(a.b)("strong",{parentName:"li"},"\u5982\u679c\u5e0c\u671b\u5728\u9996\u9875\uff0c\u6539\u4e3a\u7a7a\u5b57\u7b26\u4e32\u5373\u53ef"),"\u3002"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DocExpansionState"),"\uff1a\u6587\u6863\u663e\u793a\u65b9\u5f0f\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"DocExpansion"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"List"),"\uff0c\u53d6\u503c\uff1a",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"List"),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",Object(a.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Full"),"\uff1a\u5b8c\u5168\u5c55\u5f00"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"None"),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09"))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"XmlComments"),"\uff1a\u7a0b\u5e8f\u96c6\u6ce8\u91ca\u63cf\u8ff0\u6587\u4ef6\u540d\uff08\u53ef\u5e26 ",Object(a.b)("inlineCode",{parentName:"li"},".xml"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application, Furion.Web.Entry, Furion.Web.Core")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"GroupOpenApiInfos"),"\uff1a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiInfo[]"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"{ 'Group': 'Default'}")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SecurityDefinitions"),"\uff1a\u5b89\u5168\u7b56\u7565\u5b9a\u4e49\u914d\u7f6e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiSecurityScheme[]"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"[]")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Servers"),"\uff1a\u914d\u7f6e Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"OpenApiServer[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"[]"),"\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},'{Servers:[ { Url:"\u5730\u5740", Description:"\u63cf\u8ff0"} ]}')),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"HideServers"),"\uff1a\u662f\u5426\u9690\u85cf Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false"))))),Object(a.b)("h2",{id:"73-\u914d\u7f6e\u793a\u4f8b"},"7.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Title": "\u5206\u7ec4\u6807\u9898",\n "Description": "\u8fd9\u91cc\u662f\u5206\u7ec4\u63cf\u8ff0",\n "Version": "\u7248\u672c\u53f7",\n "TermsOfService": "https://furion.pro",\n "Contact": {\n "Name": "\u767e\u5c0f\u50e7",\n "Url": "https://gitee.com/monksoul",\n "Email": "monksoul@outlook.com"\n },\n "License": {\n "Name": "Apache-2.0",\n "Url": "https://gitee.com/monksoul/Furion/blob/alpha/LICENSE"\n }\n }\n ]\n }\n}\n')))}u.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}));var i=t(21),r=t(191);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(i.default)();return{withBaseUrl:(t,i)=>function(e,n,t,{forcePrependBaseUrl:i=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(i)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+o:o}(n,e,t,i)}}function o(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},191:function(e,n,t){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!i(e)}t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return d}));var i=t(0),r=t.n(i);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var b=r.a.createContext({}),p=function(e){var n=r.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},u=function(e){var n=p(e.components);return r.a.createElement(b.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},m=r.a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,o=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),u=p(t),m=i,d=u["".concat(o,".").concat(m)]||u[m]||s[m]||a;return t?r.a.createElement(d,c(c({ref:n},b),{},{components:t})):r.a.createElement(d,c({ref:n},b))}));function d(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=m;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:i,o[1]=c;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[78],{153:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return b})),t.d(n,"default",(function(){return u}));var i=t(3),r=t(7),a=(t(0),t(196)),o=t(197),c={id:"specificationdocumentsettings",title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",sidebar_label:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e"},l={unversionedId:"settings/specificationdocumentsettings",id:"settings/specificationdocumentsettings",isDocsHomePage:!1,title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",description:"7.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\specificationdocumentsettings.mdx",slug:"/settings/specificationdocumentsettings",permalink:"/docs/settings/specificationdocumentsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/specificationdocumentsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",sidebar:"settings",previous:{title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",permalink:"/docs/settings/friendlyexceptionsettings"},next:{title:"8. \u591a\u8bed\u8a00\u914d\u7f6e",permalink:"/docs/settings/localizationsettings"}},b=[{value:"7.1 \u5173\u4e8e\u914d\u7f6e",id:"71-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"7.2 \u914d\u7f6e\u4fe1\u606f",id:"72-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"7.3 \u914d\u7f6e\u793a\u4f8b",id:"73-\u914d\u7f6e\u793a\u4f8b",children:[]}],p={toc:b};function u(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(a.b)("wrapper",Object(i.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"71-\u5173\u4e8e\u914d\u7f6e"},"7.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6Swagger\u6587\u6863\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"72-\u914d\u7f6e\u4fe1\u606f"},"7.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SpecificationDocumentSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DocumentTitle"),"\uff1a\u6587\u6863\u6807\u9898\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Specification Api Document")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultGroupName"),"\uff1a\u9ed8\u8ba4\u5206\u7ec4\u540d\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Default")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"EnableAuthorized"),"\uff1a\u662f\u5426\u542f\u7528\u6743\u9650\u63a7\u5236\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"true")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"FormatAsV2"),"\uff1a\u91c7\u7528 ",Object(a.b)("inlineCode",{parentName:"li"},"Swagger 2.0")," \u7248\u672c\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"RoutePrefix"),"\uff1a\u89c4\u8303\u5316\u6587\u6863\u5730\u5740\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"api"),"\uff0c",Object(a.b)("strong",{parentName:"li"},"\u5982\u679c\u5e0c\u671b\u5728\u9996\u9875\uff0c\u6539\u4e3a\u7a7a\u5b57\u7b26\u4e32\u5373\u53ef"),"\u3002"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DocExpansionState"),"\uff1a\u6587\u6863\u663e\u793a\u65b9\u5f0f\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"DocExpansion"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"List"),"\uff0c\u53d6\u503c\uff1a",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"List"),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",Object(a.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Full"),"\uff1a\u5b8c\u5168\u5c55\u5f00"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"None"),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09"))),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"XmlComments"),"\uff1a\u7a0b\u5e8f\u96c6\u6ce8\u91ca\u63cf\u8ff0\u6587\u4ef6\u540d\uff08\u53ef\u5e26 ",Object(a.b)("inlineCode",{parentName:"li"},".xml"),"\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"Furion.Application, Furion.Web.Entry, Furion.Web.Core")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"GroupOpenApiInfos"),"\uff1a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiInfo[]"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"{ 'Group': 'Default'}")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"SecurityDefinitions"),"\uff1a\u5b89\u5168\u7b56\u7565\u5b9a\u4e49\u914d\u7f6e\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiSecurityScheme[]"),"\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"[]")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Servers"),"\uff1a\u914d\u7f6e Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"OpenApiServer[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"[]"),"\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},'{Servers:[ { Url:"\u5730\u5740", Description:"\u63cf\u8ff0"} ]}')),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"HideServers"),"\uff1a\u662f\u5426\u9690\u85cf Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false"))))),Object(a.b)("h2",{id:"73-\u914d\u7f6e\u793a\u4f8b"},"7.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(i.a)({parentName:"pre"},{className:"language-json"}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Title": "\u5206\u7ec4\u6807\u9898",\n "Description": "\u8fd9\u91cc\u662f\u5206\u7ec4\u63cf\u8ff0",\n "Version": "\u7248\u672c\u53f7",\n "TermsOfService": "https://furion.pro",\n "Contact": {\n "Name": "\u767e\u5c0f\u50e7",\n "Url": "https://gitee.com/monksoul",\n "Email": "monksoul@outlook.com"\n },\n "License": {\n "Name": "Apache-2.0",\n "Url": "https://gitee.com/monksoul/Furion/blob/alpha/LICENSE"\n }\n }\n ]\n }\n}\n')))}u.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}));var i=t(21),r=t(195);function a(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(i.default)();return{withBaseUrl:(t,i)=>function(e,n,t,{forcePrependBaseUrl:i=!1,absolute:a=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(i)return n+t;const o=t.startsWith(n)?t:n+t.replace(/^\//,"");return a?e+o:o}(n,e,t,i)}}function o(e,n={}){const{withBaseUrl:t}=a();return t(e,n)}},195:function(e,n,t){"use strict";function i(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!i(e)}t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return d}));var i=t(0),r=t.n(i);function a(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function o(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,i)}return t}function c(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var b=r.a.createContext({}),p=function(e){var n=r.a.useContext(b),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},u=function(e){var n=p(e.components);return r.a.createElement(b.Provider,{value:n},e.children)},s={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},m=r.a.forwardRef((function(e,n){var t=e.components,i=e.mdxType,a=e.originalType,o=e.parentName,b=l(e,["components","mdxType","originalType","parentName"]),u=p(t),m=i,d=u["".concat(o,".").concat(m)]||u[m]||s[m]||a;return t?r.a.createElement(d,c(c({ref:n},b),{},{components:t})):r.a.createElement(d,c({ref:n},b))}));function d(e,n){var t=arguments,i=n&&n.mdxType;if("string"==typeof e||i){var a=t.length,o=new Array(a);o[0]=m;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:i,o[1]=c;for(var b=2;bn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/b30e5fe3.fb93dc83.js b/docs/b30e5fe3.472c9cc2.js similarity index 92% rename from docs/b30e5fe3.fb93dc83.js rename to docs/b30e5fe3.472c9cc2.js index 681fb4248e8..b229f982d47 100644 --- a/docs/b30e5fe3.fb93dc83.js +++ b/docs/b30e5fe3.472c9cc2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[75],{150:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),o=n(7),a=(n(0),n(192)),c=(n(190),n(193)),i={id:"author",title:"1.2 \u5173\u4e8e\u4f5c\u8005",sidebar_label:"1.2 \u5173\u4e8e\u4f5c\u8005"},u={unversionedId:"author",id:"author",isDocsHomePage:!1,title:"1.2 \u5173\u4e8e\u4f5c\u8005",description:"\u4e92\u8054\u7f51\u8d26\u53f7",source:"@site/docs\\author.mdx",slug:"/author",permalink:"/docs/author",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/author.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1.2 \u5173\u4e8e\u4f5c\u8005",sidebar:"docs",previous:{title:"1.1 \u4ecb\u7ecd",permalink:"/docs/"},next:{title:"1.3 \u6e90\u7801\u7ed3\u6784",permalink:"/docs/source"}},l=[{value:"\u4e92\u8054\u7f51\u8d26\u53f7",id:"\u4e92\u8054\u7f51\u8d26\u53f7",children:[]},{value:"\u6280\u672f\u80fd\u529b",id:"\u6280\u672f\u80fd\u529b",children:[]},{value:"\u5174\u8da3\u7231\u597d",id:"\u5174\u8da3\u7231\u597d",children:[]},{value:"\u4e2a\u4eba\u4e3b\u9875",id:"\u4e2a\u4eba\u4e3b\u9875",children:[]}],p={toc:l};function b(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"\u4e92\u8054\u7f51\u8d26\u53f7"},"\u4e92\u8054\u7f51\u8d26\u53f7"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"\u767e\u5c0f\u50e7"),Object(a.b)("li",{parentName:"ul"},"Monk/MonkSoul")),Object(a.b)("h2",{id:"\u6280\u672f\u80fd\u529b"},"\u6280\u672f\u80fd\u529b"),Object(a.b)("p",null,"\u81ea 2008 \u5e74 \u63a5\u89e6 IT \u8fd9\u4e2a\u884c\u4e1a\u4e5f\u6709\u5341\u4f59\u5e74\u4e86\uff0c\u5728 \u540e\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},".NET/.NET Core/Java/PHP"),"\uff09\u3001\u79fb\u52a8\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},"Xamarin/\u5c0f\u7a0b\u5e8f/Java/Objective-C"),"\uff09\u3001\u684c\u9762\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},"WinForm/WPF/Electron"),"\uff09\u3001\u524d\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},"Node/React/Vue/Angular"),"\uff09\u3001\u8bbe\u8ba1\uff08",Object(a.b)("inlineCode",{parentName:"p"},"Photoshop\u3001CDR\u3001AI"),"\uff09\u7b49\u4e3b\u6d41\u9886\u57df\u7565\u77e5\u4e00\u4e8c\u3002"),Object(a.b)("p",null,"\u540c\u65f6\u5728\u6280\u672f\u57f9\u8bad\u9886\u57df\u4e5f\u591a\u6709\u6d89\u8db3\u3002",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://www.chinadot.net/"}),"MIP(dotNET China Most Influential Professionals)")," \u4e13\u5bb6\uff0c\u540c\u65f6\u591a\u6b21\u83b7\u5f97\u5f00\u6e90\u4e2d\u56fd Gitee \u6388\u4e88 GVP \u8bc1\u4e66\u3002"),Object(a.b)("h2",{id:"\u5174\u8da3\u7231\u597d"},"\u5174\u8da3\u7231\u597d"),Object(a.b)("p",null,"\u5bf9\u65b0\u6280\u672f\u9887\u611f\u5174\u8da3\uff0c\u559c\u6b22\u5f00\u6e90\u4e8b\u4e1a\uff0c\u559c\u6b22\u5206\u4eab\u6280\u672f\u3002"),Object(a.b)("p",null,"\u559c\u6b22\u770b\u535a\u5ba2\u56ed\u3001\u770b\u5f00\u6e90\u4e2d\u56fd\u3001\u770b Github/Gitee\u3001\u770b\u6296\u97f3\u3001\u770b\u52a8\u6f2b\u3001\u770b\u7f8e\u5267\u3002"),Object(a.b)("h2",{id:"\u4e2a\u4eba\u4e3b\u9875"},"\u4e2a\u4eba\u4e3b\u9875"),Object(a.b)("p",null,Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul"}),"https://gitee.com/monksoul")),Object(a.b)("p",null,Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/monksoul"}),"https://github.com/monksoul")))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),p=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},b=function(e){var t=p(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),b=p(n),d=r,f=b["".concat(c,".").concat(d)]||b[d]||s[d]||a;return n?o.a.createElement(f,i(i({ref:t},l),{},{components:n})):o.a.createElement(f,i({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[79],{154:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),o=n(7),a=(n(0),n(196)),c=(n(194),n(197)),i={id:"author",title:"1.2 \u5173\u4e8e\u4f5c\u8005",sidebar_label:"1.2 \u5173\u4e8e\u4f5c\u8005"},u={unversionedId:"author",id:"author",isDocsHomePage:!1,title:"1.2 \u5173\u4e8e\u4f5c\u8005",description:"\u4e92\u8054\u7f51\u8d26\u53f7",source:"@site/docs\\author.mdx",slug:"/author",permalink:"/docs/author",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/author.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1.2 \u5173\u4e8e\u4f5c\u8005",sidebar:"docs",previous:{title:"1.1 \u4ecb\u7ecd",permalink:"/docs/"},next:{title:"1.3 \u6e90\u7801\u7ed3\u6784",permalink:"/docs/source"}},l=[{value:"\u4e92\u8054\u7f51\u8d26\u53f7",id:"\u4e92\u8054\u7f51\u8d26\u53f7",children:[]},{value:"\u6280\u672f\u80fd\u529b",id:"\u6280\u672f\u80fd\u529b",children:[]},{value:"\u5174\u8da3\u7231\u597d",id:"\u5174\u8da3\u7231\u597d",children:[]},{value:"\u4e2a\u4eba\u4e3b\u9875",id:"\u4e2a\u4eba\u4e3b\u9875",children:[]}],p={toc:l};function b(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"\u4e92\u8054\u7f51\u8d26\u53f7"},"\u4e92\u8054\u7f51\u8d26\u53f7"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},"\u767e\u5c0f\u50e7"),Object(a.b)("li",{parentName:"ul"},"Monk/MonkSoul")),Object(a.b)("h2",{id:"\u6280\u672f\u80fd\u529b"},"\u6280\u672f\u80fd\u529b"),Object(a.b)("p",null,"\u81ea 2008 \u5e74 \u63a5\u89e6 IT \u8fd9\u4e2a\u884c\u4e1a\u4e5f\u6709\u5341\u4f59\u5e74\u4e86\uff0c\u5728 \u540e\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},".NET/.NET Core/Java/PHP"),"\uff09\u3001\u79fb\u52a8\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},"Xamarin/\u5c0f\u7a0b\u5e8f/Java/Objective-C"),"\uff09\u3001\u684c\u9762\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},"WinForm/WPF/Electron"),"\uff09\u3001\u524d\u7aef\uff08",Object(a.b)("inlineCode",{parentName:"p"},"Node/React/Vue/Angular"),"\uff09\u3001\u8bbe\u8ba1\uff08",Object(a.b)("inlineCode",{parentName:"p"},"Photoshop\u3001CDR\u3001AI"),"\uff09\u7b49\u4e3b\u6d41\u9886\u57df\u7565\u77e5\u4e00\u4e8c\u3002"),Object(a.b)("p",null,"\u540c\u65f6\u5728\u6280\u672f\u57f9\u8bad\u9886\u57df\u4e5f\u591a\u6709\u6d89\u8db3\u3002",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://www.chinadot.net/"}),"MIP(dotNET China Most Influential Professionals)")," \u4e13\u5bb6\uff0c\u540c\u65f6\u591a\u6b21\u83b7\u5f97\u5f00\u6e90\u4e2d\u56fd Gitee \u6388\u4e88 GVP \u8bc1\u4e66\u3002"),Object(a.b)("h2",{id:"\u5174\u8da3\u7231\u597d"},"\u5174\u8da3\u7231\u597d"),Object(a.b)("p",null,"\u5bf9\u65b0\u6280\u672f\u9887\u611f\u5174\u8da3\uff0c\u559c\u6b22\u5f00\u6e90\u4e8b\u4e1a\uff0c\u559c\u6b22\u5206\u4eab\u6280\u672f\u3002"),Object(a.b)("p",null,"\u559c\u6b22\u770b\u535a\u5ba2\u56ed\u3001\u770b\u5f00\u6e90\u4e2d\u56fd\u3001\u770b Github/Gitee\u3001\u770b\u6296\u97f3\u3001\u770b\u52a8\u6f2b\u3001\u770b\u7f8e\u5267\u3002"),Object(a.b)("h2",{id:"\u4e2a\u4eba\u4e3b\u9875"},"\u4e2a\u4eba\u4e3b\u9875"),Object(a.b)("p",null,Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul"}),"https://gitee.com/monksoul")),Object(a.b)("p",null,Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://github.com/monksoul"}),"https://github.com/monksoul")))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),p=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},b=function(e){var t=p(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),b=p(n),d=r,f=b["".concat(c,".").concat(d)]||b[d]||s[d]||a;return n?o.a.createElement(f,i(i({ref:t},l),{},{components:n})):o.a.createElement(f,i({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/b80c29d5.3365078f.js b/docs/b80c29d5.e8ecf3ec.js similarity index 97% rename from docs/b80c29d5.3365078f.js rename to docs/b80c29d5.e8ecf3ec.js index e2182fe2e8d..d99213f98f1 100644 --- a/docs/b80c29d5.3365078f.js +++ b/docs/b80c29d5.e8ecf3ec.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[76],{151:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return u}));var a=n(3),r=n(7),o=(n(0),n(192)),i=n(193),c={id:"dbcontext-locator",title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",sidebar_label:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},b={unversionedId:"dbcontext-locator",id:"dbcontext-locator",isDocsHomePage:!1,title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",description:"9.2.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",source:"@site/docs\\dbcontext-locator.mdx",slug:"/dbcontext-locator",permalink:"/docs/dbcontext-locator",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-locator.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",sidebar:"docs",previous:{title:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",permalink:"/docs/dbcontext"},next:{title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",permalink:"/docs/entity"}},l=[{value:"9.2.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"921-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",children:[]},{value:"9.2.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528",id:"922-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528",children:[]},{value:"9.2.3 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"923-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",children:[]},{value:"9.2.4 \u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"924-\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",children:[]},{value:"9.2.5 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61",id:"925-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61",children:[]},{value:"9.2.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"926-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function u(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)(i.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"921-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},"9.2.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),Object(o.b)("p",null,"\u5728\u4e86\u89e3\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u4e86\u89e3\u4ec0\u4e48\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668"),"\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668")," \u5c31\u662f\u7ed9\u7269\u4f53\u5b89\u88c5\u7279\u6b8a\u914d\u7f6e\uff0c\u4f7f\u5176\u80fd\u591f\u88ab\u5b9e\u65f6\u8ffd\u8e2a\u548c\u5b9a\u4f4d\u3002"),Object(o.b)("p",null,"\u90a3\u4e3a\u4ec0\u4e48\u9700\u8981 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668"),"\uff1f"),Object(o.b)("p",null,"\u7531\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"EF Core")," \u672c\u8eab\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u64cd\u4f5c\uff0c\u4f46\u662f\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"\u4f9d\u8d56\u6ce8\u5165")," \u7684\u65b9\u5f0f\u9ed8\u8ba4\u53ea\u521d\u59cb\u5316\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u4e5f\u5c31\u662f\u5982\u679c\u6211\u4eec\u60f3\u8981\u64cd\u4f5c\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u90a3\u4e48 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6784\u9020\u51fd\u6570")," \u6ce8\u5165\u65b9\u5f0f\u5c31\u4f1a\u53d8\u5f97\u590d\u6742\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u5b9e\u73b0\u4e86\u4e00\u5957 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668")," \u529f\u80fd\uff0c\u901a\u8fc7\u8fd9\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668")," \uff0c\u6211\u4eec\u5c31\u80fd\u591f\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"\u4f9d\u8d56\u6ce8\u5165")," \u7b49\u591a\u4e2a\u65b9\u5f0f\u5b9a\u4f4d\u5230\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5e76\u521d\u59cb\u5316\u3002"),Object(o.b)("h2",{id:"922-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528"},"9.2.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u5b9e\u73b0\u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u907f\u514d\u4e1a\u52a1\u5c42\u76f4\u63a5\u5f15\u7528 ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext")),Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u5b9e\u73b0\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u3001\u8bfb\u5199\u5206\u79bb\u3001\u4e3b\u4ece\u5e93\u7b49\u590d\u6742\u64cd\u4f5c")),Object(o.b)("h2",{id:"923-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},"9.2.3 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),Object(o.b)("p",null,"\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u53ea\u9700\u9075\u5faa\u4e09\u4e2a\u539f\u5219\u5373\u53ef\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5fc5\u987b\u662f\u516c\u5f00 ",Object(o.b)("inlineCode",{parentName:"li"},"class")," \u7c7b\u578b\u540c\u65f6\u5177\u5907\u65e0\u53c2\u6784\u9020\u51fd\u6570"),Object(o.b)("li",{parentName:"ul"},"\u8be5\u7c7b\u578b\u5fc5\u987b\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"li"},"IDbContextLocator")," \u63a5\u53e3"),Object(o.b)("li",{parentName:"ul"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u548c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5fc5\u987b\u662f\u4e00\u5bf9\u4e00\u5173\u7cfb\uff0c\u4e5f\u5c31\u662f\u4e0d\u80fd\u540c\u65f6\u88ab\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4f7f\u7528")),Object(o.b)("p",null,"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5b9a\u4e49\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public sealed class FurDbContextLocator : IDbContextLocator\n {\n }\n}\n")),Object(o.b)("h2",{id:"924-\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},"9.2.4 \u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u5df2\u7ecf\u63d0\u4f9b\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"MasterDbContextLocator")," \u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u6240\u4ee5\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u53ea\u9700\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5373\u53ef\u3002"),Object(o.b)("p",null,"\u5982\uff1a\u53ea\u6709\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString", DbProvider.Sqlite)]\n public class DefaultDbContext : AppDbContext // \u65e0\u9700\u6307\u5b9a\u5b9a\u4f4d\u5668\n {\n public DefaultDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u591a\u6570\u636e\u5e93\u5b9a\u4f4d\u5668")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u6570\u636e\u5e93\u7684\u5b9a\u4f4d\u5668\u9ed8\u8ba4\u4e3a ",Object(o.b)("inlineCode",{parentName:"p"},"MasterDbContextLocator"),"\uff0c\u6240\u4ee5\u65e0\u9700\u663e\u793a\u6307\u5b9a\u5b9a\u4f4d\u5668\uff0c",Object(o.b)("strong",{parentName:"p"},"\u4f46\u4ece\u7b2c\u4e8c\u4e2a\u6570\u636e\u5e93\u5f00\u59cb\uff0c\u90fd\u5fc5\u987b\u6307\u5b9a\u6570\u636e\u5e93\u5b9a\u4f4d\u5668"),"\u3002\u5982\uff1a"),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e0a\u4e0b\u6587\uff1a")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"options.AddDbPool();\n")),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u5b9a\u4e49\u4e0a\u4e0b\u6587")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString", DbProvider.Sqlite)]\n public class OtherDbContext : AppDbContext // \u9700\u6307\u5b9a\u5b9a\u4f4d\u5668\n {\n public OtherDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Entity/IEntity")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"IRepository")," \u7b49\u90fd\u9700\u8981\u6307\u5b9a\u5b9a\u4f4d\u5668\uff0c\u5982\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"IEntity"),"\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"IRepository")," \u64cd\u4f5c\u3002 "))),Object(o.b)("h2",{id:"925-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61"},"9.2.5 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61"),Object(o.b)("p",null,"\u76ee\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u652f\u6301\u4ee5\u4e0b\u591a\u4e2a\u5bf9\u8c61\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext"),"\uff1a\u6570\u636e\u4e0a\u4e0b\u6587"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IRepository"),": Sql \u64cd\u4f5c\u4ed3\u50a8"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Func"),"\uff1a\u4f9d\u8d56\u6ce8\u5165\u83b7\u53d6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Entity")," \uff1a\u5b9e\u4f53\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"EntityBase"),"\uff1a\u5b9e\u4f53\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"EntityNotKey"),"\uff1a\u65e0\u952e\u5b9e\u4f53\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IEntitySeedData"),"\uff1a\u79cd\u5b50\u6570\u636e\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IEntityTypeBuilder"),"\uff1a\u5b9e\u4f53\u7c7b\u578b\u6784\u5efa\u5668"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IModelBuilderFilter"),"\uff1a\u6a21\u578b\u6784\u5efa\u7b5b\u9009\u5668"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"[QueryableFunction(DbContextLocators=Type[])]"),"\uff1a\u67e5\u8be2\u51fd\u6570")),Object(o.b)("h2",{id:"926-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.2.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(191);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),u=p(n),d=a,m=u["".concat(i,".").concat(d)]||u[d]||s[d]||o;return n?r.a.createElement(m,c(c({ref:t},l),{},{components:n})):r.a.createElement(m,c({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=d;var c={};for(var b in t)hasOwnProperty.call(t,b)&&(c[b]=t[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[80],{155:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return u}));var a=n(3),r=n(7),o=(n(0),n(196)),i=n(197),c={id:"dbcontext-locator",title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",sidebar_label:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},b={unversionedId:"dbcontext-locator",id:"dbcontext-locator",isDocsHomePage:!1,title:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",description:"9.2.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",source:"@site/docs\\dbcontext-locator.mdx",slug:"/dbcontext-locator",permalink:"/docs/dbcontext-locator",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-locator.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",sidebar:"docs",previous:{title:"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587",permalink:"/docs/dbcontext"},next:{title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",permalink:"/docs/entity"}},l=[{value:"9.2.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"921-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",children:[]},{value:"9.2.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528",id:"922-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528",children:[]},{value:"9.2.3 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"923-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",children:[]},{value:"9.2.4 \u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",id:"924-\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668",children:[]},{value:"9.2.5 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61",id:"925-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61",children:[]},{value:"9.2.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"926-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function u(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(o.b)(i.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"921-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},"9.2.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),Object(o.b)("p",null,"\u5728\u4e86\u89e3\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u4e86\u89e3\u4ec0\u4e48\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668"),"\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668")," \u5c31\u662f\u7ed9\u7269\u4f53\u5b89\u88c5\u7279\u6b8a\u914d\u7f6e\uff0c\u4f7f\u5176\u80fd\u591f\u88ab\u5b9e\u65f6\u8ffd\u8e2a\u548c\u5b9a\u4f4d\u3002"),Object(o.b)("p",null,"\u90a3\u4e3a\u4ec0\u4e48\u9700\u8981 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668"),"\uff1f"),Object(o.b)("p",null,"\u7531\u4e8e ",Object(o.b)("inlineCode",{parentName:"p"},"EF Core")," \u672c\u8eab\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u64cd\u4f5c\uff0c\u4f46\u662f\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"\u4f9d\u8d56\u6ce8\u5165")," \u7684\u65b9\u5f0f\u9ed8\u8ba4\u53ea\u521d\u59cb\u5316\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u4e5f\u5c31\u662f\u5982\u679c\u6211\u4eec\u60f3\u8981\u64cd\u4f5c\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\uff0c\u90a3\u4e48 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6784\u9020\u51fd\u6570")," \u6ce8\u5165\u65b9\u5f0f\u5c31\u4f1a\u53d8\u5f97\u590d\u6742\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u5b9e\u73b0\u4e86\u4e00\u5957 ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668")," \u529f\u80fd\uff0c\u901a\u8fc7\u8fd9\u4e2a ",Object(o.b)("inlineCode",{parentName:"p"},"\u5b9a\u4f4d\u5668")," \uff0c\u6211\u4eec\u5c31\u80fd\u591f\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"\u4f9d\u8d56\u6ce8\u5165")," \u7b49\u591a\u4e2a\u65b9\u5f0f\u5b9a\u4f4d\u5230\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5e76\u521d\u59cb\u5316\u3002"),Object(o.b)("h2",{id:"922-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528"},"9.2.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u4f5c\u7528"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u5b9e\u73b0\u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u907f\u514d\u4e1a\u52a1\u5c42\u76f4\u63a5\u5f15\u7528 ",Object(o.b)("inlineCode",{parentName:"li"},"DbContext")),Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u5b9e\u73b0\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u3001\u8bfb\u5199\u5206\u79bb\u3001\u4e3b\u4ece\u5e93\u7b49\u590d\u6742\u64cd\u4f5c")),Object(o.b)("h2",{id:"923-\u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},"9.2.3 \u5982\u4f55\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),Object(o.b)("p",null,"\u5b9a\u4e49\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u53ea\u9700\u9075\u5faa\u4e09\u4e2a\u539f\u5219\u5373\u53ef\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5fc5\u987b\u662f\u516c\u5f00 ",Object(o.b)("inlineCode",{parentName:"li"},"class")," \u7c7b\u578b\u540c\u65f6\u5177\u5907\u65e0\u53c2\u6784\u9020\u51fd\u6570"),Object(o.b)("li",{parentName:"ul"},"\u8be5\u7c7b\u578b\u5fc5\u987b\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"li"},"IDbContextLocator")," \u63a5\u53e3"),Object(o.b)("li",{parentName:"ul"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u548c\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5fc5\u987b\u662f\u4e00\u5bf9\u4e00\u5173\u7cfb\uff0c\u4e5f\u5c31\u662f\u4e0d\u80fd\u540c\u65f6\u88ab\u591a\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u4f7f\u7528")),Object(o.b)("p",null,"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5b9a\u4e49\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Core\n{\n public sealed class FurDbContextLocator : IDbContextLocator\n {\n }\n}\n")),Object(o.b)("h2",{id:"924-\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"},"9.2.4 \u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u5df2\u7ecf\u63d0\u4f9b\u4e86 ",Object(o.b)("inlineCode",{parentName:"p"},"MasterDbContextLocator")," \u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\uff0c\u6240\u4ee5\u9ed8\u8ba4\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u53ea\u9700\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"p"},"AppDbContext")," \u5373\u53ef\u3002"),Object(o.b)("p",null,"\u5982\uff1a\u53ea\u6709\u4e00\u4e2a\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4e49\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString", DbProvider.Sqlite)]\n public class DefaultDbContext : AppDbContext // \u65e0\u9700\u6307\u5b9a\u5b9a\u4f4d\u5668\n {\n public DefaultDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u591a\u6570\u636e\u5e93\u5b9a\u4f4d\u5668")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u6570\u636e\u5e93\u7684\u5b9a\u4f4d\u5668\u9ed8\u8ba4\u4e3a ",Object(o.b)("inlineCode",{parentName:"p"},"MasterDbContextLocator"),"\uff0c\u6240\u4ee5\u65e0\u9700\u663e\u793a\u6307\u5b9a\u5b9a\u4f4d\u5668\uff0c",Object(o.b)("strong",{parentName:"p"},"\u4f46\u4ece\u7b2c\u4e8c\u4e2a\u6570\u636e\u5e93\u5f00\u59cb\uff0c\u90fd\u5fc5\u987b\u6307\u5b9a\u6570\u636e\u5e93\u5b9a\u4f4d\u5668"),"\u3002\u5982\uff1a"),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e0a\u4e0b\u6587\uff1a")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"options.AddDbPool();\n")),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u5b9a\u4e49\u4e0a\u4e0b\u6587")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString", DbProvider.Sqlite)]\n public class OtherDbContext : AppDbContext // \u9700\u6307\u5b9a\u5b9a\u4f4d\u5668\n {\n public OtherDbContext(DbContextOptions options) : base(options)\n {\n }\n }\n}\n')),Object(o.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Entity/IEntity")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"IRepository")," \u7b49\u90fd\u9700\u8981\u6307\u5b9a\u5b9a\u4f4d\u5668\uff0c\u5982\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"IEntity"),"\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"IRepository")," \u64cd\u4f5c\u3002 "))),Object(o.b)("h2",{id:"925-\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61"},"9.2.5 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u652f\u6301\u5bf9\u8c61"),Object(o.b)("p",null,"\u76ee\u524d\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u652f\u6301\u4ee5\u4e0b\u591a\u4e2a\u5bf9\u8c61\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"AppDbContext"),"\uff1a\u6570\u636e\u4e0a\u4e0b\u6587"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IRepository"),": Sql \u64cd\u4f5c\u4ed3\u50a8"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Func"),"\uff1a\u4f9d\u8d56\u6ce8\u5165\u83b7\u53d6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Entity")," \uff1a\u5b9e\u4f53\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"EntityBase"),"\uff1a\u5b9e\u4f53\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"EntityNotKey"),"\uff1a\u65e0\u952e\u5b9e\u4f53\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IEntitySeedData"),"\uff1a\u79cd\u5b50\u6570\u636e\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IEntityTypeBuilder"),"\uff1a\u5b9e\u4f53\u7c7b\u578b\u6784\u5efa\u5668"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IModelBuilderFilter"),"\uff1a\u6a21\u578b\u6784\u5efa\u7b5b\u9009\u5668"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"[QueryableFunction(DbContextLocators=Type[])]"),"\uff1a\u67e5\u8be2\u51fd\u6570")),Object(o.b)("h2",{id:"926-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.2.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return o})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return o?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=o();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},d=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),u=p(n),d=a,m=u["".concat(i,".").concat(d)]||u[d]||s[d]||o;return n?r.a.createElement(m,c(c({ref:t},l),{},{components:n})):r.a.createElement(m,c({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=n.length,i=new Array(o);i[0]=d;var c={};for(var b in t)hasOwnProperty.call(t,b)&&(c[b]=t[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/ba0099d5.378158a4.js b/docs/ba0099d5.5ed31b58.js similarity index 91% rename from docs/ba0099d5.378158a4.js rename to docs/ba0099d5.5ed31b58.js index e5d9bee3428..2cf1088c930 100644 --- a/docs/ba0099d5.378158a4.js +++ b/docs/ba0099d5.5ed31b58.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[77],{152:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),a=(n(0),n(192)),c=n(193),i={id:"oops",title:"4. Oops \u9759\u6001\u7c7b",sidebar_label:"4. Oops \u9759\u6001\u7c7b"},l={unversionedId:"global/oops",id:"global/oops",isDocsHomePage:!1,title:"4. Oops \u9759\u6001\u7c7b",description:"4.1 \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38",source:"@site/docs\\global\\oops.mdx",slug:"/global/oops",permalink:"/docs/global/oops",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/oops.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4. Oops \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"3. DataValidator \u9759\u6001\u7c7b",permalink:"/docs/global/datavalidator"},next:{title:"5. LinqExpression \u9759\u6001\u7c7b",permalink:"/docs/global/linqexpression"}},u=[{value:"4.1 \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38",id:"41-\u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38",children:[]},{value:"4.2 \u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38",id:"42-\u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38",children:[]},{value:"4.3 \u72b6\u6001\u7801\u5f02\u5e38",id:"43-\u72b6\u6001\u7801\u5f02\u5e38",children:[]},{value:"4.4 \u72b6\u6001\u7801\u5f02\u5e38",id:"44-\u72b6\u6001\u7801\u5f02\u5e38",children:[]}],s={toc:u};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"41-\u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38"},"4.1 \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh("\u5f02\u5e38\u6d88\u606f");\nthrow Oops.Oh("\u5f02\u5e38\u6d88\u606f\uff1a{0}", "\u51fa\u9519\u4e86");\n')),Object(a.b)("h2",{id:"42-\u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38"},"4.2 \u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh("\u5f02\u5e38\u6d88\u606f", typeof(ArgumentNullException));\nthrow Oops.Oh("\u5f02\u5e38\u6d88\u606f\uff1a{0}", typeof(ArgumentNullException), "\u51fa\u9519\u4e86");\n')),Object(a.b)("h2",{id:"43-\u72b6\u6001\u7801\u5f02\u5e38"},"4.3 \u72b6\u6001\u7801\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh(1000);\nthrow Oops.Oh(1000, "\u51fa\u9519\u4e86");\n')),Object(a.b)("h2",{id:"44-\u72b6\u6001\u7801\u5f02\u5e38"},"4.4 \u72b6\u6001\u7801\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh(1000, typeof(ArgumentNullException));\nthrow Oops.Oh(1000, typeof(ArgumentNullException), "\u51fa\u9519\u4e86");\n')))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var u=o.a.createContext({}),s=function(e){var t=o.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=s(e.components);return o.a.createElement(u.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=s(n),d=r,f=p["".concat(c,".").concat(d)]||p[d]||b[d]||a;return n?o.a.createElement(f,i(i({ref:t},u),{},{components:n})):o.a.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=d;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[81],{156:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return u})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),a=(n(0),n(196)),c=n(197),i={id:"oops",title:"4. Oops \u9759\u6001\u7c7b",sidebar_label:"4. Oops \u9759\u6001\u7c7b"},l={unversionedId:"global/oops",id:"global/oops",isDocsHomePage:!1,title:"4. Oops \u9759\u6001\u7c7b",description:"4.1 \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38",source:"@site/docs\\global\\oops.mdx",slug:"/global/oops",permalink:"/docs/global/oops",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/oops.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4. Oops \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"3. DataValidator \u9759\u6001\u7c7b",permalink:"/docs/global/datavalidator"},next:{title:"5. LinqExpression \u9759\u6001\u7c7b",permalink:"/docs/global/linqexpression"}},u=[{value:"4.1 \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38",id:"41-\u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38",children:[]},{value:"4.2 \u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38",id:"42-\u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38",children:[]},{value:"4.3 \u72b6\u6001\u7801\u5f02\u5e38",id:"43-\u72b6\u6001\u7801\u5f02\u5e38",children:[]},{value:"4.4 \u72b6\u6001\u7801\u5f02\u5e38",id:"44-\u72b6\u6001\u7801\u5f02\u5e38",children:[]}],s={toc:u};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"41-\u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38"},"4.1 \u629b\u51fa\u5b57\u7b26\u4e32\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh("\u5f02\u5e38\u6d88\u606f");\nthrow Oops.Oh("\u5f02\u5e38\u6d88\u606f\uff1a{0}", "\u51fa\u9519\u4e86");\n')),Object(a.b)("h2",{id:"42-\u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38"},"4.2 \u6307\u5b9a\u7c7b\u578b\u7684\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh("\u5f02\u5e38\u6d88\u606f", typeof(ArgumentNullException));\nthrow Oops.Oh("\u5f02\u5e38\u6d88\u606f\uff1a{0}", typeof(ArgumentNullException), "\u51fa\u9519\u4e86");\n')),Object(a.b)("h2",{id:"43-\u72b6\u6001\u7801\u5f02\u5e38"},"4.3 \u72b6\u6001\u7801\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh(1000);\nthrow Oops.Oh(1000, "\u51fa\u9519\u4e86");\n')),Object(a.b)("h2",{id:"44-\u72b6\u6001\u7801\u5f02\u5e38"},"4.4 \u72b6\u6001\u7801\u5f02\u5e38"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'throw Oops.Oh(1000, typeof(ArgumentNullException));\nthrow Oops.Oh(1000, typeof(ArgumentNullException), "\u51fa\u9519\u4e86");\n')))}p.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return f}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var u=o.a.createContext({}),s=function(e){var t=o.a.useContext(u),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=s(e.components);return o.a.createElement(u.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,u=l(e,["components","mdxType","originalType","parentName"]),p=s(n),d=r,f=p["".concat(c,".").concat(d)]||p[d]||b[d]||a;return n?o.a.createElement(f,i(i({ref:t},u),{},{components:n})):o.a.createElement(f,i({ref:t},u))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=d;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/bdb89910.da4ad34c.js b/docs/bdb89910.7e60da37.js similarity index 94% rename from docs/bdb89910.da4ad34c.js rename to docs/bdb89910.7e60da37.js index 8623041c5db..8a7a8b11ce6 100644 --- a/docs/bdb89910.da4ad34c.js +++ b/docs/bdb89910.7e60da37.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[78],{153:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return p})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(192)),i=n(193),o={id:"app",title:"1. App \u9759\u6001\u7c7b",sidebar_label:"1. App \u9759\u6001\u7c7b"},p={unversionedId:"global/app",id:"global/app",isDocsHomePage:!1,title:"1. App \u9759\u6001\u7c7b",description:"1.1 \u83b7\u53d6\u5168\u5c40\u914d\u7f6e",source:"@site/docs\\global\\app.mdx",slug:"/global/app",permalink:"/docs/global/app",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/app.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1. App \u9759\u6001\u7c7b",sidebar:"global",next:{title:"2. Db \u9759\u6001\u7c7b",permalink:"/docs/global/db"}},l=[{value:"1.1 \u83b7\u53d6\u5168\u5c40\u914d\u7f6e",id:"11-\u83b7\u53d6\u5168\u5c40\u914d\u7f6e",children:[]},{value:"1.2 \u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61",id:"12-\u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61",children:[]},{value:"1.3 \u83b7\u53d6\u73af\u5883\u5bf9\u8c61",id:"13-\u83b7\u53d6\u73af\u5883\u5bf9\u8c61",children:[]},{value:"1.4 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6",id:"14-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6",children:[]},{value:"1.5 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b",id:"15-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b",children:[]},{value:"1.6 \u83b7\u53d6 HttpContext",id:"16-\u83b7\u53d6-httpcontext",children:[]},{value:"1.7 \u83b7\u53d6\u767b\u5f55\u7684 User \u5bf9\u8c61",id:"17-\u83b7\u53d6\u767b\u5f55\u7684-user-\u5bf9\u8c61",children:[]},{value:"1.8 \u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668",id:"18-\u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668",children:[]},{value:"1.9 \u89e3\u6790\u670d\u52a1",id:"19-\u89e3\u6790\u670d\u52a1",children:[]},{value:"1.10 \u83b7\u53d6\u9009\u9879\u914d\u7f6e",id:"110-\u83b7\u53d6\u9009\u9879\u914d\u7f6e",children:[]},{value:"1.11 \u6253\u5370\u6570\u636e\u5230 MiniProfiler",id:"111-\u6253\u5370\u6570\u636e\u5230-miniprofiler",children:[]}],u={toc:l};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"11-\u83b7\u53d6\u5168\u5c40\u914d\u7f6e"},"1.1 \u83b7\u53d6\u5168\u5c40\u914d\u7f6e"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var settings = App.Settings;\n")),Object(c.b)("h2",{id:"12-\u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61"},"1.2 \u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u83b7\u53d6 IConfiguration \u5bf9\u8c61\nvar configuration = App.Configuration;\nvar value = configuration["xxx:xxx"];\n\n// \u83b7\u53d6\u6307\u5b9a\u8282\u70b9\u503c\u5e76\u8f6c\u6210 T \u7c7b\u578b\nvar data = App.GetConfig("key:key2");\n')),Object(c.b)("h2",{id:"13-\u83b7\u53d6\u73af\u5883\u5bf9\u8c61"},"1.3 \u83b7\u53d6\u73af\u5883\u5bf9\u8c61"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var webHostEnvironment = App.WebHostEnvironment;\n")),Object(c.b)("h2",{id:"14-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6"},"1.4 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var assemblies = App.Assemblies;\n")),Object(c.b)("h2",{id:"15-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b"},"1.5 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var types = App.EffectiveTypes;\n")),Object(c.b)("h2",{id:"16-\u83b7\u53d6-httpcontext"},"1.6 \u83b7\u53d6 ",Object(c.b)("inlineCode",{parentName:"h2"},"HttpContext")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var httpContext = App.HttpContext;\n")),Object(c.b)("h2",{id:"17-\u83b7\u53d6\u767b\u5f55\u7684-user-\u5bf9\u8c61"},"1.7 \u83b7\u53d6\u767b\u5f55\u7684 ",Object(c.b)("inlineCode",{parentName:"h2"},"User")," \u5bf9\u8c61"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var contextUser = App.User;\n")),Object(c.b)("h2",{id:"18-\u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668"},"1.8 \u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var serviceProvider = App.ServiceProvider;\n")),Object(c.b)("h2",{id:"19-\u89e3\u6790\u670d\u52a1"},"1.9 \u89e3\u6790\u670d\u52a1"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var service = App.GetService();\nvar service2 = App.GetService(typeof(TService));\n\nvar service3 = App.GetRequiredService();\nvar service4 = App.GetRequiredService(typeof(TService));\n")),Object(c.b)("h2",{id:"110-\u83b7\u53d6\u9009\u9879\u914d\u7f6e"},"1.10 \u83b7\u53d6\u9009\u9879\u914d\u7f6e"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var options = App.GetOptions();\nvar options2 = App.GetOptionsMonitor();\nvar options3 = App.GetOptionsSnapshot();\n")),Object(c.b)("h2",{id:"111-\u6253\u5370\u6570\u636e\u5230-miniprofiler"},"1.11 \u6253\u5370\u6570\u636e\u5230 ",Object(c.b)("inlineCode",{parentName:"h2"},"MiniProfiler")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'App.PrintToMiniProfiler("\u5206\u7c7b", "\u72b6\u6001", "\u8981\u6253\u5370\u7684\u6d88\u606f");\n')))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=a.a.createContext({}),u=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},b=function(e){var t=u(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,f=b["".concat(i,".").concat(d)]||b[d]||s[d]||c;return n?a.a.createElement(f,o(o({ref:t},l),{},{components:n})):a.a.createElement(f,o({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=d;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{157:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return p})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return b}));var r=n(3),a=n(7),c=(n(0),n(196)),i=n(197),o={id:"app",title:"1. App \u9759\u6001\u7c7b",sidebar_label:"1. App \u9759\u6001\u7c7b"},p={unversionedId:"global/app",id:"global/app",isDocsHomePage:!1,title:"1. App \u9759\u6001\u7c7b",description:"1.1 \u83b7\u53d6\u5168\u5c40\u914d\u7f6e",source:"@site/docs\\global\\app.mdx",slug:"/global/app",permalink:"/docs/global/app",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/app.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"1. App \u9759\u6001\u7c7b",sidebar:"global",next:{title:"2. Db \u9759\u6001\u7c7b",permalink:"/docs/global/db"}},l=[{value:"1.1 \u83b7\u53d6\u5168\u5c40\u914d\u7f6e",id:"11-\u83b7\u53d6\u5168\u5c40\u914d\u7f6e",children:[]},{value:"1.2 \u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61",id:"12-\u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61",children:[]},{value:"1.3 \u83b7\u53d6\u73af\u5883\u5bf9\u8c61",id:"13-\u83b7\u53d6\u73af\u5883\u5bf9\u8c61",children:[]},{value:"1.4 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6",id:"14-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6",children:[]},{value:"1.5 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b",id:"15-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b",children:[]},{value:"1.6 \u83b7\u53d6 HttpContext",id:"16-\u83b7\u53d6-httpcontext",children:[]},{value:"1.7 \u83b7\u53d6\u767b\u5f55\u7684 User \u5bf9\u8c61",id:"17-\u83b7\u53d6\u767b\u5f55\u7684-user-\u5bf9\u8c61",children:[]},{value:"1.8 \u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668",id:"18-\u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668",children:[]},{value:"1.9 \u89e3\u6790\u670d\u52a1",id:"19-\u89e3\u6790\u670d\u52a1",children:[]},{value:"1.10 \u83b7\u53d6\u9009\u9879\u914d\u7f6e",id:"110-\u83b7\u53d6\u9009\u9879\u914d\u7f6e",children:[]},{value:"1.11 \u6253\u5370\u6570\u636e\u5230 MiniProfiler",id:"111-\u6253\u5370\u6570\u636e\u5230-miniprofiler",children:[]}],u={toc:l};function b(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"11-\u83b7\u53d6\u5168\u5c40\u914d\u7f6e"},"1.1 \u83b7\u53d6\u5168\u5c40\u914d\u7f6e"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var settings = App.Settings;\n")),Object(c.b)("h2",{id:"12-\u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61"},"1.2 \u83b7\u53d6\u914d\u7f6e\u5bf9\u8c61"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u83b7\u53d6 IConfiguration \u5bf9\u8c61\nvar configuration = App.Configuration;\nvar value = configuration["xxx:xxx"];\n\n// \u83b7\u53d6\u6307\u5b9a\u8282\u70b9\u503c\u5e76\u8f6c\u6210 T \u7c7b\u578b\nvar data = App.GetConfig("key:key2");\n')),Object(c.b)("h2",{id:"13-\u83b7\u53d6\u73af\u5883\u5bf9\u8c61"},"1.3 \u83b7\u53d6\u73af\u5883\u5bf9\u8c61"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var webHostEnvironment = App.WebHostEnvironment;\n")),Object(c.b)("h2",{id:"14-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6"},"1.4 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u7a0b\u5e8f\u96c6"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var assemblies = App.Assemblies;\n")),Object(c.b)("h2",{id:"15-\u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b"},"1.5 \u83b7\u53d6\u9879\u76ee\u6240\u6709\u6709\u6548\u7c7b\u578b"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var types = App.EffectiveTypes;\n")),Object(c.b)("h2",{id:"16-\u83b7\u53d6-httpcontext"},"1.6 \u83b7\u53d6 ",Object(c.b)("inlineCode",{parentName:"h2"},"HttpContext")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var httpContext = App.HttpContext;\n")),Object(c.b)("h2",{id:"17-\u83b7\u53d6\u767b\u5f55\u7684-user-\u5bf9\u8c61"},"1.7 \u83b7\u53d6\u767b\u5f55\u7684 ",Object(c.b)("inlineCode",{parentName:"h2"},"User")," \u5bf9\u8c61"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var contextUser = App.User;\n")),Object(c.b)("h2",{id:"18-\u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668"},"1.8 \u83b7\u53d6\u670d\u52a1\u63d0\u4f9b\u5668"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var serviceProvider = App.ServiceProvider;\n")),Object(c.b)("h2",{id:"19-\u89e3\u6790\u670d\u52a1"},"1.9 \u89e3\u6790\u670d\u52a1"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var service = App.GetService();\nvar service2 = App.GetService(typeof(TService));\n\nvar service3 = App.GetRequiredService();\nvar service4 = App.GetRequiredService(typeof(TService));\n")),Object(c.b)("h2",{id:"110-\u83b7\u53d6\u9009\u9879\u914d\u7f6e"},"1.10 \u83b7\u53d6\u9009\u9879\u914d\u7f6e"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var options = App.GetOptions();\nvar options2 = App.GetOptionsMonitor();\nvar options3 = App.GetOptionsSnapshot();\n")),Object(c.b)("h2",{id:"111-\u6253\u5370\u6570\u636e\u5230-miniprofiler"},"1.11 \u6253\u5370\u6570\u636e\u5230 ",Object(c.b)("inlineCode",{parentName:"h2"},"MiniProfiler")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'App.PrintToMiniProfiler("\u5206\u7c7b", "\u72b6\u6001", "\u8981\u6253\u5370\u7684\u6d88\u606f");\n')))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),a=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=a.a.createContext({}),u=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},b=function(e){var t=u(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,l=p(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,f=b["".concat(i,".").concat(d)]||b[d]||s[d]||c;return n?a.a.createElement(f,o(o({ref:t},l),{},{components:n})):a.a.createElement(f,o({ref:t},l))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=d;var o={};for(var p in t)hasOwnProperty.call(t,p)&&(o[p]=t[p]);o.originalType=e,o.mdxType="string"==typeof e?e:r,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/blog/atom.xml b/docs/blog/atom.xml index ba2b2cd4038..50fde3251c8 100644 --- a/docs/blog/atom.xml +++ b/docs/blog/atom.xml @@ -2,13 +2,27 @@ https://furion.pro/blog Furion Blog - 2020-08-19T00:00:00.000Z + 2021-02-02T00:00:00.000Z https://github.com/jpmonette/feed Furion Blog https://furion.pro/img/favicon.ico - <![CDATA[Furion 介绍]]> + <![CDATA[3. 文件上传下载]]> + fileupload-download + + 2021-02-02T00:00:00.000Z + + + + <![CDATA[2. HttpContext 应用]]> + httpcontext + + 2021-02-01T00:00:00.000Z + + + + <![CDATA[1. Furion 介绍]]> welcome 2020-08-19T00:00:00.000Z diff --git a/docs/blog/fileupload-download/index.html b/docs/blog/fileupload-download/index.html new file mode 100644 index 00000000000..4b5448d4d72 --- /dev/null +++ b/docs/blog/fileupload-download/index.html @@ -0,0 +1,34 @@ + + + + + + + + +3. 文件上传下载 | Furion + + + + + + + + + + +
+

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}

文件上传#

[HttpPost, NonUnify]
public async Task<IActionResult> UploadFileAsync(List<IFormFile> files)
{
long size = files.Sum(f => f.Length);
+
foreach (var formFile in files)
{
if (formFile.Length > 0)
{
var filePath = Path.GetTempFileName(); // 可以替代为你需要存储的真实路径
+
using (var stream = System.IO.File.Create(filePath))
{
await formFile.CopyToAsync(stream);
}
}
}
+
return Ok(new { count = files.Count, size });
}
+ + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/httpcontext/index.html b/docs/blog/httpcontext/index.html new file mode 100644 index 00000000000..32813c8296d --- /dev/null +++ b/docs/blog/httpcontext/index.html @@ -0,0 +1,31 @@ + + + + + + + + +2. HttpContext 应用 | Furion + + + + + + + + + + +
+

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

ControllerBase 派生类中#

ControllerBase 派生类中,我们可以直接通过 HttpContext 属性获取 HttpContext 对象。

通过注入 IHttpContextAccessor#

Furion 框架中,默认已经注册了 IHttpContextAccessor 服务,所以我们可以通过构造函数注入该对象获取。

public class AppService
{
public AppService(IHttpContextAccessor httpContextAccessor)
{
var httpContext = httpContextAccessor.HttpContext;
}
}

通过 HttpContextLocal 静态类#

Furion 框架提供了 HttpContextLocal 静态类方式获取 HttpContext,如:

var HttpContext = HttpContextLocal.Current();

通过 App.HttpContext#

App 静态类也提供了 App.HttpContext 获取 HttpContext 对象。

HttpContext 拓展方法#

Furion 框架也提供了一些常用的 HttpContext 拓展方法

获取当前请求的特性#

var attribute = httpContext.GetMetadata<SomeAttribute>();

设置 Swagger 自动授权#

httpContext.SigninToSwagger("你的token");

退出 Swagger 授权#

httpContext.SignoutToSwagger();

获取本地 IP 地址#

var ipv4 = httpContext.GetLocalIpAddressToIPv4();
var ipv6 = httpContext.GetLocalIpAddressToIPv6();

获取客户端 IP 地址#

var ipv4 = httpContext.GetRemoteIpAddressToIPv4();
var ipv6 = httpContext.GetRemoteIpAddressToIPv6();

判断是否是 Ajax 请求#

var isAjaxRequest = httpContext.IsAjaxRequest();
+ + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/index.html b/docs/blog/index.html index ea8f7378218..84794099a50 100644 --- a/docs/blog/index.html +++ b/docs/blog/index.html @@ -6,28 +6,32 @@ -Blog | Furion - - - - - - - - - +Blog | Furion + + + + + + + + + + +
-

Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

- - - - - - - - - +

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/rss.xml b/docs/blog/rss.xml index 692a125ecc8..d77a76d7cd1 100644 --- a/docs/blog/rss.xml +++ b/docs/blog/rss.xml @@ -4,11 +4,25 @@ Furion Blog https://furion.pro/blog Furion Blog - Wed, 19 Aug 2020 00:00:00 GMT + Tue, 02 Feb 2021 00:00:00 GMT https://validator.w3.org/feed/docs/rss2.html https://github.com/jpmonette/feed - <![CDATA[Furion 介绍]]> + <![CDATA[3. 文件上传下载]]> + https://furion.pro/blog/fileupload-download + fileupload-download + Tue, 02 Feb 2021 00:00:00 GMT + + + + <![CDATA[2. HttpContext 应用]]> + https://furion.pro/blog/httpcontext + httpcontext + Mon, 01 Feb 2021 00:00:00 GMT + + + + <![CDATA[1. Furion 介绍]]> https://furion.pro/blog/welcome welcome Wed, 19 Aug 2020 00:00:00 GMT diff --git a/docs/blog/tags/download/index.html b/docs/blog/tags/download/index.html new file mode 100644 index 00000000000..d0201af8ad3 --- /dev/null +++ b/docs/blog/tags/download/index.html @@ -0,0 +1,33 @@ + + + + + + + + +Posts tagged "download" | Furion + + + + + + + + + + + +
+

1 post tagged with "download"

View All Tags

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}
+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/furion/index.html b/docs/blog/tags/furion/index.html index 1edd369d9d2..8293437065d 100644 --- a/docs/blog/tags/furion/index.html +++ b/docs/blog/tags/furion/index.html @@ -6,28 +6,32 @@ -Posts tagged "furion" | Furion - - - - - - - - - +Posts tagged "furion" | Furion + + + + + + + + + + +
-

1 post tagged with "furion"

View All Tags

Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

- - - - - - - - - +

3 posts tagged with "furion"

View All Tags

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/furos/index.html b/docs/blog/tags/furos/index.html index 3f5a4a8ddcc..143c86fd64b 100644 --- a/docs/blog/tags/furos/index.html +++ b/docs/blog/tags/furos/index.html @@ -6,28 +6,32 @@ -Posts tagged "furos" | Furion - - - - - - - - - +Posts tagged "furos" | Furion + + + + + + + + + + +
-

1 post tagged with "furos"

View All Tags

Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

- - - - - - - - - +

3 posts tagged with "furos"

View All Tags

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/httpcontext/index.html b/docs/blog/tags/httpcontext/index.html new file mode 100644 index 00000000000..2d96564e7c5 --- /dev/null +++ b/docs/blog/tags/httpcontext/index.html @@ -0,0 +1,33 @@ + + + + + + + + +Posts tagged "httpcontext" | Furion + + + + + + + + + + + +
+

1 post tagged with "httpcontext"

View All Tags

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/index.html b/docs/blog/tags/index.html index 8232b5c5a49..1e6dda00e6d 100644 --- a/docs/blog/tags/index.html +++ b/docs/blog/tags/index.html @@ -6,24 +6,24 @@ -Tags | Furion - - - - - - - +Tags | Furion + + + + + + + - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/net-5/index.html b/docs/blog/tags/net-5/index.html index e5d3675cc77..40d3770f727 100644 --- a/docs/blog/tags/net-5/index.html +++ b/docs/blog/tags/net-5/index.html @@ -6,28 +6,32 @@ -Posts tagged ".net5" | Furion - - - - - - - - - +Posts tagged ".net5" | Furion + + + + + + + + + + +
-

1 post tagged with ".net5"

View All Tags

Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

- - - - - - - - - +

3 posts tagged with ".net5"

View All Tags

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/net/index.html b/docs/blog/tags/net/index.html index 4f3609e8016..56155f2b705 100644 --- a/docs/blog/tags/net/index.html +++ b/docs/blog/tags/net/index.html @@ -6,28 +6,32 @@ -Posts tagged ".net" | Furion - - - - - - - - - +Posts tagged ".net" | Furion + + + + + + + + + + +
-

1 post tagged with ".net"

View All Tags

Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

- - - - - - - - - +

3 posts tagged with ".net"

View All Tags

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/netcore/index.html b/docs/blog/tags/netcore/index.html index 0a977b54178..6a8948f5057 100644 --- a/docs/blog/tags/netcore/index.html +++ b/docs/blog/tags/netcore/index.html @@ -6,28 +6,32 @@ -Posts tagged ".netcore" | Furion - - - - - - - - - +Posts tagged ".netcore" | Furion + + + + + + + + + + +
-

1 post tagged with ".netcore"

View All Tags

Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

- - - - - - - - - +

3 posts tagged with ".netcore"

View All Tags

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}

2. HttpContext 应用

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

HttpContext 重大调整#

ASP.NET 的时代,我们通常通过 HttpContext 全局静态类获取请求上下文,但在 ASP.NET Core 中,HttpContext 是一个非静态的抽象类,无法手动创建,也无法通过静态获取。

虽然在 ASP.NET Core 中无法直接获取 HttpContext 对象。但是微软也提供了注入 IHttpContextAccessor 方式获取。

HttpContext 多种获取方式#

+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/tags/upload/index.html b/docs/blog/tags/upload/index.html new file mode 100644 index 00000000000..badc969774f --- /dev/null +++ b/docs/blog/tags/upload/index.html @@ -0,0 +1,33 @@ + + + + + + + + +Posts tagged "upload" | Furion + + + + + + + + + + + +
+

1 post tagged with "upload"

View All Tags

3. 文件上传下载

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

文件下载#

[HttpGet, NonUnify]
public IActionResult FileDownload(string path, string fileName)
{
string filePath = Path.GetFullPath("~/temp/").Replace("~\\", "") + path;
return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = fileName };
}
+ + + + + + + + + + + \ No newline at end of file diff --git a/docs/blog/welcome/index.html b/docs/blog/welcome/index.html index 23f34a3267d..4111e316c4b 100644 --- a/docs/blog/welcome/index.html +++ b/docs/blog/welcome/index.html @@ -6,26 +6,26 @@ -Furion 介绍 | Furion - - - - - - - - +1. Furion 介绍 | Furion + + + + + + + +
-

Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

🌭 开源地址#

🍿 Docker 镜像#

  • Docker Hub 线上镜像
docker run --name furion -p 5000:80 monksoul/furion:v1.4.3
  • 手动 打包镜像

打开 CMD/Shell/PowerShell 进入 Furion 项目根目录打包 Furion 镜像:

docker build -t furion:v1.4.3 .

打包成功后,直接 docker run

docker run --name furion -p 5000:80 furion:v1.4.3

🥥 框架拓展包#

包类型名称版本描述
nugetFurionnugetFurion 核心包
nugetFurion.Extras.Authentication.JwtBearernugetFurion Jwt 拓展包
nugetFurion.Extras.DependencyModel.CodeAnalysisnugetFurion CodeAnalysis 拓展包
nugetFurion.Extras.Web.HttpContextnugetFurion HttpContext 拓展包
nugetFurion.Extras.ObjectMapper.MapsternugetFurion Mapster 拓展包
nugetFurion.Extras.DatabaseAccessor.SqlSugarnugetFurion SqlSugar 拓展包
nugetFurion.Extras.DatabaseAccessor.DappernugetFurion Dapper 拓展包
nugetFurion.Extras.Logging.SerilognugetFurion Serilog 拓展包

🍄 框架脚手架#

模板类型名称版本描述
nugetFurion.Template.MvcnugetMvc 模板
nugetFurion.Template.ApinugetWebApi 模板
nugetFurion.Template.AppnugetMvc/WebApi 模板
nugetFurion.Template.RazornugetRazorPages 模板
nugetFurion.Template.RazorWithWebApinugetRazorPages/WebApi 模板
nugetFurion.Template.BlazornugetBlazor 模板
nugetFurion.Template.BlazorWithWebApinugetBlazor/WebApi 模板

如何使用脚手架

🍎 框架特点#

  • 全新面貌:基于 .NET 5 平台,没有历史包袱
  • 极易入门:只需要一个 Inject() 即可完成配置
  • 极速开发:内置丰富的企业应用开发功能
  • 极少依赖:框架只依赖两个第三方包
  • 极其灵活:轻松面对多变复杂的需求
  • 极易维护:采用独特的架构思想,只为长久维护设计
  • 完整文档:提供完善的开发文档

🥞 架构设计#

正在整理中...

🥝 功能模块#

🥐 框架依赖#

Furion 为了追求极速入门,极致性能,尽可能的不使用或减少第三方依赖。目前 Furion 仅集成了以下两个依赖:

麻雀虽小五脏俱全。Furion 即使只集成了这两个依赖,但是主流的 依赖注入/控制反转AOP 面向切面编程,事件总线数据验证数据库操作 等等一个都不少。

🥗 环境要求#

  • Visual Studio 2019 16.8 +
  • .NET 5 SDK +
  • .Net Standard 2.1 +

🥪 支持平台#

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
    • Xamarin/MAUI
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • MariaDB
    • PostgreSQL
    • InMemoryDatabase
    • Oracle(并未完全适配
    • Firebird
    • 达梦数据库
  • 应用部署
    • Kestrel
    • Nginx
    • Jexus
    • IIS
    • Apache
    • PM2
    • Supervisor
    • 单文件
    • 容器(Docker/K8S/K3S/Rancher)

🍖 关于性能#

Furion 目前采用 Visual Studio 2019 16.8 自带性能测试和 JMeter 进行测试,由于篇幅有限,只贴部分测试图,测试结果如下:


🍚 关于作者#

一个拥有近 13 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎,MIP(dotNET China Most Influential Professionals) 专家,同时多次获得开源中国 Gitee 授予 GVP 证书。

🍤 项目成员#

🎈 欢迎更多的开发者加入 Furion 大家庭。

🍝 他们都在用#

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 夫上技术(阳江)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司
  • 深圳市品立方科技有限公司
  • 上海奥达科股份有限公司
  • 中山市泓升软件科技有限公司
  • 唐山天权建筑科技有限公司
  • 北京帝龙科技有限公司
  • 深圳市希立网络有限公司
  • 广州市飞帆计算机技术有限公司
  • 泉州市润海信息科技有限公司
  • 成都市彼岸里信息科技有限公司
  • 福建省山水生活服务集团有限公司
  • 安徽宝典网络科技有限公司
  • 西安空岛网络科技有限公司
  • 果糖大数据科技(南通)有限公司
  • 上海楷青信息技术有限公司
  • 上海邮银通信发展有限公司
  • 合纵动力软件科技有限公司
  • 深圳合纵动力软件科技有限公司
  • 北京帝龙科技有限公司

如果您的项目使用到 Furion 开发,可以告诉我们。

🍻 贡献代码#

Furion 遵循 Apache-2.0 开源协议,欢迎大家提交 PRIssue

如果要为项目做出贡献,请查看贡献指南

🍍 捐赠列表#

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...
😤 好人!10Nice 的小僧,我们的 dotnetchina 马上火起来了
😮 木木 Woody10感谢您的开源项目!
😚 Joker HouQQ 超级会员一个月
🤠 ccdfzQQ 专属红包 199
🌝 天夫李总支付宝 6666Furion 非常有意思,持续关注
😝 六尘子微信红包 199公司已经使用,小小敬意
🤠 ccdfzQQ 专属红包 200赞助一根内存条
🤑 邓亮灯28.88感谢您的开源项目!
😬 天道酬勤微信二维码 188小小心意
🥰 却月居士QQ 专属红包 100恭喜发财
🤩 鲁旭100感谢您的开源项目!
😬 散客行微信二维码 666终于找到一个不错的框架
😌 本心100项目功能很强大
🙆‍♂️ 毕业生100请你喝杯咖啡
🦹‍♀️ 猪鼻子微信二维码 668
🧟‍♂️ 明年·今日200使用的框架里最爽的,最理想的!加油
👨‍🎓 过去的过去50感谢您的开源项目!
👨‍🔧 万里兮100新公司的第一个项目从 Furion 开始
👴 Muphalem20很热心很亲切的开发者,加油!
💂‍♂️ 吃锅巴的码农微信二维码 500就冲你的文档写得好!
🤴 三重罗生门微信红包 200下次烤鱼你请!
🤵 李涛10加油,我们看到了 dotnet 美好的明天 :)
😂 !@#$%^&QQ 专属红包 100刚接触 furion,文档真棒
😵 李斌20看到一个不错的框架,学习学习,感谢作者的无私奉献
😞 逞强QQ 专属红包 20恭喜发财
🤒 顾锦松QQ 专属红包 200期待文档完成时候
🧟‍♀️ 哈哈微信赞赏码 1000点赞作者!
🍍 Z微信赞赏码 100恭喜孩子诞生,谢谢大佬
🍲 海涛50恭喜
😣 h微信赞赏码 100qq82683656
👱‍♀️ 冷大大微信赞赏码 100加快文档和教学补充哦,另外需要钉钉群,平常不用 QQ
👜 腾坤微信赞赏码 10感谢您的开源项目,QQ:565728589

非常感谢您们的支持,正是因为您们,中国开源才可以越走越远,Furion 越走越远。

如果想成为 Furion 支持者或赞助商,请考虑:

🥔 QQ 交流群#

dotNET 中国 ① 🥇(已满

dotNET 中国 ②(空余)

🧆 友情链接#

👉 Furion 👉 SqlSugar 👉 Layx 👉 t-io 👉 ThinkPHP 👉 Hutool 👉 BootstrapAdmin 👉 BootstrapBlazor 👉 IoTSharp 👉 Anno.Core 👉 WaterCloud 👉 OpenAuth.Net

🍵 特别鸣谢#

在这里特别感谢 QQ 网名:蓝狐星Furion 提供演示云服务器。

- - - - - - - - +

1. Furion 介绍

dotNET China

dotNET China

为中国 .NET 开发者提供优质的资讯和技术分享。

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

🌭 开源地址#

🍿 Docker 镜像#

  • Docker Hub 线上镜像
docker run --name furion -p 5000:80 monksoul/furion:v1.4.3
  • 手动 打包镜像

打开 CMD/Shell/PowerShell 进入 Furion 项目根目录打包 Furion 镜像:

docker build -t furion:v1.4.3 .

打包成功后,直接 docker run

docker run --name furion -p 5000:80 furion:v1.4.3

🥥 框架拓展包#

包类型名称版本描述
nugetFurionnugetFurion 核心包
nugetFurion.Extras.Authentication.JwtBearernugetFurion Jwt 拓展包
nugetFurion.Extras.DependencyModel.CodeAnalysisnugetFurion CodeAnalysis 拓展包
nugetFurion.Extras.Web.HttpContextnugetFurion HttpContext 拓展包
nugetFurion.Extras.ObjectMapper.MapsternugetFurion Mapster 拓展包
nugetFurion.Extras.DatabaseAccessor.SqlSugarnugetFurion SqlSugar 拓展包
nugetFurion.Extras.DatabaseAccessor.DappernugetFurion Dapper 拓展包
nugetFurion.Extras.Logging.SerilognugetFurion Serilog 拓展包

🍄 框架脚手架#

模板类型名称版本描述
nugetFurion.Template.MvcnugetMvc 模板
nugetFurion.Template.ApinugetWebApi 模板
nugetFurion.Template.AppnugetMvc/WebApi 模板
nugetFurion.Template.RazornugetRazorPages 模板
nugetFurion.Template.RazorWithWebApinugetRazorPages/WebApi 模板
nugetFurion.Template.BlazornugetBlazor 模板
nugetFurion.Template.BlazorWithWebApinugetBlazor/WebApi 模板

如何使用脚手架

🍎 框架特点#

  • 全新面貌:基于 .NET 5 平台,没有历史包袱
  • 极易入门:只需要一个 Inject() 即可完成配置
  • 极速开发:内置丰富的企业应用开发功能
  • 极少依赖:框架只依赖两个第三方包
  • 极其灵活:轻松面对多变复杂的需求
  • 极易维护:采用独特的架构思想,只为长久维护设计
  • 完整文档:提供完善的开发文档

🥞 架构设计#

正在整理中...

🥝 功能模块#

🥐 框架依赖#

Furion 为了追求极速入门,极致性能,尽可能的不使用或减少第三方依赖。目前 Furion 仅集成了以下两个依赖:

麻雀虽小五脏俱全。Furion 即使只集成了这两个依赖,但是主流的 依赖注入/控制反转AOP 面向切面编程,事件总线数据验证数据库操作 等等一个都不少。

🥗 环境要求#

  • Visual Studio 2019 16.8 +
  • .NET 5 SDK +
  • .Net Standard 2.1 +

🥪 支持平台#

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
    • Xamarin/MAUI
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • MariaDB
    • PostgreSQL
    • InMemoryDatabase
    • Oracle(并未完全适配
    • Firebird
    • 达梦数据库
  • 应用部署
    • Kestrel
    • Nginx
    • Jexus
    • IIS
    • Apache
    • PM2
    • Supervisor
    • 单文件
    • 容器(Docker/K8S/K3S/Rancher)

🍖 关于性能#

Furion 目前采用 Visual Studio 2019 16.8 自带性能测试和 JMeter 进行测试,由于篇幅有限,只贴部分测试图,测试结果如下:


🍚 关于作者#

一个拥有近 13 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎,MIP(dotNET China Most Influential Professionals) 专家,同时多次获得开源中国 Gitee 授予 GVP 证书。

🍤 项目成员#

🎈 欢迎更多的开发者加入 Furion 大家庭。

🍝 他们都在用#

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 夫上技术(阳江)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司
  • 深圳市品立方科技有限公司
  • 上海奥达科股份有限公司
  • 中山市泓升软件科技有限公司
  • 唐山天权建筑科技有限公司
  • 北京帝龙科技有限公司
  • 深圳市希立网络有限公司
  • 广州市飞帆计算机技术有限公司
  • 泉州市润海信息科技有限公司
  • 成都市彼岸里信息科技有限公司
  • 福建省山水生活服务集团有限公司
  • 安徽宝典网络科技有限公司
  • 西安空岛网络科技有限公司
  • 果糖大数据科技(南通)有限公司
  • 上海楷青信息技术有限公司
  • 上海邮银通信发展有限公司
  • 合纵动力软件科技有限公司
  • 深圳合纵动力软件科技有限公司
  • 北京帝龙科技有限公司

如果您的项目使用到 Furion 开发,可以告诉我们。

🍻 贡献代码#

Furion 遵循 Apache-2.0 开源协议,欢迎大家提交 PRIssue

如果要为项目做出贡献,请查看贡献指南

🍍 捐赠列表#

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...
😤 好人!10Nice 的小僧,我们的 dotnetchina 马上火起来了
😮 木木 Woody10感谢您的开源项目!
😚 Joker HouQQ 超级会员一个月
🤠 ccdfzQQ 专属红包 199
🌝 天夫李总支付宝 6666Furion 非常有意思,持续关注
😝 六尘子微信红包 199公司已经使用,小小敬意
🤠 ccdfzQQ 专属红包 200赞助一根内存条
🤑 邓亮灯28.88感谢您的开源项目!
😬 天道酬勤微信二维码 188小小心意
🥰 却月居士QQ 专属红包 100恭喜发财
🤩 鲁旭100感谢您的开源项目!
😬 散客行微信二维码 666终于找到一个不错的框架
😌 本心100项目功能很强大
🙆‍♂️ 毕业生100请你喝杯咖啡
🦹‍♀️ 猪鼻子微信二维码 668
🧟‍♂️ 明年·今日200使用的框架里最爽的,最理想的!加油
👨‍🎓 过去的过去50感谢您的开源项目!
👨‍🔧 万里兮100新公司的第一个项目从 Furion 开始
👴 Muphalem20很热心很亲切的开发者,加油!
💂‍♂️ 吃锅巴的码农微信二维码 500就冲你的文档写得好!
🤴 三重罗生门微信红包 200下次烤鱼你请!
🤵 李涛10加油,我们看到了 dotnet 美好的明天 :)
😂 !@#$%^&QQ 专属红包 100刚接触 furion,文档真棒
😵 李斌20看到一个不错的框架,学习学习,感谢作者的无私奉献
😞 逞强QQ 专属红包 20恭喜发财
🤒 顾锦松QQ 专属红包 200期待文档完成时候
🧟‍♀️ 哈哈微信赞赏码 1000点赞作者!
🍍 Z微信赞赏码 100恭喜孩子诞生,谢谢大佬
🍲 海涛50恭喜
😣 h微信赞赏码 100qq82683656
👱‍♀️ 冷大大微信赞赏码 100加快文档和教学补充哦,另外需要钉钉群,平常不用 QQ
👜 腾坤微信赞赏码 10感谢您的开源项目,QQ:565728589

非常感谢您们的支持,正是因为您们,中国开源才可以越走越远,Furion 越走越远。

如果想成为 Furion 支持者或赞助商,请考虑:

🥔 QQ 交流群#

dotNET 中国 ① 🥇(已满

dotNET 中国 ②(空余)

🧆 友情链接#

👉 Furion 👉 SqlSugar 👉 Layx 👉 t-io 👉 ThinkPHP 👉 Hutool 👉 BootstrapAdmin 👉 BootstrapBlazor 👉 IoTSharp 👉 Anno.Core 👉 WaterCloud 👉 OpenAuth.Net

🍵 特别鸣谢#

在这里特别感谢 QQ 网名:蓝狐星Furion 提供演示云服务器。

+ + + + + + + + \ No newline at end of file diff --git a/docs/c1dfcd55.394c8560.js b/docs/c1dfcd55.d2d0d137.js similarity index 96% rename from docs/c1dfcd55.394c8560.js rename to docs/c1dfcd55.d2d0d137.js index 53aca2c4d19..ddf94b2a541 100644 --- a/docs/c1dfcd55.394c8560.js +++ b/docs/c1dfcd55.d2d0d137.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[79],{154:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),c=(n(0),n(192)),i=(n(190),n(193)),o={id:"deploy-docker",title:"27.2 \u5728 Docker \u90e8\u7f72",sidebar_label:"27.2 \u5728 Docker \u90e8\u7f72"},b={unversionedId:"deploy-docker",id:"deploy-docker",isDocsHomePage:!1,title:"27.2 \u5728 Docker \u90e8\u7f72",description:"27.2.1 \u5173\u4e8e Docker \u90e8\u7f72",source:"@site/docs\\deploy-docker.mdx",slug:"/deploy-docker",permalink:"/docs/deploy-docker",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/deploy-docker.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.2 \u5728 Docker \u90e8\u7f72",sidebar:"docs",previous:{title:"27.1 \u5728 IIS \u90e8\u7f72",permalink:"/docs/deploy-iis"},next:{title:"27.3 \u5728 Nginx \u90e8\u7f72",permalink:"/docs/deploy-nginx"}},l=[{value:"27.2.1 \u5173\u4e8e Docker \u90e8\u7f72",id:"2721-\u5173\u4e8e-docker-\u90e8\u7f72",children:[]},{value:"27.2.2 \u4e24\u79cd\u65b9\u5f0f\u6784\u5efa",id:"2722-\u4e24\u79cd\u65b9\u5f0f\u6784\u5efa",children:[{value:"27.2.2.1 \u53d1\u5e03\u540e\u6784\u5efa",id:"27221-\u53d1\u5e03\u540e\u6784\u5efa",children:[]},{value:"27.2.2.2 \u7f16\u8bd1+\u6784\u5efa+\u53d1\u5e03",id:"27222-\u7f16\u8bd1\u6784\u5efa\u53d1\u5e03",children:[]}]},{value:"27.2.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2723-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"2721-\u5173\u4e8e-docker-\u90e8\u7f72"},"27.2.1 \u5173\u4e8e ",Object(c.b)("inlineCode",{parentName:"h2"},"Docker")," \u90e8\u7f72"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Docker")," \u4e2d\u90e8\u7f72\u7f51\u7ad9\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"\u53d1\u5e03\u540e\u6784\u5efa"),"\uff1a\u6b64\u65b9\u5f0f\u662f\u5148\u53d1\u5e03\u7f51\u7ad9\u540e\u5728\u518d\u6784\u5efa\u955c\u50cf\uff0c\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u6784\u5efa\u5c42\uff0c\u800c\u4e14\u8fd8\u80fd\u7f29\u51cf\u955c\u50cf\u5927\u5c0f\u3002",Object(c.b)("strong",{parentName:"li"},"\uff08\u63a8\u8350\uff09")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"\u7f16\u8bd1+\u6784\u5efa+\u53d1\u5e03"),"\uff1a\u4e5f\u5c31\u662f\u8bf4\u5728 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile")," \u4e2d\u914d\u7f6e\u7f51\u7ad9\u4ece\u6784\u5efa\u5230\u53d1\u5e03\u7684\u5b8c\u6574\u8fc7\u7a0b\uff0c\u6b64\u65b9\u5f0f\u4f1a\u901f\u5ea6\u6162\uff0c\u800c\u4e14\u4f1a\u4ea7\u751f\u5197\u4f59\u5c42\uff0c\u589e\u52a0\u955c\u50cf\u5927\u5c0f\u3002")),Object(c.b)("h2",{id:"2722-\u4e24\u79cd\u65b9\u5f0f\u6784\u5efa"},"27.2.2 \u4e24\u79cd\u65b9\u5f0f\u6784\u5efa"),Object(c.b)("h3",{id:"27221-\u53d1\u5e03\u540e\u6784\u5efa"},"27.2.2.1 \u53d1\u5e03\u540e\u6784\u5efa"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u53d1\u5e03\u7f51\u7ad9")),Object(c.b)("p",null,"\u9996\u5148\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Visual Studio")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"dotnet cli")," \u4e2d\u53d1\u5e03\u7f51\u7ad9\uff0c\u53ef\u4ee5\u53c2\u8003 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"deploy-iis#2611-%E5%8F%91%E5%B8%83%E7%BD%91%E7%AB%99"}),"\u5728 IIS \u90e8\u7f72-\u53d1\u5e03\u7f51\u7ad9")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u7f16\u5199 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile"))),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),'FROM mcr.microsoft.com/dotnet/aspnet:5.0.1\nWORKDIR /app\nEXPOSE 80\nEXPOSE 443\n\nCOPY . .\nENTRYPOINT ["dotnet", "Furion.Web.Entry.dll"]\n')),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u5c06 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile")," \u6587\u4ef6\u62f7\u8d1d\u5230\u53d1\u5e03\u6839\u76ee\u5f55")),Object(c.b)("p",null,"\u5c06\u7f16\u5199\u597d\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Dockerfile")," \u6587\u4ef6\uff08\u6ce8\u610f ",Object(c.b)("inlineCode",{parentName:"p"},"D")," \u5927\u5199\uff09\u62f7\u8d1d\u5230\u53d1\u5e03\u7f51\u7ad9\u7684\u6839\u76ee\u5f55\u4e0b\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u6784\u5efa ",Object(c.b)("inlineCode",{parentName:"li"},"Docker")," \u955c\u50cf")),Object(c.b)("p",null,"\u5728\u7f51\u7ad9\u53d1\u5e03\u540e\u7684\u8def\u5f84\u6839\u76ee\u5f55\u4e0b\uff08\u5fc5\u987b\u542b ",Object(c.b)("inlineCode",{parentName:"p"},"Dockerfile"),"\uff09\u6253\u5f00 ",Object(c.b)("inlineCode",{parentName:"p"},"CMD/PowerShell")," \u53ea\u9700\u6784\u5efa\u547d\u4ee4\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker build -t \u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7 .\n")),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u540e\u7aef\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},".")," \u4e0d\u80fd\u7701\u7565"))),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u542f\u52a8\u955c\u50cf")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker run --name \u5bb9\u5668\u540d\u79f0 -p 5000:80 --restart=always -d \u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7\n")),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u53d1\u5e03\u5230 ",Object(c.b)("inlineCode",{parentName:"h5"},"hub.docker.com"))),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u9700\u8981\u5c06\u8be5\u7f51\u7ad9\u7684\u955c\u50cf\u516c\u5f00\u51fa\u53bb\uff0c\u90a3\u4e48\u53ef\u4ee5\u53d1\u5e03\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"hub.docker.com")," \u4e2d\u3002\u53d1\u5e03\u6b65\u9aa4\u5982\u4e0b\uff1a"),Object(c.b)("ul",{parentName:"div"},Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u4e3a\u955c\u50cf\u6253 ",Object(c.b)("inlineCode",{parentName:"li"},"tag")," \u6807\u7b7e")),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker tag \u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7 docker\u8d26\u53f7\u540d/\u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7\n")),Object(c.b)("p",{parentName:"div"},"\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker tag furion:v1.8.0 monksoul/furion:v1.8.0\n")),Object(c.b)("ul",{parentName:"div"},Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u767b\u5f55 ",Object(c.b)("inlineCode",{parentName:"li"},"docker"))),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker login\n")),Object(c.b)("ul",{parentName:"div"},Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u63a8\u9001\u5230 ",Object(c.b)("inlineCode",{parentName:"li"},"hub.docker.com"))),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker push docker\u8d26\u53f7\u540d/\u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7\n")),Object(c.b)("p",{parentName:"div"},"\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker push monksoul/furion:v1.8.0\n")))),Object(c.b)("h3",{id:"27222-\u7f16\u8bd1\u6784\u5efa\u53d1\u5e03"},"27.2.2.2 \u7f16\u8bd1+\u6784\u5efa+\u53d1\u5e03"),Object(c.b)("p",null,"\u6b64\u65b9\u5f0f\u53ef\u4ee5\u5077\u61d2\uff0c\u4f46\u662f\u4e0d\u592a\u63a8\u8350\uff0c\u4e0d\u8fc7\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u975e\u5e38\u6709\u7528\uff0c\u5c31\u662f\u96c6\u6210 ",Object(c.b)("inlineCode",{parentName:"p"},"Devops")," \u5de5\u5177\u94fe\u53ef\u4ee5\u505a\u5230\u4e00\u6b65\u5230\u4f4d\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u7f16\u5199 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile"))),Object(c.b)("p",null,"\u8fd9\u79cd\u65b9\u5f0f\u53ea\u9700\u8981\u628a ",Object(c.b)("inlineCode",{parentName:"p"},"Dockerfile")," \u5185\u5bb9\u66ff\u6362\u6210\u4ee5\u4e0b\u5373\u53ef\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash",metastring:"{6}","{6}":!0}),'FROM mcr.microsoft.com/dotnet/sdk:5.0.1 AS build\nWORKDIR /source\n\n# Download Source\nRUN git init\nRUN git remote add -t master -m master origin \u4f60\u7684\u6e90\u7801Git\u5730\u5740\nRUN git config core.sparseCheckout true\nRUN echo samples >> .git/info/sparse-checkout\nRUN git pull --depth 1 origin main\n\n# Restore And Publish\nWORKDIR /source/samples\nRUN dotnet restore\nRUN dotnet publish -c release -o /app --no-restore\n\n# Run\nFROM mcr.microsoft.com/dotnet/aspnet:5.0.1\nWORKDIR /app\nCOPY --from=build /app ./\nEXPOSE 80\nEXPOSE 443\nENTRYPOINT ["dotnet", "Furion.Web.Entry.dll"]\n')),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u5728 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile")," \u6240\u5728\u8def\u5f84\u6784\u5efa")),Object(c.b)("p",null,"\u63a5\u4e0b\u6765\u7684\u6b65\u9aa4\u548c\u4e0a\u8ff0\u6b65\u9aa4\u4e00\u81f4\uff0c\u4e0d\u518d\u91cd\u590d\u7f16\u5199"),Object(c.b)("h2",{id:"2723-\u53cd\u9988\u4e0e\u5efa\u8bae"},"27.2.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),d=p(n),u=a,m=d["".concat(i,".").concat(u)]||d[u]||s[u]||c;return n?r.a.createElement(m,o(o({ref:t},l),{},{components:n})):r.a.createElement(m,o({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=u;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[83],{158:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),c=(n(0),n(196)),i=(n(194),n(197)),o={id:"deploy-docker",title:"27.2 \u5728 Docker \u90e8\u7f72",sidebar_label:"27.2 \u5728 Docker \u90e8\u7f72"},b={unversionedId:"deploy-docker",id:"deploy-docker",isDocsHomePage:!1,title:"27.2 \u5728 Docker \u90e8\u7f72",description:"27.2.1 \u5173\u4e8e Docker \u90e8\u7f72",source:"@site/docs\\deploy-docker.mdx",slug:"/deploy-docker",permalink:"/docs/deploy-docker",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/deploy-docker.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.2 \u5728 Docker \u90e8\u7f72",sidebar:"docs",previous:{title:"27.1 \u5728 IIS \u90e8\u7f72",permalink:"/docs/deploy-iis"},next:{title:"27.3 \u5728 Nginx \u90e8\u7f72",permalink:"/docs/deploy-nginx"}},l=[{value:"27.2.1 \u5173\u4e8e Docker \u90e8\u7f72",id:"2721-\u5173\u4e8e-docker-\u90e8\u7f72",children:[]},{value:"27.2.2 \u4e24\u79cd\u65b9\u5f0f\u6784\u5efa",id:"2722-\u4e24\u79cd\u65b9\u5f0f\u6784\u5efa",children:[{value:"27.2.2.1 \u53d1\u5e03\u540e\u6784\u5efa",id:"27221-\u53d1\u5e03\u540e\u6784\u5efa",children:[]},{value:"27.2.2.2 \u7f16\u8bd1+\u6784\u5efa+\u53d1\u5e03",id:"27222-\u7f16\u8bd1\u6784\u5efa\u53d1\u5e03",children:[]}]},{value:"27.2.3 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2723-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:l};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"2721-\u5173\u4e8e-docker-\u90e8\u7f72"},"27.2.1 \u5173\u4e8e ",Object(c.b)("inlineCode",{parentName:"h2"},"Docker")," \u90e8\u7f72"),Object(c.b)("p",null,"\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Docker")," \u4e2d\u90e8\u7f72\u7f51\u7ad9\u6709\u4e24\u79cd\u65b9\u5f0f\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"\u53d1\u5e03\u540e\u6784\u5efa"),"\uff1a\u6b64\u65b9\u5f0f\u662f\u5148\u53d1\u5e03\u7f51\u7ad9\u540e\u5728\u518d\u6784\u5efa\u955c\u50cf\uff0c\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u6784\u5efa\u5c42\uff0c\u800c\u4e14\u8fd8\u80fd\u7f29\u51cf\u955c\u50cf\u5927\u5c0f\u3002",Object(c.b)("strong",{parentName:"li"},"\uff08\u63a8\u8350\uff09")),Object(c.b)("li",{parentName:"ul"},Object(c.b)("inlineCode",{parentName:"li"},"\u7f16\u8bd1+\u6784\u5efa+\u53d1\u5e03"),"\uff1a\u4e5f\u5c31\u662f\u8bf4\u5728 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile")," \u4e2d\u914d\u7f6e\u7f51\u7ad9\u4ece\u6784\u5efa\u5230\u53d1\u5e03\u7684\u5b8c\u6574\u8fc7\u7a0b\uff0c\u6b64\u65b9\u5f0f\u4f1a\u901f\u5ea6\u6162\uff0c\u800c\u4e14\u4f1a\u4ea7\u751f\u5197\u4f59\u5c42\uff0c\u589e\u52a0\u955c\u50cf\u5927\u5c0f\u3002")),Object(c.b)("h2",{id:"2722-\u4e24\u79cd\u65b9\u5f0f\u6784\u5efa"},"27.2.2 \u4e24\u79cd\u65b9\u5f0f\u6784\u5efa"),Object(c.b)("h3",{id:"27221-\u53d1\u5e03\u540e\u6784\u5efa"},"27.2.2.1 \u53d1\u5e03\u540e\u6784\u5efa"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u53d1\u5e03\u7f51\u7ad9")),Object(c.b)("p",null,"\u9996\u5148\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},"Visual Studio")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"dotnet cli")," \u4e2d\u53d1\u5e03\u7f51\u7ad9\uff0c\u53ef\u4ee5\u53c2\u8003 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"deploy-iis#2611-%E5%8F%91%E5%B8%83%E7%BD%91%E7%AB%99"}),"\u5728 IIS \u90e8\u7f72-\u53d1\u5e03\u7f51\u7ad9")),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u7f16\u5199 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile"))),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),'FROM mcr.microsoft.com/dotnet/aspnet:5.0.1\nWORKDIR /app\nEXPOSE 80\nEXPOSE 443\n\nCOPY . .\nENTRYPOINT ["dotnet", "Furion.Web.Entry.dll"]\n')),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u5c06 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile")," \u6587\u4ef6\u62f7\u8d1d\u5230\u53d1\u5e03\u6839\u76ee\u5f55")),Object(c.b)("p",null,"\u5c06\u7f16\u5199\u597d\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Dockerfile")," \u6587\u4ef6\uff08\u6ce8\u610f ",Object(c.b)("inlineCode",{parentName:"p"},"D")," \u5927\u5199\uff09\u62f7\u8d1d\u5230\u53d1\u5e03\u7f51\u7ad9\u7684\u6839\u76ee\u5f55\u4e0b\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u6784\u5efa ",Object(c.b)("inlineCode",{parentName:"li"},"Docker")," \u955c\u50cf")),Object(c.b)("p",null,"\u5728\u7f51\u7ad9\u53d1\u5e03\u540e\u7684\u8def\u5f84\u6839\u76ee\u5f55\u4e0b\uff08\u5fc5\u987b\u542b ",Object(c.b)("inlineCode",{parentName:"p"},"Dockerfile"),"\uff09\u6253\u5f00 ",Object(c.b)("inlineCode",{parentName:"p"},"CMD/PowerShell")," \u53ea\u9700\u6784\u5efa\u547d\u4ee4\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker build -t \u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7 .\n")),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u540e\u7aef\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},".")," \u4e0d\u80fd\u7701\u7565"))),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u542f\u52a8\u955c\u50cf")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker run --name \u5bb9\u5668\u540d\u79f0 -p 5000:80 --restart=always -d \u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7\n")),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u53d1\u5e03\u5230 ",Object(c.b)("inlineCode",{parentName:"h5"},"hub.docker.com"))),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u9700\u8981\u5c06\u8be5\u7f51\u7ad9\u7684\u955c\u50cf\u516c\u5f00\u51fa\u53bb\uff0c\u90a3\u4e48\u53ef\u4ee5\u53d1\u5e03\u5230 ",Object(c.b)("inlineCode",{parentName:"p"},"hub.docker.com")," \u4e2d\u3002\u53d1\u5e03\u6b65\u9aa4\u5982\u4e0b\uff1a"),Object(c.b)("ul",{parentName:"div"},Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u4e3a\u955c\u50cf\u6253 ",Object(c.b)("inlineCode",{parentName:"li"},"tag")," \u6807\u7b7e")),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker tag \u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7 docker\u8d26\u53f7\u540d/\u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7\n")),Object(c.b)("p",{parentName:"div"},"\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker tag furion:v1.8.0 monksoul/furion:v1.8.0\n")),Object(c.b)("ul",{parentName:"div"},Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u767b\u5f55 ",Object(c.b)("inlineCode",{parentName:"li"},"docker"))),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker login\n")),Object(c.b)("ul",{parentName:"div"},Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u63a8\u9001\u5230 ",Object(c.b)("inlineCode",{parentName:"li"},"hub.docker.com"))),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker push docker\u8d26\u53f7\u540d/\u7f51\u7ad9\u540d\u79f0:\u7f51\u7ad9\u7248\u672c\u53f7\n")),Object(c.b)("p",{parentName:"div"},"\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash"}),"docker push monksoul/furion:v1.8.0\n")))),Object(c.b)("h3",{id:"27222-\u7f16\u8bd1\u6784\u5efa\u53d1\u5e03"},"27.2.2.2 \u7f16\u8bd1+\u6784\u5efa+\u53d1\u5e03"),Object(c.b)("p",null,"\u6b64\u65b9\u5f0f\u53ef\u4ee5\u5077\u61d2\uff0c\u4f46\u662f\u4e0d\u592a\u63a8\u8350\uff0c\u4e0d\u8fc7\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\u975e\u5e38\u6709\u7528\uff0c\u5c31\u662f\u96c6\u6210 ",Object(c.b)("inlineCode",{parentName:"p"},"Devops")," \u5de5\u5177\u94fe\u53ef\u4ee5\u505a\u5230\u4e00\u6b65\u5230\u4f4d\u3002"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u7f16\u5199 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile"))),Object(c.b)("p",null,"\u8fd9\u79cd\u65b9\u5f0f\u53ea\u9700\u8981\u628a ",Object(c.b)("inlineCode",{parentName:"p"},"Dockerfile")," \u5185\u5bb9\u66ff\u6362\u6210\u4ee5\u4e0b\u5373\u53ef\uff1a"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-bash",metastring:"{6}","{6}":!0}),'FROM mcr.microsoft.com/dotnet/sdk:5.0.1 AS build\nWORKDIR /source\n\n# Download Source\nRUN git init\nRUN git remote add -t master -m master origin \u4f60\u7684\u6e90\u7801Git\u5730\u5740\nRUN git config core.sparseCheckout true\nRUN echo samples >> .git/info/sparse-checkout\nRUN git pull --depth 1 origin main\n\n# Restore And Publish\nWORKDIR /source/samples\nRUN dotnet restore\nRUN dotnet publish -c release -o /app --no-restore\n\n# Run\nFROM mcr.microsoft.com/dotnet/aspnet:5.0.1\nWORKDIR /app\nCOPY --from=build /app ./\nEXPOSE 80\nEXPOSE 443\nENTRYPOINT ["dotnet", "Furion.Web.Entry.dll"]\n')),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\ud83d\udc49 \u5728 ",Object(c.b)("inlineCode",{parentName:"li"},"Dockerfile")," \u6240\u5728\u8def\u5f84\u6784\u5efa")),Object(c.b)("p",null,"\u63a5\u4e0b\u6765\u7684\u6b65\u9aa4\u548c\u4e0a\u8ff0\u6b65\u9aa4\u4e00\u81f4\uff0c\u4e0d\u518d\u91cd\u590d\u7f16\u5199"),Object(c.b)("h2",{id:"2723-\u53cd\u9988\u4e0e\u5efa\u8bae"},"27.2.3 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),p=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=p(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},s={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),d=p(n),u=a,m=d["".concat(i,".").concat(u)]||d[u]||s[u]||c;return n?r.a.createElement(m,o(o({ref:t},l),{},{components:n})):r.a.createElement(m,o({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=u;var o={};for(var b in t)hasOwnProperty.call(t,b)&&(o[b]=t[b]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/c295a3b5.048a9904.js b/docs/c295a3b5.048a9904.js new file mode 100644 index 00000000000..ee434d0710a --- /dev/null +++ b/docs/c295a3b5.048a9904.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[84],{159:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return p})),n.d(t,"toc",(function(){return i})),n.d(t,"default",(function(){return b}));var r=n(3),o=n(7),a=(n(0),n(196)),c=(n(194),{slug:"httpcontext",title:"2. HttpContext \u5e94\u7528",author:"dotNET China",author_title:"\u4e3a\u4e2d\u56fd .NET \u5f00\u53d1\u8005\u63d0\u4f9b\u4f18\u8d28\u7684\u8d44\u8baf\u548c\u6280\u672f\u5206\u4eab\u3002",author_url:"https://www.chinadot.net",author_image_url:"https://i.loli.net/2021/01/19/M8q5a3OTZWUKicl.png",tags:["furion","furos",".net",".netcore",".net5","httpcontext"]}),p={permalink:"/blog/httpcontext",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/blog/2021-02-01-httpcontext.mdx",source:"@site/blog\\2021-02-01-httpcontext.mdx",description:"HttpContext \u91cd\u5927\u8c03\u6574",date:"2021-02-01T00:00:00.000Z",tags:[{label:"furion",permalink:"/blog/tags/furion"},{label:"furos",permalink:"/blog/tags/furos"},{label:".net",permalink:"/blog/tags/net"},{label:".netcore",permalink:"/blog/tags/netcore"},{label:".net5",permalink:"/blog/tags/net-5"},{label:"httpcontext",permalink:"/blog/tags/httpcontext"}],title:"2. HttpContext \u5e94\u7528",readingTime:.775,truncated:!0,prevItem:{title:"3. \u6587\u4ef6\u4e0a\u4f20\u4e0b\u8f7d",permalink:"/blog/fileupload-download"},nextItem:{title:"1. Furion \u4ecb\u7ecd",permalink:"/blog/welcome"}},i=[{value:"HttpContext \u91cd\u5927\u8c03\u6574",id:"httpcontext-\u91cd\u5927\u8c03\u6574",children:[]},{value:"HttpContext \u591a\u79cd\u83b7\u53d6\u65b9\u5f0f",id:"httpcontext-\u591a\u79cd\u83b7\u53d6\u65b9\u5f0f",children:[{value:"\u5728 ControllerBase \u6d3e\u751f\u7c7b\u4e2d",id:"\u5728-controllerbase-\u6d3e\u751f\u7c7b\u4e2d",children:[]},{value:"\u901a\u8fc7\u6ce8\u5165 IHttpContextAccessor",id:"\u901a\u8fc7\u6ce8\u5165-ihttpcontextaccessor",children:[]},{value:"\u901a\u8fc7 HttpContextLocal \u9759\u6001\u7c7b",id:"\u901a\u8fc7-httpcontextlocal-\u9759\u6001\u7c7b",children:[]},{value:"\u901a\u8fc7 App.HttpContext",id:"\u901a\u8fc7-apphttpcontext",children:[]}]},{value:"HttpContext \u62d3\u5c55\u65b9\u6cd5",id:"httpcontext-\u62d3\u5c55\u65b9\u6cd5",children:[{value:"\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42\u7684\u7279\u6027",id:"\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42\u7684\u7279\u6027",children:[]},{value:"\u8bbe\u7f6e Swagger \u81ea\u52a8\u6388\u6743",id:"\u8bbe\u7f6e-swagger-\u81ea\u52a8\u6388\u6743",children:[]},{value:"\u9000\u51fa Swagger \u6388\u6743",id:"\u9000\u51fa-swagger-\u6388\u6743",children:[]},{value:"\u83b7\u53d6\u672c\u5730 IP \u5730\u5740",id:"\u83b7\u53d6\u672c\u5730-ip-\u5730\u5740",children:[]},{value:"\u83b7\u53d6\u5ba2\u6237\u7aef IP \u5730\u5740",id:"\u83b7\u53d6\u5ba2\u6237\u7aef-ip-\u5730\u5740",children:[]},{value:"\u5224\u65ad\u662f\u5426\u662f Ajax \u8bf7\u6c42",id:"\u5224\u65ad\u662f\u5426\u662f-ajax-\u8bf7\u6c42",children:[]}]}],l={toc:i};function b(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)("h2",{id:"httpcontext-\u91cd\u5927\u8c03\u6574"},"HttpContext \u91cd\u5927\u8c03\u6574"),Object(a.b)("p",null,"\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"ASP.NET")," \u7684\u65f6\u4ee3\uff0c\u6211\u4eec\u901a\u5e38\u901a\u8fc7 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u5168\u5c40\u9759\u6001\u7c7b\u83b7\u53d6\u8bf7\u6c42\u4e0a\u4e0b\u6587\uff0c\u4f46\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u662f\u4e00\u4e2a\u975e\u9759\u6001\u7684\u62bd\u8c61\u7c7b\uff0c\u65e0\u6cd5\u624b\u52a8\u521b\u5efa\uff0c\u4e5f\u65e0\u6cd5\u901a\u8fc7\u9759\u6001\u83b7\u53d6\u3002"),Object(a.b)("p",null,"\u867d\u7136\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\u65e0\u6cd5\u76f4\u63a5\u83b7\u53d6 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u5bf9\u8c61\u3002\u4f46\u662f\u5fae\u8f6f\u4e5f\u63d0\u4f9b\u4e86\u6ce8\u5165 ",Object(a.b)("inlineCode",{parentName:"p"},"IHttpContextAccessor")," \u65b9\u5f0f\u83b7\u53d6\u3002"),Object(a.b)("h2",{id:"httpcontext-\u591a\u79cd\u83b7\u53d6\u65b9\u5f0f"},"HttpContext \u591a\u79cd\u83b7\u53d6\u65b9\u5f0f"),Object(a.b)("h3",{id:"\u5728-controllerbase-\u6d3e\u751f\u7c7b\u4e2d"},"\u5728 ",Object(a.b)("inlineCode",{parentName:"h3"},"ControllerBase")," \u6d3e\u751f\u7c7b\u4e2d"),Object(a.b)("p",null,"\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"ControllerBase")," \u6d3e\u751f\u7c7b\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u5c5e\u6027\u83b7\u53d6 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u5bf9\u8c61\u3002"),Object(a.b)("h3",{id:"\u901a\u8fc7\u6ce8\u5165-ihttpcontextaccessor"},"\u901a\u8fc7\u6ce8\u5165 ",Object(a.b)("inlineCode",{parentName:"h3"},"IHttpContextAccessor")),Object(a.b)("p",null,"\u5728 ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u5df2\u7ecf\u6ce8\u518c\u4e86 ",Object(a.b)("inlineCode",{parentName:"p"},"IHttpContextAccessor")," \u670d\u52a1\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u6784\u9020\u51fd\u6570\u6ce8\u5165\u8be5\u5bf9\u8c61\u83b7\u53d6\u3002"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{3,5}","{3,5}":!0}),"public class AppService\n{\n public AppService(IHttpContextAccessor httpContextAccessor)\n {\n var httpContext = httpContextAccessor.HttpContext;\n }\n}\n")),Object(a.b)("h3",{id:"\u901a\u8fc7-httpcontextlocal-\u9759\u6001\u7c7b"},"\u901a\u8fc7 ",Object(a.b)("inlineCode",{parentName:"h3"},"HttpContextLocal")," \u9759\u6001\u7c7b"),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContextLocal")," \u9759\u6001\u7c7b\u65b9\u5f0f\u83b7\u53d6 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext"),"\uff0c\u5982\uff1a"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var HttpContext = HttpContextLocal.Current();\n")),Object(a.b)("h3",{id:"\u901a\u8fc7-apphttpcontext"},"\u901a\u8fc7 ",Object(a.b)("inlineCode",{parentName:"h3"},"App.HttpContext")),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"App")," \u9759\u6001\u7c7b\u4e5f\u63d0\u4f9b\u4e86 ",Object(a.b)("inlineCode",{parentName:"p"},"App.HttpContext")," \u83b7\u53d6 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u5bf9\u8c61\u3002"),Object(a.b)("h2",{id:"httpcontext-\u62d3\u5c55\u65b9\u6cd5"},Object(a.b)("inlineCode",{parentName:"h2"},"HttpContext")," \u62d3\u5c55\u65b9\u6cd5"),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u4e00\u4e9b\u5e38\u7528\u7684 ",Object(a.b)("inlineCode",{parentName:"p"},"HttpContext")," \u62d3\u5c55\u65b9\u6cd5"),Object(a.b)("h3",{id:"\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42\u7684\u7279\u6027"},"\u83b7\u53d6\u5f53\u524d\u8bf7\u6c42\u7684\u7279\u6027"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var attribute = httpContext.GetMetadata();\n")),Object(a.b)("h3",{id:"\u8bbe\u7f6e-swagger-\u81ea\u52a8\u6388\u6743"},"\u8bbe\u7f6e ",Object(a.b)("inlineCode",{parentName:"h3"},"Swagger")," \u81ea\u52a8\u6388\u6743"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'httpContext.SigninToSwagger("\u4f60\u7684token");\n')),Object(a.b)("h3",{id:"\u9000\u51fa-swagger-\u6388\u6743"},"\u9000\u51fa ",Object(a.b)("inlineCode",{parentName:"h3"},"Swagger")," \u6388\u6743"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"httpContext.SignoutToSwagger();\n")),Object(a.b)("h3",{id:"\u83b7\u53d6\u672c\u5730-ip-\u5730\u5740"},"\u83b7\u53d6\u672c\u5730 IP \u5730\u5740"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var ipv4 = httpContext.GetLocalIpAddressToIPv4();\nvar ipv6 = httpContext.GetLocalIpAddressToIPv6();\n")),Object(a.b)("h3",{id:"\u83b7\u53d6\u5ba2\u6237\u7aef-ip-\u5730\u5740"},"\u83b7\u53d6\u5ba2\u6237\u7aef IP \u5730\u5740"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var ipv4 = httpContext.GetRemoteIpAddressToIPv4();\nvar ipv6 = httpContext.GetRemoteIpAddressToIPv6();\n")),Object(a.b)("h3",{id:"\u5224\u65ad\u662f\u5426\u662f-ajax-\u8bf7\u6c42"},"\u5224\u65ad\u662f\u5426\u662f ",Object(a.b)("inlineCode",{parentName:"h3"},"Ajax")," \u8bf7\u6c42"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"var isAjaxRequest = httpContext.IsAjaxRequest();\n")))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return O}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),b=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):p(p({},t),e)),n},u=function(e){var t=b(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},s=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,l=i(e,["components","mdxType","originalType","parentName"]),u=b(n),s=r,O=u["".concat(c,".").concat(s)]||u[s]||d[s]||a;return n?o.a.createElement(O,p(p({ref:t},l),{},{components:n})):o.a.createElement(O,p({ref:t},l))}));function O(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=s;var p={};for(var i in t)hasOwnProperty.call(t,i)&&(p[i]=t[i]);p.originalType=e,p.mdxType="string"==typeof e?e:r,c[1]=p;for(var l=2;lfunction(e,t,r,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(n.b)(r))return r;if(a)return t+r;const i=r.startsWith(t)?r:t+r.replace(/^\//,"");return o?e+i:i}(t,e,r,a)}}function i(e,t={}){const{withBaseUrl:r}=o();return r(e,t)}},191:function(e,t,r){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function n(e){return void 0!==e&&!a(e)}r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return n}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return f}));var a=r(0),n=r.n(a);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var u=n.a.createContext({}),d=function(e){var t=n.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},s=function(e){var t=d(e.components);return n.a.createElement(u.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},p=n.a.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),s=d(r),p=a,f=s["".concat(i,".").concat(p)]||s[p]||b[p]||o;return r?n.a.createElement(f,l(l({ref:t},u),{},{components:r})):n.a.createElement(f,l({ref:t},u))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=p;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{160:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return l})),r.d(t,"metadata",(function(){return c})),r.d(t,"toc",(function(){return u})),r.d(t,"default",(function(){return s}));var a=r(3),n=r(7),o=(r(0),r(196)),i=r(197),l={id:"datavalidator",title:"3. DataValidator \u9759\u6001\u7c7b",sidebar_label:"3. DataValidator \u9759\u6001\u7c7b"},c={unversionedId:"global/datavalidator",id:"global/datavalidator",isDocsHomePage:!1,title:"3. DataValidator \u9759\u6001\u7c7b",description:"3.1 \u9a8c\u8bc1\u5bf9\u8c61\u6570\u636e",source:"@site/docs\\global\\datavalidator.mdx",slug:"/global/datavalidator",permalink:"/docs/global/datavalidator",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/global/datavalidator.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"3. DataValidator \u9759\u6001\u7c7b",sidebar:"global",previous:{title:"2. Db \u9759\u6001\u7c7b",permalink:"/docs/global/db"},next:{title:"4. Oops \u9759\u6001\u7c7b",permalink:"/docs/global/oops"}},u=[{value:"3.1 \u9a8c\u8bc1\u5bf9\u8c61\u6570\u636e",id:"31-\u9a8c\u8bc1\u5bf9\u8c61\u6570\u636e",children:[]},{value:"3.2 \u9a8c\u8bc1\u5355\u4e2a\u503c",id:"32-\u9a8c\u8bc1\u5355\u4e2a\u503c",children:[]},{value:"3.3 \u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u5355\u4e2a\u503c",id:"33-\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u5355\u4e2a\u503c",children:[]},{value:"3.4 \u9a8c\u8bc1\u7c7b\u578b\u9a8c\u8bc1\u5355\u4e2a\u503c",id:"34-\u9a8c\u8bc1\u7c7b\u578b\u9a8c\u8bc1\u5355\u4e2a\u503c",children:[]}],d={toc:u};function s(e){var t=e.components,r=Object(n.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},d,r,{components:t,mdxType:"MDXLayout"}),Object(o.b)(i.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"31-\u9a8c\u8bc1\u5bf9\u8c61\u6570\u636e"},"3.1 \u9a8c\u8bc1\u5bf9\u8c61\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var result = DataValidator.TryValidateObject(obj);\n")),Object(o.b)("h2",{id:"32-\u9a8c\u8bc1\u5355\u4e2a\u503c"},"3.2 \u9a8c\u8bc1\u5355\u4e2a\u503c"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var result = DataValidator.TryValidateValue(value, typeof(RequiredAttribure), typeof(RangeAttribute));\n")),Object(o.b)("h2",{id:"33-\u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u5355\u4e2a\u503c"},"3.3 \u6b63\u5219\u8868\u8fbe\u5f0f\u9a8c\u8bc1\u5355\u4e2a\u503c"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = DataValidator.TryValidateValue(value,"\u6b63\u5219\u8868\u8fbe\u5f0f");\n')),Object(o.b)("h2",{id:"34-\u9a8c\u8bc1\u7c7b\u578b\u9a8c\u8bc1\u5355\u4e2a\u503c"},"3.4 \u9a8c\u8bc1\u7c7b\u578b\u9a8c\u8bc1\u5355\u4e2a\u503c"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var result = DataValidator.TryValidateValue(value, ValidationTypes.Number);\n\nvar result2 = DataValidator.TryValidateValue(value, ValidationPattern.AllOfThem, ValidationTypes.Number, ValidationTypes.Required);\n")))}s.isMDXComponent=!0},194:function(e,t,r){"use strict";r.d(t,"b",(function(){return o})),r.d(t,"a",(function(){return i}));var a=r(21),n=r(195);function o(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(r,a)=>function(e,t,r,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(n.b)(r))return r;if(a)return t+r;const i=r.startsWith(t)?r:t+r.replace(/^\//,"");return o?e+i:i}(t,e,r,a)}}function i(e,t={}){const{withBaseUrl:r}=o();return r(e,t)}},195:function(e,t,r){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function n(e){return void 0!==e&&!a(e)}r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return n}))},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return f}));var a=r(0),n=r.n(a);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function l(e){for(var t=1;t=0||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var u=n.a.createContext({}),d=function(e){var t=n.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):l(l({},t),e)),r},s=function(e){var t=d(e.components);return n.a.createElement(u.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return n.a.createElement(n.a.Fragment,{},t)}},p=n.a.forwardRef((function(e,t){var r=e.components,a=e.mdxType,o=e.originalType,i=e.parentName,u=c(e,["components","mdxType","originalType","parentName"]),s=d(r),p=a,f=s["".concat(i,".").concat(p)]||s[p]||b[p]||o;return r?n.a.createElement(f,l(l({ref:t},u),{},{components:r})):n.a.createElement(f,l({ref:t},u))}));function f(e,t){var r=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var o=r.length,i=new Array(o);i[0]=p;var l={};for(var c in t)hasOwnProperty.call(t,c)&&(l[c]=t[c]);l.originalType=e,l.mdxType="string"==typeof e?e:a,i[1]=l;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/c456980b.dec885e2.js b/docs/c456980b.9f51a443.js similarity index 89% rename from docs/c456980b.dec885e2.js rename to docs/c456980b.9f51a443.js index 0c66f8775ce..25c5df31c2b 100644 --- a/docs/c456980b.dec885e2.js +++ b/docs/c456980b.9f51a443.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[81],{156:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return u})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return l}));var n=r(3),o=r(7),a=(r(0),r(192)),c=r(193),i={id:"performance",title:"29.2 \u6027\u80fd\u6d4b\u8bd5",sidebar_label:"29.2 \u6027\u80fd\u6d4b\u8bd5"},u={unversionedId:"performance",id:"performance",isDocsHomePage:!1,title:"29.2 \u6027\u80fd\u6d4b\u8bd5",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\performance.mdx",slug:"/performance",permalink:"/docs/performance",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/performance.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"29.2 \u6027\u80fd\u6d4b\u8bd5",sidebar:"docs",previous:{title:"29.1 \u5355\u5143\u6d4b\u8bd5",permalink:"/docs/unittest"},next:{title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",permalink:"/docs/benchmark"}},s=[],p={toc:s};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}l.isMDXComponent=!0},190:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return c}));var n=r(21),o=r(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:a=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const c=r.startsWith(t)?r:t+r.replace(/^\//,"");return a?e+c:c}(t,e,r,n)}}function c(e,t={}){const{withBaseUrl:r}=a();return r(e,t)}},191:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return m}));var n=r(0),o=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(r),d=n,m=l["".concat(c,".").concat(d)]||l[d]||f[d]||a;return r?o.a.createElement(m,i(i({ref:t},s),{},{components:r})):o.a.createElement(m,i({ref:t},s))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{161:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return u})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return l}));var n=r(3),o=r(7),a=(r(0),r(196)),c=r(197),i={id:"performance",title:"29.2 \u6027\u80fd\u6d4b\u8bd5",sidebar_label:"29.2 \u6027\u80fd\u6d4b\u8bd5"},u={unversionedId:"performance",id:"performance",isDocsHomePage:!1,title:"29.2 \u6027\u80fd\u6d4b\u8bd5",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\performance.mdx",slug:"/performance",permalink:"/docs/performance",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/performance.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"29.2 \u6027\u80fd\u6d4b\u8bd5",sidebar:"docs",previous:{title:"29.1 \u5355\u5143\u6d4b\u8bd5",permalink:"/docs/unittest"},next:{title:"29.3 \u57fa\u51c6\u6d4b\u8bd5",permalink:"/docs/benchmark"}},s=[],p={toc:s};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}l.isMDXComponent=!0},194:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return c}));var n=r(21),o=r(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:a=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const c=r.startsWith(t)?r:t+r.replace(/^\//,"");return a?e+c:c}(t,e,r,n)}}function c(e,t={}){const{withBaseUrl:r}=a();return r(e,t)}},195:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return m}));var n=r(0),o=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(r),d=n,m=l["".concat(c,".").concat(d)]||l[d]||f[d]||a;return r?o.a.createElement(m,i(i({ref:t},s),{},{components:r})):o.a.createElement(m,i({ref:t},s))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/cb0a942e.1f544cc9.js b/docs/cb0a942e.1f544cc9.js deleted file mode 100644 index 08fcda22332..00000000000 --- a/docs/cb0a942e.1f544cc9.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[82],{157:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return p}));var r=n(3),o=n(7),a=(n(0),n(192)),c=n(193),i={id:"answer",title:"31.1 \u5e38\u89c1\u95ee\u9898",sidebar_label:"31.1 \u5e38\u89c1\u95ee\u9898"},u={unversionedId:"answer",id:"answer",isDocsHomePage:!1,title:"31.1 \u5e38\u89c1\u95ee\u9898",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\answer.mdx",slug:"/answer",permalink:"/docs/answer",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/answer.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"31.1 \u5e38\u89c1\u95ee\u9898",sidebar:"docs",previous:{title:"30. \u8d21\u732e\u6307\u5357",permalink:"/docs/contribute"},next:{title:"31.2 \u5e38\u89c1\u9519\u8bef",permalink:"/docs/errors"}},s=[],l={toc:s};function p(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(r.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}p.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return p})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(n),d=r,b=p["".concat(c,".").concat(d)]||p[d]||f[d]||a;return n?o.a.createElement(b,i(i({ref:t},s),{},{components:n})):o.a.createElement(b,i({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/ccc49370.537d68d2.js b/docs/ccc49370.0902593b.js similarity index 86% rename from docs/ccc49370.537d68d2.js rename to docs/ccc49370.0902593b.js index 8d781f31f9f..af9c9a0cfed 100644 --- a/docs/ccc49370.537d68d2.js +++ b/docs/ccc49370.0902593b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[83],{188:function(e,t,a){"use strict";a.r(t);var n=a(0),l=a.n(n),r=a(203),c=a(230),i=a(198);var s=function(e){const{nextItem:t,prevItem:a}=e;return l.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog post page navigation"},l.a.createElement("div",{className:"pagination-nav__item"},a&&l.a.createElement(i.a,{className:"pagination-nav__link",to:a.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Newer Post"),l.a.createElement("div",{className:"pagination-nav__label"},"\xab ",a.title))),l.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},t&&l.a.createElement(i.a,{className:"pagination-nav__link",to:t.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Older Post"),l.a.createElement("div",{className:"pagination-nav__label"},t.title," \xbb"))))},o=a(210),m=a(231),d=a(226);t.default=function(e){const{content:t,sidebar:a}=e,{frontMatter:n,metadata:i}=t,{title:v,description:u,nextItem:E,prevItem:p,editUrl:g}=i,{hide_table_of_contents:f}=n;return l.a.createElement(r.a,{title:v,description:u,wrapperClassName:"blog-wrapper"},t&&l.a.createElement("div",{className:"container margin-vert--lg"},l.a.createElement("div",{className:"row"},l.a.createElement("div",{className:"col col--2"},l.a.createElement(o.a,{sidebar:a})),l.a.createElement("main",{className:"col col--8"},l.a.createElement(c.a,{frontMatter:n,metadata:i,isBlogPostPage:!0},l.a.createElement(t,null)),l.a.createElement("div",null,g&&l.a.createElement("a",{href:g,target:"_blank",rel:"noreferrer noopener"},l.a.createElement(d.a,null),"Edit this page")),(E||p)&&l.a.createElement("div",{className:"margin-vert--xl"},l.a.createElement(s,{nextItem:E,prevItem:p}))),!f&&t.toc&&l.a.createElement("div",{className:"col col--2"},l.a.createElement(m.a,{toc:t.toc})))))}},226:function(e,t,a){"use strict";var n=a(3),l=a(0),r=a.n(l),c=a(194),i=a(63),s=a.n(i);t.a=({className:e,...t})=>r.a.createElement("svg",Object(n.a)({fill:"currentColor",height:"1.2em",width:"1.2em",preserveAspectRatio:"xMidYMid meet",role:"img",viewBox:"0 0 40 40",className:Object(c.a)(s.a.iconEdit,e)},t),r.a.createElement("g",null,r.a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))},231:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(194);var c=function(e,t,a){const[l,r]=Object(n.useState)(void 0);Object(n.useEffect)(()=>{function n(){const n=function(){const e=Array.from(document.getElementsByClassName("anchor")),t=e.find(e=>{const{top:t}=e.getBoundingClientRect();return t>=a});if(t){if(t.getBoundingClientRect().top>=a){const a=e[e.indexOf(t)-1];return null!=a?a:t}return t}return e[e.length-1]}();if(n){let a=0,c=!1;const i=document.getElementsByClassName(e);for(;a{document.removeEventListener("scroll",n),document.removeEventListener("resize",n)}})},i=a(62),s=a.n(i);const o="table-of-contents__link";function m({toc:e,isChild:t}){return e.length?l.a.createElement("ul",{className:t?"":"table-of-contents table-of-contents__left-border"},e.map(e=>l.a.createElement("li",{key:e.id},l.a.createElement("a",{href:"#"+e.id,className:o,dangerouslySetInnerHTML:{__html:e.value}}),l.a.createElement(m,{isChild:!0,toc:e.children})))):null}t.a=function({toc:e}){return c(o,"table-of-contents__link--active",100),l.a.createElement("div",{className:Object(r.a)(s.a.tableOfContents,"thin-scrollbar")},l.a.createElement(m,{toc:e}))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[87],{192:function(e,t,a){"use strict";a.r(t);var n=a(0),l=a.n(n),r=a(207),c=a(234),i=a(202);var s=function(e){const{nextItem:t,prevItem:a}=e;return l.a.createElement("nav",{className:"pagination-nav","aria-label":"Blog post page navigation"},l.a.createElement("div",{className:"pagination-nav__item"},a&&l.a.createElement(i.a,{className:"pagination-nav__link",to:a.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Newer Post"),l.a.createElement("div",{className:"pagination-nav__label"},"\xab ",a.title))),l.a.createElement("div",{className:"pagination-nav__item pagination-nav__item--next"},t&&l.a.createElement(i.a,{className:"pagination-nav__link",to:t.permalink},l.a.createElement("div",{className:"pagination-nav__sublabel"},"Older Post"),l.a.createElement("div",{className:"pagination-nav__label"},t.title," \xbb"))))},o=a(214),m=a(235),d=a(230);t.default=function(e){const{content:t,sidebar:a}=e,{frontMatter:n,metadata:i}=t,{title:v,description:u,nextItem:E,prevItem:p,editUrl:g}=i,{hide_table_of_contents:f}=n;return l.a.createElement(r.a,{title:v,description:u,wrapperClassName:"blog-wrapper"},t&&l.a.createElement("div",{className:"container margin-vert--lg"},l.a.createElement("div",{className:"row"},l.a.createElement("div",{className:"col col--2"},l.a.createElement(o.a,{sidebar:a})),l.a.createElement("main",{className:"col col--8"},l.a.createElement(c.a,{frontMatter:n,metadata:i,isBlogPostPage:!0},l.a.createElement(t,null)),l.a.createElement("div",null,g&&l.a.createElement("a",{href:g,target:"_blank",rel:"noreferrer noopener"},l.a.createElement(d.a,null),"Edit this page")),(E||p)&&l.a.createElement("div",{className:"margin-vert--xl"},l.a.createElement(s,{nextItem:E,prevItem:p}))),!f&&t.toc&&l.a.createElement("div",{className:"col col--2"},l.a.createElement(m.a,{toc:t.toc})))))}},230:function(e,t,a){"use strict";var n=a(3),l=a(0),r=a.n(l),c=a(198),i=a(63),s=a.n(i);t.a=({className:e,...t})=>r.a.createElement("svg",Object(n.a)({fill:"currentColor",height:"1.2em",width:"1.2em",preserveAspectRatio:"xMidYMid meet",role:"img",viewBox:"0 0 40 40",className:Object(c.a)(s.a.iconEdit,e)},t),r.a.createElement("g",null,r.a.createElement("path",{d:"m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"})))},235:function(e,t,a){"use strict";var n=a(0),l=a.n(n),r=a(198);var c=function(e,t,a){const[l,r]=Object(n.useState)(void 0);Object(n.useEffect)(()=>{function n(){const n=function(){const e=Array.from(document.getElementsByClassName("anchor")),t=e.find(e=>{const{top:t}=e.getBoundingClientRect();return t>=a});if(t){if(t.getBoundingClientRect().top>=a){const a=e[e.indexOf(t)-1];return null!=a?a:t}return t}return e[e.length-1]}();if(n){let a=0,c=!1;const i=document.getElementsByClassName(e);for(;a{document.removeEventListener("scroll",n),document.removeEventListener("resize",n)}})},i=a(62),s=a.n(i);const o="table-of-contents__link";function m({toc:e,isChild:t}){return e.length?l.a.createElement("ul",{className:t?"":"table-of-contents table-of-contents__left-border"},e.map(e=>l.a.createElement("li",{key:e.id},l.a.createElement("a",{href:"#"+e.id,className:o,dangerouslySetInnerHTML:{__html:e.value}}),l.a.createElement(m,{isChild:!0,toc:e.children})))):null}t.a=function({toc:e}){return c(o,"table-of-contents__link--active",100),l.a.createElement("div",{className:Object(r.a)(s.a.tableOfContents,"thin-scrollbar")},l.a.createElement(m,{toc:e}))}}}]); \ No newline at end of file diff --git a/docs/ce4b3b2d.6b64e9cd.js b/docs/ce4b3b2d.6b64e9cd.js deleted file mode 100644 index 0233c66bd76..00000000000 --- a/docs/ce4b3b2d.6b64e9cd.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[84],{158:function(e){e.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"netcore","name":".netcore","count":1,"permalink":"/blog/tags/netcore"}')}}]); \ No newline at end of file diff --git a/docs/ce4b3b2d.ec9c8c6b.js b/docs/ce4b3b2d.ec9c8c6b.js new file mode 100644 index 00000000000..4b8b72265aa --- /dev/null +++ b/docs/ce4b3b2d.ec9c8c6b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{162:function(e){e.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"netcore","name":".netcore","count":3,"permalink":"/blog/tags/netcore"}')}}]); \ No newline at end of file diff --git a/docs/d1523b3a.91f8d2b2.js b/docs/d1523b3a.8cd222aa.js similarity index 93% rename from docs/d1523b3a.91f8d2b2.js rename to docs/d1523b3a.8cd222aa.js index daf6efe7858..62882c107e9 100644 --- a/docs/d1523b3a.91f8d2b2.js +++ b/docs/d1523b3a.8cd222aa.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[85],{159:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return b}));var r=n(3),i=n(7),a=(n(0),n(192)),o=n(193),c={id:"friendlyexceptionsettings",title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",sidebar_label:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e"},l={unversionedId:"settings/friendlyexceptionsettings",id:"settings/friendlyexceptionsettings",isDocsHomePage:!1,title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",description:"6.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\friendlyexceptionsettings.mdx",slug:"/settings/friendlyexceptionsettings",permalink:"/docs/settings/friendlyexceptionsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/friendlyexceptionsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",sidebar:"settings",previous:{title:"5. \u52a8\u6001API\u914d\u7f6e",permalink:"/docs/settings/dynamicapicontrollersettings"},next:{title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",permalink:"/docs/settings/specificationdocumentsettings"}},s=[{value:"6.1 \u5173\u4e8e\u914d\u7f6e",id:"61-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"6.2 \u914d\u7f6e\u4fe1\u606f",id:"62-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"6.3 \u914d\u7f6e\u793a\u4f8b",id:"63-\u914d\u7f6e\u793a\u4f8b",children:[]},{value:"6.4 \u5f02\u5e38\u6d88\u606f\u914d\u7f6e",id:"64-\u5f02\u5e38\u6d88\u606f\u914d\u7f6e",children:[{value:"6.4.1 \u914d\u7f6e\u4fe1\u606f",id:"641-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"6.4.2 \u914d\u7f6e\u793a\u4f8b",id:"642-\u914d\u7f6e\u793a\u4f8b",children:[]}]}],u={toc:s};function b(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"61-\u5173\u4e8e\u914d\u7f6e"},"6.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u53cb\u597d\u5f02\u5e38\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u53cb\u597d\u5f02\u5e38\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"62-\u914d\u7f6e\u4fe1\u606f"},"6.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"FriendlyExceptionSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"HideErrorCode"),"\uff1a\u9690\u85cf\u9519\u8bef\u7801\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultErrorCode"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u7801\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultErrorMessage"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u6d88\u606f\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b")))),Object(a.b)("h2",{id:"63-\u914d\u7f6e\u793a\u4f8b"},"6.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "FriendlyExceptionSettings": {\n "DefaultErrorMessage": "\u7cfb\u7edf\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458"\n }\n}\n')),Object(a.b)("h2",{id:"64-\u5f02\u5e38\u6d88\u606f\u914d\u7f6e"},"6.4 \u5f02\u5e38\u6d88\u606f\u914d\u7f6e"),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u4e3a\u53cb\u597d\u5f02\u5e38\u6d88\u606f\u63d0\u4f9b\u5916\u90e8\u914d\u7f6e"),Object(a.b)("h3",{id:"641-\u914d\u7f6e\u4fe1\u606f"},"6.4.1 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ErrorCodeMessageSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u914d\u7f6e\u5f02\u5e38\u9519\u8bef\u7801\u6d88\u606f\u7c7b\u578b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"[\u9519\u8bef\u72b6\u6001\u7801\uff0c\u9519\u8bef\u6d88\u606f][]")," \u7c7b\u578b\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},'[5000, "{0} \u4e0d\u80fd\u5c0f\u4e8e {1}"]'))))),Object(a.b)("h3",{id:"642-\u914d\u7f6e\u793a\u4f8b"},"6.4.2 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "ErrorCodeMessageSettings": {\n "Definitions": [\n [5000, "{0} \u4e0d\u80fd\u5c0f\u4e8e {1}"],\n [5001, "\u6211\u53eb {0} \u540d\u5b57", "\u767e\u5c0f\u50e7"],\n [5002, "Oops! \u51fa\u9519\u4e86"]\n ]\n }\n}\n')))}b.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=i.a.createContext({}),u=function(e){var t=i.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,f=b["".concat(o,".").concat(d)]||b[d]||p[d]||a;return n?i.a.createElement(f,c(c({ref:t},s),{},{components:n})):i.a.createElement(f,c({ref:t},s))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{163:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return b}));var r=n(3),i=n(7),a=(n(0),n(196)),o=n(197),c={id:"friendlyexceptionsettings",title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",sidebar_label:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e"},l={unversionedId:"settings/friendlyexceptionsettings",id:"settings/friendlyexceptionsettings",isDocsHomePage:!1,title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",description:"6.1 \u5173\u4e8e\u914d\u7f6e",source:"@site/docs\\settings\\friendlyexceptionsettings.mdx",slug:"/settings/friendlyexceptionsettings",permalink:"/docs/settings/friendlyexceptionsettings",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/settings/friendlyexceptionsettings.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",sidebar:"settings",previous:{title:"5. \u52a8\u6001API\u914d\u7f6e",permalink:"/docs/settings/dynamicapicontrollersettings"},next:{title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",permalink:"/docs/settings/specificationdocumentsettings"}},s=[{value:"6.1 \u5173\u4e8e\u914d\u7f6e",id:"61-\u5173\u4e8e\u914d\u7f6e",children:[]},{value:"6.2 \u914d\u7f6e\u4fe1\u606f",id:"62-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"6.3 \u914d\u7f6e\u793a\u4f8b",id:"63-\u914d\u7f6e\u793a\u4f8b",children:[]},{value:"6.4 \u5f02\u5e38\u6d88\u606f\u914d\u7f6e",id:"64-\u5f02\u5e38\u6d88\u606f\u914d\u7f6e",children:[{value:"6.4.1 \u914d\u7f6e\u4fe1\u606f",id:"641-\u914d\u7f6e\u4fe1\u606f",children:[]},{value:"6.4.2 \u914d\u7f6e\u793a\u4f8b",id:"642-\u914d\u7f6e\u793a\u4f8b",children:[]}]}],u={toc:s};function b(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},u,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(o.a,{mdxType:"JoinGroup"}),Object(a.b)("h2",{id:"61-\u5173\u4e8e\u914d\u7f6e"},"6.1 \u5173\u4e8e\u914d\u7f6e"),Object(a.b)("p",null,"\u53cb\u597d\u5f02\u5e38\u914d\u7f6e\u6307\u7684\u662f ",Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u53cb\u597d\u5f02\u5e38\u914d\u7f6e\u9009\u9879\u3002"),Object(a.b)("h2",{id:"62-\u914d\u7f6e\u4fe1\u606f"},"6.2 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"FriendlyExceptionSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"HideErrorCode"),"\uff1a\u9690\u85cf\u9519\u8bef\u7801\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(a.b)("inlineCode",{parentName:"li"},"false")),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultErrorCode"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u7801\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"DefaultErrorMessage"),"\uff1a\u9ed8\u8ba4\u9519\u8bef\u6d88\u606f\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"string")," \u7c7b\u578b")))),Object(a.b)("h2",{id:"63-\u914d\u7f6e\u793a\u4f8b"},"6.3 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "FriendlyExceptionSettings": {\n "DefaultErrorMessage": "\u7cfb\u7edf\u5f02\u5e38\uff0c\u8bf7\u8054\u7cfb\u7ba1\u7406\u5458"\n }\n}\n')),Object(a.b)("h2",{id:"64-\u5f02\u5e38\u6d88\u606f\u914d\u7f6e"},"6.4 \u5f02\u5e38\u6d88\u606f\u914d\u7f6e"),Object(a.b)("p",null,Object(a.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u8fd8\u4e3a\u53cb\u597d\u5f02\u5e38\u6d88\u606f\u63d0\u4f9b\u5916\u90e8\u914d\u7f6e"),Object(a.b)("h3",{id:"641-\u914d\u7f6e\u4fe1\u606f"},"6.4.1 \u914d\u7f6e\u4fe1\u606f"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"ErrorCodeMessageSettings"),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9",Object(a.b)("ul",{parentName:"li"},Object(a.b)("li",{parentName:"ul"},Object(a.b)("inlineCode",{parentName:"li"},"Definitions"),"\uff1a\u914d\u7f6e\u5f02\u5e38\u9519\u8bef\u7801\u6d88\u606f\u7c7b\u578b\uff0c",Object(a.b)("inlineCode",{parentName:"li"},"[\u9519\u8bef\u72b6\u6001\u7801\uff0c\u9519\u8bef\u6d88\u606f][]")," \u7c7b\u578b\uff0c\u5982\uff1a",Object(a.b)("inlineCode",{parentName:"li"},'[5000, "{0} \u4e0d\u80fd\u5c0f\u4e8e {1}"]'))))),Object(a.b)("h3",{id:"642-\u914d\u7f6e\u793a\u4f8b"},"6.4.2 \u914d\u7f6e\u793a\u4f8b"),Object(a.b)("pre",null,Object(a.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "ErrorCodeMessageSettings": {\n "Definitions": [\n [5000, "{0} \u4e0d\u80fd\u5c0f\u4e8e {1}"],\n [5001, "\u6211\u53eb {0} \u540d\u5b57", "\u767e\u5c0f\u50e7"],\n [5002, "Oops! \u51fa\u9519\u4e86"]\n ]\n }\n}\n')))}b.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return o}));var r=n(21),i=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return b})),n.d(t,"b",(function(){return f}));var r=n(0),i=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var s=i.a.createContext({}),u=function(e){var t=i.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},b=function(e){var t=u(e.components);return i.a.createElement(s.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},d=i.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,o=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),b=u(n),d=r,f=b["".concat(o,".").concat(d)]||b[d]||p[d]||a;return n?i.a.createElement(f,c(c({ref:t},s),{},{components:n})):i.a.createElement(f,c({ref:t},s))}));function f(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,o=new Array(a);o[0]=d;var c={};for(var l in t)hasOwnProperty.call(t,l)&&(c[l]=t[l]);c.originalType=e,c.mdxType="string"==typeof e?e:r,o[1]=c;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/d1bb361e.8987c84f.js b/docs/d1bb361e.8987c84f.js new file mode 100644 index 00000000000..aa7ed117db6 --- /dev/null +++ b/docs/d1bb361e.8987c84f.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{164:function(o){o.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"download","name":"download","count":1,"permalink":"/blog/tags/download"}')}}]); \ No newline at end of file diff --git a/docs/d3c206bc.1bf44a5d.js b/docs/d3c206bc.1bf44a5d.js deleted file mode 100644 index 30a9037e040..00000000000 --- a/docs/d3c206bc.1bf44a5d.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[86],{160:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return c})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return u}));var r=n(3),a=n(7),i=(n(0),n(192)),o=n(190),b={slug:"welcome",title:"Furion \u4ecb\u7ecd",author:"dotNET China",author_title:"\u4e3a\u4e2d\u56fd .NET \u5f00\u53d1\u8005\u63d0\u4f9b\u4f18\u8d28\u7684\u8d44\u8baf\u548c\u6280\u672f\u5206\u4eab\u3002",author_url:"https://furion.pro",author_image_url:"https://i.loli.net/2021/01/19/M8q5a3OTZWUKicl.png",tags:["furion","furos",".net",".netcore",".net5"]},c={permalink:"/blog/welcome",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/blog/2020-08-19-welcome.mdx",source:"@site/blog\\2020-08-19-welcome.mdx",description:"function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,r)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return O}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=a.a.createContext({}),p=function(e){var t=a.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},u=function(e){var t=p(e.components);return a.a.createElement(l.Provider,{value:t},e.children)},m={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},s=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,o=e.parentName,l=c(e,["components","mdxType","originalType","parentName"]),u=p(n),s=r,O=u["".concat(o,".").concat(s)]||u[s]||m[s]||i;return n?a.a.createElement(O,b(b({ref:t},l),{},{components:n})):a.a.createElement(O,b({ref:t},l))}));function O(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,o=new Array(i);o[0]=s;var b={};for(var c in t)hasOwnProperty.call(t,c)&&(b[c]=t[c]);b.originalType=e,b.mdxType="string"==typeof e?e:r,o[1]=b;for(var l=2;lfunction(e,t,r,{forcePrependBaseUrl:n=!1,absolute:a=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const i=r.startsWith(t)?r:t+r.replace(/^\//,"");return a?e+i:i}(t,e,r,n)}}function i(e,t={}){const{withBaseUrl:r}=a();return r(e,t)}},195:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return b})),r.d(t,"b",(function(){return g}));var n=r(0),o=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var l=o.a.createContext({}),s=function(e){var t=o.a.useContext(l),r=t;return e&&(r="function"==typeof e?e(t):c(c({},t),e)),r},b=function(e){var t=s(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},m=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,i=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),b=s(r),m=n,g=b["".concat(i,".").concat(m)]||b[m]||p[m]||a;return r?o.a.createElement(g,c(c({ref:t},l),{},{components:r})):o.a.createElement(g,c({ref:t},l))}));function g(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,i=new Array(a);i[0]=m;var c={};for(var u in t)hasOwnProperty.call(t,u)&&(c[u]=t[u]);c.originalType=e,c.mdxType="string"==typeof e?e:n,i[1]=c;for(var l=2;l[FakeDelete] \u6807\u8bb0",id:"9871-\u6dfb\u52a0-fakedelete-\u6807\u8bb0",children:[]},{value:"9.8.7.2 \u5047\u5220\u9664\u4f7f\u7528",id:"9872-\u5047\u5220\u9664\u4f7f\u7528",children:[]}]},{value:"9.8.8 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"988-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:l};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"981-\u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.1 \u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Delete(user);\n\n// \u793a\u4f8b\u4e8c\nuser.Delete();\n\n// \u793a\u4f8b\u4e09\nrepository.ChangeEntityState(user, EntityState.Deleted);\n\n// \u793a\u4f8b\u56db\nrepository.Entities.Remove(user);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteAsync();\n")),Object(c.b)("h2",{id:"982-\u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.2 \u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteNowAsync();\n")),Object(c.b)("h2",{id:"983-\u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.3 \u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Delete(1);\n\n// \u793a\u4f8b\u4e8c\nuser.Delete(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteAsync(1);\n")),Object(c.b)("h2",{id:"984-\u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.4 \u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteNow(1);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteNow(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteNowAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteNowAsync(1);\n")),Object(c.b)("h2",{id:"985-\u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.5 \u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteExists(1);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteExists(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteExistsAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteExistsAsync(1);\n")),Object(c.b)("h2",{id:"986-\u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.6 \u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteExistsNow(1);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteExistsNow(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteExistsNowAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteExistsNowAsync(1);\n")),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u6240\u6709\u5e26 ",Object(c.b)("inlineCode",{parentName:"p"},"Now")," \u7ed3\u5c3e\u7684\u8868\u793a\u7acb\u5373\u63d0\u4ea4\u5230\u6570\u636e\u5e93\uff0c\u4e5f\u5c31\u662f\u7acb\u5373\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"SaveChanges")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"SaveChangesAsync"),"\u3002"))),Object(c.b)("h2",{id:"987-\u5047\u5220\u9664\u8f6f\u5220\u9664"},"9.8.7 \u5047\u5220\u9664/\u8f6f\u5220\u9664"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"[FakeDelete]")," \u7279\u6027\u6807\u8bb0\u5047\u5220\u9664\u7279\u6027\uff0c\u5982\uff1a"),Object(c.b)("h3",{id:"9871-\u6dfb\u52a0-fakedelete-\u6807\u8bb0"},"9.8.7.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"[FakeDelete]")," \u6807\u8bb0"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public class Model: IEntity\n{\n [FakeDelete(true)] // \u8bbe\u7f6e\u5047\u5220\u9664\u7684\u503c\n public bool IsDeleted { get; set; }\n}\n")),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"[FakeDelete]")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("strong",{parentName:"p"},"`","[FakeDelete]")," \u5c5e\u6027\u62e5\u6709\u5e26\u4e00\u4e2a\u53c2\u6570\u7684\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u4e2a\u53c2\u6570\u662f\u5047\u5220\u9664\u7684\u503c"))),Object(c.b)("h3",{id:"9872-\u5047\u5220\u9664\u4f7f\u7528"},"9.8.7.2 \u5047\u5220\u9664\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.FakeDelete(entity);\n\n// \u793a\u4f8b\u4e8c\nrepository.FakeDeleteNow(entity);\n\n// \u793a\u4f8b\u4e09\nrepository.FakeDelete(1);\n\n// \u793a\u4f8b\u56db\nrepository.FakeDeleteNow(1);\n\n// \u793a\u4f8b\u4e94\nentity.FakeDelete();\n\n// \u793a\u4f8b\u516d\nrepository.UpdateInclude(user, u => u.IsDeleted);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.FakeDeleteAsync(entity);\n\n// \u793a\u4f8b\u4e8c\nawait repository.FakeDeleteNowAsync(entity);\n\n// \u793a\u4f8b\u4e09\nawait repository.FakeDeleteAsync(1);\n\n// \u793a\u4f8b\u56db\nawait repository.FakeDeleteNowAsync(1);\n\n// \u793a\u4f8b\u4e94\nawait entity.FakeDeleteAsync();\n\n// \u793a\u4f8b\u516d\nawait repository.UpdateIncludeAsync(user, u => u.IsDeleted);\n")),Object(c.b)("h2",{id:"988-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.8.8 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),b=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=b(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),d=b(n),u=a,m=d["".concat(i,".").concat(u)]||d[u]||p[u]||c;return n?r.a.createElement(m,o(o({ref:t},l),{},{components:n})):r.a.createElement(m,o({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{166:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return o})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return d}));var a=n(3),r=n(7),c=(n(0),n(196)),i=n(197),o={id:"dbcontext-delete",title:"9.8 \u5220\u9664\u64cd\u4f5c",sidebar_label:"9.8 \u5220\u9664\u64cd\u4f5c"},s={unversionedId:"dbcontext-delete",id:"dbcontext-delete",isDocsHomePage:!1,title:"9.8 \u5220\u9664\u64cd\u4f5c",description:"9.8.1 \u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",source:"@site/docs\\dbcontext-delete.mdx",slug:"/dbcontext-delete",permalink:"/docs/dbcontext-delete",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-delete.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.8 \u5220\u9664\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c",permalink:"/docs/dbcontext-add-or-update"},next:{title:"9.9 \u6279\u91cf\u64cd\u4f5c",permalink:"/docs/dbcontext-batch"}},l=[{value:"9.8.1 \u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"981-\u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.8.2 \u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"982-\u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.8.3 \u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"983-\u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.8.4 \u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"984-\u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.8.5 \u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"985-\u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.8.6 \u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"986-\u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.8.7 \u5047\u5220\u9664/\u8f6f\u5220\u9664",id:"987-\u5047\u5220\u9664\u8f6f\u5220\u9664",children:[{value:"9.8.7.1 \u6dfb\u52a0 [FakeDelete] \u6807\u8bb0",id:"9871-\u6dfb\u52a0-fakedelete-\u6807\u8bb0",children:[]},{value:"9.8.7.2 \u5047\u5220\u9664\u4f7f\u7528",id:"9872-\u5047\u5220\u9664\u4f7f\u7528",children:[]}]},{value:"9.8.8 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"988-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:l};function d(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"981-\u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.1 \u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Delete(user);\n\n// \u793a\u4f8b\u4e8c\nuser.Delete();\n\n// \u793a\u4f8b\u4e09\nrepository.ChangeEntityState(user, EntityState.Deleted);\n\n// \u793a\u4f8b\u56db\nrepository.Entities.Remove(user);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteAsync();\n")),Object(c.b)("h2",{id:"982-\u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.2 \u5220\u9664\u4e00\u4e2a\u5b9e\u4f53\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteNow(user);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteNowAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteNowAsync();\n")),Object(c.b)("h2",{id:"983-\u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.3 \u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Delete(1);\n\n// \u793a\u4f8b\u4e8c\nuser.Delete(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteAsync(1);\n")),Object(c.b)("h2",{id:"984-\u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.4 \u6839\u636e\u4e3b\u952e\u5220\u9664\u8bb0\u5f55\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteNow(1);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteNow(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteNowAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteNowAsync(1);\n")),Object(c.b)("h2",{id:"985-\u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.5 \u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteExists(1);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteExists(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteExistsAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteExistsAsync(1);\n")),Object(c.b)("h2",{id:"986-\u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.8.6 \u6570\u636e\u5b58\u5728\u624d\u6839\u636e\u4e3b\u952e\u5220\u9664\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.DeleteExistsNow(1);\n\n// \u793a\u4f8b\u4e8c\nuser.DeleteExistsNow(1);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.DeleteExistsNowAsync(1);\n\n// \u793a\u4f8b\u4e8c\nawait user.DeleteExistsNowAsync(1);\n")),Object(c.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u6240\u6709\u5e26 ",Object(c.b)("inlineCode",{parentName:"p"},"Now")," \u7ed3\u5c3e\u7684\u8868\u793a\u7acb\u5373\u63d0\u4ea4\u5230\u6570\u636e\u5e93\uff0c\u4e5f\u5c31\u662f\u7acb\u5373\u8c03\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"SaveChanges")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"SaveChangesAsync"),"\u3002"))),Object(c.b)("h2",{id:"987-\u5047\u5220\u9664\u8f6f\u5220\u9664"},"9.8.7 \u5047\u5220\u9664/\u8f6f\u5220\u9664"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u53ef\u4ee5\u901a\u8fc7 ",Object(c.b)("inlineCode",{parentName:"p"},"[FakeDelete]")," \u7279\u6027\u6807\u8bb0\u5047\u5220\u9664\u7279\u6027\uff0c\u5982\uff1a"),Object(c.b)("h3",{id:"9871-\u6dfb\u52a0-fakedelete-\u6807\u8bb0"},"9.8.7.1 \u6dfb\u52a0 ",Object(c.b)("inlineCode",{parentName:"h3"},"[FakeDelete]")," \u6807\u8bb0"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public class Model: IEntity\n{\n [FakeDelete(true)] // \u8bbe\u7f6e\u5047\u5220\u9664\u7684\u503c\n public bool IsDeleted { get; set; }\n}\n")),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"[FakeDelete]")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("strong",{parentName:"p"},"`","[FakeDelete]")," \u5c5e\u6027\u62e5\u6709\u5e26\u4e00\u4e2a\u53c2\u6570\u7684\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u4e2a\u53c2\u6570\u662f\u5047\u5220\u9664\u7684\u503c"))),Object(c.b)("h3",{id:"9872-\u5047\u5220\u9664\u4f7f\u7528"},"9.8.7.2 \u5047\u5220\u9664\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.FakeDelete(entity);\n\n// \u793a\u4f8b\u4e8c\nrepository.FakeDeleteNow(entity);\n\n// \u793a\u4f8b\u4e09\nrepository.FakeDelete(1);\n\n// \u793a\u4f8b\u56db\nrepository.FakeDeleteNow(1);\n\n// \u793a\u4f8b\u4e94\nentity.FakeDelete();\n\n// \u793a\u4f8b\u516d\nrepository.UpdateInclude(user, u => u.IsDeleted);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.FakeDeleteAsync(entity);\n\n// \u793a\u4f8b\u4e8c\nawait repository.FakeDeleteNowAsync(entity);\n\n// \u793a\u4f8b\u4e09\nawait repository.FakeDeleteAsync(1);\n\n// \u793a\u4f8b\u56db\nawait repository.FakeDeleteNowAsync(1);\n\n// \u793a\u4f8b\u4e94\nawait entity.FakeDeleteAsync();\n\n// \u793a\u4f8b\u516d\nawait repository.UpdateIncludeAsync(user, u => u.IsDeleted);\n")),Object(c.b)("h2",{id:"988-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.8.8 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var a=n(21),r=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,a)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return m}));var a=n(0),r=n.n(a);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function o(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=r.a.createContext({}),b=function(e){var t=r.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},d=function(e){var t=b(e.components);return r.a.createElement(l.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},u=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),d=b(n),u=a,m=d["".concat(i,".").concat(u)]||d[u]||p[u]||c;return n?r.a.createElement(m,o(o({ref:t},l),{},{components:n})):r.a.createElement(m,o({ref:t},l))}));function m(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var c=n.length,i=new Array(c);i[0]=u;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/d43b3010.75b1b73b.js b/docs/d43b3010.18b0b8fb.js similarity index 98% rename from docs/d43b3010.75b1b73b.js rename to docs/d43b3010.18b0b8fb.js index f47a92e04a2..d2f09ce6a67 100644 --- a/docs/d43b3010.75b1b73b.js +++ b/docs/d43b3010.18b0b8fb.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[88],{162:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return c})),n.d(t,"default",(function(){return s}));var a=n(3),i=n(7),r=(n(0),n(192)),o=n(193),b={id:"dbcontext-repository",title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",sidebar_label:"9.4 \u4ed3\u50a8\u6a21\u5f0f"},l={unversionedId:"dbcontext-repository",id:"dbcontext-repository",isDocsHomePage:!1,title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",description:"9.4.1 \u4ec0\u4e48\u662f\u4ed3\u50a8",source:"@site/docs\\dbcontext-repository.mdx",slug:"/dbcontext-repository",permalink:"/docs/dbcontext-repository",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-repository.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.4 \u4ed3\u50a8\u6a21\u5f0f",sidebar:"docs",previous:{title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",permalink:"/docs/entity"},next:{title:"9.5 \u65b0\u589e\u64cd\u4f5c",permalink:"/docs/dbcontext-add"}},c=[{value:"9.4.1 \u4ec0\u4e48\u662f\u4ed3\u50a8",id:"941-\u4ec0\u4e48\u662f\u4ed3\u50a8",children:[]},{value:"9.4.1 \u5185\u7f6e\u4ed3\u50a8",id:"941-\u5185\u7f6e\u4ed3\u50a8",children:[{value:"9.4.1.1 \u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8",id:"9411-\u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8",children:[]},{value:"9.4.1.2 \u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8",id:"9412-\u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8",children:[]},{value:"9.4.1.3 \u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8",id:"9413-\u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8",children:[]},{value:"9.4.1.4 Sql \u64cd\u4f5c\u4ed3\u50a8",id:"9414-sql-\u64cd\u4f5c\u4ed3\u50a8",children:[]},{value:"9.4.1.5 \u591a\u6570\u636e\u5e93 Sql \u64cd\u4f5c\u4ed3\u50a8",id:"9415-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c\u4ed3\u50a8",children:[]},{value:"9.4.1.6 \u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9416-\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.7 \u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9417-\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.8 \u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9418-\u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.9 \u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9419-\u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.10 \u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94110-\u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.11 \u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94111-\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.12 \u53ea\u5141\u8bb8 Sql \u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94112-\u53ea\u5141\u8bb8-sql-\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.13 \u53ea\u5141\u8bb8 Sql \u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94113-\u53ea\u5141\u8bb8-sql-\u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.14 \u8bfb\u5199\u5206\u79bb\u4ed3\u50a8",id:"94114-\u8bfb\u5199\u5206\u79bb\u4ed3\u50a8",children:[]},{value:"9.4.1.15 \u5b9a\u4f4d\u5668\u4ed3\u50a8",id:"94115-\u5b9a\u4f4d\u5668\u4ed3\u50a8",children:[]}]},{value:"9.4.2 \u4ed3\u50a8\u4f7f\u7528",id:"942-\u4ed3\u50a8\u4f7f\u7528",children:[{value:"9.4.2.1 \u6784\u9020\u51fd\u6570\u6ce8\u5165",id:"9421-\u6784\u9020\u51fd\u6570\u6ce8\u5165",children:[]},{value:"9.4.2.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",id:"9422-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",children:[]},{value:"9.4.2.3 Db.GetRepository \u83b7\u53d6",id:"9423-dbgetrepository-\u83b7\u53d6",children:[]}]},{value:"9.4.3 \u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5",id:"943-\u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5",children:[{value:"9.4.3.1 \u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8",id:"9431-\u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8",children:[]},{value:"9.4.3.2 \u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b",id:"9432-\u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b",children:[]},{value:"9.4.3.3 \u83b7\u53d6 Sql \u64cd\u4f5c\u4ed3\u50a8",id:"9433-\u83b7\u53d6-sql-\u64cd\u4f5c\u4ed3\u50a8",children:[]}]},{value:"9.4.4 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",id:"944-\u591a\u6570\u636e\u5e93\u64cd\u4f5c",children:[{value:"9.4.4.1 \u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93",id:"9441-\u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93",children:[]}]},{value:"9.4.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"945-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:c};function s(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)(o.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"941-\u4ec0\u4e48\u662f\u4ed3\u50a8"},"9.4.1 \u4ec0\u4e48\u662f\u4ed3\u50a8"),Object(r.b)("blockquote",null,Object(r.b)("p",{parentName:"blockquote"},"\u5728\u9886\u57df\u5c42\u548c\u6570\u636e\u6620\u5c04\u5c42\u7684\u4e2d\u4ecb,\u4f7f\u7528\u7c7b\u4f3c\u96c6\u5408\u7684\u63a5\u53e3\u6765\u5b58\u53d6\u9886\u57df\u5bf9\u8c61\uff0c\u5b9e\u9645\u4e0a\uff0c\u4ed3\u50a8\u88ab\u7528\u4e8e\u9886\u57df\u5bf9\u8c61\u5728\u6570\u636e\u5e93\u4e0a\u7684\u64cd\u4f5c\uff08\u5b9e\u4f53 Entity \u548c\u503c\u5bf9\u8c61 Value types\uff09\u3002\u4e00\u822c\u6765\u8bf4,\u6211\u4eec\u9488\u5bf9\u4e0d\u540c\u7684\u5b9e\u4f53(\u6216\u805a\u5408\u6839 Aggregate Root)\u4f1a\u521b\u5efa\u76f8\u5bf9\u5e94\u7684\u4ed3\u50a8\u3002")),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u4ed3\u50a8\u5c31\u662f\u6570\u636e\u5b58\u53d6\u64cd\u4f5c\u7684\u8f7d\u4f53\uff0c\u4f46\u4e0d\u9650\u5b9a\u4e8e\u6570\u636e\u5e93\u3002"),Object(r.b)("h2",{id:"941-\u5185\u7f6e\u4ed3\u50a8"},"9.4.1 \u5185\u7f6e\u4ed3\u50a8"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5185\u7f6e\u4e86\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u4ed3\u50a8\uff0c\u65b9\u4fbf\u5927\u5bb6\u62d3\u5c55\u548c\u96c6\u6210\uff1a"),Object(r.b)("div",{className:"admonition admonition-info alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u4f9d\u8d56\u6ce8\u5165\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u76ee\u524d\u80fd\u591f\u88ab\u4f9d\u8d56\u6ce8\u5165\u89e3\u6790\u670d\u52a1\u7684\u4ed3\u50a8\u6709\uff1a"),Object(r.b)("ul",{parentName:"div"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IMSRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDbRepository"))),Object(r.b)("p",{parentName:"div"},"\u9664\u6b64\u4e4b\u540e\u7684\u6240\u6709\u4ed3\u50a8\u53ea\u80fd\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"rep.Constraint()")," \u8fdb\u884c\u7ea6\u675f\u521b\u5efa\uff0c\u5982\uff0c\u53ea\u8bfb\u4ed3\u50a8\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var readRepository = rep.Constraint>();\n")))),Object(r.b)("h3",{id:"9411-\u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8"},"9.4.1.1 \u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository"),"\uff1a\u9ed8\u8ba4\u975e\u6cdb\u578b\u4ed3\u50a8\u63a5\u53e3\uff0c\u652f\u6301\u5207\u6362\u5230\u4efb\u4f55\u4ed3\u50a8"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EFCoreRepository"),"\uff1a\u9ed8\u8ba4\u975e\u6cdb\u578b\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9412-\u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8"},"9.4.1.2 \u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EFCoreRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9413-\u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8"},"9.4.1.3 \u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EFCoreRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9414-sql-\u64cd\u4f5c\u4ed3\u50a8"},"9.4.1.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SqlRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9415-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c\u4ed3\u50a8"},"9.4.1.5 \u591a\u6570\u636e\u5e93 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SqlRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9416-\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.6 \u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IReadableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IReadableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9417-\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.7 \u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IWritableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IWritableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9418-\u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.8 \u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IInsertableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u65b0\u589e\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IInsertableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u65b0\u589e\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9419-\u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.9 \u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IUpdateableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u66f4\u65b0\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IUpdateableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u66f4\u65b0\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94110-\u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.10 \u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDeletableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u5220\u9664\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDeletableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u5220\u9664\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94111-\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.11 \u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IOperableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IOperableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94112-\u53ea\u5141\u8bb8-sql-\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.12 \u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlReaderRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u67e5\u8be2\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlReaderRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u67e5\u8be2\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94113-\u53ea\u5141\u8bb8-sql-\u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.13 \u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlExecutableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u975e\u67e5\u8be2\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlExecutableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u975e\u67e5\u8be2\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94114-\u8bfb\u5199\u5206\u79bb\u4ed3\u50a8"},"9.4.1.14 \u8bfb\u5199\u5206\u79bb\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IMSRepository"),"\uff1a\u6700\u591a\u652f\u6301 ",Object(r.b)("strong",{parentName:"li"},"\u4e00\u4e3b 7 \u4ece")," \u4ed3\u50a8")),Object(r.b)("h3",{id:"94115-\u5b9a\u4f4d\u5668\u4ed3\u50a8"},"9.4.1.15 \u5b9a\u4f4d\u5668\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDbRepository"),"\uff1a\u521d\u59cb\u5316\u7279\u5b9a\u6570\u636e\u5e93\u4ed3\u50a8")),Object(r.b)("h2",{id:"942-\u4ed3\u50a8\u4f7f\u7528"},"9.4.2 \u4ed3\u50a8\u4f7f\u7528"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u975e\u5e38\u591a\u7684\u65b9\u5f0f\u521b\u5efa\u4ed3\u50a8\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u8ba9\u5927\u5bb6\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u573a\u666f\u4e2d\u4f7f\u7528\u3002"),Object(r.b)("h3",{id:"9421-\u6784\u9020\u51fd\u6570\u6ce8\u5165"},"9.4.2.1 \u6784\u9020\u51fd\u6570\u6ce8\u5165"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2}","{2}":!0}),"private readonly IRepository _personRepository;\npublic FurionService(IRepository personRepository)\n{\n _personRepository = personRepository;\n}\n")),Object(r.b)("h3",{id:"9422-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"},"9.4.2.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public async Task> GetAll([FromServices] IRepository repository, string keyword)\n{\n var persons = await repository.AsQueryable().ToListAsync();\n return persons.Adapt>();\n}\n")),Object(r.b)("h3",{id:"9423-dbgetrepository-\u83b7\u53d6"},"9.4.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"Db.GetRepository")," \u83b7\u53d6"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u975e\u6cdb\u578b\u4ed3\u50a8\nvar repository = Db.GetRepository();\n\n// \u6cdb\u578b\u4ed3\u50a8\nvar repository = Db.GetRepository();\n\n// Sql \u4ed3\u50a8\nvar sqlRepository = Db.GetSqlRepository();\n")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u4e0d\u7ba1\u91c7\u7528\u54ea\u79cd\u65b9\u5f0f\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u90fd\u4fdd\u8bc1\u4e86\u4ed3\u50a8\u4e00\u6b21\u8bf7\u6c42\u552f\u4e00\u6027\u3002\u540c\u65f6 ",Object(r.b)("inlineCode",{parentName:"p"},"Db.GetRepository()")," \u65b9\u5f0f\u652f\u6301\u4efb\u4f55\u9759\u6001\u7c7b\u4e2d\u4f7f\u7528\u3002"))),Object(r.b)("h2",{id:"943-\u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5"},"9.4.3 \u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5"),Object(r.b)("h3",{id:"9431-\u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8"},"9.4.3.1 \u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var userRepository = personRepository.Change();\n")),Object(r.b)("h3",{id:"9432-\u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b"},"9.4.3.2 \u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b"),Object(r.b)("p",null,"\u6bd4\u5982\uff0c\u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u5e93\u4ed3\u50a8\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u53ea\u8bfb\u4ed3\u50a8\nvar readRepository = personRepository.Constraint>();\n\n// \u53ea\u5199\u4ed3\u50a8\nvar writeRepository = personRepository.Constraint>();\n")),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},".Constraint")," \u652f\u6301\u5207\u6362\u4efb\u4f55\u4ed3\u50a8\u7c7b\u578b\u3002"))),Object(r.b)("h3",{id:"9433-\u83b7\u53d6-sql-\u64cd\u4f5c\u4ed3\u50a8"},"9.4.3.3 \u83b7\u53d6 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var sqlRepository = repository.Sql();\n")),Object(r.b)("h2",{id:"944-\u591a\u6570\u636e\u5e93\u64cd\u4f5c"},"9.4.4 \u591a\u6570\u636e\u5e93\u64cd\u4f5c"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5b9e\u73b0\u591a\u79cd\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u53ef\u4ee5\u968f\u610f\u5207\u6362\u6570\u636e\u5e93"),Object(r.b)("h3",{id:"9441-\u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93"},"9.4.4.1 \u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93"),Object(r.b)("h4",{id:"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93"},"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = repository.Change();\n\n// \u5176\u4ed6\u66f4\u591a\u6570\u636e\u5e93\u4e00\u6837\u7684\u64cd\u4f5c\n")),Object(r.b)("h4",{id:"\u53e6\u5916\u4efb\u4f55\u4ed3\u50a8\u6216\u5b9e\u4f53\u914d\u7f6e\u90fd\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u540c\u65f6\u64cd\u4f5c"},"\u53e6\u5916\u4efb\u4f55\u4ed3\u50a8\u6216\u5b9e\u4f53\u914d\u7f6e\u90fd\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u540c\u65f6\u64cd\u4f5c"),Object(r.b)("p",null,"\u4ed3\u50a8\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"IRepository mssqlRepository\n\nISqlRepository mssqlRepository;\n")),Object(r.b)("p",null,"\u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"select * from person".Change().SqlQuery();\n')),Object(r.b)("p",null,"\u5b9e\u4f53\u914d\u7f6e\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class User:Entity\n{\n}\n")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[SqlFunction("funcName", DbContextLocator = typeof(MySqlDbContextLocator))]\nint GetAge(int id);\n')),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u4e2d\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[QueryableFunction("funcName","dbo", DbContextLocator = typeof(MySqlDbContextLocator))]\nstring GetName()=> throw Oops.Oh("\u4e0d\u652f\u6301\u8be5\u6570\u636e\u5e93\u64cd\u4f5c");\n')),Object(r.b)("h2",{id:"945-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.4.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));var a=n(21),i=n(191);function r(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return r?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=r();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return j}));var a=n(0),i=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=i.a.createContext({}),p=function(e){var t=i.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=p(e.components);return i.a.createElement(c.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},O=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,o=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),s=p(n),O=a,j=s["".concat(o,".").concat(O)]||s[O]||d[O]||r;return n?i.a.createElement(j,b(b({ref:t},c),{},{components:n})):i.a.createElement(j,b({ref:t},c))}));function j(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=O;var b={};for(var l in t)hasOwnProperty.call(t,l)&&(b[l]=t[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,o[1]=b;for(var c=2;ct(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{167:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return b})),n.d(t,"metadata",(function(){return l})),n.d(t,"toc",(function(){return c})),n.d(t,"default",(function(){return s}));var a=n(3),i=n(7),r=(n(0),n(196)),o=n(197),b={id:"dbcontext-repository",title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",sidebar_label:"9.4 \u4ed3\u50a8\u6a21\u5f0f"},l={unversionedId:"dbcontext-repository",id:"dbcontext-repository",isDocsHomePage:!1,title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",description:"9.4.1 \u4ec0\u4e48\u662f\u4ed3\u50a8",source:"@site/docs\\dbcontext-repository.mdx",slug:"/dbcontext-repository",permalink:"/docs/dbcontext-repository",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-repository.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.4 \u4ed3\u50a8\u6a21\u5f0f",sidebar:"docs",previous:{title:"9.3 \u6570\u636e\u5e93\u5b9e\u4f53",permalink:"/docs/entity"},next:{title:"9.5 \u65b0\u589e\u64cd\u4f5c",permalink:"/docs/dbcontext-add"}},c=[{value:"9.4.1 \u4ec0\u4e48\u662f\u4ed3\u50a8",id:"941-\u4ec0\u4e48\u662f\u4ed3\u50a8",children:[]},{value:"9.4.1 \u5185\u7f6e\u4ed3\u50a8",id:"941-\u5185\u7f6e\u4ed3\u50a8",children:[{value:"9.4.1.1 \u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8",id:"9411-\u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8",children:[]},{value:"9.4.1.2 \u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8",id:"9412-\u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8",children:[]},{value:"9.4.1.3 \u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8",id:"9413-\u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8",children:[]},{value:"9.4.1.4 Sql \u64cd\u4f5c\u4ed3\u50a8",id:"9414-sql-\u64cd\u4f5c\u4ed3\u50a8",children:[]},{value:"9.4.1.5 \u591a\u6570\u636e\u5e93 Sql \u64cd\u4f5c\u4ed3\u50a8",id:"9415-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c\u4ed3\u50a8",children:[]},{value:"9.4.1.6 \u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9416-\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.7 \u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9417-\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.8 \u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9418-\u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.9 \u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"9419-\u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.10 \u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94110-\u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.11 \u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94111-\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.12 \u53ea\u5141\u8bb8 Sql \u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94112-\u53ea\u5141\u8bb8-sql-\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.13 \u53ea\u5141\u8bb8 Sql \u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",id:"94113-\u53ea\u5141\u8bb8-sql-\u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09",children:[]},{value:"9.4.1.14 \u8bfb\u5199\u5206\u79bb\u4ed3\u50a8",id:"94114-\u8bfb\u5199\u5206\u79bb\u4ed3\u50a8",children:[]},{value:"9.4.1.15 \u5b9a\u4f4d\u5668\u4ed3\u50a8",id:"94115-\u5b9a\u4f4d\u5668\u4ed3\u50a8",children:[]}]},{value:"9.4.2 \u4ed3\u50a8\u4f7f\u7528",id:"942-\u4ed3\u50a8\u4f7f\u7528",children:[{value:"9.4.2.1 \u6784\u9020\u51fd\u6570\u6ce8\u5165",id:"9421-\u6784\u9020\u51fd\u6570\u6ce8\u5165",children:[]},{value:"9.4.2.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",id:"9422-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",children:[]},{value:"9.4.2.3 Db.GetRepository \u83b7\u53d6",id:"9423-dbgetrepository-\u83b7\u53d6",children:[]}]},{value:"9.4.3 \u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5",id:"943-\u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5",children:[{value:"9.4.3.1 \u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8",id:"9431-\u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8",children:[]},{value:"9.4.3.2 \u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b",id:"9432-\u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b",children:[]},{value:"9.4.3.3 \u83b7\u53d6 Sql \u64cd\u4f5c\u4ed3\u50a8",id:"9433-\u83b7\u53d6-sql-\u64cd\u4f5c\u4ed3\u50a8",children:[]}]},{value:"9.4.4 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",id:"944-\u591a\u6570\u636e\u5e93\u64cd\u4f5c",children:[{value:"9.4.4.1 \u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93",id:"9441-\u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93",children:[]}]},{value:"9.4.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"945-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:c};function s(e){var t=e.components,n=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(r.b)(o.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"941-\u4ec0\u4e48\u662f\u4ed3\u50a8"},"9.4.1 \u4ec0\u4e48\u662f\u4ed3\u50a8"),Object(r.b)("blockquote",null,Object(r.b)("p",{parentName:"blockquote"},"\u5728\u9886\u57df\u5c42\u548c\u6570\u636e\u6620\u5c04\u5c42\u7684\u4e2d\u4ecb,\u4f7f\u7528\u7c7b\u4f3c\u96c6\u5408\u7684\u63a5\u53e3\u6765\u5b58\u53d6\u9886\u57df\u5bf9\u8c61\uff0c\u5b9e\u9645\u4e0a\uff0c\u4ed3\u50a8\u88ab\u7528\u4e8e\u9886\u57df\u5bf9\u8c61\u5728\u6570\u636e\u5e93\u4e0a\u7684\u64cd\u4f5c\uff08\u5b9e\u4f53 Entity \u548c\u503c\u5bf9\u8c61 Value types\uff09\u3002\u4e00\u822c\u6765\u8bf4,\u6211\u4eec\u9488\u5bf9\u4e0d\u540c\u7684\u5b9e\u4f53(\u6216\u805a\u5408\u6839 Aggregate Root)\u4f1a\u521b\u5efa\u76f8\u5bf9\u5e94\u7684\u4ed3\u50a8\u3002")),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u4ed3\u50a8\u5c31\u662f\u6570\u636e\u5b58\u53d6\u64cd\u4f5c\u7684\u8f7d\u4f53\uff0c\u4f46\u4e0d\u9650\u5b9a\u4e8e\u6570\u636e\u5e93\u3002"),Object(r.b)("h2",{id:"941-\u5185\u7f6e\u4ed3\u50a8"},"9.4.1 \u5185\u7f6e\u4ed3\u50a8"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u5185\u7f6e\u4e86\u4e00\u4e2a\u6570\u636e\u5e93\u64cd\u4f5c\u7684\u4ed3\u50a8\uff0c\u65b9\u4fbf\u5927\u5bb6\u62d3\u5c55\u548c\u96c6\u6210\uff1a"),Object(r.b)("div",{className:"admonition admonition-info alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u4f9d\u8d56\u6ce8\u5165\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u76ee\u524d\u80fd\u591f\u88ab\u4f9d\u8d56\u6ce8\u5165\u89e3\u6790\u670d\u52a1\u7684\u4ed3\u50a8\u6709\uff1a"),Object(r.b)("ul",{parentName:"div"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IMSRepository")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDbRepository"))),Object(r.b)("p",{parentName:"div"},"\u9664\u6b64\u4e4b\u540e\u7684\u6240\u6709\u4ed3\u50a8\u53ea\u80fd\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"rep.Constraint()")," \u8fdb\u884c\u7ea6\u675f\u521b\u5efa\uff0c\u5982\uff0c\u53ea\u8bfb\u4ed3\u50a8\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var readRepository = rep.Constraint>();\n")))),Object(r.b)("h3",{id:"9411-\u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8"},"9.4.1.1 \u975e\u6cdb\u578b\u8d85\u7ea7\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository"),"\uff1a\u9ed8\u8ba4\u975e\u6cdb\u578b\u4ed3\u50a8\u63a5\u53e3\uff0c\u652f\u6301\u5207\u6362\u5230\u4efb\u4f55\u4ed3\u50a8"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EFCoreRepository"),"\uff1a\u9ed8\u8ba4\u975e\u6cdb\u578b\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9412-\u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8"},"9.4.1.2 \u6cdb\u578b\u5b9e\u4f53\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EFCoreRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9413-\u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8"},"9.4.1.3 \u6cdb\u578b\u591a\u6570\u636e\u5e93\u5b9e\u4f53\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EFCoreRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9414-sql-\u64cd\u4f5c\u4ed3\u50a8"},"9.4.1.4 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SqlRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9415-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c\u4ed3\u50a8"},"9.4.1.5 \u591a\u6570\u636e\u5e93 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SqlRepository"),"\uff1a\u4efb\u610f\u6570\u636e\u5e93\u7684 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9416-\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.6 \u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IReadableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IReadableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u8bfb\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9417-\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.7 \u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IWritableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IWritableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5199\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9418-\u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.8 \u53ea\u5141\u8bb8\u65b0\u589e\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IInsertableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u65b0\u589e\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IInsertableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u65b0\u589e\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"9419-\u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.9 \u53ea\u5141\u8bb8\u66f4\u65b0\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IUpdateableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u66f4\u65b0\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IUpdateableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u66f4\u65b0\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94110-\u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.10 \u53ea\u5141\u8bb8\u5220\u9664\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDeletableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u5220\u9664\u7684\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDeletableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u5220\u9664\u7684\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94111-\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.11 \u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IOperableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IOperableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8\u62d3\u5c55\u64cd\u4f5c\u5b9e\u4f53\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94112-\u53ea\u5141\u8bb8-sql-\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.12 \u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlReaderRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u67e5\u8be2\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlReaderRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u67e5\u8be2\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94113-\u53ea\u5141\u8bb8-sql-\u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"},"9.4.1.13 \u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u975e\u67e5\u8be2\u4ed3\u50a8\uff08\u652f\u6301\u591a\u5e93\uff09"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlExecutableRepository"),"\uff1a\u9ed8\u8ba4\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u975e\u67e5\u8be2\u4ed3\u50a8\u63a5\u53e3"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ISqlExecutableRepository"),"\uff1a\u591a\u6570\u636e\u5e93\u53ea\u5141\u8bb8 ",Object(r.b)("inlineCode",{parentName:"li"},"Sql")," \u975e\u67e5\u8be2\u4ed3\u50a8\u5b9e\u73b0")),Object(r.b)("h3",{id:"94114-\u8bfb\u5199\u5206\u79bb\u4ed3\u50a8"},"9.4.1.14 \u8bfb\u5199\u5206\u79bb\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IMSRepository"),"\uff1a\u6700\u591a\u652f\u6301 ",Object(r.b)("strong",{parentName:"li"},"\u4e00\u4e3b 7 \u4ece")," \u4ed3\u50a8")),Object(r.b)("h3",{id:"94115-\u5b9a\u4f4d\u5668\u4ed3\u50a8"},"9.4.1.15 \u5b9a\u4f4d\u5668\u4ed3\u50a8"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IDbRepository"),"\uff1a\u521d\u59cb\u5316\u7279\u5b9a\u6570\u636e\u5e93\u4ed3\u50a8")),Object(r.b)("h2",{id:"942-\u4ed3\u50a8\u4f7f\u7528"},"9.4.2 \u4ed3\u50a8\u4f7f\u7528"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u975e\u5e38\u591a\u7684\u65b9\u5f0f\u521b\u5efa\u4ed3\u50a8\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u8ba9\u5927\u5bb6\u53ef\u4ee5\u5728\u4e0d\u540c\u7684\u573a\u666f\u4e2d\u4f7f\u7528\u3002"),Object(r.b)("h3",{id:"9421-\u6784\u9020\u51fd\u6570\u6ce8\u5165"},"9.4.2.1 \u6784\u9020\u51fd\u6570\u6ce8\u5165"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2}","{2}":!0}),"private readonly IRepository _personRepository;\npublic FurionService(IRepository personRepository)\n{\n _personRepository = personRepository;\n}\n")),Object(r.b)("h3",{id:"9422-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"},"9.4.2.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public async Task> GetAll([FromServices] IRepository repository, string keyword)\n{\n var persons = await repository.AsQueryable().ToListAsync();\n return persons.Adapt>();\n}\n")),Object(r.b)("h3",{id:"9423-dbgetrepository-\u83b7\u53d6"},"9.4.2.3 ",Object(r.b)("inlineCode",{parentName:"h3"},"Db.GetRepository")," \u83b7\u53d6"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u975e\u6cdb\u578b\u4ed3\u50a8\nvar repository = Db.GetRepository();\n\n// \u6cdb\u578b\u4ed3\u50a8\nvar repository = Db.GetRepository();\n\n// Sql \u4ed3\u50a8\nvar sqlRepository = Db.GetSqlRepository();\n")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u4e0d\u7ba1\u91c7\u7528\u54ea\u79cd\u65b9\u5f0f\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u90fd\u4fdd\u8bc1\u4e86\u4ed3\u50a8\u4e00\u6b21\u8bf7\u6c42\u552f\u4e00\u6027\u3002\u540c\u65f6 ",Object(r.b)("inlineCode",{parentName:"p"},"Db.GetRepository()")," \u65b9\u5f0f\u652f\u6301\u4efb\u4f55\u9759\u6001\u7c7b\u4e2d\u4f7f\u7528\u3002"))),Object(r.b)("h2",{id:"943-\u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5"},"9.4.3 \u4ed3\u50a8\u9ad8\u7ea7\u7528\u6cd5"),Object(r.b)("h3",{id:"9431-\u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8"},"9.4.3.1 \u52a8\u6001\u5207\u6362\u5b9e\u4f53\u4ed3\u50a8"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var userRepository = personRepository.Change();\n")),Object(r.b)("h3",{id:"9432-\u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b"},"9.4.3.2 \u52a8\u6001\u5207\u6362\u4ed3\u50a8\u7c7b\u578b"),Object(r.b)("p",null,"\u6bd4\u5982\uff0c\u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u5e93\u4ed3\u50a8\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u53ea\u8bfb\u4ed3\u50a8\nvar readRepository = personRepository.Constraint>();\n\n// \u53ea\u5199\u4ed3\u50a8\nvar writeRepository = personRepository.Constraint>();\n")),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},".Constraint")," \u652f\u6301\u5207\u6362\u4efb\u4f55\u4ed3\u50a8\u7c7b\u578b\u3002"))),Object(r.b)("h3",{id:"9433-\u83b7\u53d6-sql-\u64cd\u4f5c\u4ed3\u50a8"},"9.4.3.3 \u83b7\u53d6 ",Object(r.b)("inlineCode",{parentName:"h3"},"Sql")," \u64cd\u4f5c\u4ed3\u50a8"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var sqlRepository = repository.Sql();\n")),Object(r.b)("h2",{id:"944-\u591a\u6570\u636e\u5e93\u64cd\u4f5c"},"9.4.4 \u591a\u6570\u636e\u5e93\u64cd\u4f5c"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"DbContextLocator")," \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\u5b9e\u73b0\u591a\u79cd\u6570\u636e\u5e93\u64cd\u4f5c\uff0c\u53ef\u4ee5\u968f\u610f\u5207\u6362\u6570\u636e\u5e93"),Object(r.b)("h3",{id:"9441-\u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93"},"9.4.4.1 \u52a8\u6001\u5207\u6362\u591a\u4e2a\u6570\u636e\u5e93"),Object(r.b)("h4",{id:"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93"},"\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"// \u5207\u6362\u5230 MSSQL \u64cd\u4f5c Person\u8868\nvar mssqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 MySql \u64cd\u4f5c Person\u8868\nvar mysqlRepository = repository.Change();\n\n// \u5207\u6362\u5230 Sqlite \u64cd\u4f5c Person\u8868\nvar sqliteRepository = repository.Change();\n\n// \u5176\u4ed6\u66f4\u591a\u6570\u636e\u5e93\u4e00\u6837\u7684\u64cd\u4f5c\n")),Object(r.b)("h4",{id:"\u53e6\u5916\u4efb\u4f55\u4ed3\u50a8\u6216\u5b9e\u4f53\u914d\u7f6e\u90fd\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u540c\u65f6\u64cd\u4f5c"},"\u53e6\u5916\u4efb\u4f55\u4ed3\u50a8\u6216\u5b9e\u4f53\u914d\u7f6e\u90fd\u652f\u6301\u591a\u4e2a\u6570\u636e\u5e93\u540c\u65f6\u64cd\u4f5c"),Object(r.b)("p",null,"\u4ed3\u50a8\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"IRepository mssqlRepository\n\nISqlRepository mssqlRepository;\n")),Object(r.b)("p",null,"\u52a8\u6001 ",Object(r.b)("inlineCode",{parentName:"p"},"sql")," \u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'"select * from person".Change().SqlQuery();\n')),Object(r.b)("p",null,"\u5b9e\u4f53\u914d\u7f6e\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class User:Entity\n{\n}\n")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[SqlFunction("funcName", DbContextLocator = typeof(MySqlDbContextLocator))]\nint GetAge(int id);\n')),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Linq")," \u4e2d\u65b9\u5f0f"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'[QueryableFunction("funcName","dbo", DbContextLocator = typeof(MySqlDbContextLocator))]\nstring GetName()=> throw Oops.Oh("\u4e0d\u652f\u6301\u8be5\u6570\u636e\u5e93\u64cd\u4f5c");\n')),Object(r.b)("h2",{id:"945-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.4.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}s.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}));var a=n(21),i=n(195);function r(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(i.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return r?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=r();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return j}));var a=n(0),i=n.n(a);function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var c=i.a.createContext({}),p=function(e){var t=i.a.useContext(c),n=t;return e&&(n="function"==typeof e?e(t):b(b({},t),e)),n},s=function(e){var t=p(e.components);return i.a.createElement(c.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return i.a.createElement(i.a.Fragment,{},t)}},O=i.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,r=e.originalType,o=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),s=p(n),O=a,j=s["".concat(o,".").concat(O)]||s[O]||d[O]||r;return n?i.a.createElement(j,b(b({ref:t},c),{},{components:n})):i.a.createElement(j,b({ref:t},c))}));function j(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var r=n.length,o=new Array(r);o[0]=O;var b={};for(var l in t)hasOwnProperty.call(t,l)&&(b[l]=t[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,o[1]=b;for(var c=2;ct(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/d631a3bf.2a7a7144.js b/docs/d631a3bf.2a7a7144.js deleted file mode 100644 index 9fe8fd12344..00000000000 --- a/docs/d631a3bf.2a7a7144.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[89],{163:function(n){n.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"net-5","name":".net5","count":1,"permalink":"/blog/tags/net-5"}')}}]); \ No newline at end of file diff --git a/docs/d631a3bf.c3f28ac9.js b/docs/d631a3bf.c3f28ac9.js new file mode 100644 index 00000000000..33853fc5d88 --- /dev/null +++ b/docs/d631a3bf.c3f28ac9.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{168:function(n){n.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"net-5","name":".net5","count":3,"permalink":"/blog/tags/net-5"}')}}]); \ No newline at end of file diff --git a/docs/d80bb0e0.18c7f21f.js b/docs/d80bb0e0.18c7f21f.js deleted file mode 100644 index 0145280f5f2..00000000000 --- a/docs/d80bb0e0.18c7f21f.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[90],{164:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return i})),r.d(t,"metadata",(function(){return u})),r.d(t,"toc",(function(){return s})),r.d(t,"default",(function(){return p}));var n=r(3),o=r(7),a=(r(0),r(192)),c=r(193),i={id:"gooduse",title:"31.3 \u6700\u4f73\u5b9e\u8df5",sidebar_label:"31.3 \u6700\u4f73\u5b9e\u8df5"},u={unversionedId:"gooduse",id:"gooduse",isDocsHomePage:!1,title:"31.3 \u6700\u4f73\u5b9e\u8df5",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1ahttps://monksoul.gitbook.io/hoa/",source:"@site/docs\\gooduse.mdx",slug:"/gooduse",permalink:"/docs/gooduse",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/gooduse.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"31.3 \u6700\u4f73\u5b9e\u8df5",sidebar:"docs",previous:{title:"31.2 \u5e38\u89c1\u9519\u8bef",permalink:"/docs/errors"}},s=[],l={toc:s};function p(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(n.a)({},l,r,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u65e7\u6587\u6863\uff1a",Object(a.b)("a",Object(n.a)({parentName:"p"},{href:"https://monksoul.gitbook.io/hoa/"}),"https://monksoul.gitbook.io/hoa/")))}p.isMDXComponent=!0},190:function(e,t,r){"use strict";r.d(t,"b",(function(){return a})),r.d(t,"a",(function(){return c}));var n=r(21),o=r(191);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:a=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const c=r.startsWith(t)?r:t+r.replace(/^\//,"");return a?e+c:c}(t,e,r,n)}}function c(e,t={}){const{withBaseUrl:r}=a();return r(e,t)}},191:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return p})),r.d(t,"b",(function(){return b}));var n=r(0),o=r.n(n);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var s=o.a.createContext({}),l=function(e){var t=o.a.useContext(s),r=t;return e&&(r="function"==typeof e?e(t):i(i({},t),e)),r},p=function(e){var t=l(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,a=e.originalType,c=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),p=l(r),d=n,b=p["".concat(c,".").concat(d)]||p[d]||f[d]||a;return r?o.a.createElement(b,i(i({ref:t},s),{},{components:r})):o.a.createElement(b,i({ref:t},s))}));function b(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var a=r.length,c=new Array(a);c[0]=d;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/d8c8d2dc.80f5cb60.js b/docs/d8c8d2dc.b9e3b859.js similarity index 95% rename from docs/d8c8d2dc.80f5cb60.js rename to docs/d8c8d2dc.b9e3b859.js index c1e5a6792cb..5523561532f 100644 --- a/docs/d8c8d2dc.80f5cb60.js +++ b/docs/d8c8d2dc.b9e3b859.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[91],{165:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return o})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return u}));var r=n(3),a=n(7),c=(n(0),n(192)),l=n(193),i={id:"dbcontext-sql-template",title:"9.16 Sql \u6a21\u677f",sidebar_label:"9.16 Sql \u6a21\u677f"},o={unversionedId:"dbcontext-sql-template",id:"dbcontext-sql-template",isDocsHomePage:!1,title:"9.16 Sql \u6a21\u677f",description:"9.16.1 Sql \u6a21\u677f",source:"@site/docs\\dbcontext-sql-template.mdx",slug:"/dbcontext-sql-template",permalink:"/docs/dbcontext-sql-template",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-sql-template.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.16 Sql \u6a21\u677f",sidebar:"docs",previous:{title:"9.15 Sql \u64cd\u4f5c",permalink:"/docs/dbcontext-sql"},next:{title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",permalink:"/docs/dbcontext-sql-proxy"}},b=[{value:"9.16.1 Sql \u6a21\u677f",id:"9161-sql-\u6a21\u677f",children:[]},{value:"9.16.2 Sql \u6a21\u677f\u4f18\u7f3a\u70b9",id:"9162-sql-\u6a21\u677f\u4f18\u7f3a\u70b9",children:[{value:"9.16.2.1 \u4f18\u70b9",id:"91621-\u4f18\u70b9",children:[]},{value:"9.16.2.2 \u7f3a\u70b9",id:"91622-\u7f3a\u70b9",children:[]}]},{value:"9.16.3 \u5982\u4f55\u4f7f\u7528",id:"9163-\u5982\u4f55\u4f7f\u7528",children:[{value:"9.16.3.1 \u5e38\u89c4\u4f7f\u7528",id:"91631-\u5e38\u89c4\u4f7f\u7528",children:[]},{value:"9.16.3.2 \u9ad8\u7ea7\u5d4c\u5957",id:"91632-\u9ad8\u7ea7\u5d4c\u5957",children:[]}]},{value:"9.16.4 Sql \u6a21\u677f\u914d\u7f6e",id:"9164-sql-\u6a21\u677f\u914d\u7f6e",children:[{value:"9.16.4.1 \u666e\u901a\u6a21\u5f0f",id:"91641-\u666e\u901a\u6a21\u5f0f",children:[]},{value:"9.16.4.2 \u66f4\u591a\u914d\u7f6e",id:"91642-\u66f4\u591a\u914d\u7f6e",children:[]}]},{value:"9.16.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9165-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:b};function u(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(l.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9161-sql-\u6a21\u677f"},"9.16.1 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u6a21\u677f"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u7a0b\u5e8f\u4e2d\u6267\u884c\u6570\u636e\u5e93\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u90fd\u5199\u5728\u4e86\u7a0b\u5e8f\u96c6\u4e2d\uff0c\u968f\u7a0b\u5e8f\u4e00\u8d77\u7f16\u8bd1\uff0c\u540e\u7eed\u9700\u8981\u4fee\u6539\uff0c\u5219\u91cd\u65b0\u7f16\u8bd1\u4ee3\u7801\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u521b\u9020\u51fa\u4e00\u79cd ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u6a21\u677f\u7684\u65b9\u5f0f\uff0c\u7a0b\u5e8f\u6267\u884c ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u65f6\uff0c\u53ea\u9700\u8981\u4f7f\u7528\u7279\u6b8a\u6807\u8bb0\u5373\u53ef\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"#(\u6a21\u677fKey)"),"\uff0c\u8fd9\u4e9b\u771f\u5b9e\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u914d\u7f6e\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},".json")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},".xml")," \u914d\u7f6e\u6587\u4ef6\u4e2d\u3002"),Object(c.b)("p",null,"\u5982\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"Json")," \u65b9\u5f0f")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "Select.User": "select * from User where id > @id"\n}\n')),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"Xml")," \u65b9\u5f0f")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-xml"}),'\n\n select * from User where id > @id\n\n')),Object(c.b)("h2",{id:"9162-sql-\u6a21\u677f\u4f18\u7f3a\u70b9"},"9.16.2 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u6a21\u677f\u4f18\u7f3a\u70b9"),Object(c.b)("h3",{id:"91621-\u4f18\u70b9"},"9.16.2.1 \u4f18\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u52a8\u6001\u914d\u7f6e\uff0c\u53ef\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6\u52a8\u6001\u8c03\u914d ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u8bed\u53e5"),Object(c.b)("li",{parentName:"ul"},"\u652f\u6301\u7a0b\u5e8f ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u8bed\u53e5\u52a0\u5bc6")),Object(c.b)("h3",{id:"91622-\u7f3a\u70b9"},"9.16.2.2 \u7f3a\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u9700\u589e\u52a0\u5bf9\u5e94\u914d\u7f6e\u6587\u4ef6"),Object(c.b)("li",{parentName:"ul"},"\u4e0d\u5bb9\u6613\u8c03\u8bd5 ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u4ee3\u7801")),Object(c.b)("h2",{id:"9163-\u5982\u4f55\u4f7f\u7528"},"9.16.3 \u5982\u4f55\u4f7f\u7528"),Object(c.b)("p",null,"\u5728\u6267\u884c ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981\u586b\u5199\u6307\u5b9a\u6a21\u677f\u5373\u53ef\u3002"),Object(c.b)("h3",{id:"91631-\u5e38\u89c4\u4f7f\u7528"},"9.16.3.1 \u5e38\u89c4\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u4ed3\u50a8\u65b9\u5f0f\nvar users = repository.SqlQuery("#(Select.User)", new { id = 1});\n\n// \u61d2\u4eba\u65b9\u5f0f\nvar users = "#(Select.User)".SqlQuery(new { id = 1});\n\n// Sql \u4ee3\u7406\u65b9\u5f0f\n[SqlExecute("#(Select.User)")]\nList GetUser(int id);\n')),Object(c.b)("h3",{id:"91632-\u9ad8\u7ea7\u5d4c\u5957"},"9.16.3.2 \u9ad8\u7ea7\u5d4c\u5957"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var users = repository.SqlQuery(\n@"select * from user u\nleft join #(User.Detail) d on u.Id = d.UserId\nwhere id > @id");\n')),Object(c.b)("h2",{id:"9164-sql-\u6a21\u677f\u914d\u7f6e"},"9.16.4 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u6a21\u677f\u914d\u7f6e"),Object(c.b)("h3",{id:"91641-\u666e\u901a\u6a21\u5f0f"},"9.16.4.1 \u666e\u901a\u6a21\u5f0f"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "Select.User": "select * from User"\n}\n')),Object(c.b)("h3",{id:"91642-\u66f4\u591a\u914d\u7f6e"},"9.16.4.2 \u66f4\u591a\u914d\u7f6e"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "Select.User": {\n "Sql": "select * from User where id > @id and Name = @name",\n "Params": [\n {\n "Name": " Id",\n "Value": "1",\n "DbType": "Int16",\n "Size": 10\n },\n {\n "Name": " Name",\n "Value": "\u767e\u5c0f\u50e7",\n "DbType": "String",\n "Size": 10\n }\n ]\n }\n}\n')),Object(c.b)("h2",{id:"9165-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.16.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var r=n(21),a=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+l:l}(t,e,n,r)}}function l(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var b=a.a.createContext({}),s=function(e){var t=a.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},p=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,l=e.parentName,b=o(e,["components","mdxType","originalType","parentName"]),u=s(n),p=r,m=u["".concat(l,".").concat(p)]||u[p]||d[p]||c;return n?a.a.createElement(m,i(i({ref:t},b),{},{components:n})):a.a.createElement(m,i({ref:t},b))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,l=new Array(c);l[0]=p;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i.mdxType="string"==typeof e?e:r,l[1]=i;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[95],{169:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return o})),n.d(t,"toc",(function(){return b})),n.d(t,"default",(function(){return u}));var r=n(3),a=n(7),c=(n(0),n(196)),l=n(197),i={id:"dbcontext-sql-template",title:"9.16 Sql \u6a21\u677f",sidebar_label:"9.16 Sql \u6a21\u677f"},o={unversionedId:"dbcontext-sql-template",id:"dbcontext-sql-template",isDocsHomePage:!1,title:"9.16 Sql \u6a21\u677f",description:"9.16.1 Sql \u6a21\u677f",source:"@site/docs\\dbcontext-sql-template.mdx",slug:"/dbcontext-sql-template",permalink:"/docs/dbcontext-sql-template",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-sql-template.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.16 Sql \u6a21\u677f",sidebar:"docs",previous:{title:"9.15 Sql \u64cd\u4f5c",permalink:"/docs/dbcontext-sql"},next:{title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",permalink:"/docs/dbcontext-sql-proxy"}},b=[{value:"9.16.1 Sql \u6a21\u677f",id:"9161-sql-\u6a21\u677f",children:[]},{value:"9.16.2 Sql \u6a21\u677f\u4f18\u7f3a\u70b9",id:"9162-sql-\u6a21\u677f\u4f18\u7f3a\u70b9",children:[{value:"9.16.2.1 \u4f18\u70b9",id:"91621-\u4f18\u70b9",children:[]},{value:"9.16.2.2 \u7f3a\u70b9",id:"91622-\u7f3a\u70b9",children:[]}]},{value:"9.16.3 \u5982\u4f55\u4f7f\u7528",id:"9163-\u5982\u4f55\u4f7f\u7528",children:[{value:"9.16.3.1 \u5e38\u89c4\u4f7f\u7528",id:"91631-\u5e38\u89c4\u4f7f\u7528",children:[]},{value:"9.16.3.2 \u9ad8\u7ea7\u5d4c\u5957",id:"91632-\u9ad8\u7ea7\u5d4c\u5957",children:[]}]},{value:"9.16.4 Sql \u6a21\u677f\u914d\u7f6e",id:"9164-sql-\u6a21\u677f\u914d\u7f6e",children:[{value:"9.16.4.1 \u666e\u901a\u6a21\u5f0f",id:"91641-\u666e\u901a\u6a21\u5f0f",children:[]},{value:"9.16.4.2 \u66f4\u591a\u914d\u7f6e",id:"91642-\u66f4\u591a\u914d\u7f6e",children:[]}]},{value:"9.16.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9165-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],s={toc:b};function u(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},s,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(l.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9161-sql-\u6a21\u677f"},"9.16.1 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u6a21\u677f"),Object(c.b)("p",null,"\u901a\u5e38\u6211\u4eec\u7a0b\u5e8f\u4e2d\u6267\u884c\u6570\u636e\u5e93\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u90fd\u5199\u5728\u4e86\u7a0b\u5e8f\u96c6\u4e2d\uff0c\u968f\u7a0b\u5e8f\u4e00\u8d77\u7f16\u8bd1\uff0c\u540e\u7eed\u9700\u8981\u4fee\u6539\uff0c\u5219\u91cd\u65b0\u7f16\u8bd1\u4ee3\u7801\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u521b\u9020\u51fa\u4e00\u79cd ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u6a21\u677f\u7684\u65b9\u5f0f\uff0c\u7a0b\u5e8f\u6267\u884c ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u65f6\uff0c\u53ea\u9700\u8981\u4f7f\u7528\u7279\u6b8a\u6807\u8bb0\u5373\u53ef\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"#(\u6a21\u677fKey)"),"\uff0c\u8fd9\u4e9b\u771f\u5b9e\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u914d\u7f6e\u5728 ",Object(c.b)("inlineCode",{parentName:"p"},".json")," \u6216 ",Object(c.b)("inlineCode",{parentName:"p"},".xml")," \u914d\u7f6e\u6587\u4ef6\u4e2d\u3002"),Object(c.b)("p",null,"\u5982\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"Json")," \u65b9\u5f0f")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "Select.User": "select * from User where id > @id"\n}\n')),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"Xml")," \u65b9\u5f0f")),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-xml"}),'\n\n select * from User where id > @id\n\n')),Object(c.b)("h2",{id:"9162-sql-\u6a21\u677f\u4f18\u7f3a\u70b9"},"9.16.2 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u6a21\u677f\u4f18\u7f3a\u70b9"),Object(c.b)("h3",{id:"91621-\u4f18\u70b9"},"9.16.2.1 \u4f18\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u652f\u6301 ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u52a8\u6001\u914d\u7f6e\uff0c\u53ef\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6\u52a8\u6001\u8c03\u914d ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u8bed\u53e5"),Object(c.b)("li",{parentName:"ul"},"\u652f\u6301\u7a0b\u5e8f ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u8bed\u53e5\u52a0\u5bc6")),Object(c.b)("h3",{id:"91622-\u7f3a\u70b9"},"9.16.2.2 \u7f3a\u70b9"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},"\u9700\u589e\u52a0\u5bf9\u5e94\u914d\u7f6e\u6587\u4ef6"),Object(c.b)("li",{parentName:"ul"},"\u4e0d\u5bb9\u6613\u8c03\u8bd5 ",Object(c.b)("inlineCode",{parentName:"li"},"Sql")," \u4ee3\u7801")),Object(c.b)("h2",{id:"9163-\u5982\u4f55\u4f7f\u7528"},"9.16.3 \u5982\u4f55\u4f7f\u7528"),Object(c.b)("p",null,"\u5728\u6267\u884c ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981\u586b\u5199\u6307\u5b9a\u6a21\u677f\u5373\u53ef\u3002"),Object(c.b)("h3",{id:"91631-\u5e38\u89c4\u4f7f\u7528"},"9.16.3.1 \u5e38\u89c4\u4f7f\u7528"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'// \u4ed3\u50a8\u65b9\u5f0f\nvar users = repository.SqlQuery("#(Select.User)", new { id = 1});\n\n// \u61d2\u4eba\u65b9\u5f0f\nvar users = "#(Select.User)".SqlQuery(new { id = 1});\n\n// Sql \u4ee3\u7406\u65b9\u5f0f\n[SqlExecute("#(Select.User)")]\nList GetUser(int id);\n')),Object(c.b)("h3",{id:"91632-\u9ad8\u7ea7\u5d4c\u5957"},"9.16.3.2 \u9ad8\u7ea7\u5d4c\u5957"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var users = repository.SqlQuery(\n@"select * from user u\nleft join #(User.Detail) d on u.Id = d.UserId\nwhere id > @id");\n')),Object(c.b)("h2",{id:"9164-sql-\u6a21\u677f\u914d\u7f6e"},"9.16.4 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u6a21\u677f\u914d\u7f6e"),Object(c.b)("h3",{id:"91641-\u666e\u901a\u6a21\u5f0f"},"9.16.4.1 \u666e\u901a\u6a21\u5f0f"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "Select.User": "select * from User"\n}\n')),Object(c.b)("h3",{id:"91642-\u66f4\u591a\u914d\u7f6e"},"9.16.4.2 \u66f4\u591a\u914d\u7f6e"),Object(c.b)("pre",null,Object(c.b)("code",Object(r.a)({parentName:"pre"},{className:"language-json"}),'{\n "Select.User": {\n "Sql": "select * from User where id > @id and Name = @name",\n "Params": [\n {\n "Name": " Id",\n "Value": "1",\n "DbType": "Int16",\n "Size": 10\n },\n {\n "Name": " Name",\n "Value": "\u767e\u5c0f\u50e7",\n "DbType": "String",\n "Size": 10\n }\n ]\n }\n}\n')),Object(c.b)("h2",{id:"9165-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.16.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return l}));var r=n(21),a=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const l=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+l:l}(t,e,n,r)}}function l(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var b=a.a.createContext({}),s=function(e){var t=a.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},u=function(e){var t=s(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},p=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,l=e.parentName,b=o(e,["components","mdxType","originalType","parentName"]),u=s(n),p=r,m=u["".concat(l,".").concat(p)]||u[p]||d[p]||c;return n?a.a.createElement(m,i(i({ref:t},b),{},{components:n})):a.a.createElement(m,i({ref:t},b))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,l=new Array(c);l[0]=p;var i={};for(var o in t)hasOwnProperty.call(t,o)&&(i[o]=t[o]);i.originalType=e,i.mdxType="string"==typeof e?e:r,l[1]=i;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/d8f92c54.0de07508.js b/docs/d8f92c54.59bd4a71.js similarity index 98% rename from docs/d8f92c54.0de07508.js rename to docs/d8f92c54.59bd4a71.js index 45f9bb9cb54..3e52cc84ca3 100644 --- a/docs/d8f92c54.0de07508.js +++ b/docs/d8f92c54.59bd4a71.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[92],{166:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return d}));var a=t(3),r=t(7),c=(t(0),t(192)),i=t(193),o={id:"dbcontext-sql-proxy",title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",sidebar_label:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"},l={unversionedId:"dbcontext-sql-proxy",id:"dbcontext-sql-proxy",isDocsHomePage:!1,title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",description:"9.17.1 \u5173\u4e8e Sql \u4ee3\u7406",source:"@site/docs\\dbcontext-sql-proxy.mdx",slug:"/dbcontext-sql-proxy",permalink:"/docs/dbcontext-sql-proxy",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-sql-proxy.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",sidebar:"docs",previous:{title:"9.16 Sql \u6a21\u677f",permalink:"/docs/dbcontext-sql-template"},next:{title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",permalink:"/docs/dbcontext-multi-database"}},s=[{value:"9.17.1 \u5173\u4e8e Sql \u4ee3\u7406",id:"9171-\u5173\u4e8e-sql-\u4ee3\u7406",children:[]},{value:"9.17.2 \u4e86\u89e3 ISqlDispatchProxy",id:"9172-\u4e86\u89e3-isqldispatchproxy",children:[]},{value:"9.17.3 \u5f00\u59cb\u9886\u7565 Sql \u4ee3\u7406",id:"9173-\u5f00\u59cb\u9886\u7565-sql-\u4ee3\u7406",children:[{value:"9.17.3.1 \u6784\u9020\u51fd\u6570\u65b9\u5f0f",id:"91731-\u6784\u9020\u51fd\u6570\u65b9\u5f0f",children:[]},{value:"9.17.3.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",id:"91732-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",children:[]},{value:"9.17.3.3 Db.GetSqlDispatchProxy<ISql>()",id:"91733-dbgetsqldispatchproxyisql",children:[]}]},{value:"9.17.4 Sql \u64cd\u4f5c",id:"9174-sql-\u64cd\u4f5c",children:[{value:"9.17.4.1 \u8fd4\u56de DataTable",id:"91741-\u8fd4\u56de-datatable",children:[]},{value:"9.17.4.2 \u8fd4\u56de T \u6216 List<T>",id:"91742-\u8fd4\u56de-t-\u6216-listt",children:[]},{value:"9.17.4.3 \u8fd4\u56de DataSet",id:"91743-\u8fd4\u56de-dataset",children:[]},{value:"9.17.4.4 \u8fd4\u56de Tuple<T1,...T8>",id:"91744-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.17.4.5 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91745-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.17.4.6 \u65e0\u8fd4\u56de\u503c",id:"91746-\u65e0\u8fd4\u56de\u503c",children:[]}]},{value:"9.17.5 \u5b58\u50a8\u8fc7\u7a0b \u64cd\u4f5c",id:"9175-\u5b58\u50a8\u8fc7\u7a0b-\u64cd\u4f5c",children:[{value:"9.17.5.1 \u8fd4\u56de DataTable",id:"91751-\u8fd4\u56de-datatable",children:[]},{value:"9.17.5.2 \u8fd4\u56de T \u6216 List<T>",id:"91752-\u8fd4\u56de-t-\u6216-listt",children:[]},{value:"9.17.5.3 \u8fd4\u56de DataSet",id:"91753-\u8fd4\u56de-dataset",children:[]},{value:"9.17.5.4 \u8fd4\u56de Tuple(T1,...T8)",id:"91754-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.17.5.4 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91754-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.17.5.6 \u65e0\u8fd4\u56de\u503c",id:"91756-\u65e0\u8fd4\u56de\u503c",children:[]},{value:"9.17.5.7 \u5e26 OUTPUT/RETURN \u8fd4\u56de",id:"91757-\u5e26-outputreturn-\u8fd4\u56de",children:[]}]},{value:"9.17.5 \u51fd\u6570 \u64cd\u4f5c",id:"9175-\u51fd\u6570-\u64cd\u4f5c",children:[]},{value:"9.17.6 \u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f",id:"9176-\u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f",children:[]},{value:"9.17.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9177-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:s};function d(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},b,t,{components:n,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9171-\u5173\u4e8e-sql-\u4ee3\u7406"},"9.17.1 \u5173\u4e8e ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ee3\u7406"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u5bf9 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4e66\u5199\u6548\u7387\uff0c\u800c\u4e14\u540e\u671f\u6781\u6613\u7ef4\u62a4\u3002"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u5c5e\u4e8e ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e00\u4e2a\u9ad8\u7ea7\u529f\u80fd\u3002"),Object(c.b)("h2",{id:"9172-\u4e86\u89e3-isqldispatchproxy"},"9.17.2 \u4e86\u89e3 ",Object(c.b)("inlineCode",{parentName:"h2"},"ISqlDispatchProxy")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy")," \u63a5\u53e3\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5b9e\u73b0",Object(c.b)("strong",{parentName:"p"},"\u88ab\u4ee3\u7406\u63a5\u53e3"),"\u7684\u552f\u4e00\u4f9d\u8d56\uff0c\u4efb\u4f55\u516c\u5f00\u7684\u63a5\u53e3\u4e00\u65e6\u96c6\u6210\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy")," \u63a5\u53e3\uff0c\u90a3\u4e48\u8fd9\u4e2a\u63a5\u53e3\u5c31\u662f",Object(c.b)("strong",{parentName:"p"},"\u88ab\u6258\u7ba1\u62e6\u622a"),"\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\u63a5\u53e3\u3002"),Object(c.b)("p",null,"\u7b80\u5355\u5b9a\u4e49\u4e00\u4e2a ",Object(c.b)("strong",{parentName:"p"},"Sql \u4ee3\u7406\u63a5\u53e3")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n }\n}\n")),Object(c.b)("p",null,"\u4e00\u65e6\u8fd9\u4e2a\u63a5\u53e3\u7ee7\u627f\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy"),"\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a",Object(c.b)("strong",{parentName:"p"},"\u52a8\u6001\u521b\u5efa\u63a5\u53e3\u5b9e\u4f8b\uff0c\u800c\u4e14\u652f\u6301\u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c\u83b7\u53d6\u5b9e\u4f8b"),"\u3002"),Object(c.b)("h2",{id:"9173-\u5f00\u59cb\u9886\u7565-sql-\u4ee3\u7406"},"9.17.3 \u5f00\u59cb\u9886\u7565 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ee3\u7406"),Object(c.b)("p",null,"\u4e0b\u9762\u6211\u8bb2\u901a\u8fc7\u591a\u4e2a\u4f8b\u5b50\u6765\u6f14\u793a ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u7684\u7528\u6cd5\uff0c\u4e3a\u4ec0\u4e48\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f\u64cd\u4f5c ",Object(c.b)("inlineCode",{parentName:"p"},"Sql"),"\u3002"),Object(c.b)("p",null,"\u652f\u6301\u5404\u79cd\u65b9\u5f0f\u83b7\u53d6\u5b9e\u4f8b\uff1a"),Object(c.b)("h3",{id:"91731-\u6784\u9020\u51fd\u6570\u65b9\u5f0f"},"9.17.3.1 \u6784\u9020\u51fd\u6570\u65b9\u5f0f"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1-2}","{1-2}":!0}),"private readonly Isql _sql;\npublic FurionService(Isql sql)\n{\n _sql = sql;\n}\n")),Object(c.b)("h3",{id:"91732-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"},"9.17.3.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public async Task> GetAll([FromServices] Isql, string keyword)\n{\n}\n")),Object(c.b)("h3",{id:"91733-dbgetsqldispatchproxyisql"},"9.17.3.3 ",Object(c.b)("inlineCode",{parentName:"h3"},"Db.GetSqlDispatchProxy()")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var sql = Db.GetSqlDispatchProxy();\n")),Object(c.b)("h2",{id:"9174-sql-\u64cd\u4f5c"},"9.17.4 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u64cd\u4f5c"),Object(c.b)("h3",{id:"91741-\u8fd4\u56de-datatable"},"9.17.4.1 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,12,16,20}","{8,12,16,20}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n DataTable GetPerson(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n DataTable GetPerson(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute("exec PROP_NAME @id", CommandType = CommandType.StoredProcedure)]\n DataTable GetPerson(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n DataTable GetPerson());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task GetPersonAsync());\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u53c2\u6570")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u53c2\u6570\u67e5\u627e\u89c4\u5219\uff1a"),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u65b9\u6cd5\u7684\u53c2\u6570\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"\u57fa\u5143\u7c7b\u578b"),"\uff08\u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"string"),"\u3001",Object(c.b)("inlineCode",{parentName:"p"},"\u503c\u7c7b\u578b"),"\uff09\uff0c\u5219\u81ea\u52a8\u5c06\u8fd9\u4e9b\u7c7b\u578b\u7ec4\u5408\u6210 ",Object(c.b)("inlineCode",{parentName:"p"},"Dictionary")," \u4f5c\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u53c2\u6570\u3002\u547d\u4ee4\u53c2\u6570\u53ef\u4f7f\u7528\u65b9\u6cd5\u540c\u540d\u53c2\u6570\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"@")," \u7b26\u53f7\u3002"),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u65b9\u6cd5\u7684\u53c2\u6570\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b"),"\uff0c\u90a3\u4e48\u81ea\u52a8\u904d\u5386\u8be5\u7c7b\u516c\u5f00\u5b9e\u4f8b\u5c5e\u6027\u751f\u6210 ",Object(c.b)("inlineCode",{parentName:"p"},"DbParameter[]")," \u6570\u7ec4\uff0c\u6bcf\u4e00\u4e2a\u5c5e\u6027\u540d\u90fd\u5c06\u662f\u547d\u4ee4\u53c2\u6570\uff0c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff0c\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class MyModel\n{\n public int Id {get;set;}\n public string Name {get; set;}\n}\n")),Object(c.b)("p",{parentName:"div"},"\u90a3\u4e48 ",Object(c.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u5c5e\u6027\u540d\u4f5c\u4e3a\u53c2\u6570\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"select * from person where id > @id and name = @name;\n")))),Object(c.b)("h3",{id:"91742-\u8fd4\u56de-t-\u6216-listt"},"9.17.4.2 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"T \u6216 List")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,12,16,20}","{8,12,16,20}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n List GetPerson(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n List GetPerson(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute("exec PROP_NAME @id", CommandType = CommandType.StoredProcedure)]\n Person GetPerson(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n List GetPerson());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task> GetPersonAsync());\n }\n}\n')),Object(c.b)("h3",{id:"91743-\u8fd4\u56de-dataset"},"9.17.4.3 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8-10,14-16,20-22,26-28,32-35}","{8-10,14-16,20-22,26-28,32-35}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n DataSet GetData(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n DataSet GetData(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute(@"\n exec PROP_NAME @id;\n select * from person;", CommandType = CommandType.StoredProcedure)]\n DataSet GetData(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute(@"\n select * from person;\n select * from student;", DbContextLocator = typeof(MySqlDbContextLocator))]\n DataSet GetData());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute(@"\n select * from person;\n select * from student;\n select 1;", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task GetDataAsync());\n }\n}\n')),Object(c.b)("h3",{id:"91744-\u8fd4\u56de-tuplet1t8"},"9.17.4.4 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8-10,14-16,20-22,26-28,32-35}","{8-10,14-16,20-22,26-28,32-35}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n (List,List) GetData(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n (List,List) GetData(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute(@"\n exec PROP_NAME @id;\n select * from person;", CommandType = CommandType.StoredProcedure)]\n (List,List) GetData(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute(@"\n select * from person;\n select * from student;", DbContextLocator = typeof(MySqlDbContextLocator))]\n (List,List) GetData());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute(@"\n select * from person;\n select * from student;\n select 1;", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task<(List,List,int)> GetDataAsync());\n }\n}\n')),Object(c.b)("h3",{id:"91745-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.17.4.5 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlExecute("select Name from person where id = @id")]\n string GetValue(int id);\n\n [SqlExecute("select age from person where id = @id")]\n int GetValue(int id);\n\n [SqlExecute("select Name from person where id = @id")]\n Task GetValueAsync(int id);\n }\n}\n')),Object(c.b)("h3",{id:"91746-\u65e0\u8fd4\u56de\u503c"},"9.17.4.6 \u65e0\u8fd4\u56de\u503c"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlExecute("insert into person(Name,Age) values(@name,@age)")]\n void Insert(MyParam dto);\n\n [SqlExecute("delete from person where id = @id")]\n void Delete(int id);\n\n [SqlExecute("update person set name=@name where id=@id")]\n void Update(int id, string name);\n }\n}\n')),Object(c.b)("h2",{id:"9175-\u5b58\u50a8\u8fc7\u7a0b-\u64cd\u4f5c"},"9.17.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"\u5b58\u50a8\u8fc7\u7a0b")," \u64cd\u4f5c"),Object(c.b)("h3",{id:"91751-\u8fd4\u56de-datatable"},"9.17.5.1 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n DataTable GetPersons(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n DataTable GetPersons(int id);\n\n [SqlProcedure("PROC_Name")]\n DataTable GetPersons(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91752-\u8fd4\u56de-t-\u6216-listt"},"9.17.5.2 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"T \u6216 List")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n List GetPersons(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n List GetPersons(int id);\n\n [SqlProcedure("PROC_Name")]\n Person GetPersons(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91753-\u8fd4\u56de-dataset"},"9.17.5.3 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n DataSet GetData(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n DataSet GetData(int id);\n\n [SqlProcedure("PROC_Name")]\n DataSet GetData(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91754-\u8fd4\u56de-tuplet1t8"},"9.17.5.4 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"Tuple(T1,...T8)")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n (List, List) GetData(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n (List, List) GetData(int id);\n\n [SqlProcedure("PROC_Name")]\n (List, List, Person, int) GetData(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91754-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.17.5.4 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n object GetValue(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n string GetValue(int id);\n\n [SqlProcedure("PROC_Name")]\n int GetValue(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91756-\u65e0\u8fd4\u56de\u503c"},"9.17.5.6 \u65e0\u8fd4\u56de\u503c"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n void GetValue(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n void GetValue(int id);\n\n [SqlProcedure("PROC_Name")]\n void GetValue(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91757-\u5e26-outputreturn-\u8fd4\u56de"},"9.17.5.7 \u5e26 ",Object(c.b)("inlineCode",{parentName:"h3"},"OUTPUT/RETURN")," \u8fd4\u56de"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n ProcedureOutputResult GetOutput(ProcOutputModel pams);\n\n [SqlProcedure("PROC_Name")]\n ProcedureOutputResult GetOutput(ProcOutputModel pams);\n\n [SqlProcedure("PROC_Name")]\n ProcedureOutputResult<(List, List)> GetOutput(ProcOutputModel pams);\n }\n}\n')),Object(c.b)("h2",{id:"9175-\u51fd\u6570-\u64cd\u4f5c"},"9.17.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"\u51fd\u6570")," \u64cd\u4f5c"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10}","{7,10}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlFunction("FN_Name")] // \u6807\u91cf\u51fd\u6570\n string GetValue(MyParam dto);\n\n [SqlProcedure("FN_Name")] // \u8868\u503c\u51fd\u6570\n List GetPersons(int id);\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u8865\u5145\u8bf4\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u4f1a\u81ea\u52a8\u5224\u65ad\u8fd4\u56de\u503c\u7136\u540e\u81ea\u52a8\u6267\u884c\u7279\u5b9a\u51fd\u6570\u7c7b\u578b\u3002"))),Object(c.b)("h2",{id:"9176-\u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f"},"9.17.6 \u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f"),Object(c.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u4f8b\u5b50\u5927\u5bb6\u5c31\u53ef\u4ee5\u4e86\u89e3\uff0c\u8fd9\u79cd\u65b9\u5f0f\u64cd\u4f5c ",Object(c.b)("inlineCode",{parentName:"p"},"sql")," \u975e\u5e38\u7b80\u5355\uff0c\u800c\u4e14\u6781\u6613\u7ef4\u62a4\u3002\u5927\u5bb6\u4e0d\u7528\u53bb\u5173\u5fc3\u8fd4\u56de\u503c\uff0c\u5173\u5fc3\u7528\u54ea\u4e2a\u65b9\u6cd5\uff0c\u6240\u6709\u4e1c\u897f\u4f1a\u81ea\u52a8\u7ed9\u4f60\u5904\u7406\u597d\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c\u5982\u679c\u9700\u8981\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\uff0c\u63a8\u8350\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u9ad8\u7ea7\u4ee3\u7406\u3002"),Object(c.b)("h2",{id:"9177-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.17.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"a",(function(){return i}));var a=t(21),r=t(191);function c(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const i=t.startsWith(n)?t:n+t.replace(/^\//,"");return c?e+i:i}(n,e,t,a)}}function i(e,n={}){const{withBaseUrl:t}=c();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return m}));var a=t(0),r=t.n(a);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=r.a.createContext({}),b=function(e){var n=r.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},d=function(e){var n=b(e.components);return r.a.createElement(s.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},u=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=b(t),u=a,m=d["".concat(i,".").concat(u)]||d[u]||p[u]||c;return t?r.a.createElement(m,o(o({ref:n},s),{},{components:t})):r.a.createElement(m,o({ref:n},s))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var c=t.length,i=new Array(c);i[0]=u;var o={};for(var l in n)hasOwnProperty.call(n,l)&&(o[l]=n[l]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[96],{170:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"metadata",(function(){return l})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return d}));var a=t(3),r=t(7),c=(t(0),t(196)),i=t(197),o={id:"dbcontext-sql-proxy",title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",sidebar_label:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"},l={unversionedId:"dbcontext-sql-proxy",id:"dbcontext-sql-proxy",isDocsHomePage:!1,title:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",description:"9.17.1 \u5173\u4e8e Sql \u4ee3\u7406",source:"@site/docs\\dbcontext-sql-proxy.mdx",slug:"/dbcontext-sql-proxy",permalink:"/docs/dbcontext-sql-proxy",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-sql-proxy.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406",sidebar:"docs",previous:{title:"9.16 Sql \u6a21\u677f",permalink:"/docs/dbcontext-sql-template"},next:{title:"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c",permalink:"/docs/dbcontext-multi-database"}},s=[{value:"9.17.1 \u5173\u4e8e Sql \u4ee3\u7406",id:"9171-\u5173\u4e8e-sql-\u4ee3\u7406",children:[]},{value:"9.17.2 \u4e86\u89e3 ISqlDispatchProxy",id:"9172-\u4e86\u89e3-isqldispatchproxy",children:[]},{value:"9.17.3 \u5f00\u59cb\u9886\u7565 Sql \u4ee3\u7406",id:"9173-\u5f00\u59cb\u9886\u7565-sql-\u4ee3\u7406",children:[{value:"9.17.3.1 \u6784\u9020\u51fd\u6570\u65b9\u5f0f",id:"91731-\u6784\u9020\u51fd\u6570\u65b9\u5f0f",children:[]},{value:"9.17.3.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",id:"91732-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165",children:[]},{value:"9.17.3.3 Db.GetSqlDispatchProxy<ISql>()",id:"91733-dbgetsqldispatchproxyisql",children:[]}]},{value:"9.17.4 Sql \u64cd\u4f5c",id:"9174-sql-\u64cd\u4f5c",children:[{value:"9.17.4.1 \u8fd4\u56de DataTable",id:"91741-\u8fd4\u56de-datatable",children:[]},{value:"9.17.4.2 \u8fd4\u56de T \u6216 List<T>",id:"91742-\u8fd4\u56de-t-\u6216-listt",children:[]},{value:"9.17.4.3 \u8fd4\u56de DataSet",id:"91743-\u8fd4\u56de-dataset",children:[]},{value:"9.17.4.4 \u8fd4\u56de Tuple<T1,...T8>",id:"91744-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.17.4.5 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91745-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.17.4.6 \u65e0\u8fd4\u56de\u503c",id:"91746-\u65e0\u8fd4\u56de\u503c",children:[]}]},{value:"9.17.5 \u5b58\u50a8\u8fc7\u7a0b \u64cd\u4f5c",id:"9175-\u5b58\u50a8\u8fc7\u7a0b-\u64cd\u4f5c",children:[{value:"9.17.5.1 \u8fd4\u56de DataTable",id:"91751-\u8fd4\u56de-datatable",children:[]},{value:"9.17.5.2 \u8fd4\u56de T \u6216 List<T>",id:"91752-\u8fd4\u56de-t-\u6216-listt",children:[]},{value:"9.17.5.3 \u8fd4\u56de DataSet",id:"91753-\u8fd4\u56de-dataset",children:[]},{value:"9.17.5.4 \u8fd4\u56de Tuple(T1,...T8)",id:"91754-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.17.5.4 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91754-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.17.5.6 \u65e0\u8fd4\u56de\u503c",id:"91756-\u65e0\u8fd4\u56de\u503c",children:[]},{value:"9.17.5.7 \u5e26 OUTPUT/RETURN \u8fd4\u56de",id:"91757-\u5e26-outputreturn-\u8fd4\u56de",children:[]}]},{value:"9.17.5 \u51fd\u6570 \u64cd\u4f5c",id:"9175-\u51fd\u6570-\u64cd\u4f5c",children:[]},{value:"9.17.6 \u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f",id:"9176-\u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f",children:[]},{value:"9.17.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9177-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:s};function d(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(c.b)("wrapper",Object(a.a)({},b,t,{components:n,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("h2",{id:"9171-\u5173\u4e8e-sql-\u4ee3\u7406"},"9.17.1 \u5173\u4e8e ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ee3\u7406"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u5bf9 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\uff0c\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5927\u5927\u63d0\u9ad8 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4e66\u5199\u6548\u7387\uff0c\u800c\u4e14\u540e\u671f\u6781\u6613\u7ef4\u62a4\u3002"),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u5c5e\u4e8e ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u4e00\u4e2a\u9ad8\u7ea7\u529f\u80fd\u3002"),Object(c.b)("h2",{id:"9172-\u4e86\u89e3-isqldispatchproxy"},"9.17.2 \u4e86\u89e3 ",Object(c.b)("inlineCode",{parentName:"h2"},"ISqlDispatchProxy")),Object(c.b)("p",null,Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy")," \u63a5\u53e3\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"Furion")," \u5b9e\u73b0",Object(c.b)("strong",{parentName:"p"},"\u88ab\u4ee3\u7406\u63a5\u53e3"),"\u7684\u552f\u4e00\u4f9d\u8d56\uff0c\u4efb\u4f55\u516c\u5f00\u7684\u63a5\u53e3\u4e00\u65e6\u96c6\u6210\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy")," \u63a5\u53e3\uff0c\u90a3\u4e48\u8fd9\u4e2a\u63a5\u53e3\u5c31\u662f",Object(c.b)("strong",{parentName:"p"},"\u88ab\u6258\u7ba1\u62e6\u622a"),"\u7684 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\u63a5\u53e3\u3002"),Object(c.b)("p",null,"\u7b80\u5355\u5b9a\u4e49\u4e00\u4e2a ",Object(c.b)("strong",{parentName:"p"},"Sql \u4ee3\u7406\u63a5\u53e3")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n }\n}\n")),Object(c.b)("p",null,"\u4e00\u65e6\u8fd9\u4e2a\u63a5\u53e3\u7ee7\u627f\u4e86 ",Object(c.b)("inlineCode",{parentName:"p"},"ISqlDispatchProxy"),"\uff0c\u90a3\u4e48\u5b83\u5c31\u4f1a",Object(c.b)("strong",{parentName:"p"},"\u52a8\u6001\u521b\u5efa\u63a5\u53e3\u5b9e\u4f8b\uff0c\u800c\u4e14\u652f\u6301\u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c\u83b7\u53d6\u5b9e\u4f8b"),"\u3002"),Object(c.b)("h2",{id:"9173-\u5f00\u59cb\u9886\u7565-sql-\u4ee3\u7406"},"9.17.3 \u5f00\u59cb\u9886\u7565 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u4ee3\u7406"),Object(c.b)("p",null,"\u4e0b\u9762\u6211\u8bb2\u901a\u8fc7\u591a\u4e2a\u4f8b\u5b50\u6765\u6f14\u793a ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u7684\u7528\u6cd5\uff0c\u4e3a\u4ec0\u4e48\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f\u64cd\u4f5c ",Object(c.b)("inlineCode",{parentName:"p"},"Sql"),"\u3002"),Object(c.b)("p",null,"\u652f\u6301\u5404\u79cd\u65b9\u5f0f\u83b7\u53d6\u5b9e\u4f8b\uff1a"),Object(c.b)("h3",{id:"91731-\u6784\u9020\u51fd\u6570\u65b9\u5f0f"},"9.17.3.1 \u6784\u9020\u51fd\u6570\u65b9\u5f0f"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1-2}","{1-2}":!0}),"private readonly Isql _sql;\npublic FurionService(Isql sql)\n{\n _sql = sql;\n}\n")),Object(c.b)("h3",{id:"91732-\u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"},"9.17.3.2 \u65b9\u6cd5\u53c2\u6570\u6ce8\u5165"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public async Task> GetAll([FromServices] Isql, string keyword)\n{\n}\n")),Object(c.b)("h3",{id:"91733-dbgetsqldispatchproxyisql"},"9.17.3.3 ",Object(c.b)("inlineCode",{parentName:"h3"},"Db.GetSqlDispatchProxy()")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"var sql = Db.GetSqlDispatchProxy();\n")),Object(c.b)("h2",{id:"9174-sql-\u64cd\u4f5c"},"9.17.4 ",Object(c.b)("inlineCode",{parentName:"h2"},"Sql")," \u64cd\u4f5c"),Object(c.b)("h3",{id:"91741-\u8fd4\u56de-datatable"},"9.17.4.1 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,12,16,20}","{8,12,16,20}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n DataTable GetPerson(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n DataTable GetPerson(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute("exec PROP_NAME @id", CommandType = CommandType.StoredProcedure)]\n DataTable GetPerson(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n DataTable GetPerson());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task GetPersonAsync());\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5173\u4e8e\u53c2\u6570")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u53c2\u6570\u67e5\u627e\u89c4\u5219\uff1a"),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u65b9\u6cd5\u7684\u53c2\u6570\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"\u57fa\u5143\u7c7b\u578b"),"\uff08\u6216 ",Object(c.b)("inlineCode",{parentName:"p"},"string"),"\u3001",Object(c.b)("inlineCode",{parentName:"p"},"\u503c\u7c7b\u578b"),"\uff09\uff0c\u5219\u81ea\u52a8\u5c06\u8fd9\u4e9b\u7c7b\u578b\u7ec4\u5408\u6210 ",Object(c.b)("inlineCode",{parentName:"p"},"Dictionary")," \u4f5c\u4e3a ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u53c2\u6570\u3002\u547d\u4ee4\u53c2\u6570\u53ef\u4f7f\u7528\u65b9\u6cd5\u540c\u540d\u53c2\u6570\u52a0 ",Object(c.b)("inlineCode",{parentName:"p"},"@")," \u7b26\u53f7\u3002"),Object(c.b)("p",{parentName:"div"},"\u5982\u679c\u65b9\u6cd5\u7684\u53c2\u6570\u662f ",Object(c.b)("inlineCode",{parentName:"p"},"\u7c7b\u7c7b\u578b"),"\uff0c\u90a3\u4e48\u81ea\u52a8\u904d\u5386\u8be5\u7c7b\u516c\u5f00\u5b9e\u4f8b\u5c5e\u6027\u751f\u6210 ",Object(c.b)("inlineCode",{parentName:"p"},"DbParameter[]")," \u6570\u7ec4\uff0c\u6bcf\u4e00\u4e2a\u5c5e\u6027\u540d\u90fd\u5c06\u662f\u547d\u4ee4\u53c2\u6570\uff0c\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff0c\u5982\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public class MyModel\n{\n public int Id {get;set;}\n public string Name {get; set;}\n}\n")),Object(c.b)("p",{parentName:"div"},"\u90a3\u4e48 ",Object(c.b)("inlineCode",{parentName:"p"},"sql")," \u8bed\u53e5\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u5c5e\u6027\u540d\u4f5c\u4e3a\u53c2\u6570\uff1a"),Object(c.b)("pre",{parentName:"div"},Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sql"}),"select * from person where id > @id and name = @name;\n")))),Object(c.b)("h3",{id:"91742-\u8fd4\u56de-t-\u6216-listt"},"9.17.4.2 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"T \u6216 List")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8,12,16,20}","{8,12,16,20}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n List GetPerson(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute("select * from person where id >@id and name like %@name%")]\n List GetPerson(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute("exec PROP_NAME @id", CommandType = CommandType.StoredProcedure)]\n Person GetPerson(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n List GetPerson());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute("select * from person", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task> GetPersonAsync());\n }\n}\n')),Object(c.b)("h3",{id:"91743-\u8fd4\u56de-dataset"},"9.17.4.3 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8-10,14-16,20-22,26-28,32-35}","{8-10,14-16,20-22,26-28,32-35}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n DataSet GetData(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n DataSet GetData(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute(@"\n exec PROP_NAME @id;\n select * from person;", CommandType = CommandType.StoredProcedure)]\n DataSet GetData(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute(@"\n select * from person;\n select * from student;", DbContextLocator = typeof(MySqlDbContextLocator))]\n DataSet GetData());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute(@"\n select * from person;\n select * from student;\n select 1;", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task GetDataAsync());\n }\n}\n')),Object(c.b)("h3",{id:"91744-\u8fd4\u56de-tuplet1t8"},"9.17.4.4 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{8-10,14-16,20-22,26-28,32-35}","{8-10,14-16,20-22,26-28,32-35}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u57fa\u5143\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n (List,List) GetData(int id, string name);\n\n // \u6267\u884csql\u5e76\u4f20\u5165\u53c2\u6570\uff0c\u5bf9\u8c61\u7c7b\u578b\n [SqlExecute(@"\n select * from person where id >@id and name like %@name%;\n select top 10 * from student where Id >@id;")]\n (List,List) GetData(MyParam paras));\n\n // \u6267\u884c\u5b58\u50a8\u8fc7\u7a0b sql\uff0c\u652f\u6301\u8bbe\u7f6e\u53c2\u6570\u7c7b\u578b\n [SqlExecute(@"\n exec PROP_NAME @id;\n select * from person;", CommandType = CommandType.StoredProcedure)]\n (List,List) GetData(int id));\n\n // \u652f\u6301\u591a\u6570\u636e\u5e93\u64cd\u4f5c\n [SqlExecute(@"\n select * from person;\n select * from student;", DbContextLocator = typeof(MySqlDbContextLocator))]\n (List,List) GetData());\n\n // \u5f02\u6b65\u65b9\u5f0f\n [SqlExecute(@"\n select * from person;\n select * from student;\n select 1;", DbContextLocator = typeof(MySqlDbContextLocator))]\n Task<(List,List,int)> GetDataAsync());\n }\n}\n')),Object(c.b)("h3",{id:"91745-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.17.4.5 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlExecute("select Name from person where id = @id")]\n string GetValue(int id);\n\n [SqlExecute("select age from person where id = @id")]\n int GetValue(int id);\n\n [SqlExecute("select Name from person where id = @id")]\n Task GetValueAsync(int id);\n }\n}\n')),Object(c.b)("h3",{id:"91746-\u65e0\u8fd4\u56de\u503c"},"9.17.4.6 \u65e0\u8fd4\u56de\u503c"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlExecute("insert into person(Name,Age) values(@name,@age)")]\n void Insert(MyParam dto);\n\n [SqlExecute("delete from person where id = @id")]\n void Delete(int id);\n\n [SqlExecute("update person set name=@name where id=@id")]\n void Update(int id, string name);\n }\n}\n')),Object(c.b)("h2",{id:"9175-\u5b58\u50a8\u8fc7\u7a0b-\u64cd\u4f5c"},"9.17.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"\u5b58\u50a8\u8fc7\u7a0b")," \u64cd\u4f5c"),Object(c.b)("h3",{id:"91751-\u8fd4\u56de-datatable"},"9.17.5.1 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n DataTable GetPersons(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n DataTable GetPersons(int id);\n\n [SqlProcedure("PROC_Name")]\n DataTable GetPersons(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91752-\u8fd4\u56de-t-\u6216-listt"},"9.17.5.2 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"T \u6216 List")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n List GetPersons(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n List GetPersons(int id);\n\n [SqlProcedure("PROC_Name")]\n Person GetPersons(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91753-\u8fd4\u56de-dataset"},"9.17.5.3 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n DataSet GetData(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n DataSet GetData(int id);\n\n [SqlProcedure("PROC_Name")]\n DataSet GetData(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91754-\u8fd4\u56de-tuplet1t8"},"9.17.5.4 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"Tuple(T1,...T8)")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n (List, List) GetData(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n (List, List) GetData(int id);\n\n [SqlProcedure("PROC_Name")]\n (List, List, Person, int) GetData(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91754-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.17.5.4 \u8fd4\u56de ",Object(c.b)("inlineCode",{parentName:"h3"},"\u5355\u884c\u5355\u5217")),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n object GetValue(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n string GetValue(int id);\n\n [SqlProcedure("PROC_Name")]\n int GetValue(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91756-\u65e0\u8fd4\u56de\u503c"},"9.17.5.6 \u65e0\u8fd4\u56de\u503c"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n void GetValue(MyParam dto);\n\n [SqlProcedure("PROC_Name")]\n void GetValue(int id);\n\n [SqlProcedure("PROC_Name")]\n void GetValue(int id, string name);\n }\n}\n')),Object(c.b)("h3",{id:"91757-\u5e26-outputreturn-\u8fd4\u56de"},"9.17.5.7 \u5e26 ",Object(c.b)("inlineCode",{parentName:"h3"},"OUTPUT/RETURN")," \u8fd4\u56de"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10,13}","{7,10,13}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlProcedure("PROC_Name")]\n ProcedureOutputResult GetOutput(ProcOutputModel pams);\n\n [SqlProcedure("PROC_Name")]\n ProcedureOutputResult GetOutput(ProcOutputModel pams);\n\n [SqlProcedure("PROC_Name")]\n ProcedureOutputResult<(List, List)> GetOutput(ProcOutputModel pams);\n }\n}\n')),Object(c.b)("h2",{id:"9175-\u51fd\u6570-\u64cd\u4f5c"},"9.17.5 ",Object(c.b)("inlineCode",{parentName:"h2"},"\u51fd\u6570")," \u64cd\u4f5c"),Object(c.b)("pre",null,Object(c.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,10}","{7,10}":!0}),'using Furion.DatabaseAccessor;\n\nnamespace Furion.Application\n{\n public interface ISql : ISqlDispatchProxy\n {\n [SqlFunction("FN_Name")] // \u6807\u91cf\u51fd\u6570\n string GetValue(MyParam dto);\n\n [SqlProcedure("FN_Name")] // \u8868\u503c\u51fd\u6570\n List GetPersons(int id);\n }\n}\n')),Object(c.b)("div",{className:"admonition admonition-important alert alert--info"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u8865\u5145\u8bf4\u660e")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u4ee3\u7406\u4f1a\u81ea\u52a8\u5224\u65ad\u8fd4\u56de\u503c\u7136\u540e\u81ea\u52a8\u6267\u884c\u7279\u5b9a\u51fd\u6570\u7c7b\u578b\u3002"))),Object(c.b)("h2",{id:"9176-\u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f"},"9.17.6 \u4e3a\u4ec0\u4e48\u7528\u5b83\uff1f"),Object(c.b)("p",null,"\u901a\u8fc7\u4e0a\u9762\u7684\u4f8b\u5b50\u5927\u5bb6\u5c31\u53ef\u4ee5\u4e86\u89e3\uff0c\u8fd9\u79cd\u65b9\u5f0f\u64cd\u4f5c ",Object(c.b)("inlineCode",{parentName:"p"},"sql")," \u975e\u5e38\u7b80\u5355\uff0c\u800c\u4e14\u6781\u6613\u7ef4\u62a4\u3002\u5927\u5bb6\u4e0d\u7528\u53bb\u5173\u5fc3\u8fd4\u56de\u503c\uff0c\u5173\u5fc3\u7528\u54ea\u4e2a\u65b9\u6cd5\uff0c\u6240\u6709\u4e1c\u897f\u4f1a\u81ea\u52a8\u7ed9\u4f60\u5904\u7406\u597d\u3002"),Object(c.b)("p",null,"\u6240\u4ee5\uff0c\u5982\u679c\u9700\u8981\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\uff0c\u63a8\u8350\u4f7f\u7528 ",Object(c.b)("inlineCode",{parentName:"p"},"Sql")," \u9ad8\u7ea7\u4ee3\u7406\u3002"),Object(c.b)("h2",{id:"9177-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.17.7 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(c.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(c.b)("h5",{parentName:"div"},Object(c.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(c.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(c.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(c.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(c.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(c.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return c})),t.d(n,"a",(function(){return i}));var a=t(21),r=t(195);function c(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:c=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const i=t.startsWith(n)?t:n+t.replace(/^\//,"");return c?e+i:i}(n,e,t,a)}}function i(e,n={}){const{withBaseUrl:t}=c();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return m}));var a=t(0),r=t.n(a);function c(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function o(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var s=r.a.createContext({}),b=function(e){var n=r.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):o(o({},n),e)),t},d=function(e){var n=b(e.components);return r.a.createElement(s.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},u=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,c=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=b(t),u=a,m=d["".concat(i,".").concat(u)]||d[u]||p[u]||c;return t?r.a.createElement(m,o(o({ref:n},s),{},{components:t})):r.a.createElement(m,o({ref:n},s))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var c=t.length,i=new Array(c);i[0]=u;var o={};for(var l in n)hasOwnProperty.call(n,l)&&(o[l]=n[l]);o.originalType=e,o.mdxType="string"==typeof e?e:a,i[1]=o;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/dc10b9c8.67ebce63.js b/docs/dc10b9c8.c6db4ba8.js similarity index 98% rename from docs/dc10b9c8.67ebce63.js rename to docs/dc10b9c8.c6db4ba8.js index 0f9012ae8f5..aecbe22478a 100644 --- a/docs/dc10b9c8.67ebce63.js +++ b/docs/dc10b9c8.c6db4ba8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{167:function(e,n,a){"use strict";a.r(n),a.d(n,"frontMatter",(function(){return o})),a.d(n,"metadata",(function(){return s})),a.d(n,"toc",(function(){return l})),a.d(n,"default",(function(){return b}));var t=a(3),r=a(7),i=(a(0),a(192)),c=a(193),o={id:"dbcontext-sql",title:"9.15 Sql \u64cd\u4f5c",sidebar_label:"9.15 Sql \u64cd\u4f5c"},s={unversionedId:"dbcontext-sql",id:"dbcontext-sql",isDocsHomePage:!1,title:"9.15 Sql \u64cd\u4f5c",description:"\u63a8\u8350\u4f7f\u7528 \u300a9.17 Sql \u9ad8\u7ea7\u4ee3\u7406\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002Sql \u9ad8\u7ea7\u4ee3\u7406 \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002",source:"@site/docs\\dbcontext-sql.mdx",slug:"/dbcontext-sql",permalink:"/docs/dbcontext-sql",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-sql.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.15 Sql \u64cd\u4f5c",sidebar:"docs",previous:{title:"9.14 \u51fd\u6570\u64cd\u4f5c",permalink:"/docs/dbcontext-function"},next:{title:"9.16 Sql \u6a21\u677f",permalink:"/docs/dbcontext-sql-template"}},l=[{value:"9.15.1 \u5173\u4e8e Sql",id:"9151-\u5173\u4e8e-sql",children:[]},{value:"9.15.2 \u61d2\u4eba\u65e0\u654c Sql \ud83d\udc2e",id:"9152-\u61d2\u4eba\u65e0\u654c-sql-",children:[{value:"9.15.2.1 \u8fd4\u56de DataTable",id:"91521-\u8fd4\u56de-datatable",children:[]},{value:"9.15.2.2 \u8fd4\u56de List<T>",id:"91522-\u8fd4\u56de-listt",children:[]},{value:"9.15.2.3 \u8fd4\u56de DataSet",id:"91523-\u8fd4\u56de-dataset",children:[]},{value:"9.15.2.4 \u8fd4\u56de Tuple<T1,...T8>",id:"91524-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.15.2.5 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91525-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.15.2.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570",id:"91526-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570",children:[]}]},{value:"9.15.3 \u61d2\u4eba\u65e0\u654c \u5b58\u50a8\u8fc7\u7a0b \ud83d\udc2e",id:"9153-\u61d2\u4eba\u65e0\u654c-\u5b58\u50a8\u8fc7\u7a0b-",children:[{value:"9.15.3.1 \u8fd4\u56de DataTable",id:"91531-\u8fd4\u56de-datatable",children:[]},{value:"9.15.3.2 \u8fd4\u56de List<T>",id:"91532-\u8fd4\u56de-listt",children:[]},{value:"9.15.3.3 \u8fd4\u56de DataSet",id:"91533-\u8fd4\u56de-dataset",children:[]},{value:"9.15.3.4 \u8fd4\u56de Tuple<T1,...T8>",id:"91534-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.15.3.5 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91535-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.15.3.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570",id:"91536-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570",children:[]},{value:"9.15.3.7 \u5e26 OUTPUT/RETURN \u8fd4\u56de",id:"91537-\u5e26-outputreturn-\u8fd4\u56de",children:[]}]},{value:"9.15.4 \u61d2\u4eba\u65e0\u654c \u51fd\u6570 \ud83d\udc2e",id:"9154-\u61d2\u4eba\u65e0\u654c-\u51fd\u6570-",children:[{value:"9.15.4.1 \u6807\u91cf\u51fd\u6570",id:"91541-\u6807\u91cf\u51fd\u6570",children:[]},{value:"9.15.4.2 \u8868\u503c\u51fd\u6570",id:"91542-\u8868\u503c\u51fd\u6570",children:[]}]},{value:"9.15.5 ISqlRepository \u64cd\u4f5c",id:"9155-isqlrepository-\u64cd\u4f5c",children:[]},{value:"9.15.6 IRepository \u64cd\u4f5c",id:"9156-irepository-\u64cd\u4f5c",children:[]},{value:"9.15.7 IRepository<TEntity> \u64cd\u4f5c",id:"9157-irepositorytentity-\u64cd\u4f5c",children:[]},{value:"9.15.8 \u5173\u4e8e Sql \u53c2\u6570",id:"9158-\u5173\u4e8e-sql-\u53c2\u6570",children:[]},{value:"9.15.9 \u591a\u6570\u636e\u5e93 Sql \u64cd\u4f5c \ud83d\udcaf \ud83d\udc9b",id:"9159-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c--",children:[{value:"9.15.9.1 \u61d2\u4eba\u65e0\u654c \ud83d\udc2e \u65b9\u5f0f",id:"91591-\u61d2\u4eba\u65e0\u654c--\u65b9\u5f0f",children:[]},{value:"9.15.9.2 ISqlRepository \u65b9\u5f0f",id:"91592-isqlrepository-\u65b9\u5f0f",children:[]},{value:"9.15.9.3 IRepository \u65b9\u5f0f",id:"91593-irepository-\u65b9\u5f0f",children:[]},{value:"9.15.9.4 IRepository<TEntity> \u65b9\u5f0f",id:"91594-irepositorytentity-\u65b9\u5f0f",children:[]}]},{value:"9.15.10 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"91510-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:l};function b(e){var n=e.components,a=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(t.a)({},d,a,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(i.b)("a",Object(t.a)({parentName:"p"},{href:"/docs/dbcontext-sql-proxy"}),"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002",Object(i.b)("inlineCode",{parentName:"p"},"Sql \u9ad8\u7ea7\u4ee3\u7406")," \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002"))),Object(i.b)("h2",{id:"9151-\u5173\u4e8e-sql"},"9.15.1 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u591a\u4e14\u7075\u6d3b\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"sql")," \u64cd\u4f5c\u65b9\u6cd5\uff0c\u4e14\u6027\u80fd\u4e0d\u8f93\u4e8e ",Object(i.b)("inlineCode",{parentName:"p"},"dapper"),"\uff0c\u540c\u65f6\u903c\u8fd1 ",Object(i.b)("inlineCode",{parentName:"p"},"ADO.NET")," \u539f\u751f\u64cd\u4f5c\u3002"),Object(i.b)("h2",{id:"9152-\u61d2\u4eba\u65e0\u654c-sql-"},"9.15.2 \u61d2\u4eba\u65e0\u654c ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \ud83d\udc2e"),Object(i.b)("h3",{id:"91521-\u8fd4\u56de-datatable"},"9.15.2.1 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = "select * from person".SqlQuery();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = "select top 10 * from person where id > @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = "select Id, Name, Age from person where name like @name".SqlQuery(new Dictionary{ {"name", "%Furion%"} });\n\n// \u793a\u4f8b\u56db\nvar dataTable = "select * from person where name=@name limit 1,10".SqlQuery(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar dataTable = "select * from person where id>@id and name like @name".SqlQuery(new YourModel { Id = 1, Name = "%Furion%" });\n\n// \u793a\u4f8b\u516d\nvar dataTable = "exec PROC_GetPerson @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar dataTable = "select * from FN_GetPersons(@id)".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar dataTable = @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQuery(new {id = 10});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = await "select * from person".SqlQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = await "select top 10 * from person where id > @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = await "select Id, Name, Age from person where name like %@name%".SqlQueryAsync(new Dictionary{ {"name", "Furion"} });\n\n// \u793a\u4f8b\u56db\nvar dataTable = await "select * from person where name=@name limit 1,10".SqlQueryAsync(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar dataTable = await "select * from person where id>@id and name like %@name%".SqlQueryAsync(new YourModel { Id = 1, Name = "Furion" });\n\n// \u793a\u4f8b\u516d\nvar dataTable = await "exec PROC_GetPerson @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar dataTable = await "select * from FN_GetPersons(@id)".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar dataTable = await @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQueryAsync(new {id = 10});\n')),Object(i.b)("h3",{id:"91522-\u8fd4\u56de-listt"},"9.15.2.2 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"List")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = "select * from person".SqlQuery();\n\n// \u793a\u4f8b\u4e8c\nvar persons = "select top 10 * from person where id > @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar persons = "select Id, Name, Age from person where name like %@name%".SqlQuery(new Dictionary{ {"name", "Furion"} });\n\n// \u793a\u4f8b\u56db\nvar persons = "select * from person where name=@name limit 1,10".SqlQuery(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar persons = "select * from person where id>@id and name like %@name%".SqlQuery(new YourModel { Id = 1, Name = "Furion" });\n\n// \u793a\u4f8b\u516d\nvar persons = "exec PROC_GetPerson @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar persons = "select * from FN_GetPersons(@id)".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar persons = @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQuery(new {id = 10});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await "select * from person".SqlQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar persons = await "select top 10 * from person where id > @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar persons = await "select Id, Name, Age from person where name like %@name%".SqlQueryAsync(new Dictionary{ {"name", "Furion"} });\n\n// \u793a\u4f8b\u56db\nvar persons = await "select * from person where name=@name limit 1,10".SqlQueryAsync(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar persons = await "select * from person where id>@id and name like %@name%".SqlQueryAsync(new YourModel { Id = 1, Name = "Furion" });\n\n// \u793a\u4f8b\u516d\nvar persons = await "exec PROC_GetPerson @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar persons = await "select * from FN_GetPersons(@id)".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar persons = await @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQueryAsync(new {id = 10});\n')),Object(i.b)("h3",{id:"91523-\u8fd4\u56de-dataset"},"9.15.2.3 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = @"\nselect * from person;\nselect * from student;".SqlQueries();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueries(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueries(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = await @"\nselect * from person;\nselect * from student;".SqlQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = await @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueriesAsync(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = await @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueriesAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91524-\u8fd4\u56de-tuplet1t8"},"9.15.2.4 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar (persons, students) = @"\nselect * from person;\nselect * from student;".SqlQueries();\n\n// \u793a\u4f8b\u4e8c\nvar (persons, students) = @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueries(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar (persons, students, string, PersonDto) = @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueries(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar (persons, students) = await @"\nselect * from person;\nselect * from student;".SqlQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar (persons, students) = await @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueriesAsync(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar (persons, students, string, PersonDto) = await @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueriesAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91525-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.15.2.5 \u8fd4\u56de \u5355\u884c\u5355\u5217"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = "select Name from person where id = @id".SqlScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = "select Name from person where id = @id".SqlScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = "select Age from person where id = @id".SqlScalar(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = await "select Name from person where id = @id".SqlScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = await "select Name from person where id = @id".SqlScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = await "select Age from person where id = @id".SqlScalarAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91526-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570"},"9.15.2.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = "insert into person(Name,Age,Address) values(@name,@age,@address)".SqlNonQuery(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = @"\ninsert into person(Name,Age,Address) values(@name,@age,@address);\ninsert into person(Name,Age,Address) values(@name,@age,@address);".SqlNonQuery(persons);\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = "update person set name=@name where id=@id".SqlNonQuery(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = "delete from person where @id > 10".SqlNonQuery(new {id=1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = await "insert into person(Name,Age,Address) values(@name,@age,@address)".SqlNonQueryAsync(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = @"\ninsert into person(Name,Age,Address) values(@name,@age,@address);\ninsert into person(Name,Age,Address) values(@name,@age,@address);".SqlNonQueryAsync(persons);\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = await "update person set name=@name where id=@id".SqlNonQueryAsync(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = await "delete from person where @id > 10".SqlNonQueryAsync(new {id=1});\n')),Object(i.b)("h2",{id:"9153-\u61d2\u4eba\u65e0\u654c-\u5b58\u50a8\u8fc7\u7a0b-"},"9.15.3 \u61d2\u4eba\u65e0\u654c ",Object(i.b)("inlineCode",{parentName:"h2"},"\u5b58\u50a8\u8fc7\u7a0b")," \ud83d\udc2e"),Object(i.b)("h3",{id:"91531-\u8fd4\u56de-datatable"},"9.15.3.1 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = "PROC_Name".SqlProcedureQuery();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = "PROC_Name".SqlProcedureQuery(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = "PROC_Name".SqlProcedureQuery(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = await "PROC_Name".SqlProcedureQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91532-\u8fd4\u56de-listt"},"9.15.3.2 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"List")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = "PROC_Name".SqlProcedureQuery();\n\n// \u793a\u4f8b\u4e8c\nvar persons = "PROC_Name".SqlProcedureQuery(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = "PROC_Name".SqlProcedureQuery(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await "PROC_Name".SqlProcedureQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar persons = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91533-\u8fd4\u56de-dataset"},"9.15.3.3 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = "PROC_Name".SqlProcedureQueries();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = "PROC_Name".SqlProcedureQueries(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = "PROC_Name".SqlProcedureQueries(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = await "PROC_Name".SqlProcedureQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91534-\u8fd4\u56de-tuplet1t8"},"9.15.3.4 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = "PROC_Name".SqlProcedureQueries();\n\n// \u793a\u4f8b\u4e8c\nvar (persons,students) = "PROC_Name".SqlProcedureQueries(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar (persons,students,string) = "PROC_Name".SqlProcedureQueries(new {id = 1, age = 27});\n\n// \u793a\u4f8b\u56db\nvar (persons,students,personDetail,string) = "PROC_Name".SqlProcedureQueries(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await "PROC_Name".SqlProcedureQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar (persons,students) = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar (persons,students,string) = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1, age = 27});\n\n// \u793a\u4f8b\u56db\nvar (persons,students,personDetail,string) = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91535-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.15.3.5 \u8fd4\u56de \u5355\u884c\u5355\u5217"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = "PROC_Name".SqlProcedureScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = "PROC_Name".SqlProcedureScalar(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar value = "PROC_Name".SqlProcedureScalar(new {id = 1, address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = await "PROC_Name".SqlProcedureScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = await "PROC_Name".SqlProcedureScalarAsync(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar value = await "PROC_Name".SqlProcedureScalarAsync(new {id = 1, address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n')),Object(i.b)("h3",{id:"91536-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570"},"9.15.3.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(new {id=1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(new {id=1});\n')),Object(i.b)("h3",{id:"91537-\u5e26-outputreturn-\u8fd4\u56de"},"9.15.3.7 \u5e26 ",Object(i.b)("inlineCode",{parentName:"h3"},"OUTPUT/RETURN")," \u8fd4\u56de"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-sql",metastring:"{3,4,10-12,15-17,22}","{3,4,10-12,15-17,22}":!0}),"CREATE PROC PROC_Output\n @Id INT, // \u8f93\u5165\u53c2\u6570\n @Name NVARCHAR(32) OUTPUT, // \u8f93\u51fa\u53c2\u6570\uff0c\u8fd8\u5e26\u957f\u5ea6\n @Age INT OUTPUT // \u8f93\u51fa\u53c2\u6570\nAS\nBEGIN\n SET @Name = 'Furion Output';\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT *\n FROM dbo.Test\n WHERE Id > @Id;\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT TOP 10\n *\n FROM dbo.Test;\n\n SET @Age = 27;\n\n // \u5e26 RETURN \u8fd4\u56de\n RETURN 10;\nEND;\n")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,10,13,16}","{1,10,13,16}":!0}),"using Furion.DatabaseAccessor;\nusing System.Data;\n\nnamespace Furion.Application\n{\n public class ProcOutputModel\n {\n public int Id { get; set; } // \u8f93\u5165\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output, Size = 32)]\n public string Name { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output)]\n public int Age { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.ReturnValue)]\n public int ReturnValue { get; set; } // \u8fd4\u56de\u503c\n }\n}\n")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nProcedureOutputResult result = "PROC_Name".SqlProcedureOutput(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u4e8c\nProcedureOutputResult result = "PROC_Name".SqlProcedureOutput();\n\n// \u793a\u4f8b\u4e09\nProcedureOutputResult<(List, List)> result = "PROC_Name".SqlProcedureOutput<(List, List)>();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n// \u793a\u4f8b\u4e00\nProcedureOutputResult result = await "PROC_Name".SqlProcedureOutputAsync(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u4e8c\nProcedureOutputResult result = await "PROC_Name".SqlProcedureOutputAsync();\n\n// \u793a\u4f8b\u4e09\nProcedureOutputResult<(List, List)> result = await "PROC_Name".SqlProcedureOutputAsync<(List, List)>();\n')),Object(i.b)("h2",{id:"9154-\u61d2\u4eba\u65e0\u654c-\u51fd\u6570-"},"9.15.4 \u61d2\u4eba\u65e0\u654c ",Object(i.b)("inlineCode",{parentName:"h2"},"\u51fd\u6570")," \ud83d\udc2e"),Object(i.b)("h3",{id:"91541-\u6807\u91cf\u51fd\u6570"},"9.15.4.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u6807\u91cf\u51fd\u6570")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = "FN_Name".SqlFunctionScalar();\n\n// \u793a\u4f8b\u4e8c\nvar value = "FN_Name".SqlFunctionScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = "FN_Name".SqlFunctionScalar();\n\n// \u793a\u4f8b\u56db\nvar value = "FN_Name".SqlFunctionScalar(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = await "FN_Name".SqlFunctionScalarAsync();\n\n// \u793a\u4f8b\u4e8c\nvar value = await "FN_Name".SqlFunctionScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = await "FN_Name".SqlFunctionScalarAsync();\n\n// \u793a\u4f8b\u56db\nvar value = await "FN_Name".SqlFunctionScalarAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91542-\u8868\u503c\u51fd\u6570"},"9.15.4.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u8868\u503c\u51fd\u6570")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = "FN_Name".SqlFunctionQuery();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = "FN_Name".SqlFunctionQuery(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = "FN_Name".SqlFunctionQuery();\n\n// \u793a\u4f8b\u56db\nvar persons = "FN_Name".SqlFunctionQuery(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = await "FN_Name".SqlFunctionQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = await "FN_Name".SqlFunctionQueryAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = await "FN_Name".SqlFunctionQueryAsync();\n\n// \u793a\u4f8b\u56db\nvar persons = await "FN_Name".SqlFunctionQueryAsync(new {id = 1});\n')),Object(i.b)("h2",{id:"9155-isqlrepository-\u64cd\u4f5c"},"9.15.5 ",Object(i.b)("inlineCode",{parentName:"h2"},"ISqlRepository")," \u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"ISqlRepository")," \u4ed3\u50a8\u662f\u4e13\u95e8\u5904\u7406 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\u7684\uff0c\u65e0\u9700\u5b9e\u4f53\u65b9\u5f0f\uff0c\u6240\u6709\u63a5\u53e3\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u61d2\u4eba\u65e0\u654c")," \u65b9\u5f0f\u4e00\u6837\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar dataTable = sqlRepository.SqlQuery("select * from person");\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = sqlRepository.SqlQuery("select * from person where id > @id", new { id = 10});\n\n// \u793a\u4f8b\u56db\nvar persons = sqlRepository.SqlQuery("select * from person");\n\n// \u793a\u4f8b\u4e94\nvar persons = sqlRepository.SqlQuery("select * from person where id > @id", new { id = 10});\n\n// \u4e0d\u518d\u4e3e\u4f8b\u5b50\u3002\u3002\u3002\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8865\u5145\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u4e0d\u7ba1\u662f\u90a3\u79cd\u65b9\u5f0f\u64cd\u4f5c ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \uff0c\u65b9\u6cd5\u540d\u53c2\u6570\u90fd\u662f\u4e00\u81f4\u7684\uff0c\u5982\uff1a"),Object(i.b)("ul",{parentName:"div"},Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQueries")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQueriesAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlNonQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlNonQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlScalar")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlScalarAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQueries")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQueriesAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureScalar")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureScalarAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureNonQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureNonQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureOutput")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureOutputAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionScalar")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionScalarAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionQuery"))))),Object(i.b)("h2",{id:"9156-irepository-\u64cd\u4f5c"},"9.15.6 ",Object(i.b)("inlineCode",{parentName:"h2"},"IRepository")," \u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IRepository")," \u4e5f\u80fd\u64cd\u4f5c ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u8c03\u7528\u65b9\u6cd5\u4e5f\u662f\u548c\u4e0a\u9762\u4e00\u81f4\u7684\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var dataTable = repository.Sql().SqlQuery("select * from person");\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u4e0d\u518d\u5217\u4e3e\u6240\u6709\u4f8b\u5b50\u3002"))),Object(i.b)("h2",{id:"9157-irepositorytentity-\u64cd\u4f5c"},"9.15.7 ",Object(i.b)("inlineCode",{parentName:"h2"},"IRepository")," \u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IRepository")," \u4e5f\u80fd\u64cd\u4f5c ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u8c03\u7528\u65b9\u6cd5\u4e5f\u662f\u548c\u4e0a\u9762\u4e00\u81f4\u7684\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var dataTable = personRepository.SqlQuery("select * from person");\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u4e0d\u518d\u5217\u4e3e\u6240\u6709\u4f8b\u5b50\u3002"))),Object(i.b)("h2",{id:"9158-\u5173\u4e8e-sql-\u53c2\u6570"},"9.15.8 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \u53c2\u6570"),Object(i.b)("p",null,"\u6240\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\u3001",Object(i.b)("inlineCode",{parentName:"p"},"\u5b58\u50a8\u8fc7\u7a0b"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"\u51fd\u6570")," \u53c2\u6570\u90fd\u652f\u6301\u56db\u79cd\u65b9\u5f0f\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DbParameter[]"),"\uff1a\u6570\u7ec4\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new {}"),"\uff1a\u533f\u540d\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new Class{}"),"\uff1a\u5f3a\u7c7b\u578b\u7c7b\u578b\uff08\u652f\u6301\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Dictionary")," \u7c7b\u578b")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5efa\u8bae\u9664\u4e86\u590d\u6742\u7684\u5b58\u50a8\u8fc7\u7a0b\uff08\u5e26 ",Object(i.b)("inlineCode",{parentName:"p"},"OUTPUT/RETURN"),"\uff09\u7684\u4ee5\u5916\uff0c\u6240\u6709\u53c2\u6570\u5efa\u8bae\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"new {}")," \u533f\u540d\u7c7b\u578b\uff0c\u5982\u679c\u9700\u8981\u52a8\u6001\u53c2\u6570\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"Dictionary")," \u7c7b\u578b\u3002"))),Object(i.b)("h2",{id:"9159-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c--"},"9.15.9 \u591a\u6570\u636e\u5e93 ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \u64cd\u4f5c \ud83d\udcaf \ud83d\udc9b"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u62e5\u6709\u975e\u5e38\u7075\u6d3b\u7684\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u65b9\u5f0f\uff0c\u53ea\u9700\u901a\u8fc7\u591a",Object(i.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\u5373\u53ef\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u3002"),Object(i.b)("h3",{id:"91591-\u61d2\u4eba\u65e0\u654c--\u65b9\u5f0f"},"9.15.9.1 \u61d2\u4eba\u65e0\u654c \ud83d\udc2e \u65b9\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var dataTable = "select * from person".Change().SqlQuery();\n\nvar persons = "select * from person whre id > @id".Change().SqlQuery();\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u8865\u5145\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u61d2\u4eba\u65b9\u5f0f \u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Change")," \u65b9\u5f0f\u5373\u53ef\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u3002"))),Object(i.b)("h3",{id:"91592-isqlrepository-\u65b9\u5f0f"},"9.15.9.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"ISqlRepository")," \u65b9\u5f0f"),Object(i.b)("p",null,"\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"ISqlRepository")," \u6ce8\u5165\u6216\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"sqlRepository.Change()")," \u5207\u6362\u3002"),Object(i.b)("h3",{id:"91593-irepository-\u65b9\u5f0f"},"9.15.9.3 ",Object(i.b)("inlineCode",{parentName:"h3"},"IRepository")," \u65b9\u5f0f"),Object(i.b)("p",null,"\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"repository.Change()")," \u83b7\u53d6\u5373\u53ef\u3002"),Object(i.b)("h3",{id:"91594-irepositorytentity-\u65b9\u5f0f"},"9.15.9.4 ",Object(i.b)("inlineCode",{parentName:"h3"},"IRepository")," \u65b9\u5f0f"),Object(i.b)("p",null,"\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"IRepository")," \u6ce8\u5165\u6216\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"personRepository.Change()")," \u5207\u6362\u3002"),Object(i.b)("h2",{id:"91510-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.15.10 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(t.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},190:function(e,n,a){"use strict";a.d(n,"b",(function(){return i})),a.d(n,"a",(function(){return c}));var t=a(21),r=a(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(a,t)=>function(e,n,a,{forcePrependBaseUrl:t=!1,absolute:i=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(r.b)(a))return a;if(t)return n+a;const c=a.startsWith(n)?a:n+a.replace(/^\//,"");return i?e+c:c}(n,e,a,t)}}function c(e,n={}){const{withBaseUrl:a}=i();return a(e,n)}},191:function(e,n,a){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!t(e)}a.d(n,"b",(function(){return t})),a.d(n,"a",(function(){return r}))},192:function(e,n,a){"use strict";a.d(n,"a",(function(){return b})),a.d(n,"b",(function(){return m}));var t=a(0),r=a.n(t);function i(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function c(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function o(e){for(var n=1;n=0||(r[a]=e[a]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=r.a.createContext({}),d=function(e){var n=r.a.useContext(l),a=n;return e&&(a="function"==typeof e?e(n):o(o({},n),e)),a},b=function(e){var n=d(e.components);return r.a.createElement(l.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},p=r.a.forwardRef((function(e,n){var a=e.components,t=e.mdxType,i=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),b=d(a),p=t,m=b["".concat(c,".").concat(p)]||b[p]||u[p]||i;return a?r.a.createElement(m,o(o({ref:n},l),{},{components:a})):r.a.createElement(m,o({ref:n},l))}));function m(e,n){var a=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var i=a.length,c=new Array(i);c[0]=p;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o.mdxType="string"==typeof e?e:t,c[1]=o;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[97],{171:function(e,n,a){"use strict";a.r(n),a.d(n,"frontMatter",(function(){return o})),a.d(n,"metadata",(function(){return s})),a.d(n,"toc",(function(){return l})),a.d(n,"default",(function(){return b}));var t=a(3),r=a(7),i=(a(0),a(196)),c=a(197),o={id:"dbcontext-sql",title:"9.15 Sql \u64cd\u4f5c",sidebar_label:"9.15 Sql \u64cd\u4f5c"},s={unversionedId:"dbcontext-sql",id:"dbcontext-sql",isDocsHomePage:!1,title:"9.15 Sql \u64cd\u4f5c",description:"\u63a8\u8350\u4f7f\u7528 \u300a9.17 Sql \u9ad8\u7ea7\u4ee3\u7406\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002Sql \u9ad8\u7ea7\u4ee3\u7406 \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002",source:"@site/docs\\dbcontext-sql.mdx",slug:"/dbcontext-sql",permalink:"/docs/dbcontext-sql",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-sql.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.15 Sql \u64cd\u4f5c",sidebar:"docs",previous:{title:"9.14 \u51fd\u6570\u64cd\u4f5c",permalink:"/docs/dbcontext-function"},next:{title:"9.16 Sql \u6a21\u677f",permalink:"/docs/dbcontext-sql-template"}},l=[{value:"9.15.1 \u5173\u4e8e Sql",id:"9151-\u5173\u4e8e-sql",children:[]},{value:"9.15.2 \u61d2\u4eba\u65e0\u654c Sql \ud83d\udc2e",id:"9152-\u61d2\u4eba\u65e0\u654c-sql-",children:[{value:"9.15.2.1 \u8fd4\u56de DataTable",id:"91521-\u8fd4\u56de-datatable",children:[]},{value:"9.15.2.2 \u8fd4\u56de List<T>",id:"91522-\u8fd4\u56de-listt",children:[]},{value:"9.15.2.3 \u8fd4\u56de DataSet",id:"91523-\u8fd4\u56de-dataset",children:[]},{value:"9.15.2.4 \u8fd4\u56de Tuple<T1,...T8>",id:"91524-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.15.2.5 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91525-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.15.2.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570",id:"91526-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570",children:[]}]},{value:"9.15.3 \u61d2\u4eba\u65e0\u654c \u5b58\u50a8\u8fc7\u7a0b \ud83d\udc2e",id:"9153-\u61d2\u4eba\u65e0\u654c-\u5b58\u50a8\u8fc7\u7a0b-",children:[{value:"9.15.3.1 \u8fd4\u56de DataTable",id:"91531-\u8fd4\u56de-datatable",children:[]},{value:"9.15.3.2 \u8fd4\u56de List<T>",id:"91532-\u8fd4\u56de-listt",children:[]},{value:"9.15.3.3 \u8fd4\u56de DataSet",id:"91533-\u8fd4\u56de-dataset",children:[]},{value:"9.15.3.4 \u8fd4\u56de Tuple<T1,...T8>",id:"91534-\u8fd4\u56de-tuplet1t8",children:[]},{value:"9.15.3.5 \u8fd4\u56de \u5355\u884c\u5355\u5217",id:"91535-\u8fd4\u56de-\u5355\u884c\u5355\u5217",children:[]},{value:"9.15.3.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570",id:"91536-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570",children:[]},{value:"9.15.3.7 \u5e26 OUTPUT/RETURN \u8fd4\u56de",id:"91537-\u5e26-outputreturn-\u8fd4\u56de",children:[]}]},{value:"9.15.4 \u61d2\u4eba\u65e0\u654c \u51fd\u6570 \ud83d\udc2e",id:"9154-\u61d2\u4eba\u65e0\u654c-\u51fd\u6570-",children:[{value:"9.15.4.1 \u6807\u91cf\u51fd\u6570",id:"91541-\u6807\u91cf\u51fd\u6570",children:[]},{value:"9.15.4.2 \u8868\u503c\u51fd\u6570",id:"91542-\u8868\u503c\u51fd\u6570",children:[]}]},{value:"9.15.5 ISqlRepository \u64cd\u4f5c",id:"9155-isqlrepository-\u64cd\u4f5c",children:[]},{value:"9.15.6 IRepository \u64cd\u4f5c",id:"9156-irepository-\u64cd\u4f5c",children:[]},{value:"9.15.7 IRepository<TEntity> \u64cd\u4f5c",id:"9157-irepositorytentity-\u64cd\u4f5c",children:[]},{value:"9.15.8 \u5173\u4e8e Sql \u53c2\u6570",id:"9158-\u5173\u4e8e-sql-\u53c2\u6570",children:[]},{value:"9.15.9 \u591a\u6570\u636e\u5e93 Sql \u64cd\u4f5c \ud83d\udcaf \ud83d\udc9b",id:"9159-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c--",children:[{value:"9.15.9.1 \u61d2\u4eba\u65e0\u654c \ud83d\udc2e \u65b9\u5f0f",id:"91591-\u61d2\u4eba\u65e0\u654c--\u65b9\u5f0f",children:[]},{value:"9.15.9.2 ISqlRepository \u65b9\u5f0f",id:"91592-isqlrepository-\u65b9\u5f0f",children:[]},{value:"9.15.9.3 IRepository \u65b9\u5f0f",id:"91593-irepository-\u65b9\u5f0f",children:[]},{value:"9.15.9.4 IRepository<TEntity> \u65b9\u5f0f",id:"91594-irepositorytentity-\u65b9\u5f0f",children:[]}]},{value:"9.15.10 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"91510-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:l};function b(e){var n=e.components,a=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(t.a)({},d,a,{components:n,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(i.b)("a",Object(t.a)({parentName:"p"},{href:"/docs/dbcontext-sql-proxy"}),"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002",Object(i.b)("inlineCode",{parentName:"p"},"Sql \u9ad8\u7ea7\u4ee3\u7406")," \u80fd\u591f\u63d0\u4f9b\u66f4\u5bb9\u6613\u4e14\u66f4\u6613\u7ef4\u62a4\u7684\u65b9\u5f0f\u3002"))),Object(i.b)("h2",{id:"9151-\u5173\u4e8e-sql"},"9.15.1 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u591a\u4e14\u7075\u6d3b\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"sql")," \u64cd\u4f5c\u65b9\u6cd5\uff0c\u4e14\u6027\u80fd\u4e0d\u8f93\u4e8e ",Object(i.b)("inlineCode",{parentName:"p"},"dapper"),"\uff0c\u540c\u65f6\u903c\u8fd1 ",Object(i.b)("inlineCode",{parentName:"p"},"ADO.NET")," \u539f\u751f\u64cd\u4f5c\u3002"),Object(i.b)("h2",{id:"9152-\u61d2\u4eba\u65e0\u654c-sql-"},"9.15.2 \u61d2\u4eba\u65e0\u654c ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \ud83d\udc2e"),Object(i.b)("h3",{id:"91521-\u8fd4\u56de-datatable"},"9.15.2.1 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = "select * from person".SqlQuery();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = "select top 10 * from person where id > @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = "select Id, Name, Age from person where name like @name".SqlQuery(new Dictionary{ {"name", "%Furion%"} });\n\n// \u793a\u4f8b\u56db\nvar dataTable = "select * from person where name=@name limit 1,10".SqlQuery(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar dataTable = "select * from person where id>@id and name like @name".SqlQuery(new YourModel { Id = 1, Name = "%Furion%" });\n\n// \u793a\u4f8b\u516d\nvar dataTable = "exec PROC_GetPerson @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar dataTable = "select * from FN_GetPersons(@id)".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar dataTable = @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQuery(new {id = 10});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = await "select * from person".SqlQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = await "select top 10 * from person where id > @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = await "select Id, Name, Age from person where name like %@name%".SqlQueryAsync(new Dictionary{ {"name", "Furion"} });\n\n// \u793a\u4f8b\u56db\nvar dataTable = await "select * from person where name=@name limit 1,10".SqlQueryAsync(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar dataTable = await "select * from person where id>@id and name like %@name%".SqlQueryAsync(new YourModel { Id = 1, Name = "Furion" });\n\n// \u793a\u4f8b\u516d\nvar dataTable = await "exec PROC_GetPerson @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar dataTable = await "select * from FN_GetPersons(@id)".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar dataTable = await @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQueryAsync(new {id = 10});\n')),Object(i.b)("h3",{id:"91522-\u8fd4\u56de-listt"},"9.15.2.2 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"List")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = "select * from person".SqlQuery();\n\n// \u793a\u4f8b\u4e8c\nvar persons = "select top 10 * from person where id > @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar persons = "select Id, Name, Age from person where name like %@name%".SqlQuery(new Dictionary{ {"name", "Furion"} });\n\n// \u793a\u4f8b\u56db\nvar persons = "select * from person where name=@name limit 1,10".SqlQuery(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar persons = "select * from person where id>@id and name like %@name%".SqlQuery(new YourModel { Id = 1, Name = "Furion" });\n\n// \u793a\u4f8b\u516d\nvar persons = "exec PROC_GetPerson @id".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar persons = "select * from FN_GetPersons(@id)".SqlQuery(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar persons = @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQuery(new {id = 10});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await "select * from person".SqlQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar persons = await "select top 10 * from person where id > @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e09\nvar persons = await "select Id, Name, Age from person where name like %@name%".SqlQueryAsync(new Dictionary{ {"name", "Furion"} });\n\n// \u793a\u4f8b\u56db\nvar persons = await "select * from person where name=@name limit 1,10".SqlQueryAsync(new []{ new MySqlParameter("name","Furion") });\n\n// \u793a\u4f8b\u4e94\nvar persons = await "select * from person where id>@id and name like %@name%".SqlQueryAsync(new YourModel { Id = 1, Name = "Furion" });\n\n// \u793a\u4f8b\u516d\nvar persons = await "exec PROC_GetPerson @id".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u4e03\nvar persons = await "select * from FN_GetPersons(@id)".SqlQueryAsync(new {id = 10});\n\n// \u793a\u4f8b\u516b\nvar persons = await @"\nselect * from person p\nleft join personDetail pd on p.Id == pd.pid\nwhere p.Id > @id;".SqlQueryAsync(new {id = 10});\n')),Object(i.b)("h3",{id:"91523-\u8fd4\u56de-dataset"},"9.15.2.3 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = @"\nselect * from person;\nselect * from student;".SqlQueries();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueries(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueries(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = await @"\nselect * from person;\nselect * from student;".SqlQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = await @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueriesAsync(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = await @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueriesAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91524-\u8fd4\u56de-tuplet1t8"},"9.15.2.4 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar (persons, students) = @"\nselect * from person;\nselect * from student;".SqlQueries();\n\n// \u793a\u4f8b\u4e8c\nvar (persons, students) = @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueries(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar (persons, students, string, PersonDto) = @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueries(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar (persons, students) = await @"\nselect * from person;\nselect * from student;".SqlQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar (persons, students) = await @"\nselect * from person where Id > @id;\nselect * from student where Name like %@name%;".SqlQueriesAsync(new {id = 1, name = "furion"});\n\n// \u793a\u4f8b\u4e09\nvar (persons, students, string, PersonDto) = await @"\nselect * from person;\nexec PROC_GetStudents(@id);\nselect \'Furion\';\nselect * from FN_GetPerson(@id);".SqlQueriesAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91525-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.15.2.5 \u8fd4\u56de \u5355\u884c\u5355\u5217"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = "select Name from person where id = @id".SqlScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = "select Name from person where id = @id".SqlScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = "select Age from person where id = @id".SqlScalar(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = await "select Name from person where id = @id".SqlScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = await "select Name from person where id = @id".SqlScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = await "select Age from person where id = @id".SqlScalarAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91526-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570"},"9.15.2.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = "insert into person(Name,Age,Address) values(@name,@age,@address)".SqlNonQuery(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = @"\ninsert into person(Name,Age,Address) values(@name,@age,@address);\ninsert into person(Name,Age,Address) values(@name,@age,@address);".SqlNonQuery(persons);\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = "update person set name=@name where id=@id".SqlNonQuery(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = "delete from person where @id > 10".SqlNonQuery(new {id=1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = await "insert into person(Name,Age,Address) values(@name,@age,@address)".SqlNonQueryAsync(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = @"\ninsert into person(Name,Age,Address) values(@name,@age,@address);\ninsert into person(Name,Age,Address) values(@name,@age,@address);".SqlNonQueryAsync(persons);\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = await "update person set name=@name where id=@id".SqlNonQueryAsync(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = await "delete from person where @id > 10".SqlNonQueryAsync(new {id=1});\n')),Object(i.b)("h2",{id:"9153-\u61d2\u4eba\u65e0\u654c-\u5b58\u50a8\u8fc7\u7a0b-"},"9.15.3 \u61d2\u4eba\u65e0\u654c ",Object(i.b)("inlineCode",{parentName:"h2"},"\u5b58\u50a8\u8fc7\u7a0b")," \ud83d\udc2e"),Object(i.b)("h3",{id:"91531-\u8fd4\u56de-datatable"},"9.15.3.1 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataTable")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = "PROC_Name".SqlProcedureQuery();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = "PROC_Name".SqlProcedureQuery(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = "PROC_Name".SqlProcedureQuery(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = await "PROC_Name".SqlProcedureQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataTable = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91532-\u8fd4\u56de-listt"},"9.15.3.2 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"List")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = "PROC_Name".SqlProcedureQuery();\n\n// \u793a\u4f8b\u4e8c\nvar persons = "PROC_Name".SqlProcedureQuery(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = "PROC_Name".SqlProcedureQuery(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await "PROC_Name".SqlProcedureQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar persons = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = await "PROC_Name".SqlProcedureQueryAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91533-\u8fd4\u56de-dataset"},"9.15.3.3 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"DataSet")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = "PROC_Name".SqlProcedureQueries();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = "PROC_Name".SqlProcedureQueries(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = "PROC_Name".SqlProcedureQueries(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataSet = await "PROC_Name".SqlProcedureQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataSet = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar dataSet = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91534-\u8fd4\u56de-tuplet1t8"},"9.15.3.4 \u8fd4\u56de ",Object(i.b)("inlineCode",{parentName:"h3"},"Tuple")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = "PROC_Name".SqlProcedureQueries();\n\n// \u793a\u4f8b\u4e8c\nvar (persons,students) = "PROC_Name".SqlProcedureQueries(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar (persons,students,string) = "PROC_Name".SqlProcedureQueries(new {id = 1, age = 27});\n\n// \u793a\u4f8b\u56db\nvar (persons,students,personDetail,string) = "PROC_Name".SqlProcedureQueries(new {id = 1, age = 27});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar persons = await "PROC_Name".SqlProcedureQueriesAsync();\n\n// \u793a\u4f8b\u4e8c\nvar (persons,students) = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar (persons,students,string) = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1, age = 27});\n\n// \u793a\u4f8b\u56db\nvar (persons,students,personDetail,string) = await "PROC_Name".SqlProcedureQueriesAsync(new {id = 1, age = 27});\n')),Object(i.b)("h3",{id:"91535-\u8fd4\u56de-\u5355\u884c\u5355\u5217"},"9.15.3.5 \u8fd4\u56de \u5355\u884c\u5355\u5217"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = "PROC_Name".SqlProcedureScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = "PROC_Name".SqlProcedureScalar(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar value = "PROC_Name".SqlProcedureScalar(new {id = 1, address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = await "PROC_Name".SqlProcedureScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e8c\nvar value = await "PROC_Name".SqlProcedureScalarAsync(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar value = await "PROC_Name".SqlProcedureScalarAsync(new {id = 1, address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n')),Object(i.b)("h3",{id:"91536-\u8fd4\u56de-\u53d7\u5f71\u54cd\u884c\u6570"},"9.15.3.6 \u8fd4\u56de \u53d7\u5f71\u54cd\u884c\u6570"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = "PROC_Name".SqlProcedureNonQuery(new {id=1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(person);\n\n// \u793a\u4f8b\u4e8c\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(new {id = 1, name = "\u65b0\u751f\u5e1d", address ="\u5e7f\u4e1c\u7701\u4e2d\u5c71\u5e02"});\n\n// \u793a\u4f8b\u4e09\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u56db\nvar rowEffects = await "PROC_Name".SqlProcedureNonQueryAsync(new {id=1});\n')),Object(i.b)("h3",{id:"91537-\u5e26-outputreturn-\u8fd4\u56de"},"9.15.3.7 \u5e26 ",Object(i.b)("inlineCode",{parentName:"h3"},"OUTPUT/RETURN")," \u8fd4\u56de"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-sql",metastring:"{3,4,10-12,15-17,22}","{3,4,10-12,15-17,22}":!0}),"CREATE PROC PROC_Output\n @Id INT, // \u8f93\u5165\u53c2\u6570\n @Name NVARCHAR(32) OUTPUT, // \u8f93\u51fa\u53c2\u6570\uff0c\u8fd8\u5e26\u957f\u5ea6\n @Age INT OUTPUT // \u8f93\u51fa\u53c2\u6570\nAS\nBEGIN\n SET @Name = 'Furion Output';\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT *\n FROM dbo.Test\n WHERE Id > @Id;\n\n // \u8f93\u51fa\u7ed3\u679c\u96c6\n SELECT TOP 10\n *\n FROM dbo.Test;\n\n SET @Age = 27;\n\n // \u5e26 RETURN \u8fd4\u56de\n RETURN 10;\nEND;\n")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,10,13,16}","{1,10,13,16}":!0}),"using Furion.DatabaseAccessor;\nusing System.Data;\n\nnamespace Furion.Application\n{\n public class ProcOutputModel\n {\n public int Id { get; set; } // \u8f93\u5165\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output, Size = 32)]\n public string Name { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.Output)]\n public int Age { get; set; } // \u8f93\u51fa\u53c2\u6570\n\n [DbParameter(ParameterDirection.ReturnValue)]\n public int ReturnValue { get; set; } // \u8fd4\u56de\u503c\n }\n}\n")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nProcedureOutputResult result = "PROC_Name".SqlProcedureOutput(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u4e8c\nProcedureOutputResult result = "PROC_Name".SqlProcedureOutput();\n\n// \u793a\u4f8b\u4e09\nProcedureOutputResult<(List, List)> result = "PROC_Name".SqlProcedureOutput<(List, List)>();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n// \u793a\u4f8b\u4e00\nProcedureOutputResult result = await "PROC_Name".SqlProcedureOutputAsync(new {id=1, name="\u767e\u5c0f\u50e7"});\n\n// \u793a\u4f8b\u4e8c\nProcedureOutputResult result = await "PROC_Name".SqlProcedureOutputAsync();\n\n// \u793a\u4f8b\u4e09\nProcedureOutputResult<(List, List)> result = await "PROC_Name".SqlProcedureOutputAsync<(List, List)>();\n')),Object(i.b)("h2",{id:"9154-\u61d2\u4eba\u65e0\u654c-\u51fd\u6570-"},"9.15.4 \u61d2\u4eba\u65e0\u654c ",Object(i.b)("inlineCode",{parentName:"h2"},"\u51fd\u6570")," \ud83d\udc2e"),Object(i.b)("h3",{id:"91541-\u6807\u91cf\u51fd\u6570"},"9.15.4.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u6807\u91cf\u51fd\u6570")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = "FN_Name".SqlFunctionScalar();\n\n// \u793a\u4f8b\u4e8c\nvar value = "FN_Name".SqlFunctionScalar(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = "FN_Name".SqlFunctionScalar();\n\n// \u793a\u4f8b\u56db\nvar value = "FN_Name".SqlFunctionScalar(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar value = await "FN_Name".SqlFunctionScalarAsync();\n\n// \u793a\u4f8b\u4e8c\nvar value = await "FN_Name".SqlFunctionScalarAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar value = await "FN_Name".SqlFunctionScalarAsync();\n\n// \u793a\u4f8b\u56db\nvar value = await "FN_Name".SqlFunctionScalarAsync(new {id = 1});\n')),Object(i.b)("h3",{id:"91542-\u8868\u503c\u51fd\u6570"},"9.15.4.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"\u8868\u503c\u51fd\u6570")),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = "FN_Name".SqlFunctionQuery();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = "FN_Name".SqlFunctionQuery(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = "FN_Name".SqlFunctionQuery();\n\n// \u793a\u4f8b\u56db\nvar persons = "FN_Name".SqlFunctionQuery(new {id = 1});\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar dataTable = await "FN_Name".SqlFunctionQueryAsync();\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = await "FN_Name".SqlFunctionQueryAsync(new {id = 1});\n\n// \u793a\u4f8b\u4e09\nvar persons = await "FN_Name".SqlFunctionQueryAsync();\n\n// \u793a\u4f8b\u56db\nvar persons = await "FN_Name".SqlFunctionQueryAsync(new {id = 1});\n')),Object(i.b)("h2",{id:"9155-isqlrepository-\u64cd\u4f5c"},"9.15.5 ",Object(i.b)("inlineCode",{parentName:"h2"},"ISqlRepository")," \u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"ISqlRepository")," \u4ed3\u50a8\u662f\u4e13\u95e8\u5904\u7406 ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \u64cd\u4f5c\u7684\uff0c\u65e0\u9700\u5b9e\u4f53\u65b9\u5f0f\uff0c\u6240\u6709\u63a5\u53e3\u548c ",Object(i.b)("inlineCode",{parentName:"p"},"\u61d2\u4eba\u65e0\u654c")," \u65b9\u5f0f\u4e00\u6837\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'// \u793a\u4f8b\u4e00\nvar dataTable = sqlRepository.SqlQuery("select * from person");\n\n// \u793a\u4f8b\u4e8c\nvar dataTable = sqlRepository.SqlQuery("select * from person where id > @id", new { id = 10});\n\n// \u793a\u4f8b\u56db\nvar persons = sqlRepository.SqlQuery("select * from person");\n\n// \u793a\u4f8b\u4e94\nvar persons = sqlRepository.SqlQuery("select * from person where id > @id", new { id = 10});\n\n// \u4e0d\u518d\u4e3e\u4f8b\u5b50\u3002\u3002\u3002\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u8865\u5145\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u4e0d\u7ba1\u662f\u90a3\u79cd\u65b9\u5f0f\u64cd\u4f5c ",Object(i.b)("inlineCode",{parentName:"p"},"Sql")," \uff0c\u65b9\u6cd5\u540d\u53c2\u6570\u90fd\u662f\u4e00\u81f4\u7684\uff0c\u5982\uff1a"),Object(i.b)("ul",{parentName:"div"},Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQueries")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlQueriesAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlNonQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlNonQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlScalar")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlScalarAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQueries")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureQueriesAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureScalar")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureScalarAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureNonQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureNonQueryAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureOutput")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlProcedureOutputAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionScalar")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionScalarAsync")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionQuery")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"SqlFunctionQuery"))))),Object(i.b)("h2",{id:"9156-irepository-\u64cd\u4f5c"},"9.15.6 ",Object(i.b)("inlineCode",{parentName:"h2"},"IRepository")," \u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IRepository")," \u4e5f\u80fd\u64cd\u4f5c ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u8c03\u7528\u65b9\u6cd5\u4e5f\u662f\u548c\u4e0a\u9762\u4e00\u81f4\u7684\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var dataTable = repository.Sql().SqlQuery("select * from person");\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u4e0d\u518d\u5217\u4e3e\u6240\u6709\u4f8b\u5b50\u3002"))),Object(i.b)("h2",{id:"9157-irepositorytentity-\u64cd\u4f5c"},"9.15.7 ",Object(i.b)("inlineCode",{parentName:"h2"},"IRepository")," \u64cd\u4f5c"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IRepository")," \u4e5f\u80fd\u64cd\u4f5c ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\uff0c\u8c03\u7528\u65b9\u6cd5\u4e5f\u662f\u548c\u4e0a\u9762\u4e00\u81f4\u7684\uff0c\u5982\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var dataTable = personRepository.SqlQuery("select * from person");\n')),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7531\u4e8e\u7bc7\u5e45\u6709\u9650\uff0c\u4e0d\u518d\u5217\u4e3e\u6240\u6709\u4f8b\u5b50\u3002"))),Object(i.b)("h2",{id:"9158-\u5173\u4e8e-sql-\u53c2\u6570"},"9.15.8 \u5173\u4e8e ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \u53c2\u6570"),Object(i.b)("p",null,"\u6240\u6709 ",Object(i.b)("inlineCode",{parentName:"p"},"sql"),"\u3001",Object(i.b)("inlineCode",{parentName:"p"},"\u5b58\u50a8\u8fc7\u7a0b"),"\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"\u51fd\u6570")," \u53c2\u6570\u90fd\u652f\u6301\u56db\u79cd\u65b9\u5f0f\uff1a"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"DbParameter[]"),"\uff1a\u6570\u7ec4\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new {}"),"\uff1a\u533f\u540d\u7c7b\u578b"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"new Class{}"),"\uff1a\u5f3a\u7c7b\u578b\u7c7b\u578b\uff08\u652f\u6301\u590d\u6742\u5b58\u50a8\u8fc7\u7a0b\u53c2\u6570\uff09"),Object(i.b)("li",{parentName:"ul"},Object(i.b)("inlineCode",{parentName:"li"},"Dictionary")," \u7c7b\u578b")),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5efa\u8bae\u9664\u4e86\u590d\u6742\u7684\u5b58\u50a8\u8fc7\u7a0b\uff08\u5e26 ",Object(i.b)("inlineCode",{parentName:"p"},"OUTPUT/RETURN"),"\uff09\u7684\u4ee5\u5916\uff0c\u6240\u6709\u53c2\u6570\u5efa\u8bae\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"new {}")," \u533f\u540d\u7c7b\u578b\uff0c\u5982\u679c\u9700\u8981\u52a8\u6001\u53c2\u6570\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"Dictionary")," \u7c7b\u578b\u3002"))),Object(i.b)("h2",{id:"9159-\u591a\u6570\u636e\u5e93-sql-\u64cd\u4f5c--"},"9.15.9 \u591a\u6570\u636e\u5e93 ",Object(i.b)("inlineCode",{parentName:"h2"},"Sql")," \u64cd\u4f5c \ud83d\udcaf \ud83d\udc9b"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u62e5\u6709\u975e\u5e38\u7075\u6d3b\u7684\u591a\u6570\u636e\u5e93\u64cd\u4f5c\u65b9\u5f0f\uff0c\u53ea\u9700\u901a\u8fc7\u591a",Object(i.b)("strong",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668"),"\u5373\u53ef\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u3002"),Object(i.b)("h3",{id:"91591-\u61d2\u4eba\u65e0\u654c--\u65b9\u5f0f"},"9.15.9.1 \u61d2\u4eba\u65e0\u654c \ud83d\udc2e \u65b9\u5f0f"),Object(i.b)("pre",null,Object(i.b)("code",Object(t.a)({parentName:"pre"},{className:"language-cs"}),'var dataTable = "select * from person".Change().SqlQuery();\n\nvar persons = "select * from person whre id > @id".Change().SqlQuery();\n')),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u8865\u5145\u8bf4\u660e")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u61d2\u4eba\u65b9\u5f0f \u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"Change")," \u65b9\u5f0f\u5373\u53ef\u52a8\u6001\u5207\u6362\u6570\u636e\u5e93\u3002"))),Object(i.b)("h3",{id:"91592-isqlrepository-\u65b9\u5f0f"},"9.15.9.2 ",Object(i.b)("inlineCode",{parentName:"h3"},"ISqlRepository")," \u65b9\u5f0f"),Object(i.b)("p",null,"\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"ISqlRepository")," \u6ce8\u5165\u6216\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"sqlRepository.Change()")," \u5207\u6362\u3002"),Object(i.b)("h3",{id:"91593-irepository-\u65b9\u5f0f"},"9.15.9.3 ",Object(i.b)("inlineCode",{parentName:"h3"},"IRepository")," \u65b9\u5f0f"),Object(i.b)("p",null,"\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"repository.Change()")," \u83b7\u53d6\u5373\u53ef\u3002"),Object(i.b)("h3",{id:"91594-irepositorytentity-\u65b9\u5f0f"},"9.15.9.4 ",Object(i.b)("inlineCode",{parentName:"h3"},"IRepository")," \u65b9\u5f0f"),Object(i.b)("p",null,"\u53ea\u9700\u8981\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"IRepository")," \u6ce8\u5165\u6216\u901a\u8fc7 ",Object(i.b)("inlineCode",{parentName:"p"},"personRepository.Change()")," \u5207\u6362\u3002"),Object(i.b)("h2",{id:"91510-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.15.10 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(t.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(t.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(t.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(t.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(t.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},194:function(e,n,a){"use strict";a.d(n,"b",(function(){return i})),a.d(n,"a",(function(){return c}));var t=a(21),r=a(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(t.default)();return{withBaseUrl:(a,t)=>function(e,n,a,{forcePrependBaseUrl:t=!1,absolute:i=!1}={}){if(!a)return a;if(a.startsWith("#"))return a;if(Object(r.b)(a))return a;if(t)return n+a;const c=a.startsWith(n)?a:n+a.replace(/^\//,"");return i?e+c:c}(n,e,a,t)}}function c(e,n={}){const{withBaseUrl:a}=i();return a(e,n)}},195:function(e,n,a){"use strict";function t(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!t(e)}a.d(n,"b",(function(){return t})),a.d(n,"a",(function(){return r}))},196:function(e,n,a){"use strict";a.d(n,"a",(function(){return b})),a.d(n,"b",(function(){return m}));var t=a(0),r=a.n(t);function i(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function c(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n&&(t=t.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),a.push.apply(a,t)}return a}function o(e){for(var n=1;n=0||(r[a]=e[a]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=r.a.createContext({}),d=function(e){var n=r.a.useContext(l),a=n;return e&&(a="function"==typeof e?e(n):o(o({},n),e)),a},b=function(e){var n=d(e.components);return r.a.createElement(l.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},p=r.a.forwardRef((function(e,n){var a=e.components,t=e.mdxType,i=e.originalType,c=e.parentName,l=s(e,["components","mdxType","originalType","parentName"]),b=d(a),p=t,m=b["".concat(c,".").concat(p)]||b[p]||u[p]||i;return a?r.a.createElement(m,o(o({ref:n},l),{},{components:a})):r.a.createElement(m,o({ref:n},l))}));function m(e,n){var a=arguments,t=n&&n.mdxType;if("string"==typeof e||t){var i=a.length,c=new Array(i);c[0]=p;var o={};for(var s in n)hasOwnProperty.call(n,s)&&(o[s]=n[s]);o.originalType=e,o.mdxType="string"==typeof e?e:t,c[1]=o;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/dea2fede.0a60a8de.js b/docs/dea2fede.e6e82056.js similarity index 95% rename from docs/dea2fede.0a60a8de.js rename to docs/dea2fede.e6e82056.js index b4a672e2c51..58f97e6baa3 100644 --- a/docs/dea2fede.0a60a8de.js +++ b/docs/dea2fede.e6e82056.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[94],{168:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return s})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return d})),t.d(n,"default",(function(){return p}));var a=t(3),o=t(7),r=(t(0),t(192)),i=(t(190),t(199)),c=t(200),l=t(193),s={id:"tran",title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",sidebar_label:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143"},b={unversionedId:"tran",id:"tran",isDocsHomePage:!1,title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",description:"9.26.1 \u4e8b\u52a1",source:"@site/docs\\tran.mdx",slug:"/tran",permalink:"/docs/tran",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/tran.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",sidebar:"docs",previous:{title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",permalink:"/docs/dbcontext-entitytrigger"},next:{title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",permalink:"/docs/dbcontext-read-write"}},d=[{value:"9.26.1 \u4e8b\u52a1",id:"9261-\u4e8b\u52a1",children:[]},{value:"9.26.2 \u5de5\u4f5c\u5355\u5143",id:"9262-\u5de5\u4f5c\u5355\u5143",children:[]},{value:"9.26.3 \u5982\u4f55\u4f7f\u7528",id:"9263-\u5982\u4f55\u4f7f\u7528",children:[{value:"9.26.3.1 \u81ea\u52a8\u7ba1\u7406",id:"92631-\u81ea\u52a8\u7ba1\u7406",children:[]},{value:"9.26.3.2 \u624b\u52a8\u7ba1\u7406",id:"92632-\u624b\u52a8\u7ba1\u7406",children:[]}]},{value:"9.26.4 \u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e",id:"9264-\u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e",children:[{value:"9.26.4.1 [UnitOfWork]",id:"92641-unitofwork",children:[]}]},{value:"9.26.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9265-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:d};function p(e){var n=e.components,t=Object(o.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},u,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(l.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"9261-\u4e8b\u52a1"},"9.26.1 \u4e8b\u52a1"),Object(r.b)("p",null,"\u4e8b\u52a1\u6307\u4f5c\u4e3a\u5355\u4e2a\u903b\u8f91\u5de5\u4f5c\u5355\u5143\u6267\u884c\u7684\u4e00\u7cfb\u5217\u64cd\u4f5c\uff0c\u8981\u4e48",Object(r.b)("strong",{parentName:"p"},"\u5b8c\u5168\u5730\u6267\u884c\uff0c\u8981\u4e48\u5b8c\u5168\u5730\u4e0d\u6267\u884c"),"\u3002"),Object(r.b)("p",null,"\u7b80\u5355\u7684\u8bf4\uff0c\u4e8b\u52a1\u5c31\u662f\u5e76\u53d1\u63a7\u5236\u7684\u5355\u4f4d\uff0c\u662f\u7528\u6237\u5b9a\u4e49\u7684\u4e00\u4e2a\u64cd\u4f5c\u5e8f\u5217\u3002 \u800c\u4e00\u4e2a\u903b\u8f91\u5de5\u4f5c\u5355\u5143\u8981\u6210\u4e3a\u4e8b\u52a1\uff0c\u5c31\u5fc5\u987b\u6ee1\u8db3 ",Object(r.b)("inlineCode",{parentName:"p"},"ACID")," \u5c5e\u6027\u3002"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"A"),"\uff1a\u539f\u5b50\u6027\uff08Atomicity\uff09\uff1a\u4e8b\u52a1\u4e2d\u7684\u64cd\u4f5c\u8981\u4e48\u90fd\u4e0d\u505a\uff0c\u8981\u4e48\u5c31\u5168\u505a"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"C"),"\uff1a\u4e00\u81f4\u6027\uff08Consistency\uff09\uff1a\u4e8b\u52a1\u6267\u884c\u7684\u7ed3\u679c\u5fc5\u987b\u662f\u4ece\u6570\u636e\u5e93\u4ece\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001\u8f6c\u6362\u5230\u53e6\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"I"),"\uff1a\u9694\u79bb\u6027\uff08Isolation\uff09\uff1a\u4e00\u4e2a\u4e8b\u52a1\u7684\u6267\u884c\u4e0d\u80fd\u88ab\u5176\u4ed6\u4e8b\u52a1\u5e72\u6270"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"D"),"\uff1a\u6301\u4e45\u6027\uff08Durability\uff09\uff1a\u4e00\u4e2a\u4e8b\u52a1\u4e00\u65e6\u63d0\u4ea4\uff0c\u5b83\u5bf9\u6570\u636e\u5e93\u4e2d\u6570\u636e\u7684\u6539\u53d8\u5c31\u5e94\u8be5\u662f\u6c38\u4e45\u6027\u7684")),Object(r.b)("h2",{id:"9262-\u5de5\u4f5c\u5355\u5143"},"9.26.2 \u5de5\u4f5c\u5355\u5143"),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u4e3a\u4e86\u4fdd\u8bc1\u4e00\u6b21\u5b8c\u6574\u7684\u529f\u80fd\u64cd\u4f5c\u6240\u4ea7\u751f\u7684\u4e00\u4e9b\u5217\u63d0\u4ea4\u6570\u636e\u7684\u5b8c\u6574\u6027\uff0c\u8d77\u7740\u4e8b\u52a1\u7684\u4f5c\u7528\u3002\u5728\u8ba1\u7b97\u673a\u9886\u57df\u4e2d\uff0c\u5de5\u4f5c\u5355\u5143\u901a\u5e38\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"UnitOfWork")," \u540d\u79f0\u8868\u793a\u3002"),Object(r.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4fdd\u8bc1\u7528\u6237\u7684\u6bcf\u4e00\u6b21\u8bf7\u6c42\u90fd\u662f\u5904\u4e8e\u5728\u4e00\u4e2a\u529f\u80fd\u5355\u5143\u4e2d\uff0c\u4e5f\u5c31\u662f\u5de5\u4f5c\u5355\u5143\u3002"),Object(r.b)("h2",{id:"9263-\u5982\u4f55\u4f7f\u7528"},"9.26.3 \u5982\u4f55\u4f7f\u7528"),Object(r.b)("h3",{id:"92631-\u81ea\u52a8\u7ba1\u7406"},"9.26.3.1 \u81ea\u52a8\u7ba1\u7406"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u63a7\u5236\u5668 Action \u4e2d\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[UnitOfWork]")," \u7279\u6027\u5373\u53ef\u5f00\u542f\u5de5\u4f5c\u5355\u5143\u6a21\u5f0f\uff0c\u4fdd\u8bc1\u4e86\u6bcf\u4e00\u6b21\u8bf7\u6c42\u90fd\u662f\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"\u5de5\u4f5c\u5355\u5143"),"\uff0c\u8981\u4e48\u540c\u65f6\u6210\u529f\uff0c\u8981\u4e48\u540c\u65f6\u5931\u8d25\u3002"),Object(r.b)("h3",{id:"92632-\u624b\u52a8\u7ba1\u7406"},"9.26.3.2 \u624b\u52a8\u7ba1\u7406"),Object(r.b)(i.a,{defaultValue:"one",values:[{label:"\u793a\u4f8b\u4e00",value:"one"},{label:"\u793a\u4f8b\u4e8c",value:"two"},{label:"\u793a\u4f8b\u4e09",value:"three"}],mdxType:"Tabs"},Object(r.b)(c.a,{value:"one",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u5f00\u542f\u4e8b\u52a1\nusing (var transaction = _testRepository.Database.BeginTransaction())\n{\n try\n {\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n _testRepository.SaveChanges();\n\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/visualstudio" });\n _testRepository.SaveChanges();\n\n var blogs = _testRepository.Entity\n .OrderBy(b => b.Url)\n .ToList();\n\n // \u63d0\u4ea4\u4e8b\u52a1\n transaction.Commit();\n }\n catch (Exception)\n {\n // \u56de\u6eda\u4e8b\u52a1\n transaction.RollBack();\n }\n}\n'))),Object(r.b)(c.a,{value:"two",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var options = new DbContextOptionsBuilder()\n .UseSqlServer(new SqlConnection(connectionString))\n .Options;\n\n// \u521b\u5efa\u8fde\u63a5\u5b57\u7b26\u4e32\nusing (var context1 = new HoaDbContext(options))\n{\n // \u5f00\u542f\u4e8b\u52a1\n using (var transaction = context1.Database.BeginTransaction())\n {\n try\n {\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n _testRepository.SaveChanges();\n\n context1.Blogs.Add(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n context1.SaveChanges();\n\n // \u521b\u5efa\u65b0\u7684\u8fde\u63a5\u5bf9\u8c61\n using (var context2 = new HoaDbContext(options))\n {\n // \u5171\u4eab\u8fde\u63a5\u4e8b\u52a1\n context2.Database.UseTransaction(transaction.GetDbTransaction());\n\n var blogs = context2.Blogs\n .OrderBy(b => b.Url)\n .ToList();\n }\n\n // \u63d0\u4ea4\u4e8b\u52a1\n transaction.Commit();\n }\n catch (Exception)\n {\n // \u56de\u6eda\u4e8b\u52a1\n transaction.RollBack();\n }\n }\n}\n'))),Object(r.b)(c.a,{value:"three",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u5f00\u542f\u5206\u5e03\u5f0f\u4e8b\u52a1\nusing (var scope = new TransactionScope(\n TransactionScopeOption.Required,\n new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }))\n{\n using (var connection = new SqlConnection(connectionString))\n {\n connection.Open();\n\n try\n {\n // \u8fd9\u91cc\u662f Ado.NET \u64cd\u4f5c\n var command = connection.CreateCommand();\n command.CommandText = "DELETE FROM dbo.Blogs";\n command.ExecuteNonQuery();\n\n // \u521b\u5efaEF Core \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n var options = new DbContextOptionsBuilder()\n .UseSqlServer(connection)\n .Options;\n using (var context = new BloggingContext(options))\n {\n context.Blogs.Add(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n context.SaveChanges();\n }\n\n // \u6846\u67b6\u5c01\u88c5\u7684\u4ed3\u50a8\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n _testRepository.SaveChanges();\n\n // \u63d0\u4ea4\u4e8b\u52a1\n scope.Complete();\n }\n catch (System.Exception)\n {\n // \u81ea\u52a8\u56de\u6eda\n }\n }\n}\n')))),Object(r.b)("h2",{id:"9264-\u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e"},"9.26.4 \u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e"),Object(r.b)("h3",{id:"92641-unitofwork"},"9.26.4.1 ",Object(r.b)("inlineCode",{parentName:"h3"},"[UnitOfWork]")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"[UnitOfWork]")," \u7279\u6027\u7528\u6765\u6807\u8bb0\u4e8b\u52a1\u4fe1\u606f\uff0c\u5982\u4f5c\u7528\u8303\u56f4\uff0c\u9694\u79bb\u7ea7\u522b\u7b49\u3002"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Enabled"),"\uff1a\u662f\u5426\u542f\u52a8\u5de5\u4f5c\u5355\u5143\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"true")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ScopeOption"),"\uff1a\u5b9a\u4e49\u4e8b\u52a1\u8303\u56f4\u884c\u4e3a\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"TransactionScopeOption.Required")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IsolationLevel"),"\uff1a\u8bbe\u7f6e\u4e8b\u52a1\u9694\u79bb\u7ea7\u522b\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"IsolationLevel.ReadCommitted"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"AsyncFlowOption"),"\uff1a\u5141\u8bb8\u8de8\u7ebf\u7a0b\u8fde\u7eed\u4efb\u52a1\u7684\u4e8b\u52a1\u6d41\uff0c\u5982\u6709\u5f02\u6b65\u64cd\u4f5c\u9700\u5f00\u542f\u8be5\u9009\u9879\uff0c\u9ed8\u8ba4\u5f00\u542f")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u4e00\u65e6\u65b9\u6cd5\u8d34\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"[UnitOfWork(false)]")," \u7279\u6027\u540e\uff0c\u90a3\u4e48\u8be5\u65b9\u6cd5\u4e0d\u518d\u542f\u7528\u5de5\u4f5c\u5355\u5143\u6a21\u5f0f\uff0c\u4e5f\u5c31\u662f\u4e0d\u5305\u542b\u4e8b\u52a1\uff0c\u4e5f\u4e0d\u4f1a\u81ea\u52a8\u63d0\u4ea4\u6570\u636e\u5e93\u3002\u614e\u7528!"))),Object(r.b)("h2",{id:"9265-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.26.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(r.b)("hr",null),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(r.b)("inlineCode",{parentName:"p"},"\u4e8b\u52a1")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/saving/transactions"}),"EF Core - \u4f7f\u7528\u4e8b\u52a1")," \u7ae0\u8282\u3002"))))}p.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}));var a=t(21),o=t(191);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(o.b)(t))return t;if(a)return n+t;const i=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+i:i}(n,e,t,a)}}function i(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return m}));var a=t(0),o=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=o.a.createContext({}),b=function(e){var n=o.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},d=function(e){var n=b(e.components);return o.a.createElement(s.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},p=o.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=b(t),p=a,m=d["".concat(i,".").concat(p)]||d[p]||u[p]||r;return t?o.a.createElement(m,c(c({ref:n},s),{},{components:t})):o.a.createElement(m,c({ref:n},s))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,i=new Array(r);i[0]=p;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,n,t){"use strict";function a(e){var n,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&v(e)}const g=e=>{v(e),null!=u&&O(u,e)},h=[];return o.a.createElement("div",null,o.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.a)("tabs",{"tabs--block":t},p)},d.map(({value:e,label:n})=>o.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(i.a)("tabs__item",l.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case b:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case s:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(h,e.target,e)},onFocus:()=>g(e),onClick:()=>{g(e)}},n))),n?Object(a.cloneElement)(f.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):o.a.createElement("div",{className:"margin-vert--md"},f.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==j}))))}},200:function(e,n,t){"use strict";var a=t(3),o=t(0),r=t.n(o);n.a=function({children:e,hidden:n,className:t}){return r.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[98],{172:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return s})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return d})),t.d(n,"default",(function(){return p}));var a=t(3),o=t(7),r=(t(0),t(196)),i=(t(194),t(203)),c=t(204),l=t(197),s={id:"tran",title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",sidebar_label:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143"},b={unversionedId:"tran",id:"tran",isDocsHomePage:!1,title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",description:"9.26.1 \u4e8b\u52a1",source:"@site/docs\\tran.mdx",slug:"/tran",permalink:"/docs/tran",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/tran.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",sidebar:"docs",previous:{title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",permalink:"/docs/dbcontext-entitytrigger"},next:{title:"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236",permalink:"/docs/dbcontext-read-write"}},d=[{value:"9.26.1 \u4e8b\u52a1",id:"9261-\u4e8b\u52a1",children:[]},{value:"9.26.2 \u5de5\u4f5c\u5355\u5143",id:"9262-\u5de5\u4f5c\u5355\u5143",children:[]},{value:"9.26.3 \u5982\u4f55\u4f7f\u7528",id:"9263-\u5982\u4f55\u4f7f\u7528",children:[{value:"9.26.3.1 \u81ea\u52a8\u7ba1\u7406",id:"92631-\u81ea\u52a8\u7ba1\u7406",children:[]},{value:"9.26.3.2 \u624b\u52a8\u7ba1\u7406",id:"92632-\u624b\u52a8\u7ba1\u7406",children:[]}]},{value:"9.26.4 \u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e",id:"9264-\u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e",children:[{value:"9.26.4.1 [UnitOfWork]",id:"92641-unitofwork",children:[]}]},{value:"9.26.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9265-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],u={toc:d};function p(e){var n=e.components,t=Object(o.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},u,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(l.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"9261-\u4e8b\u52a1"},"9.26.1 \u4e8b\u52a1"),Object(r.b)("p",null,"\u4e8b\u52a1\u6307\u4f5c\u4e3a\u5355\u4e2a\u903b\u8f91\u5de5\u4f5c\u5355\u5143\u6267\u884c\u7684\u4e00\u7cfb\u5217\u64cd\u4f5c\uff0c\u8981\u4e48",Object(r.b)("strong",{parentName:"p"},"\u5b8c\u5168\u5730\u6267\u884c\uff0c\u8981\u4e48\u5b8c\u5168\u5730\u4e0d\u6267\u884c"),"\u3002"),Object(r.b)("p",null,"\u7b80\u5355\u7684\u8bf4\uff0c\u4e8b\u52a1\u5c31\u662f\u5e76\u53d1\u63a7\u5236\u7684\u5355\u4f4d\uff0c\u662f\u7528\u6237\u5b9a\u4e49\u7684\u4e00\u4e2a\u64cd\u4f5c\u5e8f\u5217\u3002 \u800c\u4e00\u4e2a\u903b\u8f91\u5de5\u4f5c\u5355\u5143\u8981\u6210\u4e3a\u4e8b\u52a1\uff0c\u5c31\u5fc5\u987b\u6ee1\u8db3 ",Object(r.b)("inlineCode",{parentName:"p"},"ACID")," \u5c5e\u6027\u3002"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"A"),"\uff1a\u539f\u5b50\u6027\uff08Atomicity\uff09\uff1a\u4e8b\u52a1\u4e2d\u7684\u64cd\u4f5c\u8981\u4e48\u90fd\u4e0d\u505a\uff0c\u8981\u4e48\u5c31\u5168\u505a"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"C"),"\uff1a\u4e00\u81f4\u6027\uff08Consistency\uff09\uff1a\u4e8b\u52a1\u6267\u884c\u7684\u7ed3\u679c\u5fc5\u987b\u662f\u4ece\u6570\u636e\u5e93\u4ece\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001\u8f6c\u6362\u5230\u53e6\u4e00\u4e2a\u4e00\u81f4\u6027\u72b6\u6001"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"I"),"\uff1a\u9694\u79bb\u6027\uff08Isolation\uff09\uff1a\u4e00\u4e2a\u4e8b\u52a1\u7684\u6267\u884c\u4e0d\u80fd\u88ab\u5176\u4ed6\u4e8b\u52a1\u5e72\u6270"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"D"),"\uff1a\u6301\u4e45\u6027\uff08Durability\uff09\uff1a\u4e00\u4e2a\u4e8b\u52a1\u4e00\u65e6\u63d0\u4ea4\uff0c\u5b83\u5bf9\u6570\u636e\u5e93\u4e2d\u6570\u636e\u7684\u6539\u53d8\u5c31\u5e94\u8be5\u662f\u6c38\u4e45\u6027\u7684")),Object(r.b)("h2",{id:"9262-\u5de5\u4f5c\u5355\u5143"},"9.26.2 \u5de5\u4f5c\u5355\u5143"),Object(r.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u4e3a\u4e86\u4fdd\u8bc1\u4e00\u6b21\u5b8c\u6574\u7684\u529f\u80fd\u64cd\u4f5c\u6240\u4ea7\u751f\u7684\u4e00\u4e9b\u5217\u63d0\u4ea4\u6570\u636e\u7684\u5b8c\u6574\u6027\uff0c\u8d77\u7740\u4e8b\u52a1\u7684\u4f5c\u7528\u3002\u5728\u8ba1\u7b97\u673a\u9886\u57df\u4e2d\uff0c\u5de5\u4f5c\u5355\u5143\u901a\u5e38\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"UnitOfWork")," \u540d\u79f0\u8868\u793a\u3002"),Object(r.b)("p",null,"\u901a\u5e38\u6211\u4eec\u4fdd\u8bc1\u7528\u6237\u7684\u6bcf\u4e00\u6b21\u8bf7\u6c42\u90fd\u662f\u5904\u4e8e\u5728\u4e00\u4e2a\u529f\u80fd\u5355\u5143\u4e2d\uff0c\u4e5f\u5c31\u662f\u5de5\u4f5c\u5355\u5143\u3002"),Object(r.b)("h2",{id:"9263-\u5982\u4f55\u4f7f\u7528"},"9.26.3 \u5982\u4f55\u4f7f\u7528"),Object(r.b)("h3",{id:"92631-\u81ea\u52a8\u7ba1\u7406"},"9.26.3.1 \u81ea\u52a8\u7ba1\u7406"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u63a7\u5236\u5668 Action \u4e2d\u8d34 ",Object(r.b)("inlineCode",{parentName:"p"},"[UnitOfWork]")," \u7279\u6027\u5373\u53ef\u5f00\u542f\u5de5\u4f5c\u5355\u5143\u6a21\u5f0f\uff0c\u4fdd\u8bc1\u4e86\u6bcf\u4e00\u6b21\u8bf7\u6c42\u90fd\u662f\u4e00\u4e2a ",Object(r.b)("inlineCode",{parentName:"p"},"\u5de5\u4f5c\u5355\u5143"),"\uff0c\u8981\u4e48\u540c\u65f6\u6210\u529f\uff0c\u8981\u4e48\u540c\u65f6\u5931\u8d25\u3002"),Object(r.b)("h3",{id:"92632-\u624b\u52a8\u7ba1\u7406"},"9.26.3.2 \u624b\u52a8\u7ba1\u7406"),Object(r.b)(i.a,{defaultValue:"one",values:[{label:"\u793a\u4f8b\u4e00",value:"one"},{label:"\u793a\u4f8b\u4e8c",value:"two"},{label:"\u793a\u4f8b\u4e09",value:"three"}],mdxType:"Tabs"},Object(r.b)(c.a,{value:"one",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u5f00\u542f\u4e8b\u52a1\nusing (var transaction = _testRepository.Database.BeginTransaction())\n{\n try\n {\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n _testRepository.SaveChanges();\n\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/visualstudio" });\n _testRepository.SaveChanges();\n\n var blogs = _testRepository.Entity\n .OrderBy(b => b.Url)\n .ToList();\n\n // \u63d0\u4ea4\u4e8b\u52a1\n transaction.Commit();\n }\n catch (Exception)\n {\n // \u56de\u6eda\u4e8b\u52a1\n transaction.RollBack();\n }\n}\n'))),Object(r.b)(c.a,{value:"two",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var options = new DbContextOptionsBuilder()\n .UseSqlServer(new SqlConnection(connectionString))\n .Options;\n\n// \u521b\u5efa\u8fde\u63a5\u5b57\u7b26\u4e32\nusing (var context1 = new HoaDbContext(options))\n{\n // \u5f00\u542f\u4e8b\u52a1\n using (var transaction = context1.Database.BeginTransaction())\n {\n try\n {\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n _testRepository.SaveChanges();\n\n context1.Blogs.Add(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n context1.SaveChanges();\n\n // \u521b\u5efa\u65b0\u7684\u8fde\u63a5\u5bf9\u8c61\n using (var context2 = new HoaDbContext(options))\n {\n // \u5171\u4eab\u8fde\u63a5\u4e8b\u52a1\n context2.Database.UseTransaction(transaction.GetDbTransaction());\n\n var blogs = context2.Blogs\n .OrderBy(b => b.Url)\n .ToList();\n }\n\n // \u63d0\u4ea4\u4e8b\u52a1\n transaction.Commit();\n }\n catch (Exception)\n {\n // \u56de\u6eda\u4e8b\u52a1\n transaction.RollBack();\n }\n }\n}\n'))),Object(r.b)(c.a,{value:"three",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'// \u5f00\u542f\u5206\u5e03\u5f0f\u4e8b\u52a1\nusing (var scope = new TransactionScope(\n TransactionScopeOption.Required,\n new TransactionOptions { IsolationLevel = IsolationLevel.ReadCommitted }))\n{\n using (var connection = new SqlConnection(connectionString))\n {\n connection.Open();\n\n try\n {\n // \u8fd9\u91cc\u662f Ado.NET \u64cd\u4f5c\n var command = connection.CreateCommand();\n command.CommandText = "DELETE FROM dbo.Blogs";\n command.ExecuteNonQuery();\n\n // \u521b\u5efaEF Core \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n var options = new DbContextOptionsBuilder()\n .UseSqlServer(connection)\n .Options;\n using (var context = new BloggingContext(options))\n {\n context.Blogs.Add(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n context.SaveChanges();\n }\n\n // \u6846\u67b6\u5c01\u88c5\u7684\u4ed3\u50a8\n _testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });\n _testRepository.SaveChanges();\n\n // \u63d0\u4ea4\u4e8b\u52a1\n scope.Complete();\n }\n catch (System.Exception)\n {\n // \u81ea\u52a8\u56de\u6eda\n }\n }\n}\n')))),Object(r.b)("h2",{id:"9264-\u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e"},"9.26.4 \u5de5\u4f5c\u5355\u5143\u7279\u6027\u8bf4\u660e"),Object(r.b)("h3",{id:"92641-unitofwork"},"9.26.4.1 ",Object(r.b)("inlineCode",{parentName:"h3"},"[UnitOfWork]")),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"[UnitOfWork]")," \u7279\u6027\u7528\u6765\u6807\u8bb0\u4e8b\u52a1\u4fe1\u606f\uff0c\u5982\u4f5c\u7528\u8303\u56f4\uff0c\u9694\u79bb\u7ea7\u522b\u7b49\u3002"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Enabled"),"\uff1a\u662f\u5426\u542f\u52a8\u5de5\u4f5c\u5355\u5143\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"true")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"ScopeOption"),"\uff1a\u5b9a\u4e49\u4e8b\u52a1\u8303\u56f4\u884c\u4e3a\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"TransactionScopeOption.Required")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"IsolationLevel"),"\uff1a\u8bbe\u7f6e\u4e8b\u52a1\u9694\u79bb\u7ea7\u522b\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"IsolationLevel.ReadCommitted"),";"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"AsyncFlowOption"),"\uff1a\u5141\u8bb8\u8de8\u7ebf\u7a0b\u8fde\u7eed\u4efb\u52a1\u7684\u4e8b\u52a1\u6d41\uff0c\u5982\u6709\u5f02\u6b65\u64cd\u4f5c\u9700\u5f00\u542f\u8be5\u9009\u9879\uff0c\u9ed8\u8ba4\u5f00\u542f")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u4e00\u65e6\u65b9\u6cd5\u8d34\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"[UnitOfWork(false)]")," \u7279\u6027\u540e\uff0c\u90a3\u4e48\u8be5\u65b9\u6cd5\u4e0d\u518d\u542f\u7528\u5de5\u4f5c\u5355\u5143\u6a21\u5f0f\uff0c\u4e5f\u5c31\u662f\u4e0d\u5305\u542b\u4e8b\u52a1\uff0c\u4e5f\u4e0d\u4f1a\u81ea\u52a8\u63d0\u4ea4\u6570\u636e\u5e93\u3002\u614e\u7528!"))),Object(r.b)("h2",{id:"9265-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.26.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(r.b)("hr",null),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(r.b)("inlineCode",{parentName:"p"},"\u4e8b\u52a1")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/ef/core/saving/transactions"}),"EF Core - \u4f7f\u7528\u4e8b\u52a1")," \u7ae0\u8282\u3002"))))}p.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return i}));var a=t(21),o=t(195);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(o.b)(t))return t;if(a)return n+t;const i=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+i:i}(n,e,t,a)}}function i(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return o}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return d})),t.d(n,"b",(function(){return m}));var a=t(0),o=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function i(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var s=o.a.createContext({}),b=function(e){var n=o.a.useContext(s),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},d=function(e){var n=b(e.components);return o.a.createElement(s.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return o.a.createElement(o.a.Fragment,{},n)}},p=o.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,i=e.parentName,s=l(e,["components","mdxType","originalType","parentName"]),d=b(t),p=a,m=d["".concat(i,".").concat(p)]||d[p]||u[p]||r;return t?o.a.createElement(m,c(c({ref:n},s),{},{components:t})):o.a.createElement(m,c({ref:n},s))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,i=new Array(r);i[0]=p;var c={};for(var l in n)hasOwnProperty.call(n,l)&&(c[l]=n[l]);c.originalType=e,c.mdxType="string"==typeof e?e:a,i[1]=c;for(var s=2;sn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,n,t){"use strict";function a(e){var n,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&v(e)}const g=e=>{v(e),null!=u&&O(u,e)},h=[];return o.a.createElement("div",null,o.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(i.a)("tabs",{"tabs--block":t},p)},d.map(({value:e,label:n})=>o.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(i.a)("tabs__item",l.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>h.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case b:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case s:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(h,e.target,e)},onFocus:()=>g(e),onClick:()=>{g(e)}},n))),n?Object(a.cloneElement)(f.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):o.a.createElement("div",{className:"margin-vert--md"},f.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==j}))))}},204:function(e,n,t){"use strict";var a=t(3),o=t(0),r=t.n(o);n.a=function({children:e,hidden:n,className:t}){return r.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file diff --git a/docs/docs/answer/index.html b/docs/docs/answer/index.html deleted file mode 100644 index 9c48d55b846..00000000000 --- a/docs/docs/answer/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - -31.1 常见问题 | Furion - - - - - - - - - - - -
-
Last updated on by 百小僧
- - - - - - - - - - - \ No newline at end of file diff --git a/docs/docs/appstartup/index.html b/docs/docs/appstartup/index.html index 89fd8017cc1..eb86bda7c1b 100644 --- a/docs/docs/appstartup/index.html +++ b/docs/docs/appstartup/index.html @@ -6,20 +6,20 @@ -3. 应用启动 | Furion - - - - - - - - - +3. 应用启动 | Furion + + + + + + + + +
-

3. 应用启动

3.1 Startup#

Startup 类是 ASP.NET Core 应用程序启动默认调用的类,该类是在 Program.cs 中配置:

Furion.Web.Entry\Program.cs
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
+

3. 应用启动

3.1 Startup#

Startup 类是 ASP.NET Core 应用程序启动默认调用的类,该类是在 Program.cs 中配置:

Furion.Web.Entry\Program.cs
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Furion.Web.Entry
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.Inject()
.UseStartup<Startup>();
});
}
}
}

3.1.1 Startup 两个重要方法#

Startup 默认有两个重要的方法:

  • ConfigureServices:配置应用所需服务,在该方法中可以添加应用所需要的功能或服务
  • Configure:配置应用请求处理管道

默认代码如下:

Furion.Web.Entry\Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Furion.Web.Entry
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}
@@ -47,14 +47,14 @@
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.Inject()
.UseStartup<Startup>();
});
}
}
}
Furion.Web.Entry\Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Furion.Web.Entry
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
}
}
}
Startup.cs 代码迁移

只需要将 ConfigureServicesConfigure 方法代码迁移到 Furion.Web.Core.Startup.cs 中即可,而 Startup.cs 中两个方法留空即可。

非常简单吧。我们后续创建任何 MVCRazorPagesBlazor 项目只需要添加 Furion.Web.Core 引用和调用 Inject() 即可。

3.6 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/auth-control/index.html b/docs/docs/auth-control/index.html index 2adc1694189..0e56905f401 100644 --- a/docs/docs/auth-control/index.html +++ b/docs/docs/auth-control/index.html @@ -6,20 +6,20 @@ -15. 安全鉴权 | Furion - - - - - - - - - +15. 安全鉴权 | Furion + + + + + + + + +
-

15. 安全鉴权

15.1 什么是鉴权#

鉴权实际上就是一种身份认证

由用户提供凭据,然后将其与存储在操作系统、数据库、应用或资源中的凭据进行比较。 在授权过程中,如果凭据匹配,则用户身份验证成功,可执行已向其授权的操作。 授权指判断允许用户执行的操作的过程。 +

15. 安全鉴权

15.1 什么是鉴权#

鉴权实际上就是一种身份认证

由用户提供凭据,然后将其与存储在操作系统、数据库、应用或资源中的凭据进行比较。 在授权过程中,如果凭据匹配,则用户身份验证成功,可执行已向其授权的操作。 授权指判断允许用户执行的操作的过程。 也可以将身份验证理解为进入空间(例如服务器、数据库、应用或资源)的一种方式,而授权是用户可以对该空间(服务器、数据库或应用)内的哪些对象执行哪些操作。

15.1.1 常见的鉴权方式#

  • HTTP Basic Authentication

这是 HTTP 协议实现的基本认证方式,我们在浏览网页时,从浏览器正上方弹出的对话框要求我们输入账号密码,正是使用了这种认证方式

  • Session + Cookie

利用服务器端的 session(会话)和浏览器端的 cookie 来实现前后端的认证,由于 http 请求时是无状态的,服务器正常情况下是不知道当前请求之前有没有来过,这个时候我们如果要记录状态,就需要在服务器端创建一个会话(seesion),将同一个客户端的请求都维护在各自得会会话中,每当请求到达服务器端的时候,先去查一下该客户端有没有在服务器端创建 seesion,如果有则已经认证成功了,否则就没有认证。

  • Token

客户端在首次登陆以后,服务端再次接收 HTTP 请求的时候,就只认 Token 了,请求只要每次把 Token 带上就行了,服务器端会拦截所有的请求,然后校验 Token 的合法性,合法就放行,不合法就返回 401(鉴权失败)

Token验证比较灵活,适用于大部分场景。常用的 Token 鉴权方式的解决方案是 JWTJWT 是通过对带有相关用户信息的进行加密,加密的方式比较灵活,可以根据需求具体设计。

  • OAuth

OAuth(开放授权)是一个开放标准,允许用户授权第三方网站访问他们存储在另外的服务提供者上的信息,而不需要将用户名和密码提供给第三方网站或分享他们数据的所有内容,为了保护用户数据的安全和隐私,第三方网站访问用户数据前都需要显式的向用户征求授权。我们常见的提供 OAuth 认证服务的厂商有支付宝,QQ,微信。

OAuth 协议又有 1.0 和 2.0 两个版本。相比较 1.0 版,2.0 版整个授权验证流程更简单更安全,也是目前最主要的用户身份验证和授权方式。

15.2 如何使用#

配置之前

在添加授权服务之前,请先确保 Startup.csConfigure 是否添加了以下两个中间件:

app.UseAuthentication();
app.UseAuthorization();

15.2.1 添加 Cookie 授权#

// Cookies单独授权
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, b =>
{
b.LoginPath = "/Home/Login";
});

15.2.2 添加 Jwt 授权#

services.AddJwt();
特别注意

JWT 鉴权并未包含在 Furion 框架中,需要安装 Furion 框架提供的 Furion.Extras.Authentication.JwtBearer 拓展包。

  • 自定义 Jwt 配置(默认无需配置)
{
"JWTSettings": {
"ValidateIssuerSigningKey": true, // 是否验证密钥,bool 类型,默认true
"IssuerSigningKey": "你的密钥", // 密钥,string 类型,必须是复杂密钥,长度大于16
"ValidateIssuer": true, // 是否验证签发方,bool 类型,默认true
"ValidIssuer": "签发方", // 签发方,string 类型
"ValidateAudience": true, // 是否验证签收方,bool 类型,默认true
"ValidAudience": "签收方", // 签收方,string 类型
"ValidateLifetime": true, // 是否验证过期时间,bool 类型,默认true,建议true
"ExpiredTime": 20, // 过期时间,long 类型,单位分钟,默认20分钟
"ClockSkew": 5 // 过期时间容错值,long 类型,单位秒,默认 5秒
}
}
  • 生成 Token
// 生成 token
var accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>()
{
{ "UserId", user.Id }, // 存储Id
{ "Account",user.Account }, // 存储用户名
});

15.2.3 混合授权#

// JWT 和 Cookies 同时授权
services.AddJwt(options =>
{
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, b =>
{
b.LoginPath = "/Home/Login";
});

15.3 高级自定义授权#

Furion 框架提供了非常灵活的高级策略鉴权和授权方式,通过该策略授权方式可以实现任何自定义授权。

15.3.1 AppAuthorizeHandler#

Furion 框架提供了 AppAuthorizeHandler 策略授权处理程序提供基类,只需要创建自己的 Handler 继承它即可。如:JwtHandler

using Furion.Authorization;
using Furion.Core;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.IdentityModel.JsonWebTokens;
namespace Furion.Web.Core
{
/// <summary>
/// JWT 授权自定义处理程序
/// </summary>
public class JwtHandler : AppAuthorizeHandler
{
/// <summary>
/// 请求管道
/// </summary>
/// <param name="context"></param>
/// <param name="httpContext"></param>
/// <returns></returns>
public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)
{
// 此处已经自动验证 Jwt token的有效性了,无需手动验证
// 检查权限,如果方法时异步的就不用 Task.FromResult 包裹,直接使用 async/await 即可
return Task.FromResult(CheckAuthorzie(httpContext));
}
@@ -29,14 +29,14 @@
// 设置请求报文头
httpContextAccessor.HttpContext.Response.Headers["access-token"] = accessToken;
httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;

用户登录成功之后把 accessTokenrefreshToken 一起返回给客户端存储起来。

15.5.2 后端授权 Handler 部分#

using Furion.Authorization;
using Furion.Core;
using Furion.DataEncryption;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
namespace Furion.Web.Core
{
/// <summary>
/// JWT 授权自定义处理程序
/// </summary>
public class JwtHandler : AppAuthorizeHandler
{
/// <summary>
/// 重写 Handler 添加自动刷新收取逻辑
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override async Task HandleAsync(AuthorizationHandlerContext context)
{
// 自动刷新 token
if (JWTEncryption.AutoRefreshToken(context, context.GetCurrentHttpContext()))
{
await AuthorizeHandleAsync(context);
}
}
/// <summary>
/// 验证管道,也就是验证核心代码
/// </summary>
/// <param name="context"></param>
/// <param name="httpContext"></param>
/// <returns></returns>
public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)
{
// 检查权限,如果方法时异步的就不用 Task.FromResult 包裹,直接使用 async/await 即可
return Task.FromResult(true);
}
}
}

15.5.3 客户端部分#

客户端每次请求需将 accessTokenrefreshToken 放到请求报文头中传送到服务端,格式为:

Authorization: Bearer 你的token
X-Authorization: Bearer 你的刷新token
特别注意

在正常开发中,refreshToken 无需每次请求携带,而是 accessToken 即将过期之后携带即可。可以在客户端自行判断 accessToken 是否即将过期。

如果 Token 过期,那么 Furion 将自动根据有效期内的 refreshToken 自动生成新的 AceessToken,并在 响应报文 中返回,如:

access-token: 新的token
x-access-token: 新的刷新token
存储新的 Token

前端需要获取 响应报文 新的 token 和刷新 token 替换之前在客户处存储旧的 token 和刷新 token。

15.6 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 鉴权授权 知识可查阅 ASP.NET Core - 安全和标识 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/author/index.html b/docs/docs/author/index.html index d85f5479897..a301136da07 100644 --- a/docs/docs/author/index.html +++ b/docs/docs/author/index.html @@ -6,28 +6,28 @@ -1.2 关于作者 | Furion - - - - - - - - - +1.2 关于作者 | Furion + + + + + + + + +
-

1.2 关于作者

互联网账号#

  • 百小僧
  • Monk/MonkSoul

技术能力#

自 2008 年 接触 IT 这个行业也有十余年了,在 后端(.NET/.NET Core/Java/PHP)、移动端(Xamarin/小程序/Java/Objective-C)、桌面端(WinForm/WPF/Electron)、前端(Node/React/Vue/Angular)、设计(Photoshop、CDR、AI)等主流领域略知一二。

同时在技术培训领域也多有涉足。MIP(dotNET China Most Influential Professionals) 专家,同时多次获得开源中国 Gitee 授予 GVP 证书。

兴趣爱好#

对新技术颇感兴趣,喜欢开源事业,喜欢分享技术。

喜欢看博客园、看开源中国、看 Github/Gitee、看抖音、看动漫、看美剧。

个人主页#

https://gitee.com/monksoul

https://github.com/monksoul

Last updated on by 百小僧
- - - - - - - - - +

1.2 关于作者

互联网账号#

  • 百小僧
  • Monk/MonkSoul

技术能力#

自 2008 年 接触 IT 这个行业也有十余年了,在 后端(.NET/.NET Core/Java/PHP)、移动端(Xamarin/小程序/Java/Objective-C)、桌面端(WinForm/WPF/Electron)、前端(Node/React/Vue/Angular)、设计(Photoshop、CDR、AI)等主流领域略知一二。

同时在技术培训领域也多有涉足。MIP(dotNET China Most Influential Professionals) 专家,同时多次获得开源中国 Gitee 授予 GVP 证书。

兴趣爱好#

对新技术颇感兴趣,喜欢开源事业,喜欢分享技术。

喜欢看博客园、看开源中国、看 Github/Gitee、看抖音、看动漫、看美剧。

个人主页#

https://gitee.com/monksoul

https://github.com/monksoul

Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/benchmark/index.html b/docs/docs/benchmark/index.html index 61ae4699e6f..da586903614 100644 --- a/docs/docs/benchmark/index.html +++ b/docs/docs/benchmark/index.html @@ -6,28 +6,34 @@ -29.3 基准测试 | Furion - - - - - - - - - +29.3 基准测试 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +

29.3 基准测试

29.3.1 基准测试#

基准测试(benchmarking)是一种测量和评估软件性能指标的活动。你可以在某个时候通过基准测试建立一个已知的性能水平(称为基准线),当系统的软硬件环境发生变化之后再进行一次基准测试以确定那些变化对性能的影响。这是基准测试最常见的用途。其他用途包括测定某种负载水平下的性能极限、管理系统或环境的变化、发现可能导致性能问题的条件,等等。

29.3.2 基准测试特质及意义#

29.3.2.1 特质#

  • 可重复性:可进行重复性的测试,这样做有利于比较每次的测试结果,得到性能结果的长期变化趋势,为系统调优和上线前的容量规划做参考。
  • 可观测性:通过全方位的监控(包括测试开始到结束,执行机、服务器、数据库),及时了解和分析测试过程发生了什么。
  • 可展示性:相关人员可以直观明了的了解测试结果(web 界面、仪表盘、折线图树状图等形式)。
  • 真实性:测试的结果反映了客户体验到的真实的情况(真实准确的业务场景+与生产一致的配置+合理正确的测试方法)。
  • 可执行性:相关人员可以快速的进行测试验证修改调优(可定位可分析)。

29.3.2.2 意义#

  • 为容量规划确定系统和应用程序的极限;
  • 为配置测试的参数和配置选项提供参考依据;
  • 为验收测试确定系统是否具备自己所宣称的能力;
  • 为性能基线的建立提供长期的数据统计来源以及比较基准;

29.3.3 BenchmarkDotNet#

BenchmarkDotNet.NET 平台提供的基准测试工具,BenchmarkDotNet 可帮助您将方法转换为基准,跟踪其性能,并共享可重复的测量实验。BenchmarkDotNet 可保护您免受流行的基准测试错误,并在基准设计或获得的测量中出现问题时警告您。结果以用户友好的形式呈现,突出显示了有关实验的所有重要事实。

29.3.3.1 如何使用#

创建一个 控制台 应用程序,并通过 Nuget 按照 BenchmarkDotNet 拓展包。编写测试:

using System;
using System.Security.Cryptography;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
+
namespace MyBenchmarks
{
public class Md5VsSha256
{
private const int N = 10000;
private readonly byte[] data;
+
private readonly SHA256 sha256 = SHA256.Create();
private readonly MD5 md5 = MD5.Create();
+
public Md5VsSha256()
{
data = new byte[N];
new Random(42).NextBytes(data);
}
+
[Benchmark]
public byte[] Sha256() => sha256.ComputeHash(data);
+
[Benchmark]
public byte[] Md5() => md5.ComputeHash(data);
}
+
public class Program
{
public static void Main(string[] args)
{
var summary = BenchmarkRunner.Run<Md5VsSha256>();
}
}
}

29.3.3.2 查看结果#

运行控制器程序,将得到以下结果

BenchmarkDotNet=v0.12.0, OS=Windows 10.0.17763.805 (1809/October2018Update/Redstone5)
Intel Core i7-7700K CPU 4.20GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores
[Host] : .NET Framework 4.7.2 (4.7.3468.0), X64 RyuJIT
Net472 : .NET Framework 4.7.2 (4.7.3468.0), X64 RyuJIT
NetCoreApp30 : .NET Core 3.0.0 (CoreCLR 4.700.19.46205, CoreFX 4.700.19.46214), X64 RyuJIT
CoreRt30 : .NET CoreRT 1.0.28231.02 @Commit: 741d61493c560ba96e8151f9e56876d4d3828489, X64 AOT
Mono : Mono 6.4.0 (Visual Studio), X64
MethodRuntimeNMeanErrorStdDevRatio
Sha256.NET 4.7.210007.735 us0.1913 us0.4034 us1.00
Sha256.NET Core 3.010003.989 us0.0796 us0.0745 us0.50
Sha256CoreRt 3.010004.091 us0.0811 us0.1562 us0.53
Sha256Mono100013.117 us0.2485 us0.5019 us1.70
Md5.NET 4.7.210002.872 us0.0552 us0.0737 us1.00
Md5.NET Core 3.010001.848 us0.0348 us0.0326 us0.64
Md5CoreRt 3.010001.817 us0.0359 us0.0427 us0.63
Md5Mono10003.574 us0.0678 us0.0753 us1.24
Sha256.NET 4.7.21000074.509 us1.5787 us4.6052 us1.00
Sha256.NET Core 3.01000036.049 us0.7151 us1.0025 us0.49
Sha256CoreRt 3.01000036.253 us0.7076 us0.7571 us0.49
Sha256Mono10000116.350 us2.2555 us3.0110 us1.58
Md5.NET 4.7.21000017.308 us0.3361 us0.4250 us1.00
Md5.NET Core 3.01000015.726 us0.2064 us0.1930 us0.90
Md5CoreRt 3.01000015.627 us0.2631 us0.2461 us0.89
Md5Mono1000030.205 us0.5868 us0.6522 us1.74

29.3.3.3 导出报表#

也可以导出各种图表

29.3.4 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 BenchmarkDotNet 知识可查阅 BenchmarkDotNet 官网

Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/cache/index.html b/docs/docs/cache/index.html index cb05bd7052a..d14622cf84f 100644 --- a/docs/docs/cache/index.html +++ b/docs/docs/cache/index.html @@ -6,20 +6,20 @@ -14. 分布式缓存 | Furion - - - - - - - - - +14. 分布式缓存 | Furion + + + + + + + + +
-

14. 分布式缓存

14.1 什么是缓存#

缓存可以减少生成内容所需的工作,从而显著提高应用程序的性能和可伸缩性。 缓存最适用于不经常更改的数据,因为生成成本很高。 通过缓存,可以比从数据源返回的数据的副本速度快得多。 应该对应用进行编写和测试,使其永不依赖于缓存的数据。

14.2 缓存类型#

  • 内存缓存:顾名思义,就是缓存在应用部署所在服务器的内存中
  • 分布式缓存:分布式缓存是由多个应用服务器共享的缓存
  • 响应缓存:缓存服务器端 Not Modified 的数据

14.3 内存缓存使用#

内存缓存是最常用的缓存方式,具有存取快,效率高特点。

内存缓存通过注入 IMemoryCache 方式注入即可。

备注

Furion 框架中,内存缓存服务已经默认注册,无需手动注册。

14.3.1 基本使用#

如,缓存当前时间:

using Furion.DynamicApiController;
using Microsoft.Extensions.Caching.Memory;
using System;
+

14. 分布式缓存

14.1 什么是缓存#

缓存可以减少生成内容所需的工作,从而显著提高应用程序的性能和可伸缩性。 缓存最适用于不经常更改的数据,因为生成成本很高。 通过缓存,可以比从数据源返回的数据的副本速度快得多。 应该对应用进行编写和测试,使其永不依赖于缓存的数据。

14.2 缓存类型#

  • 内存缓存:顾名思义,就是缓存在应用部署所在服务器的内存中
  • 分布式缓存:分布式缓存是由多个应用服务器共享的缓存
  • 响应缓存:缓存服务器端 Not Modified 的数据

14.3 内存缓存使用#

内存缓存是最常用的缓存方式,具有存取快,效率高特点。

内存缓存通过注入 IMemoryCache 方式注入即可。

备注

Furion 框架中,内存缓存服务已经默认注册,无需手动注册。

14.3.1 基本使用#

如,缓存当前时间:

using Furion.DynamicApiController;
using Microsoft.Extensions.Caching.Memory;
using System;
namespace Furion.Application
{
public class CacheServices : IDynamicApiController
{
private const string _timeCacheKey = "cache_time";
private readonly IMemoryCache _memoryCache;
public CacheServices(IMemoryCache memoryCache)
{
_memoryCache = memoryCache;
}
@@ -41,14 +41,14 @@
// 设置分布式缓存
var options = new DistributedCacheEntryOptions()
.SetSlidingExpiration(TimeSpan.FromSeconds(20));
await _cache.SetAsync("cachedTimeUTC", encodedCurrentTimeUTC, options);
return RedirectToPage();
}
}

14.6 分布式缓存建议#

确定 IDistributedCache 最适合你的应用的实现时,请考虑以下事项:

  • 现有基础结构
  • 性能要求
  • 成本
  • 团队经验

缓存解决方案通常依赖于内存中的存储以快速检索缓存的数据,但是,内存是有限的资源,并且很昂贵。 仅将常用数据存储在缓存中。

通常,Redis 缓存提供比 SQL Server 缓存更高的吞吐量和更低的延迟。 但是,通常需要进行基准测试来确定缓存策略的性能特征。

SQL Server 用作分布式缓存后备存储时,对缓存使用同一数据库,并且应用的普通数据存储和检索会对这两种情况的性能产生负面影响。 建议使用分布式缓存后备存储的专用 SQL Server 实例。

14.7 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 分布式缓存 知识可查阅 ASP.NET Core - 分布式缓存 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/configuration/index.html b/docs/docs/configuration/index.html index 211f7081ae4..dcb3ccdccb3 100644 --- a/docs/docs/configuration/index.html +++ b/docs/docs/configuration/index.html @@ -6,31 +6,31 @@ -4.1 配置 | Furion - - - - - - - - - +4.1 配置 | Furion + + + + + + + + +
-

4.1 配置

温馨提示

推荐使用 《4.2 选项》代替本章节功能。(为什么)?

自定义配置特别注意

如:xxxx.json,必须在 VS Studio 中右键属性设置 复制输出目录为如果较新则复制,生成操作为:内容

4.1.1 什么是配置#

简单来说,配置将系统应用可动态调配的选项放在统一地方管理,通过不同的配置让系统做出动态调整。

ASP.NET Core 应用程序启动时默认加载 启动项目 下的 appsettings.json 作为应用配置。同时还支持不同的运行环境加载对应的配置文件,如:

  • Development:加载 appsettings.Development.json
  • Staging:加载 appsettings.Staging.json
  • {Environment}appsettings.{Environment}.json

4.1.2 配置的使用#

假设我们需要在系统运行时获取系统名称、版本号及版权信息,这些信息可能随时变化而且需要在多个地方使用。这时就需要将这些信息配置起来。具体步骤如下:

4.1.2.1 配置 appsettings.json 信息#

{
"AppInfo": {
"Name": "Furion",
"Version": "1.0.0",
"Company": "Baiqian"
}
}
特别注意

appsettings.json 复制输出目录为如果较新则复制,生成操作为:内容

4.1.2.2 读取 appsettings.json 信息#

Furion 框架中,提供了两种读取方式:

  • 依赖注入 IConfiguration 对象读取
  • 通过 App.Configuration[jsonKey] 读取
using Microsoft.AspNetCore.Mvc;
+

4.1 配置

温馨提示

推荐使用 《4.2 选项》代替本章节功能。(为什么)?

自定义配置特别注意

如:xxxx.json,必须在 VS Studio 中右键属性设置 复制输出目录为如果较新则复制,生成操作为:内容

4.1.1 什么是配置#

简单来说,配置将系统应用可动态调配的选项放在统一地方管理,通过不同的配置让系统做出动态调整。

ASP.NET Core 应用程序启动时默认加载 启动项目 下的 appsettings.json 作为应用配置。同时还支持不同的运行环境加载对应的配置文件,如:

  • Development:加载 appsettings.Development.json
  • Staging:加载 appsettings.Staging.json
  • {Environment}appsettings.{Environment}.json

4.1.2 配置的使用#

假设我们需要在系统运行时获取系统名称、版本号及版权信息,这些信息可能随时变化而且需要在多个地方使用。这时就需要将这些信息配置起来。具体步骤如下:

4.1.2.1 配置 appsettings.json 信息#

{
"AppInfo": {
"Name": "Furion",
"Version": "1.0.0",
"Company": "Baiqian"
}
}
特别注意

appsettings.json 复制输出目录为如果较新则复制,生成操作为:内容

4.1.2.2 读取 appsettings.json 信息#

Furion 框架中,提供了两种读取方式:

  • 依赖注入 IConfiguration 对象读取
  • 通过 App.Configuration[jsonKey] 读取
using Microsoft.AspNetCore.Mvc;
namespace Furion.Web.Entry.Controllers
{
[Route("api/[controller]")]
public class DefaultController : ControllerBase
{
[HttpGet]
public string Get()
{
return $@"名称:{App.Configuration["AppInfo:Name"]},
版本:{App.Configuration["AppInfo:Version"]},
公司:{App.Configuration["AppInfo:Company"]}";
}
}
}
依赖注入的方式

通过依赖注入注入实例有几种方式:

  • 构造函数注入方式
private readonly IConfiguration _configuration;
public DefaultController(IConfiguration configuration)
{
_configuration = configuration;
}
  • 参数注入方式 [FromServices]
public string Get([FromServices] IConfiguration configuration)
{
}
  • 属性注入方式
public IConfiguration Configuration { get; set; }

想了解更多关于《ASP.NET Core - 依赖注入》 知识

4.1.2.3 如何选择读取方式#

  • 在可依赖注入类中,依赖注入 IConfiguration 读取
  • 在静态类/非依赖注入类中,选择 App.Configuration[jsonKey] 读取

4.1.3 路径符 查找节点#

ASP.NET Core 中,配置采用 : 分隔符来读取分层配置数据。如上述例子中的 AppInfo:Name。如有更多层级数据则只需要通过 : 进入下一层节点即可。

假设我们有以下配置信息:

{
"AppInfo": {
"Name": "Furion",
"Version": "1.0.0",
"Company": {
"Name": "Baiqian",
"Address": {
"City": "中国",
"Province": "广东省",
"Detail": "中山市东区紫马公园西门"
}
}
}
}
var companyName = App.Configuration["AppInfo:Name"]; // => Furion

4.1.4 自定义配置文件#

大多情况下,我们的配置只需要在 appsettings.json 中配置即可,但一些特殊情况下,我们希望某些组件或功能拥有独立的配置,这个时候就需要用到自定义配置,Furion 目前支持 .json.xml 两种方式配置,如:

Furion.Web.Entry/emailsetting.json
{
"outlook": {
"smtp": {
"server": "smtp.office365.com",
"port": "587",
"ssl": "STARTTLS"
},
"pop": {
"server": "outlook.office365.com",
"port": "995",
"ssl": "TLS"
}
}
}
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<MyKey>MyXMLFile Value</MyKey>
<Position>
<Title>Title from MyXMLFile</Title>
<Name>Name from MyXMLFile</Name>
</Position>
<Logging>
<LogLevel>
<Default>Information</Default>
<Microsoft>Warning</Microsoft>
</LogLevel>
</Logging>
</configuration>
xml 配置事项

如果采用 xml 配置,那么文件名必须以 .config.xml 结尾(不区分大小写)。

特别说明

Furion 框架会在启动时自动扫描每一个项目层根目录下的 *.json*.xml 文件加入配置中,所以无需手工配置。

新增 *.json*.xml 文件的属性复制到输出目录设置为始终复制或较新复制,否则不会载入。另外配置文件不能出现重名,也就是保证整个项目中配置文件名字唯一。

同时 Furion 提供了非常灵活的方式支持自定义配置文件读取,如:

4.1.4.1 读取 emailsetting.json 配置#

读取自定义配置文件和读取 appsettings.json 一致,系统会自动从多个配置文件中读取输入,如:

var smtpServer = App.Configuration["outlook:smtp:server"]; // => smtp.office365.com

4.1.4.2 排除特定配置文件#

有些时候,我们不需要 .json.xml 自动载入配置中,我们只需要在启动层 appsettings.json 中添加 IgnoreConfigurationFiles 节点即可:

{
"IgnoreConfigurationFiles": ["runtime.json"]
}

4.1.5 不同环境读取#

在实际应用开发中,我们可能会根据不同的环境加载不同的配置文件,如 数据库连接字符串

这时我们只需要遵循特定命名规范 {name}.{Environment}.json 即可。如:

  • appsettings.Development.json
  • appsettings.Staging.json
  • appsettings.Production.json
  • emailsetting.Development.json
  • emailsetting.Staging.json
  • emailsetting.Production.json

这时,ASP.NET Core 会在应用启动时自动加载不同环境的配置文件。

4.1.6 配置更改通知(热更新#

.NET Core 应用程序中,配置支持更改通知,也就是热更新操作。一旦监听到 appsetting.json 或自定义配置文件发生变动,就会触发 OnChange 方法。代码如下:

var appInfoConfiguration = App.Configuration["AppInfo"];
ChangeToken.OnChange(() => appInfoConfiguration.GetReloadToken(), () =>
{
var name = appInfoConfiguration["Name"]; // 实时的最新值
var version = appInfoConfiguration["Version"]; // 实时的最新值
});

4.1.7 手动添加配置文件#

有些时候,我们的配置文件没有放在项目的根目录下,这时候我们需要手动载入自定义配置文件,只需要在 Program.cs 中加载即可:

public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureAppConfiguration((hostingContext, config) =>
{
// 加载自定义配置
config.AddJsonFile("MyConfig.json", optional: true, reloadOnChange: true);
})
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
补充说明
  • 获取项目目录:AppContext.BaseDirectory
  • 获取网站根目录:Directory.GetCurrentDirectory()

4.1.8 配置的优缺点#

  • 优点

    • 能够在系统运行时快速读取
    • 无需额外配置
  • 缺点

    • 存在重复读取
    • 通过硬编码字符串读取,容易出错
    • 不能设置默认值
    • 不能在运行环境中动态配置
    • 不能验证配置有效性
    • 不支持更改通知

4.1.9 配置使用场景#

如果只需要一次性读取配置信息,则使用配置,否则应该使用 《4.2 选项》代替。

4.1.10 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 配置 知识可查阅 ASP.NET Core - 配置 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/contribute/index.html b/docs/docs/contribute/index.html index 0d371e55440..95d57b8951f 100644 --- a/docs/docs/contribute/index.html +++ b/docs/docs/contribute/index.html @@ -6,28 +6,28 @@ -30. 贡献指南 | Furion - - - - - - - - - +30. 贡献指南 | Furion + + + + + + + + +
-

30. 贡献指南

提交错误报告#

如果您在 XXX 中发现了一个不存在安全问题的漏洞,请在 XXX 仓库中的 Issues 中搜索,以防该漏洞已被提交,如果找不到漏洞可以创建一个新的 Issues,如果发现了一个安全问题请不要将其公开,请参阅安全问题处理方式,提交错误报告时应该详尽。

安全问题处理#

本项目中对安全问题处理的形式,项目核心人员确认编辑,该部分内容可以根据项目情况添加。

解决现有问题#

通过查看仓库的 Issues 列表何以发现需要处理的问题信息,可以尝试解决其中的某个问题。

如何提出新功能#

提出新功能有些项目使用 Issues 的 Feature 标签进行管理,有些则通过邮件的形式统一收集,在收集后项目内人员会进行确认开发,一般的将确认开发的功能会放入下一个版本的任务列表。

如何设置开发环境并运行测试#

如果是通过 Git 管理可以从 git clone xxx 开始编写,将开发环境的配置信息,IDE 的设置等信息配置文档编写。

变更日志填写规则#

  1. 使用现在时态
  2. 第一行字数限制
  3. 提交内容的约束

编码约定#

  • 项目内编码约定文件:.editorconfig

分支处理约定#

  • 分支处理形式,如 gitFlow

合并 PR 的形式#

在什么情况下可以合并到 master/main:

  1. 通过 CI
  2. 两个及以上的维护者通过.
  3. 最新版本
Last updated on by 百小僧
- - - - - - - - - +

30. 贡献指南

提交错误报告#

如果您在 XXX 中发现了一个不存在安全问题的漏洞,请在 XXX 仓库中的 Issues 中搜索,以防该漏洞已被提交,如果找不到漏洞可以创建一个新的 Issues,如果发现了一个安全问题请不要将其公开,请参阅安全问题处理方式,提交错误报告时应该详尽。

安全问题处理#

本项目中对安全问题处理的形式,项目核心人员确认编辑,该部分内容可以根据项目情况添加。

解决现有问题#

通过查看仓库的 Issues 列表何以发现需要处理的问题信息,可以尝试解决其中的某个问题。

如何提出新功能#

提出新功能有些项目使用 Issues 的 Feature 标签进行管理,有些则通过邮件的形式统一收集,在收集后项目内人员会进行确认开发,一般的将确认开发的功能会放入下一个版本的任务列表。

如何设置开发环境并运行测试#

如果是通过 Git 管理可以从 git clone xxx 开始编写,将开发环境的配置信息,IDE 的设置等信息配置文档编写。

变更日志填写规则#

  1. 使用现在时态
  2. 第一行字数限制
  3. 提交内容的约束

编码约定#

  • 项目内编码约定文件:.editorconfig

分支处理约定#

  • 分支处理形式,如 gitFlow

合并 PR 的形式#

在什么情况下可以合并到 master/main:

  1. 通过 CI
  2. 两个及以上的维护者通过.
  3. 最新版本
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/cooperate/index.html b/docs/docs/cooperate/index.html index 4e191dd4582..b69a213ab34 100644 --- a/docs/docs/cooperate/index.html +++ b/docs/docs/cooperate/index.html @@ -6,28 +6,28 @@ -1.4 项目合作 | Furion - - - - - - - - - +1.4 项目合作 | Furion + + + + + + + + +
-

1.4 项目合作

本人提供以下技术服务项目:

  • 技术指导、技术培训:(.NET、Docker、Devops、K8S、Nginx)
  • 项目外包服务开发:(网站、小程序、App、桌面应用程序、管理系统)
  • 产品合作服务开发:(共同开发,收益后分成)
  • Furion 文档广告投放:(800 元/月,覆盖所有文档页面)

如有项目合作意愿可发送邮件至:monksoul@outlook.com 电子邮箱。

- - - - - - - - - +

1.4 项目合作

本人提供以下技术服务项目:

  • 技术指导、技术培训:(.NET、Docker、Devops、K8S、Nginx)
  • 项目外包服务开发:(网站、小程序、App、桌面应用程序、管理系统)
  • 产品合作服务开发:(共同开发,收益后分成)
  • Furion 文档广告投放:(800 元/月,覆盖所有文档页面)

如有项目合作意愿可发送邮件至:monksoul@outlook.com 电子邮箱。

Last updated on by Monk
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/cors/index.html b/docs/docs/cors/index.html index 942c8d5b211..bf89434652c 100644 --- a/docs/docs/cors/index.html +++ b/docs/docs/cors/index.html @@ -6,33 +6,33 @@ -16. CORS 跨域 | Furion - - - - - - - - - +16. CORS 跨域 | Furion + + + + + + + + +
-

16. CORS 跨域

16.1 什么是跨域#

简单来说,当一个请求 url 的协议、域名、端口三者之间任意一个与当前页面 url 不同即为跨域。那为什么会出现跨域问题呢?

出于浏览器的同源策略限制。同源策略(Sameoriginpolicy)是一种约定,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,则浏览器的正常功能可能都会受到影响。可以说 Web 是构建在同源策略基础之上的,浏览器只是针对同源策略的一种实现。同源策略会阻止一个域的 javascript 脚本和另外一个域的内容进行交互。所谓同源(即指在同一个域)就是两个页面具有相同的协议(protocol),主机(host)和端口号(port)

16.2 有跨域行为示例#

当前页面 url被请求页面 url是否跨域原因
http://www.furion.pro/http://www.furion.pro/index.html同源(协议、域名、端口号相同)
http://www.furion.pro/https://www.furion.pro/index.html跨域协议不同(http/https)
http://www.furion.pro/http://www.baidu.com/跨域主域名不同(chinadot/baidu)
http://www.furion.pro/http://blog.furion.pro/跨域子域名不同(www/blog)
http://www.furion.pro:8080/http://www.furion.pro:7001/跨域端口号不同(8080/7001)

16.3 什么是 CORS#

跨源资源共享 (CORS) :

  • 是一种 W3C 标准,可让服务器放宽相同的源策略。
  • 不是一项安全功能,CORS 放宽 securityAPI 不能通过允许 CORS 来更安全。 有关详细信息,请参阅 CORS 工作原理
  • 允许服务器明确允许一些跨源请求,同时拒绝其他请求。
  • 比早期的技术(如 JSONP)更安全且更灵活。

16.4 如何使用#

16.4.1 添加 CORS 服务#

启用跨域 Cors 支持首先添加 CorsAccessor 服务,如:

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+

16. CORS 跨域

16.1 什么是跨域#

简单来说,当一个请求 url 的协议、域名、端口三者之间任意一个与当前页面 url 不同即为跨域。那为什么会出现跨域问题呢?

出于浏览器的同源策略限制。同源策略(Sameoriginpolicy)是一种约定,它是浏览器最核心也最基本的安全功能,如果缺少了同源策略,则浏览器的正常功能可能都会受到影响。可以说 Web 是构建在同源策略基础之上的,浏览器只是针对同源策略的一种实现。同源策略会阻止一个域的 javascript 脚本和另外一个域的内容进行交互。所谓同源(即指在同一个域)就是两个页面具有相同的协议(protocol),主机(host)和端口号(port)

16.2 有跨域行为示例#

当前页面 url被请求页面 url是否跨域原因
http://www.furion.pro/http://www.furion.pro/index.html同源(协议、域名、端口号相同)
http://www.furion.pro/https://www.furion.pro/index.html跨域协议不同(http/https)
http://www.furion.pro/http://www.baidu.com/跨域主域名不同(chinadot/baidu)
http://www.furion.pro/http://blog.furion.pro/跨域子域名不同(www/blog)
http://www.furion.pro:8080/http://www.furion.pro:7001/跨域端口号不同(8080/7001)

16.3 什么是 CORS#

跨源资源共享 (CORS) :

  • 是一种 W3C 标准,可让服务器放宽相同的源策略。
  • 不是一项安全功能,CORS 放宽 securityAPI 不能通过允许 CORS 来更安全。 有关详细信息,请参阅 CORS 工作原理
  • 允许服务器明确允许一些跨源请求,同时拒绝其他请求。
  • 比早期的技术(如 JSONP)更安全且更灵活。

16.4 如何使用#

16.4.1 添加 CORS 服务#

启用跨域 Cors 支持首先添加 CorsAccessor 服务,如:

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace Furion.Web.Core
{
[AppStartup(700)]
public sealed class FurWebCoreStartup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddCorsAccessor();
// ...
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
//...
app.UseCorsAccessor();
// ...
}
}
}
特别注意

services.AddCorsAccessor(); 需在 services.AddControllers() 之前注册。

app.UseCorsAccessor(); 需在 app.UseRouting();app.UseAuthentication(); 之间注册。

16.4.2 配置允许跨域域名#

小提醒

默认情况下,Furion 允许所有域名来源访问,也就是无需配置任何来源域名,另外前端也需要设置请求参数:withCredentials:false

如果需要指定特定域名,则添加以下配置即可:

{
"CorsAccessorSettings": {
"PolicyName": "自定义跨域策略名",
"WithOrigins": ["http://localhost:4200", "https://furion.pro"]
}
}

16.5 CorsAccessorSettings 配置#

  • CorsAccessorSettings
    • PolicyName:跨域策略名,字符串类型,必填,默认 FurCorsAccessor
    • WithOrigins:允许跨域的域名列表,字符串数组类型,默认 [ "http://localhost:4200" ]
    • WithHeaders:请求表头,没有配置则允许所有表头,字符串数组类型
    • WithExposedHeaders:响应标头,字符串数组类型
    • WithMethods:设置跨域允许请求谓词,没有配置则允许所有,字符串数组类型
    • AllowCredentials:跨域请求中的凭据,bool 类型
    • SetPreflightMaxAge:设置预检过期时间,int 类型

16.6 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 跨域请求 知识可查阅 ASP.NET Core - 启用跨域请求 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dapper/index.html b/docs/docs/dapper/index.html index 6c577483341..843829a8ace 100644 --- a/docs/docs/dapper/index.html +++ b/docs/docs/dapper/index.html @@ -6,20 +6,20 @@ -10.2. Dapper 集成 | Furion - - - - - - - - - +10.2. Dapper 集成 | Furion + + + + + + + + +
-

10.2. Dapper 集成

10.2.1 关于 Dapper#

Dapper 是 .NET/C# 平台非常优秀的 微型 ORM 框架,主要是为 ADO.NET 操作对象提供拓展能力,推崇原生 sql 操作法。

Dapper 官方仓库地址:https://github.com/StackExchange/Dapper

10.2.2 如何集成#

Furion 框架中,已经推出 Dapper 拓展包 Furion.Extras.DatabaseAccessor.Dapper

10.2.2.1 注册 Dapper 服务#

使用非常简单,只需要在 Startup.cs 中添加 services.AddDapper(connStr, SqlProvider) 即可。如:

services.AddDapper("Data Source=./Furion.db", SqlProvider.Sqlite);

10.2.2.2 安装对应的数据库提供器#

  • SqlServerMicrosoft.Data.SqlClient
  • SqliteMicrosoft.Data.Sqlite
  • MySqlMySql.Data
  • NpgsqlNpgsql
  • OracleOracle.ManagedDataAccess.Core
  • FirebirdFirebirdSql.Data.FirebirdClient
安装拓展包位置

Furion 框架中,推荐将拓展包 Furion.Extras.DatabaseAccessor.Dapper 安装到 Furion.Core 层中。

10.2.3 基本使用#

在使用之前,我们可以通过构造函数注入 IDapperRepositoryIDapperRepository<TEntity> 接口,如:

  • 非泛型版本
private readonly IDapperRepository _dapperRepository;
public PersonService(IDapperRepository dapperRepository)
{
_dapperRepository = dapperRepository;
}
  • 泛型版本
private readonly IDapperRepository<Person> _personRepository;
public PersonService(IDapperRepository<Person> personRepository)
{
_personRepository = personRepository;
}

10.2.3.1 sql 操作#

var data = _dapperRepository.Query("select * from person");
var data = await _dapperRepository.QueryAsync("select * from person");
+

10.2. Dapper 集成

10.2.1 关于 Dapper#

Dapper 是 .NET/C# 平台非常优秀的 微型 ORM 框架,主要是为 ADO.NET 操作对象提供拓展能力,推崇原生 sql 操作法。

Dapper 官方仓库地址:https://github.com/StackExchange/Dapper

10.2.2 如何集成#

Furion 框架中,已经推出 Dapper 拓展包 Furion.Extras.DatabaseAccessor.Dapper

10.2.2.1 注册 Dapper 服务#

使用非常简单,只需要在 Startup.cs 中添加 services.AddDapper(connStr, SqlProvider) 即可。如:

services.AddDapper("Data Source=./Furion.db", SqlProvider.Sqlite);

10.2.2.2 安装对应的数据库提供器#

  • SqlServerMicrosoft.Data.SqlClient
  • SqliteMicrosoft.Data.Sqlite
  • MySqlMySql.Data
  • NpgsqlNpgsql
  • OracleOracle.ManagedDataAccess.Core
  • FirebirdFirebirdSql.Data.FirebirdClient
安装拓展包位置

Furion 框架中,推荐将拓展包 Furion.Extras.DatabaseAccessor.Dapper 安装到 Furion.Core 层中。

10.2.3 基本使用#

在使用之前,我们可以通过构造函数注入 IDapperRepositoryIDapperRepository<TEntity> 接口,如:

  • 非泛型版本
private readonly IDapperRepository _dapperRepository;
public PersonService(IDapperRepository dapperRepository)
{
_dapperRepository = dapperRepository;
}
  • 泛型版本
private readonly IDapperRepository<Person> _personRepository;
public PersonService(IDapperRepository<Person> personRepository)
{
_personRepository = personRepository;
}

10.2.3.1 sql 操作#

var data = _dapperRepository.Query("select * from person");
var data = await _dapperRepository.QueryAsync("select * from person");
var data = _dapperRepository.Query<Person>("select * from person");
var guid = Guid.NewGuid();
var dog = _dapperRepository.Query<Dog>("select Age = @Age, Id = @Id", new { Age = (int?)null, Id = guid });
var count = _dapperRepository.Execute(@"insert MyTable(colA, colB) values (@a, @b)",
new[] { new { a=1, b=1 }, new { a=2, b=2 }, new { a=3, b=3 } }
);
var user = _dapperRepository.Query<User>("spGetUser", new {Id = 1},
commandType: CommandType.StoredProcedure).SingleOrDefault();

用法和官方一致,此处不再举更多例子。

10.2.3.2 <TEntity> 操作#

Furion 框架提供了 IDapperRepositoryIDapperRepository<TEntity> 两个操作仓储,后者继承前者。使用如下:

var person = personRepository.Get(1);
var persons = personRepository.GetAll();
@@ -31,14 +31,14 @@
var typeColumnIndex = reader.GetOrdinal("Type");
while (reader.Read())
{
IShape shape;
var type = (ShapeType)reader.GetInt32(typeColumnIndex);
switch (type)
{
case ShapeType.Circle:
shape = circleParser(reader);
break;
case ShapeType.Square:
shape = squareParser(reader);
break;
case ShapeType.Triangle:
shape = triangleParser(reader);
break;
default:
throw new NotImplementedException();
}
shapes.Add(shape);
}
}

10.2.5 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 Dapper 知识可查阅 Dapper 官网

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/data-validation/index.html b/docs/docs/data-validation/index.html index f231763df17..36fe85c866e 100644 --- a/docs/docs/data-validation/index.html +++ b/docs/docs/data-validation/index.html @@ -6,20 +6,20 @@ -8. 数据校验 | Furion - - - - - - - - - +8. 数据校验 | Furion + + + + + + + + +
-

8. 数据校验

8.1 关于数据校验#

数据校验字面上的意思就是对使用者提交过来的数据进行合法性验证。在一套完善的应用系统中,数据有效性校验是必不可少的业务处理第一道关卡。

8.2 数据校验的好处#

  • 过滤不安全数据,提高系统的安全性
  • 减少不必要的业务异常处理,提高系统的响应速度
  • 大大提高系统稳定性
  • 大数据并发时起着一定的缓冲作用

8.3 数据校验方式#

  • 传统方式,在业务代码之前手动验证
  • Mvc 特性方式,Mvc 内置的 DataAnnotations 方式
  • 推荐方式Furion 框架内置的 DataValidation 验证
  • 其他方式,使用第三方验证库,如 FluentValidation

8.3.1 传统方式#

在很多老项目中,我们经常看到这样的代码:

public bool Insert(Person person)
{
// 验证参数
if(string.IsNullOrEmty(person.Name))
{
throw new System.Exception("名字不能为空");
}
+

8. 数据校验

8.1 关于数据校验#

数据校验字面上的意思就是对使用者提交过来的数据进行合法性验证。在一套完善的应用系统中,数据有效性校验是必不可少的业务处理第一道关卡。

8.2 数据校验的好处#

  • 过滤不安全数据,提高系统的安全性
  • 减少不必要的业务异常处理,提高系统的响应速度
  • 大大提高系统稳定性
  • 大数据并发时起着一定的缓冲作用

8.3 数据校验方式#

  • 传统方式,在业务代码之前手动验证
  • Mvc 特性方式,Mvc 内置的 DataAnnotations 方式
  • 推荐方式Furion 框架内置的 DataValidation 验证
  • 其他方式,使用第三方验证库,如 FluentValidation

8.3.1 传统方式#

在很多老项目中,我们经常看到这样的代码:

public bool Insert(Person person)
{
// 验证参数
if(string.IsNullOrEmty(person.Name))
{
throw new System.Exception("名字不能为空");
}
if(person.Age < 18)
{
throw new System.Exception("年龄不能小于 18 岁");
}
if(!person.Password.Equals(person.ConfirmPassword)
{
throw new System.Exception("两次密码不一致");
}
// 业务代码
_repository.Insert(person.Adapt<PersonEntity>());
@@ -72,14 +72,14 @@
["StrongPassword", "密码太简单了!!!"]
]
}
}
important

appsettings.json 中相同的 Key 会覆盖 IValidationMessageTypeProvider 提供相同 Key 的值。

错误消息查找优先级#

DefaultErrorMessage -> IValidationMessageTypeProvider -> appsettings.json (低 -> 高)

8.9 模型验证范围#

Furion 提供多种模型验证范围设置:

  • 全局验证(默认)
  • [NonValidation] 跳过验证
  • [TypeFilter(typeof(DataValidationFilter))] 局部验证
  • [ApiController] 控制器范围验证

8.9.1 全局验证#

默认情况下,通过 .AddDataValidation() 注册数据验证服务已经启用了全局验证,如若不想启用全局验证,则传入 false 即可,如:.AddDataValidation(false)

8.9.2 [NonValidation] 跳过验证#

可通过 [NonValidation] 贴在 控制器动作方法 中跳过全局验证或不需要验证

8.9.3 [TypeFilter(typeof(DataValidationFilter))] 局部验证#

我们也可以无需注册 .AddDataValidation() 服务,直接在 动作方法 上贴 [TypeFilter(typeof(DataValidationFilter))] 可启用局部验证。如:

using Furion.DataValidation;
using Furion.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
namespace Furion.Application
{
public class FurAppService : IDynamicApiController
{
[TypeFilter(typeof(DataValidationFilter))]
public TestDto Post(TestDto testDto)
{
return testDto;
}
}
}

8.9.4 [ApiController] 控制器范围验证#

[ApiController]Mvc 提供的控制器范围(含所有动作方法)的验证。

using Microsoft.AspNetCore.Mvc;
namespace Furion.Web.Entry.Controllers
{
[ApiController]
public class MvcController : Controller
{
public IActionResult Index()
{
return View();
}
}
}

8.10 MiniProfiler 查看#

如下图所示:

8.11 多语言支持#

参见 【全球化和本地化(多语言)】 章节

8.12 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-Interceptor/index.html b/docs/docs/dbcontext-Interceptor/index.html index c9084b33f9d..5efefa5fc38 100644 --- a/docs/docs/dbcontext-Interceptor/index.html +++ b/docs/docs/dbcontext-Interceptor/index.html @@ -6,20 +6,20 @@ -9.24 数据库操作拦截器 | Furion - - - - - - - - - +9.24 数据库操作拦截器 | Furion + + + + + + + + +
-

9.24 数据库操作拦截器

9.24.1 数据库拦截器#

Furion 框架提供四种数据库操作拦截器,可以通过拦截器动态修改数据库连接字符串,动态修改 sql,动态更改参数等操作。

Furion 支持这四种拦截器:

  • DbConnectionInterceptor:数据库连接拦截器
  • DbCommandInterceptor:数据库执行 Sql 拦截器
  • SaveChangesInterceptor:提交到数据库拦截器
  • 在数据库上下文中重写 SavedChangesEvent 相关事件

9.24.2 支持拦截类型#

9.24.2.1 DbConnectionInterceptor#

using Microsoft.EntityFrameworkCore.Diagnostics;
using System.Data.Common;
using System.Threading;
using System.Threading.Tasks;
+

9.24 数据库操作拦截器

9.24.1 数据库拦截器#

Furion 框架提供四种数据库操作拦截器,可以通过拦截器动态修改数据库连接字符串,动态修改 sql,动态更改参数等操作。

Furion 支持这四种拦截器:

  • DbConnectionInterceptor:数据库连接拦截器
  • DbCommandInterceptor:数据库执行 Sql 拦截器
  • SaveChangesInterceptor:提交到数据库拦截器
  • 在数据库上下文中重写 SavedChangesEvent 相关事件

9.24.2 支持拦截类型#

9.24.2.1 DbConnectionInterceptor#

using Microsoft.EntityFrameworkCore.Diagnostics;
using System.Data.Common;
using System.Threading;
using System.Threading.Tasks;
namespace Furion.DatabaseAccessor.Interceptors
{
public class SqlConnectionInterceptor : DbConnectionInterceptor
{
// 数据库连接之前
public override InterceptionResult ConnectionOpening(DbConnection connection, ConnectionEventData eventData, InterceptionResult result)
{
return base.ConnectionOpening(connection, eventData, result);
}
// 数据库连接之前(异步)
public override ValueTask<InterceptionResult> ConnectionOpeningAsync(DbConnection connection, ConnectionEventData eventData, InterceptionResult result, CancellationToken cancellationToken = default)
{
return base.ConnectionOpeningAsync(connection, eventData, result, cancellationToken);
}
// 数据库连接成功
public override void ConnectionOpened(DbConnection connection, ConnectionEndEventData eventData)
{
base.ConnectionOpened(connection, eventData);
}
@@ -55,14 +55,14 @@
// 提交数据库失败(异步)
public override Task SaveChangesFailedAsync(DbContextErrorEventData eventData, CancellationToken cancellationToken = default)
{
return base.SaveChangesFailedAsync(eventData, cancellationToken);
}
}
}

9.24.2.4 SavedChangesEvent 拦截#

Furion 框架中为所有 AppDbContext 子类都提供了三个可重写的方法,这三个方法分别由三个事件触发:

  • 提交更改之前 SavingChanges 事件:触发 void SavingChangesEvent(DbContextEventData eventData, InterceptionResult<int> result) 方法
  • 提交更改之后 SavedChanges 事件:触发 void SavedChangesEvent(SaveChangesCompletedEventData eventData, int result) 方法
  • 提交更改失败 SaveChangesFailed 事件:触发 void SaveChangesFailedEvent(DbContextErrorEventData eventData) 方法

通过这三个事件我们可以在数据库做增、删、改时候做拦截,比如设置创建时间、更新时间或其他默认操作

如自动添加租户 Id:

protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult<int> result)
{
// 获取当前事件对应上下文
var dbContext = eventData.Context;
// 获取所有新增和更新的实体
var entities = dbContext.ChangeTracker.Entries()
.Where(u => u.State == EntityState.Added || u.State == EntityState.Modified);
foreach (var entity in entities)
{
switch (entity.State)
{
// 自动设置租户Id
case EntityState.Added:
entity.Property(nameof(Entity.TenantId)).CurrentValue = GetTenantId();
break;
// 排除租户Id
case EntityState.Modified:
entity.Property(nameof(Entity.TenantId)).IsModified = false;
break;
}
}
}

9.24.3 注册自定义过滤器#

定义好过滤器之后,我们需要在数据库上下文中注册:

services.AddDbPool<FurDbContext>(interceptors: new IInterceptor[] {
new YourSqlConnectionProfilerInterceptor(),
new YourDbContextSaveChangesInterceptor(),
new YourSqlCommandProfilerInterceptor()
});

9.24.4 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-add-or-update/index.html b/docs/docs/dbcontext-add-or-update/index.html index 0ac2aecc409..d15830a5f85 100644 --- a/docs/docs/dbcontext-add-or-update/index.html +++ b/docs/docs/dbcontext-add-or-update/index.html @@ -6,20 +6,20 @@ -9.7 新增或更新操作 | Furion - - - - - - - - - +9.7 新增或更新操作 | Furion + + + + + + + + +
-

9.7 新增或更新操作

9.7.1 新增或更新(不立即提交)#

// ==== 同步操作 ====
+

9.7 新增或更新操作

9.7.1 新增或更新(不立即提交)#

// ==== 同步操作 ====
// 示例一
repository.InsertOrUpdate(user);
// 示例二
user.InsertOrUpdate();
// ==== 异步操作 ====
@@ -98,14 +98,14 @@
// 示例六
await user.InsertOrUpdateExcludeNowAsync("Age", "Name");
// 示例七
await user.InsertOrUpdateExcludeNowAsync(new[] { u=>u.Name, u=>u.Age});
// 示例八
await user.InsertOrUpdateExcludeNowAsync(new[] {"Age", "Name"});

9.5.7 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-add/index.html b/docs/docs/dbcontext-add/index.html index 3aa1362b0c3..c8c21948b26 100644 --- a/docs/docs/dbcontext-add/index.html +++ b/docs/docs/dbcontext-add/index.html @@ -6,20 +6,20 @@ -9.5 新增操作 | Furion - - - - - - - - - +9.5 新增操作 | Furion + + + + + + + + +
-

9.5 新增操作

Furion 框架提供非常多的语法糖进行数据库操作。

9.5.1 新增一条,无返回值#

var user = new User { Name = "百小僧", Age = 27 };
+

9.5 新增操作

Furion 框架提供非常多的语法糖进行数据库操作。

9.5.1 新增一条,无返回值#

var user = new User { Name = "百小僧", Age = 27 };
// ==== 同步操作 ====
// 示例一
repository.Insert(user);
// 示例二
user.Insert();
@@ -49,14 +49,14 @@
// 示例一
await repository.InsertNowAsync(user, user2);
// 示例二
await repository.InsertNowAsync(new List<User> { user, user2 });
// 示例三
await repository.InsertNowAsync(new[] {user, user2 });
小知识

所有带 Now 结尾的表示立即提交到数据库,也就是立即调用 SaveChangesSaveChangesAsync

9.5.5 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-audit/index.html b/docs/docs/dbcontext-audit/index.html index de07f5ab4ae..bd1a4bd00d8 100644 --- a/docs/docs/dbcontext-audit/index.html +++ b/docs/docs/dbcontext-audit/index.html @@ -6,20 +6,20 @@ -9.22 审计日志 | Furion - - - - - - - - - +9.22 审计日志 | Furion + + + + + + + + +
-

9.22 审计日志

9.22.1 审计日志#

在一个企业应用系统中,用户对系统所有的操作包括请求,数据库操作等等都应该记录起来,那么这些日志我们成为操作日志,也可以说审计日志。

通常来说,我们审计日志更多指的是数据库的操作记录。

审计日志一般会记录以下三个操作:

  • 新增操作:记录某某人在某某时间对哪个表新增了什么数据
  • 更新操作:记录某某人在某某时间对哪个表的哪些数据做了更改,记录更改前的值和更改后的值
  • 删除操作:记录某某人在某某时间对哪个表删除了什么数据

9.22.2 关于 SaveChanges 事件#

Furion 框架中为所有 AppDbContext 子类都提供了三个可重写的方法,这三个方法分别由三个事件触发:

  • 提交更改之前 SavingChanges 事件:触发 void SavingChangesEvent(DbContextEventData eventData, InterceptionResult<int> result) 方法
  • 提交更改之后 SavedChanges 事件:触发 void SavedChangesEvent(SaveChangesCompletedEventData eventData, int result) 方法
  • 提交更改失败 SaveChangesFailed 事件:触发 void SaveChangesFailedEvent(DbContextErrorEventData eventData) 方法

通过这三个事件我们就可以捕获所有更改的实体然后保存到数据库审计日志中。

9.22.3 如何使用#

我们只需要在 AppDbContext 子类中重写 SavingChanges 事件对应方法即可:

using Furion.DatabaseAccessor;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using System;
using System.Linq;
using System.Security.AccessControl;
+

9.22 审计日志

9.22.1 审计日志#

在一个企业应用系统中,用户对系统所有的操作包括请求,数据库操作等等都应该记录起来,那么这些日志我们成为操作日志,也可以说审计日志。

通常来说,我们审计日志更多指的是数据库的操作记录。

审计日志一般会记录以下三个操作:

  • 新增操作:记录某某人在某某时间对哪个表新增了什么数据
  • 更新操作:记录某某人在某某时间对哪个表的哪些数据做了更改,记录更改前的值和更改后的值
  • 删除操作:记录某某人在某某时间对哪个表删除了什么数据

9.22.2 关于 SaveChanges 事件#

Furion 框架中为所有 AppDbContext 子类都提供了三个可重写的方法,这三个方法分别由三个事件触发:

  • 提交更改之前 SavingChanges 事件:触发 void SavingChangesEvent(DbContextEventData eventData, InterceptionResult<int> result) 方法
  • 提交更改之后 SavedChanges 事件:触发 void SavedChangesEvent(SaveChangesCompletedEventData eventData, int result) 方法
  • 提交更改失败 SaveChangesFailed 事件:触发 void SaveChangesFailedEvent(DbContextErrorEventData eventData) 方法

通过这三个事件我们就可以捕获所有更改的实体然后保存到数据库审计日志中。

9.22.3 如何使用#

我们只需要在 AppDbContext 子类中重写 SavingChanges 事件对应方法即可:

using Furion.DatabaseAccessor;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using System;
using System.Linq;
using System.Security.AccessControl;
namespace Furion.EntityFramework.Core
{
[AppDbContext("Sqlite3ConnectionString")]
public class FurDbContext : AppDbContext<FurDbContext>
{
public FurDbContext(DbContextOptions<FurDbContext> options) : base(options)
{
}
/// <summary>
/// 重写保存之前事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected override void SavingChangesEvent(DbContextEventData eventData, InterceptionResult<int> result)
{
// 获取当前事件对应上下文
var dbContext = eventData.Context;
// 强制重新检查一边实体更改信息
// dbContext.ChangeTracker.DetectChanges();
@@ -33,14 +33,14 @@
// 获取现在的实体值
var newValue = currentValues[propName];
object oldValue = null;
// 如果是新增数据,则 databaseValues 为空,所以需要判断一下
if (databaseValues != null)
{
oldValue = databaseValues[propName];
}
// 插入审计日志表
dbContext.Audits.Add(new Audit
{
Table = entityType.Name, // 表名
Column = propName, // 更新的列
NewValue = newValue, // 新值
OldValue = oldValue, // 旧值
CreatedTime = DateTime.Now, // 操作时间
UserId = userId, // 操作人
Operate = entity.State.ToString(); // 操作方式:新增、更新、删除
});
}
}
}
}
}
小知识

如果对性能有所要求,那么建议审计日志通过 日志组件 写入数据库,如,通过 Nlog、Log4Net 这些等:

// 插入审计日志表
dbContext.Audits.Add(new Audit
{
Table = entityType.Name, // 表名
Column = propName, // 更新的列
newValue = newValue, // 新值
OldValue = oldValue, // 旧值
CreatedTime = DateTime.Now, // 操作时间
UserId = userId, // 操作人
Operate = entity.State.ToString(); // 操作方式:新增、更新、删除
});

替换为:

logger.Information(JsonConvert.SerializeObject(new Audit
{
Table = entityType.Name, // 表名
Column = propName, // 更新的列
newValue = newValue, // 新值
OldValue = oldValue, // 旧值
CreatedTime = DateTime.Now, // 操作时间
UserId = userId, // 操作人
Operate = entity.State.ToString(); // 操作方式:新增、更新、删除
}));

通过上面的例子,我们就可以对数据库所有的新增、更新、删除进行监控了。

9.22.4 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-batch/index.html b/docs/docs/dbcontext-batch/index.html index 0bf740ad935..edab0b06e99 100644 --- a/docs/docs/dbcontext-batch/index.html +++ b/docs/docs/dbcontext-batch/index.html @@ -6,20 +6,20 @@ -9.9 批量操作 | Furion - - - - - - - - - +9.9 批量操作 | Furion + + + + + + + + +
-

9.9 批量操作

9.9.1 关于批量操作#

Furion 框架中,默认只提供小数据(100 以内)批量数据操作,如果需要更大的数据批量处理,推荐使用第三方包 EFCore.BulkExtensions,支持和 Furion 无缝衔接。

9.9.2 EFCore.BulkExtensions 使用#

9.9.2.1 常见批量操作#

// 批量插入
repository.Context.BulkInsert(entitiesList);
repository.Context.BulkInsertAsync(entitiesList);
+

9.9 批量操作

9.9.1 关于批量操作#

Furion 框架中,默认只提供小数据(100 以内)批量数据操作,如果需要更大的数据批量处理,推荐使用第三方包 EFCore.BulkExtensions,支持和 Furion 无缝衔接。

9.9.2 EFCore.BulkExtensions 使用#

9.9.2.1 常见批量操作#

// 批量插入
repository.Context.BulkInsert(entitiesList);
repository.Context.BulkInsertAsync(entitiesList);
// 批量更新
repository.Context.BulkUpdate(entitiesList);
repository.Context.BulkUpdateAsync(entitiesList);
// 批量删除
repository.Context.BulkDelete(entitiesList);
repository.Context.BulkDeleteAsync(entitiesList);
// 批量插入或更新
repository.Context.BulkInsertOrUpdate(entitiesList);
repository.Context.BulkInsertOrUpdateAsync(entitiesList);
@@ -28,14 +28,14 @@
// 批量清空表(慎用!!!!!)
repository.Context.Truncate<Entity>();
repository.Context.TruncateAsync<Entity>();

9.9.2.2 查询后批量操作#

// 根据条件批量删除
repository.Where(a => a.ItemId > 500).BatchDelete();
await repository.Where(a => a.ItemId > 500).BatchDeleteAsync();
// 根据条件批量更新
repository.Where(a => a.ItemId <= 500).BatchUpdate(a => new Item { Quantity = a.Quantity + 100 });
repository.Where(a => a.ItemId <= 500).BatchUpdate(new Item { Description = "Updated" });
await repository.Where(a => a.ItemId <= 500).BatchUpdateAsync(new Item { Description = "Updated" });
// 批量更新指定列
var updateColumns = new List<string> { nameof(Item.Quantity) };
var q = repository.Where(a => a.ItemId <= 500);
int affected = q.BatchUpdate(new Item { Description = "Updated" }, updateColumns);

9.9.3 批量操作性能#

Operations\Rows100,000 EF100,000 EFBulk1,000,000 EFBulk
Insert38.98 s2.10 s17.99 s
Update109.25 s3.96 s31.45 s
Delete7.26 s2.04 s12.18 s
---------------------------------------------------------------
Together70.70 s5.88 s56.84 s

9.9.4 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 EFCore.BulkExtensions 知识可查阅 EFCore.BulkExtensions 开源仓库

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-code-first/index.html b/docs/docs/dbcontext-code-first/index.html index a1850bd574d..2c020826bc6 100644 --- a/docs/docs/dbcontext-code-first/index.html +++ b/docs/docs/dbcontext-code-first/index.html @@ -6,32 +6,32 @@ -9.20 模型生成数据库 | Furion - - - - - - - - - +9.20 模型生成数据库 | Furion + + + + + + + + +
-

9.20 模型生成数据库

开始之前

Fur.Web.Entry 层需要安装 Microsoft.EntityFrameworkCore.Tools 包。

9.20.1 数据库开发方式#

Furion 提供两种主要方法来 保持实体模型和数据库架构同步

至于我们应该选用哪个方法,请确定你是希望以实体模型为准还是以数据库为准:

  • 如果希望 以实体模型为准,请使用正向工程(Code First)。 对实体模型进行更改时,此方法会以增量方式将相应架构更改应用到数据库,以使数据库保持与实体模型兼容。

  • 如果希望 以数据库架构为准,请使用反向工程(Database First)。 使用此方法,可通过将数据库架构反向工程到实体模型来生成相应的实体类型。

本章节是 正向工程(Code First) 的相关内容。

9.20.2 操作指南#

特别注意

Furion 框架默认数据迁移的程序集为:Furion.Database.Migrations,所以如果您改了程序集名称或通过 Nuget 方式安装的 Furion 包,则需要配置迁移程序集名称:

services.AddDatabaseAccessor(options =>
{
options.AddDbPool<FurDbContext>(DbProvider.Sqlite);
}, "自定义迁移名称");

另外,如果应用中配置了多个数据库上下文,那么所有的 迁移命令 都需要指定 -Context 数据库上下文名称 参数。如:

Add-Migration v1.0.0 -Context FurDbContext

9.20.2.1 创建实体模型 Person#

using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
+

9.20 模型生成数据库

开始之前

Fur.Web.Entry 层需要安装 Microsoft.EntityFrameworkCore.Tools 包。

9.20.1 数据库开发方式#

Furion 提供两种主要方法来 保持实体模型和数据库架构同步

至于我们应该选用哪个方法,请确定你是希望以实体模型为准还是以数据库为准:

  • 如果希望 以实体模型为准,请使用正向工程(Code First)。 对实体模型进行更改时,此方法会以增量方式将相应架构更改应用到数据库,以使数据库保持与实体模型兼容。

  • 如果希望 以数据库架构为准,请使用反向工程(Database First)。 使用此方法,可通过将数据库架构反向工程到实体模型来生成相应的实体类型。

本章节是 正向工程(Code First) 的相关内容。

9.20.2 操作指南#

特别注意

Furion 框架默认数据迁移的程序集为:Furion.Database.Migrations,所以如果您改了程序集名称或通过 Nuget 方式安装的 Furion 包,则需要配置迁移程序集名称:

services.AddDatabaseAccessor(options =>
{
options.AddDbPool<FurDbContext>(DbProvider.Sqlite);
}, "自定义迁移名称");

另外,如果应用中配置了多个数据库上下文,那么所有的 迁移命令 都需要指定 -Context 数据库上下文名称 参数。如:

Add-Migration v1.0.0 -Context FurDbContext

9.20.2.1 创建实体模型 Person#

using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Furion.Core
{
public class Person : Entity
{
/// <summary>
/// 构造函数
/// </summary>
public Person()
{
CreatedTime = DateTime.Now;
IsDeleted = false;
}
/// <summary>
/// 姓名
/// </summary>
[MaxLength(32)]
public string Name { get; set; }
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
/// <summary>
/// 住址
/// </summary>
public string Address { get; set; }
}
}
实体约定

所有数据库实体必须直接或间接继承 IEntity 接口。

9.20.2.2 打开 程序包管理控制台#

9.20.2.3 切换默认项目#

程序包管理控制台 默认项目设置为 Furion.Database.Migrations

9.20.2.4 创建模型版本#

Add-Migration v1.0.0
特别说明

v1.0.0 是此处数据库更改的版本号,可以写任何字符串,但推荐写版本号,每次 +1

最终命令如下:

PM> Add-Migration v1.0.0
Build started...
Build succeeded.
Microsoft.EntityFrameworkCore.Model.Validation[10400]
Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data, this mode should only be enabled during development.
Microsoft.EntityFrameworkCore.Infrastructure[10403]
Entity Framework Core 5.0.0-rc.1.20451.13 initialized 'FurDbContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled MaxPoolSize=100 MigrationsAssembly=Furion.Database.Migrations
To undo this action, use Remove-Migration.
PM>

生成成功后,Furion.Database.Migrations 项目下会新增 Migrations 文件夹(如果没有),同时本次的架构生成文件,如:

9.20.2.5 更新到数据库#

Update-Database

执行该命令后,数据库就会自动根据模型生成对于的表。

小知识

如果 Update-Database 后面带字符串参数,则会自动还原数据库到指定版本,如:

Update-Database v0.0.3

将数据库还原到 v0.0.3 版本

9.20.3 更新模型#

如果模型改变了,重复上面操作即可,如:

Add-Migration v1.0.1
Update-Database

9.20.4 导出 Sql#

有些时候,我们没有直接更新数据库的权限,或者怕出问题,我们都会先生成 Sql 看看,这时候只需要通过 Script-Migration 导出即可,如:

Script-Migration

9.20.5 VS Code 方式#

9.20.5.1 安装 dotnet ef#

dotnet tool install --global dotnet-ef --version 5.0.0-rc.2.20475.6

9.20.5.2 cd 目录#

通过 VS Code 打开 .sln 所在的目录,如:framework

之后进入 Furion.Database.Migrations 目录

cd Furion.Database.Migrations

9.20.5.3 执行命令#

dotnet ef migrations add v1.0.0 -s "../Furion.Web.Entry"
dotnet ef database update -s "../Furion.Web.Entry"

9.20.6 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 正向工厂 知识可查阅 EF Core - 管理数据库架构 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-db-first/index.html b/docs/docs/dbcontext-db-first/index.html index f4fc646dfdc..661ca784de4 100644 --- a/docs/docs/dbcontext-db-first/index.html +++ b/docs/docs/dbcontext-db-first/index.html @@ -6,20 +6,20 @@ -9.19 数据库生成模型 | Furion - - - - - - - - - +9.19 数据库生成模型 | Furion + + + + + + + + +
-

9.19 数据库生成模型

关于脚本

在阅读下面文档之前,必须把Furion 源码文件夹下的 tools/cli.ps1 文件拷贝到本地中。而且 Fur.Web.Entry 层需要安装 Microsoft.EntityFrameworkCore.Tools 包。

9.19.1 数据库开发方式#

Furion 提供两种主要方法来 保持实体模型和数据库架构同步

至于我们应该选用哪个方法,请确定你是希望以实体模型为准还是以数据库为准:

  • 如果希望 以实体模型为准,请使用正向工程(Code First)。 对实体模型进行更改时,此方法会以增量方式将相应架构更改应用到数据库,以使数据库保持与实体模型兼容。

  • 如果希望 以数据库架构为准,请使用反向工程(Database First)。 使用此方法,可通过将数据库架构反向工程到实体模型来生成相应的实体类型。

本章节是 反向工程(Database First) 的相关内容。

9.19.2 操作指南#

操作之前注意事项

目前 Furion Tools 生成工具默认不支持任何数据库生成,所以如需生成特定数据库的代码,只需要在 Furion.EntityFrameworkCore.Core 安装对应的数据库包即可:

各个数据库的包可查阅:多数据库操作-数据库提供器对应包

另外,只有 SqlServer 数据库支持可视化 GUI 操作,其他的只能命令行操作。

9.19.2.1 打开 程序包管理控制台#

注意:开始之前先把 Furion.Web.Entry 设为启动项目。

9.19.2.2 切换默认项目#

程序包管理控制台 默认项目设置为 Furion.Core,如果您是其他名字,则切换对应即可。

9.19.2.3 输入 cli.ps1 命令#

&"../tools/cli.ps1" -CoreProject "你的Core层" -EntryProject "你的启动层"
关于数据库命名

如果需要保持和数据库一模一样的命名,则使用 -UseDatabaseNames 参数指定,如:

&"../tools/cli.ps1" -UseDatabaseNames
等待输入

执行上面命令后,此时,Cli 有一个等待输入提示:

Furion Tools v1.0.0 请键入操作类型:[G] 界面操作,[任意字符] 命令行操作
Furion Tools v1.0.0 您的输入是:

输入大写 G 进入界面操作模式,其他任意字符进入命令行操作模式。

注意事项

目前只有 Sql Server 数据库才支持 GUI 界面操作模式,其他数据库请使用命令行模式。

9.19.3 界面操作模式#

9.19.3.1 启动界面操作#

当我们输入 G 时,将打开 GUI 界面操作模式,如:

这时,Furion Tools 会自动查找所有数据库配置连接字符串的 .json 文件:

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DbConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;",
"Sqlite3ConnectionString": "Data Source=./Furion.db"
}
}

9.19.3.2 加载数据库表#

选择连接字符串之后,点击 加载数据库表和视图 按钮加载。

9.19.3.3 选择表或视图生成#

加载表完成后,可以选择您要生成的表或视图,支持多选

点击底部按钮 立即生成

9.19.3.4 选择保存目录#

点击 立即生成 按钮后,会弹出实体保存选择目录资源管理器,默认实体只能保存在 Furion.Core 层:

点击确定后就可完成所有生成操作。

9.19.3.5 生成最终实体代码#

最终脚本如下:

PM> &"../tools/cli.ps1"
// -----------------------------------------------------------------------------
// ______ _______ _
// | ____| |__ __| | |
// | |__ _ _ _ __ | | ___ ___ | |___
// | __| | | | '__| | |/ _ \ / _ \| / __|
// | | | |_| | | | | (_) | (_) | \__ \
// |_| \__,_|_| |_|\___/ \___/|_|___/
//
// -----------------------------------------------------------------------------
// 让 .NET 开发更简单,更通用,更流行。
// Copyright © 2020 Furion, Baiqian Co.,Ltd.
//
// 框架名称:Furion
// 框架作者:百小僧
// 框架版本:1.0.0
// 源码地址:https://gitee.com/monksoul/Furion
// 开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)
// -----------------------------------------------------------------------------
Furion Tools v1.0.0 启动中......
Furion Tools v1.0.0 启动成功!
Furion Tools v1.0.0 请键入操作类型:[G] 界面操作,[任意字符] 命令行操作
Furion Tools v1.0.0 您的输入是: G
Furion Tools v1.0.0 正在加载数据库表和视图......
Furion Tools v1.0.0 加载成功!
Furion Tools v1.0.0 正在编译解决方案代码......
Build started...
Build succeeded.
For foreign key FK_PersonDetail_Person_PersonId on table dbo.PersonDetail, unable to model the end of the foreign key on principal table dbo.Person. This is usually because the principal table was not included in the selection set.
Furion Tools v1.0.0 编译成功!
Furion Tools v1.0.0 开始生成实体文件......
Furion Tools v1.0.0 正在生成 City.cs 实体代码......
Furion Tools v1.0.0 成功生成 City.cs 实体代码
// -----------------------------------------------------------------------------
// 以下代码由 Furion Tools v1.0.0 生成
// -----------------------------------------------------------------------------
+

9.19 数据库生成模型

关于脚本

在阅读下面文档之前,必须把Furion 源码文件夹下的 tools/cli.ps1 文件拷贝到本地中。而且 Fur.Web.Entry 层需要安装 Microsoft.EntityFrameworkCore.Tools 包。

9.19.1 数据库开发方式#

Furion 提供两种主要方法来 保持实体模型和数据库架构同步

至于我们应该选用哪个方法,请确定你是希望以实体模型为准还是以数据库为准:

  • 如果希望 以实体模型为准,请使用正向工程(Code First)。 对实体模型进行更改时,此方法会以增量方式将相应架构更改应用到数据库,以使数据库保持与实体模型兼容。

  • 如果希望 以数据库架构为准,请使用反向工程(Database First)。 使用此方法,可通过将数据库架构反向工程到实体模型来生成相应的实体类型。

本章节是 反向工程(Database First) 的相关内容。

9.19.2 操作指南#

操作之前注意事项

目前 Furion Tools 生成工具默认不支持任何数据库生成,所以如需生成特定数据库的代码,只需要在 Furion.EntityFrameworkCore.Core 安装对应的数据库包即可:

各个数据库的包可查阅:多数据库操作-数据库提供器对应包

另外,只有 SqlServer 数据库支持可视化 GUI 操作,其他的只能命令行操作。

9.19.2.1 打开 程序包管理控制台#

注意:开始之前先把 Furion.Web.Entry 设为启动项目。

9.19.2.2 切换默认项目#

程序包管理控制台 默认项目设置为 Furion.Core,如果您是其他名字,则切换对应即可。

9.19.2.3 输入 cli.ps1 命令#

&"../tools/cli.ps1" -CoreProject "你的Core层" -EntryProject "你的启动层"
关于数据库命名

如果需要保持和数据库一模一样的命名,则使用 -UseDatabaseNames 参数指定,如:

&"../tools/cli.ps1" -UseDatabaseNames
等待输入

执行上面命令后,此时,Cli 有一个等待输入提示:

Furion Tools v1.0.0 请键入操作类型:[G] 界面操作,[任意字符] 命令行操作
Furion Tools v1.0.0 您的输入是:

输入大写 G 进入界面操作模式,其他任意字符进入命令行操作模式。

注意事项

目前只有 Sql Server 数据库才支持 GUI 界面操作模式,其他数据库请使用命令行模式。

9.19.3 界面操作模式#

9.19.3.1 启动界面操作#

当我们输入 G 时,将打开 GUI 界面操作模式,如:

这时,Furion Tools 会自动查找所有数据库配置连接字符串的 .json 文件:

{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DbConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;",
"Sqlite3ConnectionString": "Data Source=./Furion.db"
}
}

9.19.3.2 加载数据库表#

选择连接字符串之后,点击 加载数据库表和视图 按钮加载。

9.19.3.3 选择表或视图生成#

加载表完成后,可以选择您要生成的表或视图,支持多选

点击底部按钮 立即生成

9.19.3.4 选择保存目录#

点击 立即生成 按钮后,会弹出实体保存选择目录资源管理器,默认实体只能保存在 Furion.Core 层:

点击确定后就可完成所有生成操作。

9.19.3.5 生成最终实体代码#

最终脚本如下:

PM> &"../tools/cli.ps1"
// -----------------------------------------------------------------------------
// ______ _______ _
// | ____| |__ __| | |
// | |__ _ _ _ __ | | ___ ___ | |___
// | __| | | | '__| | |/ _ \ / _ \| / __|
// | | | |_| | | | | (_) | (_) | \__ \
// |_| \__,_|_| |_|\___/ \___/|_|___/
//
// -----------------------------------------------------------------------------
// 让 .NET 开发更简单,更通用,更流行。
// Copyright © 2020 Furion, Baiqian Co.,Ltd.
//
// 框架名称:Furion
// 框架作者:百小僧
// 框架版本:1.0.0
// 源码地址:https://gitee.com/monksoul/Furion
// 开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)
// -----------------------------------------------------------------------------
Furion Tools v1.0.0 启动中......
Furion Tools v1.0.0 启动成功!
Furion Tools v1.0.0 请键入操作类型:[G] 界面操作,[任意字符] 命令行操作
Furion Tools v1.0.0 您的输入是: G
Furion Tools v1.0.0 正在加载数据库表和视图......
Furion Tools v1.0.0 加载成功!
Furion Tools v1.0.0 正在编译解决方案代码......
Build started...
Build succeeded.
For foreign key FK_PersonDetail_Person_PersonId on table dbo.PersonDetail, unable to model the end of the foreign key on principal table dbo.Person. This is usually because the principal table was not included in the selection set.
Furion Tools v1.0.0 编译成功!
Furion Tools v1.0.0 开始生成实体文件......
Furion Tools v1.0.0 正在生成 City.cs 实体代码......
Furion Tools v1.0.0 成功生成 City.cs 实体代码
// -----------------------------------------------------------------------------
// 以下代码由 Furion Tools v1.0.0 生成
// -----------------------------------------------------------------------------
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
#nullable disable
namespace Furion.Core
{
public partial class City : IEntity, IEntityTypeBuilder<City>
{
@@ -57,14 +57,14 @@
}
}
}
Furion Tools v1.0.0 全部实体生成成功!
PM>

9.19.4 命令参数配置#

Furion Tools Cli 支持多个参数配置,使用方法只需要在命令后面添加即可,如:

&"../tools/cli.ps1" -Context 数据库上下文名 -ConnectionName 连接字符串Key

支持参数如下:

  • -Tables:配置要生成的数据库表,数组类型,如果为空,则生成数据库所有表和视图。如:-Tables Person,PersonDetails
  • -Context:配置数据库上下文,默认 FurDbContext,如果有多个数据库上下文,则此参数必须配置
  • -ConnectionName:配置数据库连接字符串,对于 appsetting.json 中的 Key
  • -OutputDir:生成实体代码输出目录,默认为:./Furion.Core/Entities/
  • -DbProvider:数据库提供器,默认是 Microsoft.EntityFrameworkCore.SqlServer,其他数据库请指定对应程序集
    • SqlServerMicrosoft.EntityFrameworkCore.SqlServer
    • SqliteMicrosoft.EntityFrameworkCore.Sqlite
    • CosmosMicrosoft.EntityFrameworkCore.Cosmos
    • InMemoryDatabaseMicrosoft.EntityFrameworkCore.InMemory
    • MySqlPomelo.EntityFrameworkCore.MySql
    • PostgreSQLNpgsql.EntityFrameworkCore.PostgreSQL
    • OracleCitms.EntityFrameworkCore.Oracle
    • DmMicrosoft.EntityFrameworkCore.Dm
  • -EntryProject:Web 启用项目层名,默认 Furion.Web.Entry
  • -CoreProject:实体项目层名,默认 Furion.Core
  • -DbContextLocators:多数据库上下文定位器,默认 MasterDbContextLocator,支持多个,如:MasterDbContextLocator,MySqlDbContextLocator
  • -Product:解决方案默认前缀,如 Furion
  • -UseDatabaseNames:是否保持生成和数据库、表一致的名称
  • -Namespace:指定实体命名空间

9.19.5 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-delete/index.html b/docs/docs/dbcontext-delete/index.html index 0c956c64bf9..80e06df11af 100644 --- a/docs/docs/dbcontext-delete/index.html +++ b/docs/docs/dbcontext-delete/index.html @@ -6,20 +6,20 @@ -9.8 删除操作 | Furion - - - - - - - - - +9.8 删除操作 | Furion + + + + + + + + +
-

9.8 删除操作

9.8.1 删除一个实体(不立即提交)#

// ==== 同步操作 ====
+

9.8 删除操作

9.8.1 删除一个实体(不立即提交)#

// ==== 同步操作 ====
// 示例一
repository.Delete(user);
// 示例二
user.Delete();
// 示例三
repository.ChangeEntityState(user, EntityState.Deleted);
@@ -65,14 +65,14 @@
// 示例四
await repository.FakeDeleteNowAsync(1);
// 示例五
await entity.FakeDeleteAsync();
// 示例六
await repository.UpdateIncludeAsync(user, u => u.IsDeleted);

9.8.8 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-entitytrigger/index.html b/docs/docs/dbcontext-entitytrigger/index.html index add44602f8e..cced8c1196f 100644 --- a/docs/docs/dbcontext-entitytrigger/index.html +++ b/docs/docs/dbcontext-entitytrigger/index.html @@ -6,20 +6,20 @@ -9.25. 实体数据监听器 | Furion - - - - - - - - - +9.25. 实体数据监听器 | Furion + + + + + + + + +
-

9.25. 实体数据监听器

9.25.1 实体数据监听器#

在最新的 Furion1.1.6+ 版本中,新增了 IEntityChangedListener 实体数据监听接口,可以监听 EFCore 任何实体表 增删改 操作。

9.25.2 有何作用#

  • 类似数据库 触发器 功能,可实现 增删改 监听
  • 可以实现特殊操作,比如刷新缓存,记录日志等

9.25.3 如何使用#

Furion 框架中,默认不启用实体数据监听器,如想启用,只需要在 数据库上下文 构造函数中启用即可:

9.25.3.1 启用数据监听#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
+

9.25. 实体数据监听器

9.25.1 实体数据监听器#

在最新的 Furion1.1.6+ 版本中,新增了 IEntityChangedListener 实体数据监听接口,可以监听 EFCore 任何实体表 增删改 操作。

9.25.2 有何作用#

  • 类似数据库 触发器 功能,可实现 增删改 监听
  • 可以实现特殊操作,比如刷新缓存,记录日志等

9.25.3 如何使用#

Furion 框架中,默认不启用实体数据监听器,如想启用,只需要在 数据库上下文 构造函数中启用即可:

9.25.3.1 启用数据监听#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
namespace Furion.EntityFramework.Core
{
[AppDbContext("Sqlite3ConnectionString")]
public class DefaultDbContext : AppDbContext<DefaultDbContext>
{
public DefaultDbContext(DbContextOptions<DefaultDbContext> options) : base(options)
{
EnabledEntityChangedListener = true;
}
}
}

9.25.3.2 监听特定实体数据#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Collections.Generic;
namespace Furion.Core
{
public class Post : Entity, IEntityChangedListener<Post>
{
/// <summary>
/// 构造函数
/// </summary>
public Post()
{
CreatedTime = DateTimeOffset.UtcNow;
IsDeleted = false;
}
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
@@ -27,14 +27,14 @@
/// <summary>
/// 实体更改后触发
/// </summary>
/// <param name="entity">实体数据</param>
/// <param name="dbContext">数据库上下文</param>
/// <param name="dbContextLocator">数据库上下文定位器</param>
/// <param name="state">实体状态</param>
public void OnChanged(Post entity, DbContext dbContext, Type dbContextLocator, EntityState state)
{
// 刷新缓存
App.GetService<IMemoryCache>().Set("Key", "Value");
}
}
}

9.25.4 IEntityChangedListener 定义#

/// <summary>
/// 实体数据改变监听依赖接口
/// </summary>
/// <typeparam name="TEntity"></typeparam>
public interface IEntityChangedListener<TEntity>
where TEntity : class, IPrivateEntity, new()
{
/// <summary>
/// 监听数据改变之前(仅支持EFCore操作)
/// </summary>
/// <param name="entity"></param>
/// <param name="dbContext"></param>
/// <param name="dbContextLocator"></param>
/// <param name="state"></param>
void OnChanging(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state) { }
/// <summary>
/// 监听数据改变之后(仅支持EFCore操作)
/// </summary>
/// <param name="entity"></param>
/// <param name="dbContext"></param>
/// <param name="dbContextLocator"></param>
/// <param name="state"></param>
void OnChanged(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state);
/// <summary>
/// 监听数据改变失败(仅支持EFCore操作)
/// </summary>
/// <param name="entity"></param>
/// <param name="dbContext"></param>
/// <param name="dbContextLocator"></param>
/// <param name="state"></param>
void OnChangeFailed(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state) { }
}

9.29.5 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-filter/index.html b/docs/docs/dbcontext-filter/index.html index 3a7f4d08f45..3f230114093 100644 --- a/docs/docs/dbcontext-filter/index.html +++ b/docs/docs/dbcontext-filter/index.html @@ -6,20 +6,20 @@ -9.23 实体/全局查询筛选器 | Furion - - - - - - - - - +9.23 实体/全局查询筛选器 | Furion + + + + + + + + +
-

9.23 实体/全局查询筛选器

9.23.1 查询筛选器#

通常,我们系统中有一些维护字段,如 IsDeleted 字段,这个字段用来标识用户已经删除的数据,那么我们需要每次查询数据的时候带上这个字段,避免查询出不该出现的数据。

Furion 提供非常灵活方便的全局查询筛选器,能够应用到每一次查询中。

9.23.2 多种筛选器配置#

9.23.2.1 单表筛选器#

单表筛选器就是只针对特定实体进行筛选操作,使用简单,只需要在继承 IEntityTypeBuilder<TEntity> 接口并实现即可,如:

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
+

9.23 实体/全局查询筛选器

9.23.1 查询筛选器#

通常,我们系统中有一些维护字段,如 IsDeleted 字段,这个字段用来标识用户已经删除的数据,那么我们需要每次查询数据的时候带上这个字段,避免查询出不该出现的数据。

Furion 提供非常灵活方便的全局查询筛选器,能够应用到每一次查询中。

9.23.2 多种筛选器配置#

9.23.2.1 单表筛选器#

单表筛选器就是只针对特定实体进行筛选操作,使用简单,只需要在继承 IEntityTypeBuilder<TEntity> 接口并实现即可,如:

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
namespace Furion.Core
{
public class Person : Entity, IEntityTypeBuilder<Person>
{
public Person()
{
CreatedTime = DateTime.Now;
IsDeleted = false;
}
public string Name { get; set; }
public int Age { get; set; }
@@ -32,14 +32,14 @@
/// <summary>
/// 构建 u => EF.Property<bool>(u, "IsDeleted") == false 表达式
/// </summary>
/// <param name="entityBuilder"></param>
/// <returns></returns>
private LambdaExpression BuilderIsDeleteLambdaExpression(EntityTypeBuilder entityBuilder)
{
// 获取实体构建器元数据
var metadata = entityBuilder.Metadata;
if (metadata.FindProperty(nameof(Entity.IsDeleted)) == null) return default;
// 创建表达式元素
var parameter = Expression.Parameter(metadata.ClrType, "u");
var properyName = Expression.Constant(nameof(Entity.IsDeleted));
var propertyValue = Expression.Constant(false);
// 构建表达式 u => EF.Property<bool>(u, "IsDeleted") == false
var expressionBody = Expression.Equal(Expression.Call(typeof(EF), nameof(EF.Property), new[] { typeof(bool) }, parameter, properyName), propertyValue);
var expression = Expression.Lambda(expressionBody, parameter);
return expression;
}
}
}
小建议

如果对动态构建 LambdaExpression 不熟悉的朋友,可以使用 System.Linq.Dynamic.Corehttps://github.com/zzzprojects/System.Linq.Dynamic.Core

9.23.3 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-function/index.html b/docs/docs/dbcontext-function/index.html index f802cb03291..7bf6596b8a5 100644 --- a/docs/docs/dbcontext-function/index.html +++ b/docs/docs/dbcontext-function/index.html @@ -6,20 +6,20 @@ -9.14 函数操作 | Furion - - - - - - - - - +9.14 函数操作 | Furion + + + + + + + + +
-

9.14 函数操作

温馨提示

推荐使用 《9.17 Sql 高级代理》代替本章节功能。Sql 高级代理 能够提供更容易且更易维护的方式。

9.14.1 数据库函数#

引用百度百科:

数据库函数是指当需要分析数据清单中的数值是否符合特定条件时,使用数据库工作表函数。

简单来说,数据库函数就是用于子计算的函数。其计算的结果可以用于构建 sql 语句。

9.14.1.1 支持标量函数的数据库#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.14.1.2 支持表值函数的数据库#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.14.2 数据库函数类型#

在关系型数据库中,数据库函数有这两种类型:

  • 标量函数:只能返回单个值
  • 表值函数:只能返回一个结果集

9.14.3 函数的使用#

9.14.3.1 标量函数返回 object#

// ISqlRepository 方法
var value = _sqlRepository.SqlFunctionScalar("func_GetValue");
+

9.14 函数操作

温馨提示

推荐使用 《9.17 Sql 高级代理》代替本章节功能。Sql 高级代理 能够提供更容易且更易维护的方式。

9.14.1 数据库函数#

引用百度百科:

数据库函数是指当需要分析数据清单中的数值是否符合特定条件时,使用数据库工作表函数。

简单来说,数据库函数就是用于子计算的函数。其计算的结果可以用于构建 sql 语句。

9.14.1.1 支持标量函数的数据库#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.14.1.2 支持表值函数的数据库#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.14.2 数据库函数类型#

在关系型数据库中,数据库函数有这两种类型:

  • 标量函数:只能返回单个值
  • 表值函数:只能返回一个结果集

9.14.3 函数的使用#

9.14.3.1 标量函数返回 object#

// ISqlRepository 方法
var value = _sqlRepository.SqlFunctionScalar("func_GetValue");
// ISqlDispatchProxy 方式
var value = _sqlExecuteProxy.GetValue(); // 推荐方式
// 实体仓储方式
var value = _personRepository.SqlFunctionScalar("func_GetValue");
// IRepository 非泛型方式
var value = _repository.Sql().SqlFunctionScalar("func_GetValue");
@@ -44,14 +44,14 @@
public FurDbContext(DbContextOptions<FurDbContext> options) : base(options)
{
}
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity(typeof(F_Person)).HasNoKey();
modelBuilder.HasDbFunction(() => GetPersons(default));
}
}
}

9.14.5.4 在 Linq 中使用#

IQueryable<F_Person> query = _repository.DynamicDbContext.GetPersons(1);
var result = query.Where(u => u.Name.Equals("Furion")).ToList();

最终生成 Sql

SELECT [g].Id, [g].Name, [g].Age, [g].Address
FROM dbo.GetPersons(1) AS [g]
WHERE [g].Name == N'Furion';

9.14.6 在 EF Core 内置函数#

EF Core 为我们提供了很多常用的内置函数,可以在 Lambda 条件中使用,主要是通过 EF.Functions 调用,如:

_repository.Where(u => EF.Functions.DateDiffHour(u.CreatedDt, DateTime.Now) > 8).FirstOrDefault();

这个语句使用了 EF.Functions.DateDiffHour 最终生成的 Sql 如下:

SELECT TOP(1) [a].*
FROM [dbo].[TEST] AS [a]
WHERE DATEDIFF(HOUR, [a].[CREATED_DT], GETDATE()) > 8

EF Core 内置函数就不一一列出了,可以通过 EF.Functions 查看更多,如果不能满足自己的需求,那么可以自定义 Linq 标量函数

9.14.7 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-hight-query/index.html b/docs/docs/dbcontext-hight-query/index.html index 5416e5f5f22..b4baa602ff8 100644 --- a/docs/docs/dbcontext-hight-query/index.html +++ b/docs/docs/dbcontext-hight-query/index.html @@ -6,20 +6,20 @@ -9.11 高级查询操作 | Furion - - - - - - - - - +9.11 高级查询操作 | Furion + + + + + + + + +
-

9.11 高级查询操作

9.11.1 关联数据模型#

using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
+

9.11 高级查询操作

9.11.1 关联数据模型#

using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
namespace Furion.Core
{
public class Person : Entity
{
/// <summary>
/// 构造函数
/// </summary>
public Person()
{
CreatedTime = DateTime.Now;
IsDeleted = false;
}
/// <summary>
/// 姓名
/// </summary>
[MaxLength(32)]
public string Name { get; set; }
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
@@ -66,14 +66,14 @@
// 示例二
var e = DynamicExpressionParser.ParseLambda(
typeof(Customer), typeof(bool),
"City = @0 and Orders.Count >= @1",
"London", 10);

9.11.11 时态查询#

Furion 框架还提供了时态查询功能,可以查询特定时间的数据,如:

var result = rep.Entities
.AsTemporalOf(DateTime.UtcNow.AddDays(-1))
.Include(i=> i.Company)
.FirstOrDefault(i => i.Name == "Furion");

另外提供了多个时态查询方法

  • AsTemporalAll()
  • AsTemporalAsOf(date)
  • AsTemporalFrom(startDate, endDate)
  • AsTemporalBetween(startDate, endDate)
  • AsTemporalContained(startDate, endDate)

9.11.12 性能优化#

默认情况下,EF Core 会跟踪所有实体,也就是任何数据改变都会引起数据检查,所以如果只做查询操作,建议关闭实体跟踪功能。

Furion 框架提供了以下高性能实体集合:

  • DetachedEntities:脱轨/不追踪实体
  • AsQueryable():不追踪实体
  • Entities.AsNoTracking():手动关闭实体追踪

EF Core 中,复杂查询总是会生成一个 sql,也就是 AsSingleQuery(),我们也可以设置为 AsSplitQuery() 切割成多个查询。

9.11.13 分表查询小例子#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
namespace Furion.Core
{
public class Person : Entity, IEntityTypeBuilder<Person>
{
public string Name { get; set; }
/// <summary>
/// 配置实体关系
/// </summary>
/// <param name="entityBuilder"></param>
/// <param name="dbContext"></param>
/// <param name="dbContextLocator"></param>
public void Configure(EntityTypeBuilder<City> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.ToSqlQuery(
@"select * from dbo.person.2020-09-19
union all
select * from dbo.person.2020-09-20");
}
}
}
var posts = repository.Where(u => u.Id > 10).ToList();

9.11.14 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-locator/index.html b/docs/docs/dbcontext-locator/index.html index 26a826b46ff..d9f932d6acb 100644 --- a/docs/docs/dbcontext-locator/index.html +++ b/docs/docs/dbcontext-locator/index.html @@ -6,31 +6,31 @@ -9.2 数据库上下文定位器 | Furion - - - - - - - - - +9.2 数据库上下文定位器 | Furion + + + + + + + + +
-

9.2 数据库上下文定位器

9.2.1 数据库上下文定位器#

在了解数据库上下文定位器之前,我们先了解什么是 定位器定位器 就是给物体安装特殊配置,使其能够被实时追踪和定位。

那为什么需要 定位器

由于 EF Core 本身支持多个数据库上下文操作,但是通过 依赖注入 的方式默认只初始化一个数据库上下文,也就是如果我们想要操作多个数据库上下文,那么 构造函数 注入方式就会变得复杂。

所以,Furion 实现了一套 定位器 功能,通过这个 定位器 ,我们就能够通过 依赖注入 等多个方式定位到数据库上下文并初始化。

9.2.2 数据库上下文定位器作用#

  • 能够实现构造函数初始化多个数据库上下文
  • 能够避免业务层直接引用 DbContext
  • 能够实现动态切换数据库、读写分离、主从库等复杂操作

9.2.3 如何定义数据库上下文定位器#

定义数据库上下文定位器只需遵循三个原则即可:

  • 必须是公开 class 类型同时具备无参构造函数
  • 该类型必须继承 IDbContextLocator 接口
  • 数据库上下文定位器和数据库上下文必须是一对一关系,也就是不能同时被多个数据库上下文使用

数据库上下文定位器定义代码如下:

using Furion.DatabaseAccessor;
+

9.2 数据库上下文定位器

9.2.1 数据库上下文定位器#

在了解数据库上下文定位器之前,我们先了解什么是 定位器定位器 就是给物体安装特殊配置,使其能够被实时追踪和定位。

那为什么需要 定位器

由于 EF Core 本身支持多个数据库上下文操作,但是通过 依赖注入 的方式默认只初始化一个数据库上下文,也就是如果我们想要操作多个数据库上下文,那么 构造函数 注入方式就会变得复杂。

所以,Furion 实现了一套 定位器 功能,通过这个 定位器 ,我们就能够通过 依赖注入 等多个方式定位到数据库上下文并初始化。

9.2.2 数据库上下文定位器作用#

  • 能够实现构造函数初始化多个数据库上下文
  • 能够避免业务层直接引用 DbContext
  • 能够实现动态切换数据库、读写分离、主从库等复杂操作

9.2.3 如何定义数据库上下文定位器#

定义数据库上下文定位器只需遵循三个原则即可:

  • 必须是公开 class 类型同时具备无参构造函数
  • 该类型必须继承 IDbContextLocator 接口
  • 数据库上下文定位器和数据库上下文必须是一对一关系,也就是不能同时被多个数据库上下文使用

数据库上下文定位器定义代码如下:

using Furion.DatabaseAccessor;
namespace Furion.Core
{
public sealed class FurDbContextLocator : IDbContextLocator
{
}
}

9.2.4 默认数据库上下文定位器#

Furion 框架中已经提供了 MasterDbContextLocator 默认数据库上下文定位器,所以默认数据库上下文只需继承 AppDbContext<TDbContext> 即可。

如:只有一个数据库上下文定义:

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
namespace Furion.EntityFramework.Core
{
[AppDbContext("Sqlite3ConnectionString", DbProvider.Sqlite)]
public class DefaultDbContext : AppDbContext<DefaultDbContext> // 无需指定定位器
{
public DefaultDbContext(DbContextOptions<DefaultDbContext> options) : base(options)
{
}
}
}
关于多数据库定位器

默认数据库的定位器默认为 MasterDbContextLocator,所以无需显示指定定位器,但从第二个数据库开始,都必须指定数据库定位器。如:

  • 注册上下文:
options.AddDbPool<OtherDbContext, OtherDbContextLocator>();
  • 定义上下文
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
namespace Furion.EntityFramework.Core
{
[AppDbContext("Sqlite3ConnectionString", DbProvider.Sqlite)]
public class OtherDbContext : AppDbContext<OtherDbContext, OtherDbContextLocator> // 需指定定位器
{
public OtherDbContext(DbContextOptions<OtherDbContext> options) : base(options)
{
}
}
}

另外,Entity/IEntityIRepository 等都需要指定定位器,如:IEntity<TKey, TLocator>IRepository<TEntity, TLocator> 操作。

9.2.5 数据库上下文定位器支持对象#

目前数据库上下文支持以下多个对象:

  • AppDbContext<TEntity, TDbContextLocator>:数据上下文
  • IRepository<TEntity, TDbContextLocator:实体仓储
  • ISqlRepository<TDbContextLocator>: Sql 操作仓储
  • Func<Type, DbContext>:依赖注入获取数据库上下文
  • Entity<Tkey, TDbContextLocator> :实体配置
  • EntityBase<Tkey, TDbContextLocator1, ... TDbContextLocator8>:实体配置
  • EntityNotKey<TDbContextLocator1, ... TDbContextLocator8>:无键实体配置
  • IEntitySeedData<TEntity, TDbContextLocator1, ... TDbContextLocator8>:种子数据配置
  • IEntityTypeBuilder<TEntity, TDbContextLocator1, ... TDbContextLocator8>:实体类型构建器
  • IModelBuilderFilter<TDbContextLocator1, ... TDbContextLocator8>:模型构建筛选器
  • [QueryableFunction(DbContextLocators=Type[])]:查询函数

9.2.6 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-multi-database/index.html b/docs/docs/dbcontext-multi-database/index.html index 98527b15e3c..5846f5bd816 100644 --- a/docs/docs/dbcontext-multi-database/index.html +++ b/docs/docs/dbcontext-multi-database/index.html @@ -6,20 +6,20 @@ -9.18 多数据库操作 | Furion - - - - - - - - - +9.18 多数据库操作 | Furion + + + + + + + + +
-

9.18 多数据库操作

9.18.1 Furion 支持数据库提供器#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.18.1.1 数据库提供器对应包#

  • SqlServerMicrosoft.EntityFrameworkCore.SqlServer
  • SqliteMicrosoft.EntityFrameworkCore.Sqlite
  • CosmosMicrosoft.EntityFrameworkCore.Cosmos
  • InMemoryDatabaseMicrosoft.EntityFrameworkCore.InMemory
  • MySqlPomelo.EntityFrameworkCore.MySqlNuget需勾选预览版
  • PostgreSQLNpgsql.EntityFrameworkCore.PostgreSQL
  • OracleCitms.EntityFrameworkCore.Oracle暂未可用
  • FirebirdFirebirdSql.EntityFrameworkCore.Firebird
  • DmMicrosoft.EntityFrameworkCore.Dm
小知识

这些数据库包应该安装在 Furion.EntityFramework.Core 层。特殊情况需安装在 Furion.Core 层中,如 Mysql HasCharset() 配置。

9.18.2 多数据库服务注册#

// 注册 SqlServer
options.AddDbPool<FurDbContext>(DbProvider.SqlServer);
+

9.18 多数据库操作

9.18.1 Furion 支持数据库提供器#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.18.1.1 数据库提供器对应包#

  • SqlServerMicrosoft.EntityFrameworkCore.SqlServer
  • SqliteMicrosoft.EntityFrameworkCore.Sqlite
  • CosmosMicrosoft.EntityFrameworkCore.Cosmos
  • InMemoryDatabaseMicrosoft.EntityFrameworkCore.InMemory
  • MySqlPomelo.EntityFrameworkCore.MySqlNuget需勾选预览版
  • PostgreSQLNpgsql.EntityFrameworkCore.PostgreSQL
  • OracleCitms.EntityFrameworkCore.Oracle暂未可用
  • FirebirdFirebirdSql.EntityFrameworkCore.Firebird
  • DmMicrosoft.EntityFrameworkCore.Dm
小知识

这些数据库包应该安装在 Furion.EntityFramework.Core 层。特殊情况需安装在 Furion.Core 层中,如 Mysql HasCharset() 配置。

9.18.2 多数据库服务注册#

// 注册 SqlServer
options.AddDbPool<FurDbContext>(DbProvider.SqlServer);
// 注册 Sqlite
options.AddDbPool<FurDbContext>(DbProvider.Sqlite);
// 注册 Cosmos
options.AddDbPool<FurDbContext>(DbProvider.Cosmos);
// 注册 InMemoryDatabase
options.AddDbPool<FurDbContext>(DbProvider.InMemoryDatabase);
@@ -37,14 +37,14 @@
// 切换到 Sqlite 操作 Person表
var sqliteRepository = sqlRepository.Change<SqliteDbContextLocator>();

9.18.3.4 实体定义方式#

// 支持一个数据库
public class Person: IEntity<MySqlDbContextLocator>
{
// ....
}
// 支持多个数据库
public class Person: IEntity<MySqlDbContextLocator, SqliteDbContextLocator>
{
// ....
}
小知识

所有的 实体依赖接口或抽象类 都支持泛型方式 指定 数据库上下文定位器,最多支持 8 个。

9.18.3.5 Linq 函数方式#

public static class QueryFunctions
{
[QueryableFunction("FN_GetId", "dbo", typeof(MySqlDbContextLocator), typeof(SqliteDbContextLocator))]
public static int GetId(int id) => throw new NotSupportedException();
}

9.18.4 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-proc/index.html b/docs/docs/dbcontext-proc/index.html index 9e285e6d4cd..170f2bd650c 100644 --- a/docs/docs/dbcontext-proc/index.html +++ b/docs/docs/dbcontext-proc/index.html @@ -6,20 +6,20 @@ -9.13 存储过程操作 | Furion - - - - - - - - - +9.13 存储过程操作 | Furion + + + + + + + + +
-

9.13 存储过程操作

温馨提示

推荐使用 《9.17 Sql 高级代理》代替本章节功能。Sql 高级代理 能够提供更容易且更易维护的方式。

9.13.1 关于存储过程#

引用百度百科:

存储过程(Stored Procedure)是在大型数据库系统中,一组为了完成特定功能的 SQL 语句集,它存储在数据库中,一次编译后永久有效,用户通过指定存储过程的名字并给出参数(如果该存储过程带有参数)来执行它。

存储过程是数据库中的一个重要对象。在数据量特别庞大的情况下利用存储过程能达到倍速的效率提升。

简单来说,存储过程就是关系型数据库中(Sqlite 除外)中编写逻辑的函数/方法,通过这种方式,可以将 sql 编译缓存起来,大大提高存储过程的执行效率。

这里不讨论存储过程的优缺点。

9.13.1.1 支持存储过程的数据库#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.13.2 存储过程使用#

Furion 框架中提供了多种存储过程操作方式:

  • ISqlRepositorySql 操作仓储,可通过 依赖注入
  • ISqlDispatchProxySql 代理方式(高级用法,推荐)
  • 通过任意实体仓储操作:personRepository.SqlProcedureQuery(procName)
  • 通过字符串拓展方法:procName.SqlProcedureQuery()
  • 通过 repository.Sql().SqlProcedureQuery() 方式

9.13.2.1 初始化方式#

using Furion.DatabaseAccessor;
using Furion.DynamicApiController;
+

9.13 存储过程操作

温馨提示

推荐使用 《9.17 Sql 高级代理》代替本章节功能。Sql 高级代理 能够提供更容易且更易维护的方式。

9.13.1 关于存储过程#

引用百度百科:

存储过程(Stored Procedure)是在大型数据库系统中,一组为了完成特定功能的 SQL 语句集,它存储在数据库中,一次编译后永久有效,用户通过指定存储过程的名字并给出参数(如果该存储过程带有参数)来执行它。

存储过程是数据库中的一个重要对象。在数据量特别庞大的情况下利用存储过程能达到倍速的效率提升。

简单来说,存储过程就是关系型数据库中(Sqlite 除外)中编写逻辑的函数/方法,通过这种方式,可以将 sql 编译缓存起来,大大提高存储过程的执行效率。

这里不讨论存储过程的优缺点。

9.13.1.1 支持存储过程的数据库#

SqlServerSqliteCosmosInMemoryDatabaseMySqlPostgreSQLOracleFirebirdDm

9.13.2 存储过程使用#

Furion 框架中提供了多种存储过程操作方式:

  • ISqlRepositorySql 操作仓储,可通过 依赖注入
  • ISqlDispatchProxySql 代理方式(高级用法,推荐)
  • 通过任意实体仓储操作:personRepository.SqlProcedureQuery(procName)
  • 通过字符串拓展方法:procName.SqlProcedureQuery()
  • 通过 repository.Sql().SqlProcedureQuery() 方式

9.13.2.1 初始化方式#

using Furion.DatabaseAccessor;
using Furion.DynamicApiController;
namespace Furion.Application
{
[DynamicApiController]
public class SqlService
{
private ISqlRepository _sqlRepository;
public SqlService(ISqlRepository sqlRepository)
{
_sqlRepository = sqlRepository;
}
}
}

9.13.2.2 返回 DataTable#

// ISqlRepository 方法
var dataTable = _sqlRepository.SqlProcedureQuery("proc_GetPersons");
@@ -115,14 +115,14 @@
// 变态懒人方式,直接通过存储过程名执行
ProcedureOutputResult<(List<Test>, List<Test>)> result = "proc_Complex".SqlProcedureOutput<(List<Test>, List<Test>)>(new ProcOutputModel{});
// 获取 OUTPUT 参数值
var outputs = result.OutputValues;
// 获取 RETURN 返回值
var reval = result.ReturnValue;
// 获取返回结果集
var (list1,list2) = result.Result;
关于异步

Furion 框架每一个数据库操作都支持异步方式,由于篇幅有限,就不列举异步方式了。

9.13.3 关于 [DbParameter]#

[DbParameter] 特性是用来标注 Sql函数存储过程 参数的,可配置属性:

  • Direction:设置参数方向,ParameterDirection 枚举类型,默认 ParameterDirection.Input
  • DbType:设置参数类型,DbType 枚举类型,无默认
  • Size:设置参数长度的,int 类型

其中 Direction 属性是默认构造函数参数。

9.13.4 关于 ProcedureOutputResult#

ProcedureOutputResultProcedureOutputResult<TResult> 是复杂存储过程执行返回模型类,有以下属性:

  • OutputValues:多个输出值,ProcedureOutputValue 类型
  • ReturnValue:返回值,object 类型
  • Result:结果集,非泛型版本是 DataSet类型,否则是 泛型类型

9.13.5 存储过程参数#

所有 sql 参数都支持四种方式:

  • DbParameter[]:数组类型
  • new {}:匿名类型
  • new Class{}:强类型类型(支持复杂存储过程参数)
  • Dictionary<string,object> 类型

9.13.6 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-query/index.html b/docs/docs/dbcontext-query/index.html index 22e99ec75e5..0bd94da6dcf 100644 --- a/docs/docs/dbcontext-query/index.html +++ b/docs/docs/dbcontext-query/index.html @@ -6,20 +6,20 @@ -9.10 查询操作 | Furion - - - - - - - - - +9.10 查询操作 | Furion + + + + + + + + +
-

9.10 查询操作

9.10.1 根据主键查询一条#

// ==== 同步操作 ====
+

9.10 查询操作

9.10.1 根据主键查询一条#

// ==== 同步操作 ====
// 示例一
var person = repository.Find(1);
// 示例二
var person = repository.FindOrDefault(1);
// 示例三
var person = repository.Entities.Find(1);
@@ -132,14 +132,14 @@
// 示例三
var sum = await repository.DetachedEntities.AverageAsync(u => u.Cost);

9.10.6.7 时间查询#

var starDate = DateTime.Parse("2020-09-10");
var endDate = DateTime.Parse("2020-09-10");
var query = repository.Where(u => u.CreatedDt >= starDate && u.CreatedDt <= endDate);

9.10.6.8 模糊查询#

// 示例一
repository.Where(u => u.Name.StartWith("Furion"));
// 示例二
_testRepository.Where(u => u.Name.EndWith("Furion"));
// 示例三
_testRepository.Where(u => u.Name.Contains("Furion"));

9.10.6.9 Case When#

数据库中的 Case When 实际上对应的是我们程序中的 三元表达式 ,也就是使用 三元表达式 即可自动生成 Case When 语句。

9.10.7 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-read-write/index.html b/docs/docs/dbcontext-read-write/index.html index 21258a190bc..0e32a74cb29 100644 --- a/docs/docs/dbcontext-read-write/index.html +++ b/docs/docs/dbcontext-read-write/index.html @@ -6,20 +6,20 @@ -9.27 读写分离/主从复制 | Furion - - - - - - - - - +9.27 读写分离/主从复制 | Furion + + + + + + + + +
-

9.27 读写分离/主从复制

9.27.1 读写分离#

其实就是将数据库分为了主从库,一个主库用于写数据,多个从库完成读数据的操作,主从库之间通过某种机制进行数据的同步,是一种常见的数据库架构。

9.27.1.1 解决了什么问题#

大多数互联网业务,往往读多写少,这时候,数据库的读会首先成为数据库的瓶颈,这时,如果我们希望能够线性的提升数据库的读性能,消除读写锁冲突从而提升数据库的写性能,那么就可以使用“分组架构”(读写分离架构)。

用一句话概括,读写分离是用来解决数据库的读性能瓶颈的。

9.27.1.2 注意事项#

  • 数据库连接池要进行区分,哪些是读连接池,哪个是写连接池,研发的难度会增加;
  • 为了保证高可用,读连接池要能够实现故障自动转移;
  • 主从的一致性问题需要考虑。

9.27.2 如何实现#

Furion 在数据库模块设计之初,就考虑了读写分离这种情况,所以从底层就支持动态切换数据库上下文及读写操作方法约束。

读写分离操作主要使用 IMSRepository 仓储,该仓储已经为开发者提供方便的操作调用。当然也可以不使用该仓储。

下面就给大家演示如何读写多库读写操作。

9.27.2.1 创建 主库 数据库上下文#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
+

9.27 读写分离/主从复制

9.27.1 读写分离#

其实就是将数据库分为了主从库,一个主库用于写数据,多个从库完成读数据的操作,主从库之间通过某种机制进行数据的同步,是一种常见的数据库架构。

9.27.1.1 解决了什么问题#

大多数互联网业务,往往读多写少,这时候,数据库的读会首先成为数据库的瓶颈,这时,如果我们希望能够线性的提升数据库的读性能,消除读写锁冲突从而提升数据库的写性能,那么就可以使用“分组架构”(读写分离架构)。

用一句话概括,读写分离是用来解决数据库的读性能瓶颈的。

9.27.1.2 注意事项#

  • 数据库连接池要进行区分,哪些是读连接池,哪个是写连接池,研发的难度会增加;
  • 为了保证高可用,读连接池要能够实现故障自动转移;
  • 主从的一致性问题需要考虑。

9.27.2 如何实现#

Furion 在数据库模块设计之初,就考虑了读写分离这种情况,所以从底层就支持动态切换数据库上下文及读写操作方法约束。

读写分离操作主要使用 IMSRepository 仓储,该仓储已经为开发者提供方便的操作调用。当然也可以不使用该仓储。

下面就给大家演示如何读写多库读写操作。

9.27.2.1 创建 主库 数据库上下文#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
namespace Furion.EntityFramework.Core
{
/// <summary>
/// 主库数据库上下文
/// </summary>
[AppDbContext("MasterConnectionString")]
public class MasterDbContext : AppDbContext<MasterDbContext>
{
public MasterDbContext(DbContextOptions<MasterDbContext> options) : base(options)
{
}
}
}

数据库连接字符串:

{
"ConnectionStrings": {
"MasterConnectionString": "Server=localhost;Database=Furion;User=sa;Password=000000;MultipleActiveResultSets=True;"
}
}

9.27.2.2 创建 从库 数据库上下文#

using Furion.Core;
using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
namespace Furion.EntityFramework.Core
{
/// <summary>
/// 从库数据库上下文
/// </summary>
[AppDbContext("SlaveConnectionString")]
public class SlaveDbContext : AppDbContext<SlaveDbContext, SlaveDbContextLocator>
{
public SlaveDbContext(DbContextOptions<SlaveDbContext> options) : base(options)
{
}
}
}
特别注意

多数据库操作除了默认数据库无需自定义 数据库上下文定位器,其他数据库都需要有数据库上下文定位器。如 SlaveDbContextLocator

从库数据库上下文定位器:

using Furion.DatabaseAccessor;
namespace Furion.Core
{
/// <summary>
/// 从库数据库上下文定位器
/// </summary>
public class SlaveDbContextLocator : IDbContextLocator
{
}
}

数据库连接字符串:

{
"ConnectionStrings": {
"SlaveConnectionString": "Server=localhost;Database=FurSlave;User=sa;Password=000000;MultipleActiveResultSets=True;"
}
}

9.27.2.3 注册 主从库 数据库上下文#

using Furion.Core;
using Microsoft.Extensions.DependencyInjection;
@@ -32,14 +32,14 @@
/// <summary>
/// 新增走主库
/// </summary>
/// <param name="person"></param>
/// <returns></returns>
public void Insert(Person person)
{
_msRepository.Master<Person>().Insert(person);
}
/// <summary>
/// 查询走从库
/// </summary>
/// <returns></returns>
public List<Person> Get()
{
return _msRepository.Slave1<Person>().AsEnumerable();
}
}
}

9.27.3 主从复制#

主从复制:是一种数据备份的方案。

简单来说,是使用两个或两个以上相同的数据库,将一个数据库当做主数据库,而另一个数据库当做从数据库。在主数据库中进行相应操作时,从数据库记录下所有主数据库的操作,使其二者一模一样。

9.27.4 主从复制几种方式#

9.27.4.1 同步复制#

所谓的同步复制,意思是 Master 的变化,必须等待 Slave-1,Slave-2,...,Slave-n 完成后才能返回。 这样,显然不可取,比如,在 Web 前端页面上,用户增加了条记录,需要等待很长时间。

9.27.4.2 异步复制#

如同 AJAX 请求一样。Master 只需要完成自己的数据库操作即可。至于 Slaves 是否收到二进制日志,是否完成操作,不用关心。(推荐方式)

9.27.4.3 半同步复制#

Master 只保证 Slaves 中的一个操作成功,就返回,其他 Slave 不管。

下面将使用 SqlServer 简单配置主从复制功能。

9.27.5 SqlServer 主库配置#

9.27.5.1 添加 本地发布#

9.27.5.2 选择 分发服务器#

9.27.5.3 启用 代理#

9.27.5.4 发布数据库#

9.27.5.5 快照发布#

具体选择何种发布类型,视具体业务场景而定。

9.27.5.6 选择发布项目#

9.27.5.7 配置分发计划#

9.27.5.8 配置安全设置#

9.27.5.9 完成配置#

9.27.6 SqlServer 从库配置#

9.27.6.1 添加 本地订阅#

9.27.6.2 选择 分发服务器#

9.27.6.3 选择 分发代理位置#

9.27.6.4 选择 订阅数据库#

9.27.6.5 选择 分发安全设置#

9.27.6.6 选择 同步计划#

9.27.6.7 完成订阅#

9.27.7 分发定义监视#

9.27.8 查看主从复制结果#

特别特性

主从复制有一定迟延性,所以系统设计要有一定“容忍性"。

9.27.9 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-repository/index.html b/docs/docs/dbcontext-repository/index.html index b43a5d5db7f..c2b9054fb29 100644 --- a/docs/docs/dbcontext-repository/index.html +++ b/docs/docs/dbcontext-repository/index.html @@ -6,20 +6,20 @@ -9.4 仓储模式 | Furion - - - - - - - - - +9.4 仓储模式 | Furion + + + + + + + + +
-

9.4 仓储模式

9.4.1 什么是仓储#

在领域层和数据映射层的中介,使用类似集合的接口来存取领域对象,实际上,仓储被用于领域对象在数据库上的操作(实体 Entity 和值对象 Value types)。一般来说,我们针对不同的实体(或聚合根 Aggregate Root)会创建相对应的仓储。

简单来说,仓储就是数据存取操作的载体,但不限定于数据库。

9.4.1 内置仓储#

Furion 框架内置了一个数据库操作的仓储,方便大家拓展和集成:

关于依赖注入说明

目前能够被依赖注入解析服务的仓储有:

  • IRepository
  • IRepository<TEntity>
  • IRepository<TEntity, TDbContextLocator>
  • ISqlRepository
  • ISqlRepository<TDbContextLocator>
  • IMSRepository<TDbContextLocator1,...TDbContextLocator8>
  • IDbRepository<TDbContextLocator>

除此之后的所有仓储只能通过 rep.Constraint<TRepository>() 进行约束创建,如,只读仓储:

var readRepository = rep.Constraint<IReadableRepository<TEntity>>();

9.4.1.1 非泛型超级仓储#

  • IRepository:默认非泛型仓储接口,支持切换到任何仓储
  • EFCoreRepository:默认非泛型仓储实现

9.4.1.2 泛型实体仓储#

  • IRepository<TEntity>:默认数据库实体仓储接口
  • EFCoreRepository<TEntity>:默认数据库实体仓储实现

9.4.1.3 泛型多数据库实体仓储#

  • IRepository<TEntity, TDbContextLocator>:任意数据库的实体仓储接口
  • EFCoreRepository<TEntity, TDbContextLocator>:任意数据库的实体仓储实现

9.4.1.4 Sql 操作仓储#

  • ISqlRepository:默认数据库 Sql 操作仓储接口
  • SqlRepository:默认数据库 Sql 操作仓储实现

9.4.1.5 多数据库 Sql 操作仓储#

  • ISqlRepository<TDbContextLocator>:任意数据库的 Sql 操作仓储接口
  • SqlRepository<TDbContextLocator>:任意数据库的 Sql 操作仓储实现

9.4.1.6 只读实体仓储(支持多库)#

  • IReadableRepository<TEntity>:默认数据库只读实体仓储接口
  • IReadableRepository<TEntity, TDbContextLocator>:多数据库只读实体仓储实现

9.4.1.7 只写实体仓储(支持多库)#

  • IWritableRepository<TEntity>:默认数据库只写实体仓储接口
  • IWritableRepository<TEntity, TDbContextLocator>:多数据库只写实体仓储实现

9.4.1.8 只允许新增实体仓储(支持多库)#

  • IInsertableRepository<TEntity>:默认数据库只允许新增的实体仓储接口
  • IInsertableRepository<TEntity, TDbContextLocator>:多数据库只允许新增的实体仓储实现

9.4.1.9 只允许更新实体仓储(支持多库)#

  • IUpdateableRepository<TEntity>:默认数据库只允许更新的实体仓储接口
  • IUpdateableRepository<TEntity, TDbContextLocator>:多数据库只允许更新的实体仓储实现

9.4.1.10 只允许删除实体仓储(支持多库)#

  • IDeletableRepository<TEntity>:默认数据库只允许删除的实体仓储接口
  • IDeletableRepository<TEntity, TDbContextLocator>:多数据库只允许删除的实体仓储实现

9.4.1.11 只允许拓展操作实体仓储(支持多库)#

  • IOperableRepository<TEntity>:默认数据库只允许拓展操作实体仓储接口
  • IOperableRepository<TEntity, TDbContextLocator>:多数据库只允许拓展操作实体仓储实现

9.4.1.12 只允许 Sql 查询仓储(支持多库)#

  • ISqlReaderRepository:默认数据库只允许 Sql 查询仓储接口
  • ISqlReaderRepository<TDbContextLocator>:多数据库只允许 Sql 查询仓储实现

9.4.1.13 只允许 Sql 非查询仓储(支持多库)#

  • ISqlExecutableRepository:默认数据库只允许 Sql 非查询仓储接口
  • ISqlExecutableRepository<TDbContextLocator>:多数据库只允许 Sql 非查询仓储实现

9.4.1.14 读写分离仓储#

  • IMSRepository:最多支持 一主 7 从 仓储

9.4.1.15 定位器仓储#

  • IDbRepository<TDbContextLocator>:初始化特定数据库仓储

9.4.2 仓储使用#

Furion 提供了非常多的方式创建仓储,目的是为了让大家可以在不同的场景中使用。

9.4.2.1 构造函数注入#

private readonly IRepository<Person> _personRepository;
public FurionService(IRepository<Person> personRepository)
{
_personRepository = personRepository;
}

9.4.2.2 方法参数注入#

public async Task<List<PersonDto>> GetAll([FromServices] IRepository<Person> repository, string keyword)
{
var persons = await repository.AsQueryable().ToListAsync();
return persons.Adapt<List<PersonDto>>();
}

9.4.2.3 Db.GetRepository 获取#

// 非泛型仓储
var repository = Db.GetRepository();
+

9.4 仓储模式

9.4.1 什么是仓储#

在领域层和数据映射层的中介,使用类似集合的接口来存取领域对象,实际上,仓储被用于领域对象在数据库上的操作(实体 Entity 和值对象 Value types)。一般来说,我们针对不同的实体(或聚合根 Aggregate Root)会创建相对应的仓储。

简单来说,仓储就是数据存取操作的载体,但不限定于数据库。

9.4.1 内置仓储#

Furion 框架内置了一个数据库操作的仓储,方便大家拓展和集成:

关于依赖注入说明

目前能够被依赖注入解析服务的仓储有:

  • IRepository
  • IRepository<TEntity>
  • IRepository<TEntity, TDbContextLocator>
  • ISqlRepository
  • ISqlRepository<TDbContextLocator>
  • IMSRepository<TDbContextLocator1,...TDbContextLocator8>
  • IDbRepository<TDbContextLocator>

除此之后的所有仓储只能通过 rep.Constraint<TRepository>() 进行约束创建,如,只读仓储:

var readRepository = rep.Constraint<IReadableRepository<TEntity>>();

9.4.1.1 非泛型超级仓储#

  • IRepository:默认非泛型仓储接口,支持切换到任何仓储
  • EFCoreRepository:默认非泛型仓储实现

9.4.1.2 泛型实体仓储#

  • IRepository<TEntity>:默认数据库实体仓储接口
  • EFCoreRepository<TEntity>:默认数据库实体仓储实现

9.4.1.3 泛型多数据库实体仓储#

  • IRepository<TEntity, TDbContextLocator>:任意数据库的实体仓储接口
  • EFCoreRepository<TEntity, TDbContextLocator>:任意数据库的实体仓储实现

9.4.1.4 Sql 操作仓储#

  • ISqlRepository:默认数据库 Sql 操作仓储接口
  • SqlRepository:默认数据库 Sql 操作仓储实现

9.4.1.5 多数据库 Sql 操作仓储#

  • ISqlRepository<TDbContextLocator>:任意数据库的 Sql 操作仓储接口
  • SqlRepository<TDbContextLocator>:任意数据库的 Sql 操作仓储实现

9.4.1.6 只读实体仓储(支持多库)#

  • IReadableRepository<TEntity>:默认数据库只读实体仓储接口
  • IReadableRepository<TEntity, TDbContextLocator>:多数据库只读实体仓储实现

9.4.1.7 只写实体仓储(支持多库)#

  • IWritableRepository<TEntity>:默认数据库只写实体仓储接口
  • IWritableRepository<TEntity, TDbContextLocator>:多数据库只写实体仓储实现

9.4.1.8 只允许新增实体仓储(支持多库)#

  • IInsertableRepository<TEntity>:默认数据库只允许新增的实体仓储接口
  • IInsertableRepository<TEntity, TDbContextLocator>:多数据库只允许新增的实体仓储实现

9.4.1.9 只允许更新实体仓储(支持多库)#

  • IUpdateableRepository<TEntity>:默认数据库只允许更新的实体仓储接口
  • IUpdateableRepository<TEntity, TDbContextLocator>:多数据库只允许更新的实体仓储实现

9.4.1.10 只允许删除实体仓储(支持多库)#

  • IDeletableRepository<TEntity>:默认数据库只允许删除的实体仓储接口
  • IDeletableRepository<TEntity, TDbContextLocator>:多数据库只允许删除的实体仓储实现

9.4.1.11 只允许拓展操作实体仓储(支持多库)#

  • IOperableRepository<TEntity>:默认数据库只允许拓展操作实体仓储接口
  • IOperableRepository<TEntity, TDbContextLocator>:多数据库只允许拓展操作实体仓储实现

9.4.1.12 只允许 Sql 查询仓储(支持多库)#

  • ISqlReaderRepository:默认数据库只允许 Sql 查询仓储接口
  • ISqlReaderRepository<TDbContextLocator>:多数据库只允许 Sql 查询仓储实现

9.4.1.13 只允许 Sql 非查询仓储(支持多库)#

  • ISqlExecutableRepository:默认数据库只允许 Sql 非查询仓储接口
  • ISqlExecutableRepository<TDbContextLocator>:多数据库只允许 Sql 非查询仓储实现

9.4.1.14 读写分离仓储#

  • IMSRepository:最多支持 一主 7 从 仓储

9.4.1.15 定位器仓储#

  • IDbRepository<TDbContextLocator>:初始化特定数据库仓储

9.4.2 仓储使用#

Furion 提供了非常多的方式创建仓储,目的是为了让大家可以在不同的场景中使用。

9.4.2.1 构造函数注入#

private readonly IRepository<Person> _personRepository;
public FurionService(IRepository<Person> personRepository)
{
_personRepository = personRepository;
}

9.4.2.2 方法参数注入#

public async Task<List<PersonDto>> GetAll([FromServices] IRepository<Person> repository, string keyword)
{
var persons = await repository.AsQueryable().ToListAsync();
return persons.Adapt<List<PersonDto>>();
}

9.4.2.3 Db.GetRepository 获取#

// 非泛型仓储
var repository = Db.GetRepository();
// 泛型仓储
var repository = Db.GetRepository<Person>();
// Sql 仓储
var sqlRepository = Db.GetSqlRepository();
特别说明

不管采用哪种方式,Furion 都保证了仓储一次请求唯一性。同时 Db.GetRepository<TEntity>() 方式支持任何静态类中使用。

9.4.3 仓储高级用法#

9.4.3.1 动态切换实体仓储#

var userRepository = personRepository.Change<User>();

9.4.3.2 动态切换仓储类型#

比如,读写分离/主从库仓储:

// 只读仓储
var readRepository = personRepository.Constraint<IReadableRepository<User>>();
// 只写仓储
var writeRepository = personRepository.Constraint<IWritableRepository<User>>();
小知识

.Constraint 支持切换任何仓储类型。

9.4.3.3 获取 Sql 操作仓储#

var sqlRepository = repository.Sql();

9.4.4 多数据库操作#

Furion 通过 DbContextLocator 数据库上下文定位器实现多种数据库操作,可以随意切换数据库

9.4.4.1 动态切换多个数据库#

动态切换数据库#

// 切换到 MSSQL 操作 Person表
var mssqlRepository = repository.Change<Person, MsSqlDbContextLocator>();
@@ -27,14 +27,14 @@
// 切换到 Sqlite 操作 Person表
var sqliteRepository = repository.Change<Person, SqliteDbContextLocator>();
// 其他更多数据库一样的操作

另外任何仓储或实体配置都支持多个数据库同时操作#

仓储方式

IRepository<Person, MsSqlDbContextLocator> mssqlRepository
ISqlRepository<MsSqlDbContextLocator> mssqlRepository;

动态 sql 方式

"select * from person".Change<MsSqlDbContextLocator>().SqlQuery();

实体配置方式

public class User:Entity<MsSqlDbContextLocator, MySqlDbContextLocator>
{
}

Sql 代理方式

[SqlFunction("funcName", DbContextLocator = typeof(MySqlDbContextLocator))]
int GetAge(int id);

Linq 中方式

[QueryableFunction("funcName","dbo", DbContextLocator = typeof(MySqlDbContextLocator))]
string GetName()=> throw Oops.Oh("不支持该数据库操作");

9.4.5 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-seed-data/index.html b/docs/docs/dbcontext-seed-data/index.html index ef21dab9ec1..0ee55ad5124 100644 --- a/docs/docs/dbcontext-seed-data/index.html +++ b/docs/docs/dbcontext-seed-data/index.html @@ -6,34 +6,34 @@ -9.21 实体种子数据 | Furion - - - - - - - - - +9.21 实体种子数据 | Furion + + + + + + + + +
-

9.21 实体种子数据

9.21.1 什么是种子数据#

Furion 框架种,种子数据通常指的是通过程序为数据库预先设置一些初始化数据,比如我们的数据字典表,我们可能希望在系统构建初期就自动将一些规范化数据保存到数据库中。

如性别:男/女,地区,行业信息等等。

9.21.2 如何配置#

Furion 提供非常灵活方便的 IEntitySeedData<TEntity> 依赖接口可以快速的构建种子数据,支持任何无参构造函数对象类中使用。如我们需要为 Person 表插入初始化数据:

9.21.2.1 在实体定义中使用#

using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
+

9.21 实体种子数据

9.21.1 什么是种子数据#

Furion 框架种,种子数据通常指的是通过程序为数据库预先设置一些初始化数据,比如我们的数据字典表,我们可能希望在系统构建初期就自动将一些规范化数据保存到数据库中。

如性别:男/女,地区,行业信息等等。

9.21.2 如何配置#

Furion 提供非常灵活方便的 IEntitySeedData<TEntity> 依赖接口可以快速的构建种子数据,支持任何无参构造函数对象类中使用。如我们需要为 Person 表插入初始化数据:

9.21.2.1 在实体定义中使用#

using Furion.DatabaseAccessor;
using System;
using System.Collections.Generic;
namespace Furion.Core
{
public class Person : EntityBase, IEntitySeedData<Person>
{
public string Name { get; set; }
public int Age { get; set; }
public string Address { get; set; }
// 配置种子数据
public IEnumerable<Person> HasData(DbContext dbContext, Type dbContextLocator)
{
return new List<Person>
{
new Person { Id = 1, Name = "百小僧", Address = "广东省中山市" },
new Person { Id = 2, Name = "新生帝", Address = "广东省珠海市" }
};
}
}
}
特别注意

主键 值必须手动插入,因为会自动关闭主键或自增标识检查。

9.21.2.2 在任意对象类中使用#

using Furion.DatabaseAccessor;
using System.Collections.Generic;
namespace Furion.Application
{
public class PersonSeedData : IEntitySeedData<Person>
{
// 配置种子数据
public IEnumerable<Person> HasData(DbContext dbContext, Type dbContextLocator)
{
return new List<Person>
{
new Person { Id = 1, Name = "百小僧", Address = "广东省中山市" },
new Person { Id = 2, Name = "新生帝", Address = "广东省珠海市" }
};
}
}
}

9.21.3 导航属性#

通常我们的实体有 一对多多对多等外键关系,那么我们需要单独为每一个实体添加数据种子,而不是直接写在主表中。

9.21.4 多个数据库种子数据#

Furion 提供泛型的方式支持多个数据库种子数据设定,如:

using Furion.DatabaseAccessor;
using System.Collections.Generic;
namespace Furion.Application
{
public class PersonSeedData : IEntitySeedData<Person, MySqlDbContextLocator, SqliteDbContextLocator>
{
// 配置种子数据
public IEnumerable<Person> HasData(DbContext dbContext, Type dbContextLocator)
{
return new List<Person>
{
new Person { Id = 1, Name = "百小僧", Address = "广东省中山市" },
new Person { Id = 2, Name = "新生帝", Address = "广东省珠海市" }
};
}
}
}

上面的例子表示同时为 MySqlDbContextSqliteDbContext 创建种子数据。

9.21.5 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 数据种子 知识可查阅 EF Core - 数据种子设定 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-sql-proxy/index.html b/docs/docs/dbcontext-sql-proxy/index.html index 4bded697d12..4a2c567c7a4 100644 --- a/docs/docs/dbcontext-sql-proxy/index.html +++ b/docs/docs/dbcontext-sql-proxy/index.html @@ -6,20 +6,20 @@ -9.17 Sql 高级代理 | Furion - - - - - - - - - +9.17 Sql 高级代理 | Furion + + + + + + + + +
-

9.17 Sql 高级代理

9.17.1 关于 Sql 代理#

Sql 代理是 Furion 框架中对 Sql 操作一个非常重要的概念,通过这种方式可以大大提高 Sql 书写效率,而且后期极易维护。

Sql 代理属于 Furion 框架中一个高级功能。

9.17.2 了解 ISqlDispatchProxy#

ISqlDispatchProxy 接口是 Furion 实现被代理接口的唯一依赖,任何公开的接口一旦集成了 ISqlDispatchProxy 接口,那么这个接口就是被托管拦截Sql 操作接口。

简单定义一个 Sql 代理接口

using Furion.DatabaseAccessor;
+

9.17 Sql 高级代理

9.17.1 关于 Sql 代理#

Sql 代理是 Furion 框架中对 Sql 操作一个非常重要的概念,通过这种方式可以大大提高 Sql 书写效率,而且后期极易维护。

Sql 代理属于 Furion 框架中一个高级功能。

9.17.2 了解 ISqlDispatchProxy#

ISqlDispatchProxy 接口是 Furion 实现被代理接口的唯一依赖,任何公开的接口一旦集成了 ISqlDispatchProxy 接口,那么这个接口就是被托管拦截Sql 操作接口。

简单定义一个 Sql 代理接口

using Furion.DatabaseAccessor;
namespace Furion.Application
{
public interface ISql : ISqlDispatchProxy
{
}
}

一旦这个接口继承了 ISqlDispatchProxy,那么它就会动态创建接口实例,而且支持依赖注入/控制反转获取实例

9.17.3 开始领略 Sql 代理#

下面我讲通过多个例子来演示 Sql 代理的用法,为什么推荐这种方式操作 Sql

支持各种方式获取实例:

9.17.3.1 构造函数方式#

private readonly Isql _sql;
public FurionService(Isql sql)
{
_sql = sql;
}

9.17.3.2 方法参数注入#

public async Task<List<PersonDto>> GetAll([FromServices] Isql, string keyword)
{
}

9.17.3.3 Db.GetSqlDispatchProxy<ISql>()#

var sql = Db.GetSqlDispatchProxy<ISql>();

9.17.4 Sql 操作#

9.17.4.1 返回 DataTable#

using Furion.DatabaseAccessor;
namespace Furion.Application
{
public interface ISql : ISqlDispatchProxy
{
// 执行sql并传入参数,基元类型
[SqlExecute("select * from person where id >@id and name like %@name%")]
DataTable GetPerson(int id, string name);
// 执行sql并传入参数,对象类型
[SqlExecute("select * from person where id >@id and name like %@name%")]
DataTable GetPerson(MyParam paras));
@@ -70,14 +70,14 @@
[SqlProcedure("PROC_Name")]
ProcedureOutputResult<(List<Person>, List<Student>)> GetOutput(ProcOutputModel pams);
}
}

9.17.5 函数 操作#

using Furion.DatabaseAccessor;
namespace Furion.Application
{
public interface ISql : ISqlDispatchProxy
{
[SqlFunction("FN_Name")] // 标量函数
string GetValue(MyParam dto);
[SqlProcedure("FN_Name")] // 表值函数
List<Person> GetPersons(int id);
}
}
补充说明

Sql 代理会自动判断返回值然后自动执行特定函数类型。

9.17.6 为什么用它?#

通过上面的例子大家就可以了解,这种方式操作 sql 非常简单,而且极易维护。大家不用去关心返回值,关心用哪个方法,所有东西会自动给你处理好。

所以,如果需要用 Sql 操作,推荐使用 Sql 高级代理。

9.17.7 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-sql-template/index.html b/docs/docs/dbcontext-sql-template/index.html index e62a895d0a2..066e460f9fc 100644 --- a/docs/docs/dbcontext-sql-template/index.html +++ b/docs/docs/dbcontext-sql-template/index.html @@ -6,30 +6,30 @@ -9.16 Sql 模板 | Furion - - - - - - - - - +9.16 Sql 模板 | Furion + + + + + + + + +
-

9.16 Sql 模板

9.16.1 Sql 模板#

通常我们程序中执行数据库的 sql 语句都写在了程序集中,随程序一起编译,后续需要修改,则重新编译代码。

所以,Furion 创造出一种 Sql 模板的方式,程序执行 Sql 时,只需要使用特殊标记即可:#(模板Key),这些真实的 Sql 配置在 .json.xml 配置文件中。

如:

  • Json 方式
{
"Select.User": "select * from User where id > @id"
}
  • Xml 方式
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<Select.User>select * from User where id > @id</Select.User>
</configuration>

9.16.2 Sql 模板优缺点#

9.16.2.1 优点#

  • 支持 Sql 动态配置,可在程序运行时动态调配 Sql 语句
  • 支持程序 Sql 语句加密

9.16.2.2 缺点#

  • 需增加对应配置文件
  • 不容易调试 Sql 代码

9.16.3 如何使用#

在执行 Sql 的时候,只需要填写指定模板即可。

9.16.3.1 常规使用#

// 仓储方式
var users = repository.SqlQuery<User>("#(Select.User)", new { id = 1});
+

9.16 Sql 模板

9.16.1 Sql 模板#

通常我们程序中执行数据库的 sql 语句都写在了程序集中,随程序一起编译,后续需要修改,则重新编译代码。

所以,Furion 创造出一种 Sql 模板的方式,程序执行 Sql 时,只需要使用特殊标记即可:#(模板Key),这些真实的 Sql 配置在 .json.xml 配置文件中。

如:

  • Json 方式
{
"Select.User": "select * from User where id > @id"
}
  • Xml 方式
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<Select.User>select * from User where id > @id</Select.User>
</configuration>

9.16.2 Sql 模板优缺点#

9.16.2.1 优点#

  • 支持 Sql 动态配置,可在程序运行时动态调配 Sql 语句
  • 支持程序 Sql 语句加密

9.16.2.2 缺点#

  • 需增加对应配置文件
  • 不容易调试 Sql 代码

9.16.3 如何使用#

在执行 Sql 的时候,只需要填写指定模板即可。

9.16.3.1 常规使用#

// 仓储方式
var users = repository.SqlQuery<User>("#(Select.User)", new { id = 1});
// 懒人方式
var users = "#(Select.User)".SqlQuery<User>(new { id = 1});
// Sql 代理方式
[SqlExecute("#(Select.User)")]
List<User> GetUser(int id);

9.16.3.2 高级嵌套#

var users = repository.SqlQuery<User>(
@"select * from user u
left join #(User.Detail) d on u.Id = d.UserId
where id > @id");

9.16.4 Sql 模板配置#

9.16.4.1 普通模式#

{
"Select.User": "select * from User"
}

9.16.4.2 更多配置#

{
"Select.User": {
"Sql": "select * from User where id > @id and Name = @name",
"Params": [
{
"Name": " Id",
"Value": "1",
"DbType": "Int16",
"Size": 10
},
{
"Name": " Name",
"Value": "百小僧",
"DbType": "String",
"Size": 10
}
]
}
}

9.16.5 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-sql/index.html b/docs/docs/dbcontext-sql/index.html index f97a08a46c7..0526825acad 100644 --- a/docs/docs/dbcontext-sql/index.html +++ b/docs/docs/dbcontext-sql/index.html @@ -6,20 +6,20 @@ -9.15 Sql 操作 | Furion - - - - - - - - - +9.15 Sql 操作 | Furion + + + + + + + + +
-

9.15 Sql 操作

温馨提示

推荐使用 《9.17 Sql 高级代理》代替本章节功能。Sql 高级代理 能够提供更容易且更易维护的方式。

9.15.1 关于 Sql#

Furion 框架提供非常多且灵活的 sql 操作方法,且性能不输于 dapper,同时逼近 ADO.NET 原生操作。

9.15.2 懒人无敌 Sql 🐮#

9.15.2.1 返回 DataTable#

// ==== 同步操作 ====
+

9.15 Sql 操作

温馨提示

推荐使用 《9.17 Sql 高级代理》代替本章节功能。Sql 高级代理 能够提供更容易且更易维护的方式。

9.15.1 关于 Sql#

Furion 框架提供非常多且灵活的 sql 操作方法,且性能不输于 dapper,同时逼近 ADO.NET 原生操作。

9.15.2 懒人无敌 Sql 🐮#

9.15.2.1 返回 DataTable#

// ==== 同步操作 ====
// 示例一
var dataTable = "select * from person".SqlQuery();
// 示例二
var dataTable = "select top 10 * from person where id > @id".SqlQuery(new {id = 10});
// 示例三
var dataTable = "select Id, Name, Age from person where name like @name".SqlQuery(new Dictionary<string,object>{ {"name", "%Furion%"} });
@@ -167,14 +167,14 @@
// 示例五
var persons = sqlRepository.SqlQuery<Person>("select * from person where id > @id", new { id = 10});
// 不再举例子。。。
补充说明

不管是那种方式操作 Sql ,方法名参数都是一致的,如:

  • SqlQuery
  • SqlQueryAsync
  • SqlQueries
  • SqlQueriesAsync
  • SqlNonQuery
  • SqlNonQueryAsync
  • SqlScalar
  • SqlScalarAsync
  • SqlProcedureQuery
  • SqlProcedureQueryAsync
  • SqlProcedureQueries
  • SqlProcedureQueriesAsync
  • SqlProcedureScalar
  • SqlProcedureScalarAsync
  • SqlProcedureNonQuery
  • SqlProcedureNonQueryAsync
  • SqlProcedureOutput
  • SqlProcedureOutputAsync
  • SqlFunctionScalar
  • SqlFunctionScalarAsync
  • SqlFunctionQuery
  • SqlFunctionQuery

9.15.6 IRepository 操作#

IRepository 也能操作 sql,调用方法也是和上面一致的,如:

var dataTable = repository.Sql().SqlQuery("select * from person");
特别说明

由于篇幅有限,不再列举所有例子。

9.15.7 IRepository<TEntity> 操作#

IRepository<TEntity> 也能操作 sql,调用方法也是和上面一致的,如:

var dataTable = personRepository.SqlQuery("select * from person");
特别说明

由于篇幅有限,不再列举所有例子。

9.15.8 关于 Sql 参数#

所有 sql存储过程函数 参数都支持四种方式:

  • DbParameter[]:数组类型
  • new {}:匿名类型
  • new Class{}:强类型类型(支持复杂存储过程参数)
  • Dictionary<string,object> 类型
小知识

建议除了复杂的存储过程(带 OUTPUT/RETURN)的以外,所有参数建议使用 new {} 匿名类型,如果需要动态参数,则可以使用 Dictionary<string,object> 类型。

9.15.9 多数据库 Sql 操作 💯 💛#

Furion 框架拥有非常灵活的多数据库操作方式,只需通过多数据库上下文定位器即可动态切换数据库。

9.15.9.1 懒人无敌 🐮 方式#

var dataTable = "select * from person".Change<MySqlDbContextLocator>().SqlQuery();
var persons = "select * from person whre id > @id".Change<SqliteDbContextLocator>().SqlQuery<Person>();
补充说明

懒人方式 只需要通过 Change<TDbContextLocator> 方式即可动态切换数据库。

9.15.9.2 ISqlRepository 方式#

只需要通过 ISqlRepository<TDbContextLocator> 注入或通过 sqlRepository.Change<TDbContextLocator>() 切换。

9.15.9.3 IRepository 方式#

只需要通过 repository.Change<TDbContextLocator>() 获取即可。

9.15.9.4 IRepository<TEntity> 方式#

只需要通过 IRepository<TEntity, TDbContextLocator> 注入或通过 personRepository.Change<TEntity, TDbContextLocator>() 切换。

9.15.10 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-update/index.html b/docs/docs/dbcontext-update/index.html index 6ff15a40c71..f6acc31b639 100644 --- a/docs/docs/dbcontext-update/index.html +++ b/docs/docs/dbcontext-update/index.html @@ -6,20 +6,20 @@ -9.6 更新操作 | Furion - - - - - - - - - +9.6 更新操作 | Furion + + + + + + + + +
-

9.6 更新操作

9.6.1 更新全部列(不立即提交)#

// ==== 同步操作 ====
+

9.6 更新操作

9.6.1 更新全部列(不立即提交)#

// ==== 同步操作 ====
// 示例一
repository.Update(user);
// 示例二
user.Update();
// 示例三
repository.ChangeEntityState(user, EntityState.Modified);
@@ -168,14 +168,14 @@
// 示例一
await repository.UpdateNowAsync(user, user2);
// 示例二
await repository.UpdateNowAsync(new List<User> { user, user2 });
// 示例三
await repository.UpdateNowAsync(new[] {user, user2 });
小知识

所有带 Now 结尾的表示立即提交到数据库,也就是立即调用 SaveChangesSaveChangesAsync

9.6.15 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext-view/index.html b/docs/docs/dbcontext-view/index.html index 58fc872e4bb..3aceeb015d8 100644 --- a/docs/docs/dbcontext-view/index.html +++ b/docs/docs/dbcontext-view/index.html @@ -6,20 +6,20 @@ -9.12 视图操作 | Furion - - - - - - - - - +9.12 视图操作 | Furion + + + + + + + + +
-

9.12 视图操作

9.12.1 关于视图#

视图是数据库中非常重要的对象,是一张虚拟表,通过视图我们可以对结果进行筛选缓存,同时还能实现颗粒化权限控制,如控制指定行,指定列。

9.12.2 视图的使用#

Furion 中实现视图的操作非常简单,只需要创建视图模型,并继承 EntityNotKey 基类即可。代码如下:

9.12.2.1 创建视图 SQL#

CREATE VIEW V_Person AS
SELECT Id,Name,Age,Address FROM person

9.12.2.2 视图模型#

using Furion.DatabaseAccessor;
+

9.12 视图操作

9.12.1 关于视图#

视图是数据库中非常重要的对象,是一张虚拟表,通过视图我们可以对结果进行筛选缓存,同时还能实现颗粒化权限控制,如控制指定行,指定列。

9.12.2 视图的使用#

Furion 中实现视图的操作非常简单,只需要创建视图模型,并继承 EntityNotKey 基类即可。代码如下:

9.12.2.1 创建视图 SQL#

CREATE VIEW V_Person AS
SELECT Id,Name,Age,Address FROM person

9.12.2.2 视图模型#

using Furion.DatabaseAccessor;
namespace Furion.Core
{
public class V_Person : EntityNotKey
{
/// <summary>
/// 配置视图名
/// </summary>
public V_Person() : base("V_Person")
{
}
/// <summary>
/// 主键Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 姓名
/// </summary>
public string Name { get; set; }
@@ -28,14 +28,14 @@
namespace Furion.Application.Persons
{
public class FurionService : IDynamicApiController
{
private readonly IReadableRepository<V_Person> _readableRepository;
public FurionService(IRepository<V_Person> repository)
{
// 初始化只读仓储
_readableRepository = repository.Constraint<IReadableRepository<V_Person>>();
}
/// <summary>
/// 读取视图
/// </summary>
/// <returns></returns>
public async Task<List<V_Person>> GetVPerson()
{
var list = await _readableRepository.AsAsyncEnumerable();
return list;
}
}
}
小知识

通过 .Constraint<TEntity,TDbContextLocator> 方法可以将仓储约束为特定仓储,如只读仓储,可读可写仓储,只新增仓储等。

9.12.5 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dbcontext/index.html b/docs/docs/dbcontext/index.html index 8359eb22b87..be019a30316 100644 --- a/docs/docs/dbcontext/index.html +++ b/docs/docs/dbcontext/index.html @@ -6,20 +6,20 @@ -9.1 数据库上下文 | Furion - - - - - - - - - +9.1 数据库上下文 | Furion + + + + + + + + +
-

9.1 数据库上下文

连接字符串配置注意事项

如果连接字符串是配置在自定义的 .json 文件中,那么必须在 Visual Studio 中配置 .json 右键属性,设置 复制 输出目录为 如果较新则复制,生成操作为:内容

否则就会提示找不到配置或连接字符串的错误。

9.1.1 数据库上下文#

简单来说,数据库上下文是负责和数据库交互的对象,提供程序对数据库存取提供了大量的方法。

Furion 框架中,默认集成了微软亲儿子:EntityFramework Core ,也就是通常数据库上下文指的是 DbContext 类或它的实现类。

9.1.2 AppDbContext#

在我们实际项目开发过程中,使用 EFCore 提供的 DbContext 操作对象操作数据库有些繁琐和复杂,且默认不具备读写分离、多库等操作功能。

所以,Furion 框架提供了 AppDbContext<TDbContext, TDbContextLocator> 数据库上下文,该上下文继承自 DbContext

特别说明

后续章节,皆采用 EFCore 代替 EntityFramework Core

9.1.3 AppDbContextDbContext 区别#

  • AppDbContext 继承自 DbContext,具备 DbContext 所有功能。
  • AppDbContext 支持多数据库操作泛型版本,如:AppDbContext<TDbContext, TDbContextLocator>
  • AppDbContext 自动配置实体信息,无需在 OnModelCreating 中配置
  • AppDbContext 支持内置多租户支持
  • AppDbContext 支持全局模型配置拦截器
  • AppDbContext 支持数据提交更改多个事件
  • AppDbContext 提供更加强大的模型操作能力,如 Sql 操作,读写分离等
  • AppDbContext 能够得到 Furion 框架更多的功能支持

9.1.4 如何定义数据库上下文#

Furion 框架中了,提供了两种 AppDbContext 定义方式:

  • AppDbContext<TDbContext> 操作默认数据库
  • AppDbContext<TDbContext, TDbContextLocator> 操作 N 个数据库

其中 AppDbContext<TDbContext> 默认继承自 AppDbContext<TDbContext, TDbContextLocator>

下面是数据库上下文创建的多个例子:

9.1.4.1 创建默认数据库上下文#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
+

9.1 数据库上下文

连接字符串配置注意事项

如果连接字符串是配置在自定义的 .json 文件中,那么必须在 Visual Studio 中配置 .json 右键属性,设置 复制 输出目录为 如果较新则复制,生成操作为:内容

否则就会提示找不到配置或连接字符串的错误。

9.1.1 数据库上下文#

简单来说,数据库上下文是负责和数据库交互的对象,提供程序对数据库存取提供了大量的方法。

Furion 框架中,默认集成了微软亲儿子:EntityFramework Core ,也就是通常数据库上下文指的是 DbContext 类或它的实现类。

9.1.2 AppDbContext#

在我们实际项目开发过程中,使用 EFCore 提供的 DbContext 操作对象操作数据库有些繁琐和复杂,且默认不具备读写分离、多库等操作功能。

所以,Furion 框架提供了 AppDbContext<TDbContext, TDbContextLocator> 数据库上下文,该上下文继承自 DbContext

特别说明

后续章节,皆采用 EFCore 代替 EntityFramework Core

9.1.3 AppDbContextDbContext 区别#

  • AppDbContext 继承自 DbContext,具备 DbContext 所有功能。
  • AppDbContext 支持多数据库操作泛型版本,如:AppDbContext<TDbContext, TDbContextLocator>
  • AppDbContext 自动配置实体信息,无需在 OnModelCreating 中配置
  • AppDbContext 支持内置多租户支持
  • AppDbContext 支持全局模型配置拦截器
  • AppDbContext 支持数据提交更改多个事件
  • AppDbContext 提供更加强大的模型操作能力,如 Sql 操作,读写分离等
  • AppDbContext 能够得到 Furion 框架更多的功能支持

9.1.4 如何定义数据库上下文#

Furion 框架中了,提供了两种 AppDbContext 定义方式:

  • AppDbContext<TDbContext> 操作默认数据库
  • AppDbContext<TDbContext, TDbContextLocator> 操作 N 个数据库

其中 AppDbContext<TDbContext> 默认继承自 AppDbContext<TDbContext, TDbContextLocator>

下面是数据库上下文创建的多个例子:

9.1.4.1 创建默认数据库上下文#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
namespace Furion.EntityFramework.Core
{
[AppDbContext("连接字符串或appsetting.json 键")]
public class FurDbContext : AppDbContext<FurDbContext> // 继承 AppDbContext<> 类
{
/// <summary>
/// 继承父类构造函数
/// </summary>
/// <param name="options"></param>
public FurDbContext(DbContextOptions<FurDbContext> options) : base(options)
{
}
}
}

9.1.4.2 创建其他数据库上下文#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
namespace Furion.EntityFramework.Core
{
[AppDbContext("连接字符串或appsetting.json 键")]
public class FurOtherDbContext : AppDbContext<FurOtherDbContext, FurOtherDbContextLocator> // 继承 AppDbContext<> 类
{
/// <summary>
/// 继承父类构造函数
/// </summary>
/// <param name="options"></param>
public FurOtherDbContext(DbContextOptions<FurOtherDbContext> options) : base(options)
{
}
}
}
特别注意

所有数据库上下文都应该在 Furion.EntityFramework.Core 项目中创建。另外如果系统用到了多个数据库,那么从第二个开始必须指定数据库上下文定位器。关于 TDbContextLocator 将在下一章节 《9.2 数据库上下文定位器》阐述。

9.1.5 配置连接字符串#

Furion 框架提供多种数据库连接字符串配置方式:

  • 在注册数据库服务时配置:AddSqlServerPool<TDbContext>("连接字符串") 方式
  • 使用 [AppDbContext("连接字符串/Key")] 特性方式(只在 AppDbContext 实现类有效推荐
  • 通过重写 OnConfiguring(DbContextOptionsBuilder optionsBuilder) 配置

9.1.5.1 在注册数据库服务时配置#

Furion.EntityFramework.Core\FurEntityFrameworkCoreStartup.cs
using Furion.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
namespace Furion.EntityFramework.Core
{
[AppStartup(600)]
public sealed class FurEntityFrameworkCoreStartup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
// 配置数据库上下文,支持N个数据库
services.AddDatabaseAccessor(options =>
{
// 配置默认数据库
options.AddDbPool<FurDbContext>(DbProvider.SqlServer, connectionString:"连接字符串");
@@ -31,14 +31,14 @@
namespace Furion.EntityFramework.Core
{
[AppStartup(600)]
public sealed class FurEntityFrameworkCoreStartup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddDatabaseAccessor(options =>
{
options.AddDbPool<FurDbContext>(DbProvider.Sqlite);
});
}
}
}

如果有多个数据库操作,那么从第二个起,就需要绑定数据库上下文定位器,如:

options.AddDbPool<FurDbContext>(DbProvider.Sqlite); // 第一个数据库
options.AddDbPool<SecondDbContext, SecondDbContextDbContextLocator>(DbProvider.SqlServer); // 第二个数据库
options.AddDbPool<ThirdDbContext, ThirdDbContextDbContextLocator>(DbProvider.SqlServer); // 第三个数据库

9.1.8 动态数据库上下文对象#

Furion 框架中,数据库上下文是定义在 Furion.EntityFramework.Core 项目层,并且该层不被 Furion.ApplicationFurion.Core 等层引用。

所以就不能直接在 Furion.Application 项目层直接使用 Furion.EntityFramework.Core 定义的数据库上下文。

Furion 为了解决这个问题,提供了两种方式处理:

  • respository.Context :当前数据库上下文对象,返回是 DbContext 抽象类型
  • respository.DynamicContext:当前数据库上下文对象,返回的是 dynamic 类型

如果你只是想使用 DbContext 的功能,直接使用 respository.Context 即可,如:

respository.Context.SaveChanges();

如果你想能够获取具体的数据库上下文类型,如 MyDbContext,那么使用 respository.DynamicContext 就可以获取到具体的 MyDbContext 类型。如:

var persons = respository.DynamicContext.Persons.Find(1);
var users = respository.DynamicContext.Users;

这样就可以直接操作 MyDbContext 定义的属性和方法了。

9.1.9 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 数据库上下文 知识可查阅 EF Core - 配置 DbContext 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dependency-injection/index.html b/docs/docs/dependency-injection/index.html index f4cd7207f1f..1088d389be3 100644 --- a/docs/docs/dependency-injection/index.html +++ b/docs/docs/dependency-injection/index.html @@ -6,20 +6,20 @@ -12. 依赖注入/控制反转 | Furion - - - - - - - - - +12. 依赖注入/控制反转 | Furion + + + + + + + + +
-

12. 依赖注入/控制反转

12.1 依赖注入#

所谓依赖注入,是指程序运行过程中,如果需要调用另一个对象协助时,无须在代码中创建被调用者,而是依赖于外部的注入。

通俗来讲,就是把有依赖关系的类放到容器中,然后在我们需要这些类时,容器自动解析出这些类的实例。

依赖注入最大的好处时实现类的解耦,利于程序拓展、单元测试、自动化模拟测试等。

依赖注入的英文为:Dependency Injection,简称 DI

12.2 控制反转#

控制反转只是一个概念,也就是将创建对象实例的控制权(原本是程序员)从代码控制权剥离到 IOC 容器 中控制。

控制反转的英文为:Inversion of Control,简称 IOC

12.3 IOC/DI 优缺点#

传统的代码,每个对象负责管理与自己需要依赖的对象,导致如果需要切换依赖对象的实现类时,需要修改多处地方。同时,过度耦合也使得对象难以进行单元测试。

  • 优点

    • 依赖注入把对象的创造交给外部去管理,很好的解决了代码紧耦合(tight couple)的问题,是一种让代码实现松耦合(loose couple)的机制
    • 松耦合让代码更具灵活性,能更好地应对需求变动,以及方便单元测试
  • 缺点

    • 目前主流的 IOC/DI 基本采用反射的方式来实现依赖注入,在一定程度会影响性能
特别说明

在本章节不打算细讲 依赖注入/控制反转 具体实现和应用场景,想了解更多知识,可查阅 【ASP.NET Core 依赖注入】 官方文档。

12.4 依赖注入的三种方式#

12.4.1 构造方法注入#

目前构造方法注入是依赖注入推荐使用方式。

  • 优点

    • 在构造方法中体现出对其他类的依赖,一眼就能看出这个类需要其他那些类才能工作
    • 脱离了 IOC 框架,这个类仍然可以工作,POJO 的概念
    • 一旦对象初始化成功了,这个对象的状态肯定是正确的
  • 缺点

    • 构造函数会有很多参数(Bad smell)
    • 有些类是需要默认构造函数的,比如 MVC 框架的 Controller 类,一旦使用构造函数注入,就无法使用默认构造函数
    • 这个类里面的有些方法并不需要用到这些依赖(Bad smell)

代码示例:

public class FurionService
{
private readonly IRepository _repository;
public FurionService(IRepository repository)
{
_repository = repository;
}
}

12.4.2 属性方式注入#

特别声明

Furion 新版本中,已经移除属性注入功能,建议使用构造函数或方法方式注入,也可以通过 App.GetService<TService> 方式注入。

通过属性方式注入容易和类的实例属性混淆,不建议使用。

  • 优点

    • 在对象的整个生命周期内,可以随时动态的改变依赖
    • 非常灵活
  • 缺点

    • 对象在创建后,被设置依赖对象之前这段时间状态是不对的
    • 不直观,无法清晰地表示哪些属性是必须的
public class FurionService
{
public IRepository Repository { get; set; }
}

12.4.3 方法参数注入#

方法参数注入的意思是在创建对象后,通过自动调用某个方法来注入依赖。

  • 优点:

    • 比较灵活
  • 缺点:

    • 新加入依赖时会破坏原有的方法签名,如果这个方法已经被其他很多模块用到就很麻烦
    • 与构造方法注入一样,会有很多参数
public class FurionService
{
public Person GetById([FromServices]IRepository repository, int id)
{
return repository.Find(id);
}
}

12.5 注册对象生存期#

12.5.1 暂时/瞬时 生存期#

暂时生存期服务是每次从服务容器进行请求时创建的。 这种生存期适合轻量级、 无状态的服务。

在处理请求的应用中,在请求结束时会释放暂时服务。

通常我们使用 ITransient 接口依赖表示该生命周期。

12.5.2 作用域 生存期#

作用域生存期服务针对每个客户端请求(连接)创建一次。在处理请求的应用中,在请求结束时会释放有作用域的服务。

通常我们使用 IScoped 接口依赖表示该生命周期。

12.5.3 单例 生存期#

在首次请求它们时进行创建,之后每个后续请求都使用相同的实例。

通常我们使用 ISingleton 接口依赖表示该生命周期。

了解更多

想了解更多 服务生存期 知识可查阅 ASP.NET Core - 依赖注入 - 服务生存期 章节。

12.6 内置依赖接口#

Furion 框架提供三个接口依赖分别对应不同的服务生存期:

  • ITransient:对应暂时/瞬时作用域服务生存期
  • IScoped:对应请求作用域服务生存期
  • ISingleton:对应单例作用域服务生存期
特别注意

以上三个接口只能实例类实现,其他静态类、抽象类、及接口不能实现。

12.7 常见使用#

12.7.1 第一个例子#

创建 IBusinessService 接口和 BusinessService 实现类,代码如下:

using Furion.Core;
using Furion.DatabaseAccessor;
using Furion.DependencyInjection;
+

12. 依赖注入/控制反转

12.1 依赖注入#

所谓依赖注入,是指程序运行过程中,如果需要调用另一个对象协助时,无须在代码中创建被调用者,而是依赖于外部的注入。

通俗来讲,就是把有依赖关系的类放到容器中,然后在我们需要这些类时,容器自动解析出这些类的实例。

依赖注入最大的好处时实现类的解耦,利于程序拓展、单元测试、自动化模拟测试等。

依赖注入的英文为:Dependency Injection,简称 DI

12.2 控制反转#

控制反转只是一个概念,也就是将创建对象实例的控制权(原本是程序员)从代码控制权剥离到 IOC 容器 中控制。

控制反转的英文为:Inversion of Control,简称 IOC

12.3 IOC/DI 优缺点#

传统的代码,每个对象负责管理与自己需要依赖的对象,导致如果需要切换依赖对象的实现类时,需要修改多处地方。同时,过度耦合也使得对象难以进行单元测试。

  • 优点

    • 依赖注入把对象的创造交给外部去管理,很好的解决了代码紧耦合(tight couple)的问题,是一种让代码实现松耦合(loose couple)的机制
    • 松耦合让代码更具灵活性,能更好地应对需求变动,以及方便单元测试
  • 缺点

    • 目前主流的 IOC/DI 基本采用反射的方式来实现依赖注入,在一定程度会影响性能
特别说明

在本章节不打算细讲 依赖注入/控制反转 具体实现和应用场景,想了解更多知识,可查阅 【ASP.NET Core 依赖注入】 官方文档。

12.4 依赖注入的三种方式#

12.4.1 构造方法注入#

目前构造方法注入是依赖注入推荐使用方式。

  • 优点

    • 在构造方法中体现出对其他类的依赖,一眼就能看出这个类需要其他那些类才能工作
    • 脱离了 IOC 框架,这个类仍然可以工作,POJO 的概念
    • 一旦对象初始化成功了,这个对象的状态肯定是正确的
  • 缺点

    • 构造函数会有很多参数(Bad smell)
    • 有些类是需要默认构造函数的,比如 MVC 框架的 Controller 类,一旦使用构造函数注入,就无法使用默认构造函数
    • 这个类里面的有些方法并不需要用到这些依赖(Bad smell)

代码示例:

public class FurionService
{
private readonly IRepository _repository;
public FurionService(IRepository repository)
{
_repository = repository;
}
}

12.4.2 属性方式注入#

特别声明

Furion 新版本中,已经移除属性注入功能,建议使用构造函数或方法方式注入,也可以通过 App.GetService<TService> 方式注入。

通过属性方式注入容易和类的实例属性混淆,不建议使用。

  • 优点

    • 在对象的整个生命周期内,可以随时动态的改变依赖
    • 非常灵活
  • 缺点

    • 对象在创建后,被设置依赖对象之前这段时间状态是不对的
    • 不直观,无法清晰地表示哪些属性是必须的
public class FurionService
{
public IRepository Repository { get; set; }
}

12.4.3 方法参数注入#

方法参数注入的意思是在创建对象后,通过自动调用某个方法来注入依赖。

  • 优点:

    • 比较灵活
  • 缺点:

    • 新加入依赖时会破坏原有的方法签名,如果这个方法已经被其他很多模块用到就很麻烦
    • 与构造方法注入一样,会有很多参数
public class FurionService
{
public Person GetById([FromServices]IRepository repository, int id)
{
return repository.Find(id);
}
}

12.5 注册对象生存期#

12.5.1 暂时/瞬时 生存期#

暂时生存期服务是每次从服务容器进行请求时创建的。 这种生存期适合轻量级、 无状态的服务。

在处理请求的应用中,在请求结束时会释放暂时服务。

通常我们使用 ITransient 接口依赖表示该生命周期。

12.5.2 作用域 生存期#

作用域生存期服务针对每个客户端请求(连接)创建一次。在处理请求的应用中,在请求结束时会释放有作用域的服务。

通常我们使用 IScoped 接口依赖表示该生命周期。

12.5.3 单例 生存期#

在首次请求它们时进行创建,之后每个后续请求都使用相同的实例。

通常我们使用 ISingleton 接口依赖表示该生命周期。

了解更多

想了解更多 服务生存期 知识可查阅 ASP.NET Core - 依赖注入 - 服务生存期 章节。

12.6 内置依赖接口#

Furion 框架提供三个接口依赖分别对应不同的服务生存期:

  • ITransient:对应暂时/瞬时作用域服务生存期
  • IScoped:对应请求作用域服务生存期
  • ISingleton:对应单例作用域服务生存期
特别注意

以上三个接口只能实例类实现,其他静态类、抽象类、及接口不能实现。

12.7 常见使用#

12.7.1 第一个例子#

创建 IBusinessService 接口和 BusinessService 实现类,代码如下:

using Furion.Core;
using Furion.DatabaseAccessor;
using Furion.DependencyInjection;
namespace Furion.Application
{
public interface IBusinessService
{
Person Get(int id);
}
public class BusinessService : IBusinessService, ITransient
{
private readonly IRepository<Person> _personRepository;
public BusinessService(IRepository<Person> personRepository)
{
_personRepository = personRepository;
}
@@ -61,14 +61,14 @@
Console.WriteLine("SayHello 方法返回值:" + result);
return result;
}
}
}

之后我们只需要为 TestService 增加 [Injection] 特性即可,如:

[Injection(Proxy = typeof(LogDispatchProxy))]
public class TestService: ITestService, ITransient
{
public string SayHello(string word)
{
return $"Hello {word}";
}
}

之后 SayHello 方法被调用的时候就可以实现动态拦截了,比如这里写日志。

12.12.1 全局Aop拦截#

Furion 框架也提供了全局拦截的方式,只需要将 IDispatchProxy 修改为 IGlobalDispatchProxy 即可。

using Furion;
using System.Reflection;
namespace Furion.Application
{
public class LogDispatchProxy : AspectDispatchProxy, IGlobalDispatchProxy
{
// ....
}
}

这样就会拦截所有的 Service,当然也可以通过给特定类贴 [SkipProxy] 跳过全局拦截操作。

拦截优先级

[SkipProxy] > [Injection(Proxy = typeof(LogDispatchProxy))] > 全局拦截

12.12.2 AOP 的作用#

这种面向切面的能力(动态拦截/代理)可以实现很多很多功能,如:

  • 动态日志记录
  • 动态修改参数
  • 动态修改返回值
  • 动态方法重定向
  • 动态修改代码逻辑
  • 动态实现异常监听

还可以做更多更多的事情。

12.13 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/deploy-docker/index.html b/docs/docs/deploy-docker/index.html index 69d57bc7130..66f2464336a 100644 --- a/docs/docs/deploy-docker/index.html +++ b/docs/docs/deploy-docker/index.html @@ -6,32 +6,32 @@ -27.2 在 Docker 部署 | Furion - - - - - - - - - +27.2 在 Docker 部署 | Furion + + + + + + + + +
-

27.2 在 Docker 部署

27.2.1 关于 Docker 部署#

Docker 中部署网站有两种方式:

  • 发布后构建:此方式是先发布网站后在再构建镜像,这样可以减少不必要的构建层,而且还能缩减镜像大小。(推荐)
  • 编译+构建+发布:也就是说在 Dockerfile 中配置网站从构建到发布的完整过程,此方式会速度慢,而且会产生冗余层,增加镜像大小。

27.2.2 两种方式构建#

27.2.2.1 发布后构建#

  • 👉 发布网站

首先在 Visual Studiodotnet cli 中发布网站,可以参考 在 IIS 部署-发布网站

  • 👉 编写 Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:5.0.1
WORKDIR /app
EXPOSE 80
EXPOSE 443
+

27.2 在 Docker 部署

27.2.1 关于 Docker 部署#

Docker 中部署网站有两种方式:

  • 发布后构建:此方式是先发布网站后在再构建镜像,这样可以减少不必要的构建层,而且还能缩减镜像大小。(推荐)
  • 编译+构建+发布:也就是说在 Dockerfile 中配置网站从构建到发布的完整过程,此方式会速度慢,而且会产生冗余层,增加镜像大小。

27.2.2 两种方式构建#

27.2.2.1 发布后构建#

  • 👉 发布网站

首先在 Visual Studiodotnet cli 中发布网站,可以参考 在 IIS 部署-发布网站

  • 👉 编写 Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:5.0.1
WORKDIR /app
EXPOSE 80
EXPOSE 443
COPY . .
ENTRYPOINT ["dotnet", "Furion.Web.Entry.dll"]
  • 👉 将 Dockerfile 文件拷贝到发布根目录

将编写好的 Dockerfile 文件(注意 D 大写)拷贝到发布网站的根目录下。

  • 👉 构建 Docker 镜像

在网站发布后的路径根目录下(必须含 Dockerfile)打开 CMD/PowerShell 只需构建命令:

docker build -t 网站名称:网站版本号 .
特别注意

后端的 . 不能省略

  • 👉 启动镜像
docker run --name 容器名称 -p 5000:80 --restart=always -d 网站名称:网站版本号
发布到 hub.docker.com

如果需要将该网站的镜像公开出去,那么可以发布到 hub.docker.com 中。发布步骤如下:

  • 👉 为镜像打 tag 标签
docker tag 网站名称:网站版本号 docker账号名/网站名称:网站版本号

如:

docker tag furion:v1.8.0 monksoul/furion:v1.8.0
  • 👉 登录 docker
docker login
  • 👉 推送到 hub.docker.com
docker push docker账号名/网站名称:网站版本号

如:

docker push monksoul/furion:v1.8.0

27.2.2.2 编译+构建+发布#

此方式可以偷懒,但是不太推荐,不过在某些场景下非常有用,就是集成 Devops 工具链可以做到一步到位。

  • 👉 编写 Dockerfile

这种方式只需要把 Dockerfile 内容替换成以下即可:

FROM mcr.microsoft.com/dotnet/sdk:5.0.1 AS build
WORKDIR /source
# Download Source
RUN git init
RUN git remote add -t master -m master origin 你的源码Git地址
RUN git config core.sparseCheckout true
RUN echo samples >> .git/info/sparse-checkout
RUN git pull --depth 1 origin main
# Restore And Publish
WORKDIR /source/samples
RUN dotnet restore
RUN dotnet publish -c release -o /app --no-restore
# Run
FROM mcr.microsoft.com/dotnet/aspnet:5.0.1
WORKDIR /app
COPY --from=build /app ./
EXPOSE 80
EXPOSE 443
ENTRYPOINT ["dotnet", "Furion.Web.Entry.dll"]
  • 👉 在 Dockerfile 所在路径构建

接下来的步骤和上述步骤一致,不再重复编写

27.2.3 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/deploy-iis/index.html b/docs/docs/deploy-iis/index.html index ca74bab54c6..f8740d344a2 100644 --- a/docs/docs/deploy-iis/index.html +++ b/docs/docs/deploy-iis/index.html @@ -6,28 +6,28 @@ -27.1 在 IIS 部署 | Furion - - - - - - - - - +27.1 在 IIS 部署 | Furion + + + + + + + + +
-

27.1 在 IIS 部署

27.1.1 发布网站#

27.1.1.1 选择启动项发布#

27.1.1.2 选择发布到文件夹#

27.1.1.3 配置发布后路径#

27.1.1.4 点击发布#

27.1.2 服务器环境配置#

27.1.2.1 第一步#

安装.NET Core 运行时捆绑包:点击下载

27.1.2.2 第二步(命令)#

net stop was /y

27.1.2.3 第三步(命令)#

net start w3svc

27.1.2.4 第四步(命令)#

set ASPNETCORE_ENVIRONMENT=Production

27.1.3 部署到 IIS#

27.1.3.1 添加新网站#

27.1.3.2 配置网站信息#

27.1.3.3 配置应用程序池#

27.1.3.4 设置为 非托管#

27.1.3.5 重启网站#

只需重启网站或应用程序池即可。

27.1.4 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - +

27.1 在 IIS 部署

27.1.1 发布网站#

27.1.1.1 选择启动项发布#

27.1.1.2 选择发布到文件夹#

27.1.1.3 配置发布后路径#

27.1.1.4 点击发布#

27.1.2 服务器环境配置#

27.1.2.1 第一步#

安装.NET Core 运行时捆绑包:点击下载

27.1.2.2 第二步(命令)#

net stop was /y

27.1.2.3 第三步(命令)#

net start w3svc

27.1.2.4 第四步(命令)#

set ASPNETCORE_ENVIRONMENT=Production

27.1.3 部署到 IIS#

27.1.3.1 添加新网站#

27.1.3.2 配置网站信息#

27.1.3.3 配置应用程序池#

27.1.3.4 设置为 非托管#

27.1.3.5 重启网站#

只需重启网站或应用程序池即可。

27.1.4 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/deploy-nginx/index.html b/docs/docs/deploy-nginx/index.html index 2b0dff78262..8ea1a782c0d 100644 --- a/docs/docs/deploy-nginx/index.html +++ b/docs/docs/deploy-nginx/index.html @@ -6,28 +6,28 @@ -27.3 在 Nginx 部署 | Furion - - - - - - - - - +27.3 在 Nginx 部署 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/devops/index.html b/docs/docs/devops/index.html index 95cae51a7f4..77296e7610d 100644 --- a/docs/docs/devops/index.html +++ b/docs/docs/devops/index.html @@ -6,28 +6,28 @@ -28. 持续部署集成 | Furion - - - - - - - - - +28. 持续部署集成 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/donate/index.html b/docs/docs/donate/index.html index b4987e02d4f..00a40b5354f 100644 --- a/docs/docs/donate/index.html +++ b/docs/docs/donate/index.html @@ -6,28 +6,28 @@ -1.5 赞助 Furion | Furion - - - - - - - - - +1.5 赞助 Furion | Furion + + + + + + + + +
-

1.5 赞助 Furion

如果想成为 Furion 支持者或赞助商,请考虑:

🍍 赞助列表#

注:排序按赞助顺序书写

赞助人昵称赞助金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...
😤 好人!10Nice 的小僧,我们的 dotnetchina 马上火起来了
😮 木木 Woody10感谢您的开源项目!
😚 Joker HouQQ 超级会员一个月
🤠 ccdfzQQ 专属红包 199
🌝 天夫李总支付宝 6666Furion 非常有意思,持续关注
😝 六尘子微信红包 199公司已经使用,小小敬意
🤠 ccdfzQQ 专属红包 200赞助一根内存条
🤑 邓亮灯28.88感谢您的开源项目!
😬 天道酬勤微信二维码 188小小心意
🥰 却月居士QQ 专属红包 100恭喜发财
🤩 鲁旭100感谢您的开源项目!
😬 散客行微信二维码 666终于找到一个不错的框架
😌 本心100项目功能很强大
🙆‍♂️ 毕业生100请你喝杯咖啡
🦹‍♀️ 猪鼻子微信二维码 668
🧟‍♂️ 明年·今日200使用的框架里最爽的,最理想的!加油
👨‍🎓 过去的过去50感谢您的开源项目!
👨‍🔧 万里兮100新公司的第一个项目从 Furion 开始
👴 Muphalem20很热心很亲切的开发者,加油!
💂‍♂️ 吃锅巴的码农微信二维码 500就冲你的文档写得好!
🤴 三重罗生门微信红包 200下次烤鱼你请!
🤵 李涛10加油,我们看到了 dotnet 美好的明天 :)
😂 !@#$%^&QQ 专属红包 100刚接触 furion,文档真棒
😵 李斌20看到一个不错的框架,学习学习,感谢作者的无私奉献
😞 逞强QQ 专属红包 20恭喜发财
🤒 顾锦松QQ 专属红包 200期待文档完成时候
🧟‍♀️ 哈哈微信赞赏码 1000点赞作者!
🍍 Z微信赞赏码 100恭喜孩子诞生,谢谢大佬
🍲 海涛50恭喜
😣 h微信赞赏码 100qq82683656
👱‍♀️ 冷大大微信赞赏码 100加快文档和教学补充哦,另外需要钉钉群,平常不用 QQ
👜 腾坤微信赞赏码 10感谢您的开源项目,QQ:565728589
🚆 文耶耶微信赞赏码 10很棒

非常感谢您们的支持,正是因为您们,中国开源才可以越走越远,Furion 越走越远。

Last updated on by Monk
- - - - - - - - - +

1.5 赞助 Furion

如果想成为 Furion 支持者或赞助商,请考虑:

🍍 赞助列表#

注:排序按赞助顺序书写

赞助人昵称赞助金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...
😤 好人!10Nice 的小僧,我们的 dotnetchina 马上火起来了
😮 木木 Woody10感谢您的开源项目!
😚 Joker HouQQ 超级会员一个月
🤠 ccdfzQQ 专属红包 199
🌝 天夫李总支付宝 6666Furion 非常有意思,持续关注
😝 六尘子微信红包 199公司已经使用,小小敬意
🤠 ccdfzQQ 专属红包 200赞助一根内存条
🤑 邓亮灯28.88感谢您的开源项目!
😬 天道酬勤微信二维码 188小小心意
🥰 却月居士QQ 专属红包 100恭喜发财
🤩 鲁旭100感谢您的开源项目!
😬 散客行微信二维码 666终于找到一个不错的框架
😌 本心100项目功能很强大
🙆‍♂️ 毕业生100请你喝杯咖啡
🦹‍♀️ 猪鼻子微信二维码 668
🧟‍♂️ 明年·今日200使用的框架里最爽的,最理想的!加油
👨‍🎓 过去的过去50感谢您的开源项目!
👨‍🔧 万里兮100新公司的第一个项目从 Furion 开始
👴 Muphalem20很热心很亲切的开发者,加油!
💂‍♂️ 吃锅巴的码农微信二维码 500就冲你的文档写得好!
🤴 三重罗生门微信红包 200下次烤鱼你请!
🤵 李涛10加油,我们看到了 dotnet 美好的明天 :)
😂 !@#$%^&QQ 专属红包 100刚接触 furion,文档真棒
😵 李斌20看到一个不错的框架,学习学习,感谢作者的无私奉献
😞 逞强QQ 专属红包 20恭喜发财
🤒 顾锦松QQ 专属红包 200期待文档完成时候
🧟‍♀️ 哈哈微信赞赏码 1000点赞作者!
🍍 Z微信赞赏码 100恭喜孩子诞生,谢谢大佬
🍲 海涛50恭喜
😣 h微信赞赏码 100qq82683656
👱‍♀️ 冷大大微信赞赏码 100加快文档和教学补充哦,另外需要钉钉群,平常不用 QQ
👜 腾坤微信赞赏码 10感谢您的开源项目,QQ:565728589
🚆 文耶耶微信赞赏码 10很棒

非常感谢您们的支持,正是因为您们,中国开源才可以越走越远,Furion 越走越远。

Last updated on by Monk
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/dynamic-api-controller/index.html b/docs/docs/dynamic-api-controller/index.html index 11340b922ff..4b016b54fef 100644 --- a/docs/docs/dynamic-api-controller/index.html +++ b/docs/docs/dynamic-api-controller/index.html @@ -6,20 +6,20 @@ -5. 动态 WebAPI | Furion - - - - - - - - - +5. 动态 WebAPI | Furion + + + + + + + + +
-

5. 动态 WebAPI

小知识

动态WebAPI 实际上就是将普通的类变为 Controller,也就是 动态WebAPI 就是控制器,支持控制器一切功能。

5.1 什么是控制器#

简单来说,控制器是一个承上启下的作用,根据用户输入,执行响应行为(动作方法),同时在行为中调用模型的业务逻辑,返回给用户结果(视图)。

ASP.NET Core 中,控制器有两种表现形式:

  • Mvc(带视图)
  • WebAPI(RESTful API)
using Microsoft.AspNetCore.Mvc;
+

5. 动态 WebAPI

小知识

动态WebAPI 实际上就是将普通的类变为 Controller,也就是 动态WebAPI 就是控制器,支持控制器一切功能。

5.1 什么是控制器#

简单来说,控制器是一个承上启下的作用,根据用户输入,执行响应行为(动作方法),同时在行为中调用模型的业务逻辑,返回给用户结果(视图)。

ASP.NET Core 中,控制器有两种表现形式:

  • Mvc(带视图)
  • WebAPI(RESTful API)
using Microsoft.AspNetCore.Mvc;
namespace Furion.Web.Entry.Controllers
{
public class MvcController : Controller
{
public IActionResult Index()
{
return View();
}
}
}

Mvc 控制器和 WebAPI 控制器最大的区别是 WebAPI 控制器不带 视图 和通过 请求谓词和路由地址响应行为

5.2 Mvc 控制器 约定和缺点#

在学习动态 WebAPI 控制器之前,首先了解 ASP.NET CoreWebAPI 的一些约定和注意事项。

5.2.1 WebAPI 约定#

ASP.NET Core 应用中,一个 WebAPI 控制器需遵循以下约定:

  • 控制器类必须继承 ControllerBase 或间接继承
  • 动作方法必须贴有 [HttpMethod] 特性,如:[HttpGet]
  • 控制器或动作方法至少有一个配置 [Route] 特性
  • 生成 WebAPI 路由地址时会自动去掉控制器名称 Controller 后缀,同时也会去掉动作方法匹配的 HttpVerb 谓词,如 GET,POST,DELETE,PUT
  • 不支持返回非 IEnumerable<T> 泛型对象
  • 不支持类类型参数在 GET,HEAD 请求下生成 Query 参数

除了上述约定外,WebAPI 路由地址基本靠手工完成,不利于书写,不利于维护,再者,在移动应用对接中难以进行多版本控制。

5.2.2 .NET Core WebAPI 缺点#

通过上一章节可以看出,ASP.NET Core 应用实现 WebAPI 需要遵循种种约定,而且容易出错。

除了这些约定,.NET Core WebAPI 有以下缺点:

  • 路由地址基本靠手工完成
  • 在现在移动为王的时代,不利于进行多版本控制
  • 对接 Swagger 文档分组比较复杂
  • 实现 Policy 策略授权也比较复杂
  • 不支持控制器热拔插插件化
  • 难以实现复杂自定义的 RESTful API 风格

5.3 动态 WebAPI 控制器#

针对以上 ASP.NET Core 提供的 WebAPI 必须遵循的约定和不可避免的缺点,Furion 框架创造出一种更加灵活创建 WebAPI 控制器的方式。

这个方式在继承了 ASP.NET Core WebAPI 所有优点,同时进行了大量拓展和优化。优化后的 WebAPI 具有以下优点:

  • 具备原有的 ControllerBase 所有功能
  • 支持任意公开 非静态 非抽象 非泛型类转控制器
  • 提供更加灵活方便的 IDynamicApiController 空接口或 [DynamicApiController] 特性替代 ControllerBase 抽象类
  • 无需手动配置 [HttpMethod] 特性,同时支持一个动作方法多个 HttpVerb
  • 无需手动配置 [Route] 特性,支持更加灵活的配置及自动路由生成
  • 支持返回泛型接口,泛型类
  • Swagger 深度结合,提供极其方便的创建 Swagger 分组配置
  • 支持 Basic Auth,Jwt,ApiKey 等多种权限灵活配置
  • 支持控制器、动作方法版本控制功能
  • 支持 GET、HEAD 请求自动转换 类类型参数
  • 支持生成 OAS3 接口规范

5.4 注册动态 WebAPI 服务#

备注

.AddDynamicApiControllers() 默认已经集成在 AddInject() 中了,无需再次注册。也就是下列代码可不配置。

Furion.Web.Core\FurWebCoreStartup.cs
using Microsoft.Extensions.DependencyInjection;
namespace Furion.Web.Core
{
[AppStartup(800)]
public sealed class FurWebCoreStartup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers()
.AddDynamicApiControllers();
}
}
}
特别注意

.AddDynamicApiControllers() 必须在 services.AddControllers() 之后注册。

5.5 第一个例子#

创建一个 FurAppService 类继承 IDynamicApiController 接口 或 贴 [DynamicApiController] 特性,并在这个类中编写一个 Get 方法。

  • IDynamicApiController 方式
using Furion.DynamicApiController;
@@ -80,14 +80,14 @@
// 拦截之后
// 异常拦截
if(resultContext.Exception != null)
{
}
}
}

详细用法可参见 ASP.NET Core 5.0 - 筛选器

5.12 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/encryption/index.html b/docs/docs/encryption/index.html index 066827dc918..3d473e1f467 100644 --- a/docs/docs/encryption/index.html +++ b/docs/docs/encryption/index.html @@ -6,31 +6,31 @@ -20. 数据加解密 | Furion - - - - - - - - - +20. 数据加解密 | Furion + + + + + + + + +
-

20. 数据加解密

20.1 数据加解密#

由于现在的互联网越具发达,数据成为了我们生活的一部分,当然也带来了很多数据安全性的问题,比如用户密码明文存储,用户信息明文存在在浏览器 cookies 中等等不安全操作。

所以,对数据的加解密是系统开发必要的环节。

20.2 内置加密类型#

  • MD5 加密
  • DESC 加解密
  • AES 加解密
  • JWT 加解密

20.2 加解密使用#

20.2.1 MD5 加密#

// 测试 MD5 加密,比较
var md5Hash = MD5Encryption.Encrypt("百小僧"); // 加密
var isEqual = MD5Encryption.Compare("百小僧", md5Hash); // 比较
return (md5Hash, isEqual);

20.2.2 DESC 加解密#

// 测试 DESC 加解密
var descHash = DESCEncryption.Encrypt("百小僧", "Furion"); // 加密
var str = DESCEncryption.Decrypt(descHash, "Furion"); // 解密
return (descHash, str);

20.2.3 AES 加解密#

// 测试 AES 加解密
var key = Guid.NewGuid().ToString("N"); // 密钥,长度必须大于20位
+

20. 数据加解密

20.1 数据加解密#

由于现在的互联网越具发达,数据成为了我们生活的一部分,当然也带来了很多数据安全性的问题,比如用户密码明文存储,用户信息明文存在在浏览器 cookies 中等等不安全操作。

所以,对数据的加解密是系统开发必要的环节。

20.2 内置加密类型#

  • MD5 加密
  • DESC 加解密
  • AES 加解密
  • JWT 加解密

20.2 加解密使用#

20.2.1 MD5 加密#

// 测试 MD5 加密,比较
var md5Hash = MD5Encryption.Encrypt("百小僧"); // 加密
var isEqual = MD5Encryption.Compare("百小僧", md5Hash); // 比较
return (md5Hash, isEqual);

20.2.2 DESC 加解密#

// 测试 DESC 加解密
var descHash = DESCEncryption.Encrypt("百小僧", "Furion"); // 加密
var str = DESCEncryption.Decrypt(descHash, "Furion"); // 解密
return (descHash, str);

20.2.3 AES 加解密#

// 测试 AES 加解密
var key = Guid.NewGuid().ToString("N"); // 密钥,长度必须大于20位
var aesHash = AESEncryption.Encrypt("百小僧", key); // 加密
var str2 = AESEncryption.Decrypt(aesHash, key); // 解密
return (aesHash, str2);

20.2.4 JWT 加解密#

var token = JWTEncryption.Encrypt(new Dictionary<string, object>() // 加密
{
{ "UserId", user.Id },
{ "Account",user.Account }
});
var tokenData = JWTEncryption.ReadJwtToken("你的token"); // 解密
var (isValid, tokenData) = JWTEncryption.Validate("你的token"); // 验证token有效期

20.3 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/entity/index.html b/docs/docs/entity/index.html index b1a399ddef7..fdd3cda6d35 100644 --- a/docs/docs/entity/index.html +++ b/docs/docs/entity/index.html @@ -6,20 +6,20 @@ -9.3 数据库实体 | Furion - - - - - - - - - +9.3 数据库实体 | Furion + + + + + + + + +
-

9.3 数据库实体

9.3.1 数据库实体#

在面向对象开发思想中,最重要尤为对象二字,在 .NET 开发过去,操作数据库往往采用 DataTableDataSet 来接收数据库返回结果集,而操作数据库也离不开手写 sql 语句。

在过去面向过程和应用不发达的时代,这些操作确实好使。然后随着中国互联网网民的激增,电子化时代的到来,各行各业对应用需求也达到了前所未有的量级。

所以,在过去手写 sql 的时代各种问题显露无疑:

  • 程序员能力参差不齐,写出的 sql 性能自然也天差地别
  • sql 属于字符串硬编程,后期维护难上加难
  • 许多单表甚至多表结构一致,出现大量重复 sql 代码
  • sql 本身在不同的数据库提供器中写法有差,后续迁移头痛不已

当然,sql 是时代的产物,我们也离不开 sql,但对于大多数程序员和项目来说,sql 未必能够带给他们多大的效益。

所以,ORM 就诞生了,所谓的 ORM 就是对象关系映射,英文:Object Relational Mapping,简单点说,ORM 根据特有的 POCO 贫血模型 规则生成 sql 语句。大大避免了重复 sqlsql 能力参差不齐等问题。(当然 ORM 作者 sql 能力也会影响最终性能)

上面所说的 POCO 贫血模型正是我们本章节的 数据库实体

简单来说,数据库实体就是数据库表的类表现,通过一定的规则使这个类能够一一对应表结构。通常这样的类也称为:POCO 贫血模型,也就是只有定义,没有行为。

9.3.2 如何定义实体#

Furion 框架提供多种定义实体的接口依赖:

  • IEntity:实体基接口,是所有实体的基接口
  • IEntityNotKey:无键实体接口,也就是视图、存储过程、函数依赖接口
  • EntityBase:实体基抽象类,内置了 IdTenantId 字段
  • Entity:实体通用抽象类,继承自 EntityBase,同时内置 CreatedTimeUpdatedTimeIsDeleted 字段
  • EntityNotKey:无键实体抽象类,视图、存储过程、函数依赖抽象类
实体定义位置

Furion 框架中有约定,实体统一定义在 Furion.Core 层。

9.3.2.1 实体继承选用原则#

  • 如果你不需要 Furion 为实体添加任何内置特性,选用 IEntity,无键实体选用 IEntityNotKey
  • 如果你只需要 Id 属性,选用 EntityBase
  • 如果你需要 Furion 为你自动添加常用字段,则选用 Entity
  • 如果你需要视图、存储过程、函数可以通过 DbSet 操作,则继承 EntityNotKey

9.3.2.2 IEntity 示范:#

using Furion.DatabaseAccessor;
+

9.3 数据库实体

9.3.1 数据库实体#

在面向对象开发思想中,最重要尤为对象二字,在 .NET 开发过去,操作数据库往往采用 DataTableDataSet 来接收数据库返回结果集,而操作数据库也离不开手写 sql 语句。

在过去面向过程和应用不发达的时代,这些操作确实好使。然后随着中国互联网网民的激增,电子化时代的到来,各行各业对应用需求也达到了前所未有的量级。

所以,在过去手写 sql 的时代各种问题显露无疑:

  • 程序员能力参差不齐,写出的 sql 性能自然也天差地别
  • sql 属于字符串硬编程,后期维护难上加难
  • 许多单表甚至多表结构一致,出现大量重复 sql 代码
  • sql 本身在不同的数据库提供器中写法有差,后续迁移头痛不已

当然,sql 是时代的产物,我们也离不开 sql,但对于大多数程序员和项目来说,sql 未必能够带给他们多大的效益。

所以,ORM 就诞生了,所谓的 ORM 就是对象关系映射,英文:Object Relational Mapping,简单点说,ORM 根据特有的 POCO 贫血模型 规则生成 sql 语句。大大避免了重复 sqlsql 能力参差不齐等问题。(当然 ORM 作者 sql 能力也会影响最终性能)

上面所说的 POCO 贫血模型正是我们本章节的 数据库实体

简单来说,数据库实体就是数据库表的类表现,通过一定的规则使这个类能够一一对应表结构。通常这样的类也称为:POCO 贫血模型,也就是只有定义,没有行为。

9.3.2 如何定义实体#

Furion 框架提供多种定义实体的接口依赖:

  • IEntity:实体基接口,是所有实体的基接口
  • IEntityNotKey:无键实体接口,也就是视图、存储过程、函数依赖接口
  • EntityBase:实体基抽象类,内置了 IdTenantId 字段
  • Entity:实体通用抽象类,继承自 EntityBase,同时内置 CreatedTimeUpdatedTimeIsDeleted 字段
  • EntityNotKey:无键实体抽象类,视图、存储过程、函数依赖抽象类
实体定义位置

Furion 框架中有约定,实体统一定义在 Furion.Core 层。

9.3.2.1 实体继承选用原则#

  • 如果你不需要 Furion 为实体添加任何内置特性,选用 IEntity,无键实体选用 IEntityNotKey
  • 如果你只需要 Id 属性,选用 EntityBase
  • 如果你需要 Furion 为你自动添加常用字段,则选用 Entity
  • 如果你需要视图、存储过程、函数可以通过 DbSet 操作,则继承 EntityNotKey

9.3.2.2 IEntity 示范:#

using Furion.DatabaseAccessor;
namespace Furion.Core
{
public class User : IEntity
{
/// <summary>
/// 手工定义 Id
/// </summary>
public int Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
}

9.3.2.2 EntityBase 示范:#

using Furion.DatabaseAccessor;
namespace Furion.Core
{
public class User : EntityBase
{
// 无需定义 Id 属性
@@ -33,14 +33,14 @@
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
// 配置数据库实体
public void Configure(EntityTypeBuilder<User> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasKey(u => u.Id);
entityBuilder.HasIndex(u => u.Name);
}
}
}

9.3.3.2 在任何实例类中配置#

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
namespace Furion.Core
{
public class SomeClass : IEntityTypeBuilder<User>
{
public void Configure(EntityTypeBuilder<User> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasKey(u => u.Id);
entityBuilder.HasIndex(u => u.Name);
}
}
}

如,上面例子,通过 SomeClass 配置 User 数据库实体。

9.3.4 数据库实体配置说明#

Furion 框架会自动扫描所有继承 IEntity 接口的类进行 DbSet<TEntity> 注册,也就是实现自动配置 DbContextOnModelCreating

如果需要跳过自动注册,只需要贴 [NonAutomatic][SkipScan] 特性即可。一旦贴了此特性,那么就需要手动配置 DbContextOnModelCreating

9.3.5 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/errors/index.html b/docs/docs/errors/index.html deleted file mode 100644 index ce36a6353ae..00000000000 --- a/docs/docs/errors/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - -31.2 常见错误 | Furion - - - - - - - - - - - -
-
Last updated on by 百小僧
- - - - - - - - - - - \ No newline at end of file diff --git a/docs/docs/event-bus/index.html b/docs/docs/event-bus/index.html index e99251dd751..9f66c69f4eb 100644 --- a/docs/docs/event-bus/index.html +++ b/docs/docs/event-bus/index.html @@ -6,30 +6,30 @@ -22. 事件总线 | Furion - - - - - - - - - +22. 事件总线 | Furion + + + + + + + + +
-

22. 事件总线

22.1 什么是事件总线#

事件总线是对发布-订阅模式的一种实现。它是一种集中式事件处理机制,允许不同的组件之间进行彼此通信而又不需要相互依赖,达到一种解耦的目的。

我们来看看事件总线的处理流程:

22.2 MessageCenter 消息中心#

Furion 框架中,实现了一种轻量级的事件总线实现机制:MessageCenter(消息中心),MessageCenter 采用字符串消息机制进行广播, 可以在绝大多数中小型项目中发挥作用,缺点是消息处理是在主线程中完成并且消息不支持分布式存储。

另外,MessageCenter 支持单播、多播发布及多订阅。如图所示:

22.2.1 注册 轻量级事件总线服务#

如果想使用 MessageCenter 轻量级事件总线,只需要在 Startup.cs 中注册服务即可,如:

public void ConfigureServices(IServiceCollection services)
{
services.AddSimpleEventBus();
}

22.2.2 定义订阅处理程序#

MessageCenter 是根据 MesseageId 消息 Id 来触发对应的处理程序的,所以我们需要定义 订阅处理程序类,该类需实现 ISubscribeHandler 接口,如:

public class UserChangeSubscribeHandler : ISubscribeHandler
{
// 定义一条消息
[SubscribeMessage("create:user")]
public void CreateUser(string eventId, object payload)
{
Console.WriteLine("我是"+eventId);
}
+

22. 事件总线

22.1 什么是事件总线#

事件总线是对发布-订阅模式的一种实现。它是一种集中式事件处理机制,允许不同的组件之间进行彼此通信而又不需要相互依赖,达到一种解耦的目的。

我们来看看事件总线的处理流程:

22.2 MessageCenter 消息中心#

Furion 框架中,实现了一种轻量级的事件总线实现机制:MessageCenter(消息中心),MessageCenter 采用字符串消息机制进行广播, 可以在绝大多数中小型项目中发挥作用,缺点是消息处理是在主线程中完成并且消息不支持分布式存储。

另外,MessageCenter 支持单播、多播发布及多订阅。如图所示:

22.2.1 注册 轻量级事件总线服务#

如果想使用 MessageCenter 轻量级事件总线,只需要在 Startup.cs 中注册服务即可,如:

public void ConfigureServices(IServiceCollection services)
{
services.AddSimpleEventBus();
}

22.2.2 定义订阅处理程序#

MessageCenter 是根据 MesseageId 消息 Id 来触发对应的处理程序的,所以我们需要定义 订阅处理程序类,该类需实现 ISubscribeHandler 接口,如:

public class UserChangeSubscribeHandler : ISubscribeHandler
{
// 定义一条消息
[SubscribeMessage("create:user")]
public void CreateUser(string eventId, object payload)
{
Console.WriteLine("我是"+eventId);
}
// 多条消息共用同一个处理程序
[SubscribeMessage("delete:user")]
[SubscribeMessage("remove:user")]
public void RemoveUser(string eventId, object payload)
{
Console.WriteLine("我是"+eventId);
}
}

22.2.3 发布消息#

定义好订阅处理程序后,我们就可以在程序任何地方进行广播消息,事件总线会自动根据消息 Id 触发对应的处理程序方法:

MessageCenter.Send("create:user", new User {}); // => 打印:我是create:user
MessageCenter.Send("delete:user", new User {}); // => 打印:我是delete:user
MessageCenter.Send("remove:user", new User {}); // => 打印:我是remove:user

22.2.4 直接订阅消息#

在上面的例子中,我们需要创建 ISubscribeHandler 的派生类进行相关配置才能实现订阅处理。

在某些特殊情况下,可能只需要订阅一次即可。所以,在 Furion 框架中,为了更简便的订阅消息,也提供了 MessageCenter.Subscribe<T> 静态方法,如:

MessageCenter.Subscribe<User>("create:user", (i,p) => {
// do something。。。
});

22.3 MediatR#

Furion 框架默认只实现了轻量级的事件总线机制,可能还远远未达到大型项目和高并发数据的处理需求。

这个时候,推荐使用 MediatR 这个第三方库进行处理,Github 地址:https://github.com/jbogard/MediatR

MediatR 是非常优秀的事件总线库,支持单播、多播、消息通知推送、智能调度等操作,非常小巧。

22.3.1 MediatR 使用文档#

https://github.com/jbogard/MediatR/wiki

22.4 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/friendly-exception/index.html b/docs/docs/friendly-exception/index.html index 2c2d9c7e9c7..f9b9db6818c 100644 --- a/docs/docs/friendly-exception/index.html +++ b/docs/docs/friendly-exception/index.html @@ -6,20 +6,20 @@ -7. 友好异常处理 | Furion - - - - - - - - - +7. 友好异常处理 | Furion + + + + + + + + +
-

7. 友好异常处理

7.1 什么是异常#

异常一般是指运行期(此处特指 Exception 类)会发生的导致程序意外中止的问题,是一种对问题的描述后的封装对象。

在过去开发中,通常异常由系统运行时出错抛出,但现在的开发过程中,我们应在程序开发中合理的抛出异常,比如更新一条不存在的实体,或查询一个不存在的数据等等。

7.2 处理异常方式#

  • 不处理,直接中断程序执行(不推荐)
  • 通过 try catch finally 处理(不推荐)
  • 全局统一处理,并记录异常信息(推荐)
  • 异常注解方式处理,支持本地化 (推荐)

7.3 什么是友好异常处理#

7.3.1 非友好异常处理#

在了解友好异常处理之前可以看看非友好异常处理:

  • 对终端用户抛出 500状态码 堆栈信息
  • 大量的 try catch 代码,污染正常业务逻辑
  • 没有规范化的异常状态码和异常消息管理
  • 没有异常日志收集记录
  • 不支持异常消息本地化处理
  • 不支持异常策略,失败后程序立即终止
  • 不支持分布式事务 CAP
  • 不支持异常传播
  • 返回的异常格式杂乱

7.3.2 友好异常处理#

  • 对终端用户提示友好
  • 对后端开发人员提供详细的异常堆栈
  • 不干扰正常业务逻辑代码,如 没有 try catch 代码
  • 支持异常状态码多方设置
  • 支持异常消息本地化
  • 异常信息统一配置管理
  • 支持异常策略,如重试
  • 支持异常日志收集记录
  • 支持 CAP 分布式事务关联
  • 支持内部异常外部传播
  • 支持返回统一的异常格式数据

7.4 友好异常处理使用示例#

Furion 框架提供了非常灵活的友好异常处理方式。

备注

.AddFriendlyException() 默认已经继承在 AddInject() 中了,无需再次注册。也就是 7.4.1 章节可不配置。

7.4.1 注册友好异常服务#

Furion.Web.Core\FurWebCoreStartup.cs
using Microsoft.Extensions.DependencyInjection;
+

7. 友好异常处理

7.1 什么是异常#

异常一般是指运行期(此处特指 Exception 类)会发生的导致程序意外中止的问题,是一种对问题的描述后的封装对象。

在过去开发中,通常异常由系统运行时出错抛出,但现在的开发过程中,我们应在程序开发中合理的抛出异常,比如更新一条不存在的实体,或查询一个不存在的数据等等。

7.2 处理异常方式#

  • 不处理,直接中断程序执行(不推荐)
  • 通过 try catch finally 处理(不推荐)
  • 全局统一处理,并记录异常信息(推荐)
  • 异常注解方式处理,支持本地化 (推荐)

7.3 什么是友好异常处理#

7.3.1 非友好异常处理#

在了解友好异常处理之前可以看看非友好异常处理:

  • 对终端用户抛出 500状态码 堆栈信息
  • 大量的 try catch 代码,污染正常业务逻辑
  • 没有规范化的异常状态码和异常消息管理
  • 没有异常日志收集记录
  • 不支持异常消息本地化处理
  • 不支持异常策略,失败后程序立即终止
  • 不支持分布式事务 CAP
  • 不支持异常传播
  • 返回的异常格式杂乱

7.3.2 友好异常处理#

  • 对终端用户提示友好
  • 对后端开发人员提供详细的异常堆栈
  • 不干扰正常业务逻辑代码,如 没有 try catch 代码
  • 支持异常状态码多方设置
  • 支持异常消息本地化
  • 异常信息统一配置管理
  • 支持异常策略,如重试
  • 支持异常日志收集记录
  • 支持 CAP 分布式事务关联
  • 支持内部异常外部传播
  • 支持返回统一的异常格式数据

7.4 友好异常处理使用示例#

Furion 框架提供了非常灵活的友好异常处理方式。

备注

.AddFriendlyException() 默认已经继承在 AddInject() 中了,无需再次注册。也就是 7.4.1 章节可不配置。

7.4.1 注册友好异常服务#

Furion.Web.Core\FurWebCoreStartup.cs
using Microsoft.Extensions.DependencyInjection;
namespace Furion.Web.Core
{
[AppStartup(800)]
public sealed class FurWebCoreStartup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddControllers()
.AddFriendlyException();
}
}
}
特别注意

.AddFriendlyException() 需在 services.AddControllers() 之后注册。

7.4.2 两个例子#

简单抛个异常#

using Furion.DynamicApiController;
using Furion.FriendlyException;
namespace Furion.Application
{
public class FurAppService : IDynamicApiController
{
public int Get(int id)
{
if (id < 3)
{
throw Oops.Oh($"{id} 不能小于3");
}
return id;
}
}
}

如下图所示:

抛出特定类型异常#

using Furion.DynamicApiController;
using Furion.FriendlyException;
using System;
@@ -58,14 +58,14 @@
default:
break;
}
}
}
}

之后在 Startup.cs 中注册即可:

services.AddControllers()
.AddInjectWithUnifyResult<RESTfulResultProvider>();

7.14 全局异常处理提供器#

通常我们需要在异常捕获的时候写日志,这时候就需要使用到 IGlobalExceptionHandler 异常定义处理程序,如:

using Furion.DependencyInjection;
using Furion.FriendlyException;
using Microsoft.AspNetCore.Mvc.Filters;
using System.Threading.Tasks;
namespace Furion.Application
{
public class LogExceptionHandler : IGlobalExceptionHandler, ISingleton
{
public Task OnExceptionAsync(ExceptionContext context)
{
// 写日志
return Task.CompletedTask;
}
}
}

7.15 FriendlyExceptionSettings 配置#

  • HideErrorCode:隐藏错误码,bool 类型,默认 false
  • DefaultErrorCode:默认错误码,string 类型
  • DefaultErrorMessage:默认错误消息,string 类型

配置示例

{
"FriendlyExceptionSettings": {
"DefaultErrorMessage": "系统异常,请联系管理员"
}
}

7.16 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/get-start/index.html b/docs/docs/get-start/index.html index e3424d55f56..7bd1a781e1e 100644 --- a/docs/docs/get-start/index.html +++ b/docs/docs/get-start/index.html @@ -6,20 +6,20 @@ -2.1 一分钟上手 | Furion - - - - - - - - - +2.1 一分钟上手 | Furion + + + + + + + + +
-

2.1 一分钟上手

推荐使用脚手架

Furion 官方提供了非常灵活方便的脚手架,可以快速的创建多层架构项目。

推荐使用 《2.2 官方脚手架》代替本章节功能。

2.1 创建 Web 项目#

2.1.1 创建 ASP.NET Core Web 应用程序#

  • 打开 Visual Studio 2019 并创建 Web 项目
  • 配置项目名称
  • 选择 WebAPI 项目
特别注意

Furion 已经内置了 Swagger 规范化库,所以创建时无需勾选 Enable OpenAPI support 选项。

2.2 添加 Furion 依赖包#

2.3 Furion 基本配置#

2.3.1 Program.cs 添加 Inject()#

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
+

2.1 一分钟上手

推荐使用脚手架

Furion 官方提供了非常灵活方便的脚手架,可以快速的创建多层架构项目。

推荐使用 《2.2 官方脚手架》代替本章节功能。

2.1 创建 Web 项目#

2.1.1 创建 ASP.NET Core Web 应用程序#

  • 打开 Visual Studio 2019 并创建 Web 项目
  • 配置项目名称
  • 选择 WebAPI 项目
特别注意

Furion 已经内置了 Swagger 规范化库,所以创建时无需勾选 Enable OpenAPI support 选项。

2.2 添加 Furion 依赖包#

2.3 Furion 基本配置#

2.3.1 Program.cs 添加 Inject()#

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace FurStart
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder
.Inject() // 添加这一行
.UseStartup<Startup>();
});
}
}

2.3.2 在 Startup.cs 中添加两个 Inject()#

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace FurStart
{
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
@@ -31,14 +31,14 @@
app.UseAuthorization();
// 添加这一行,如果是 MVC和API共存项目,无需添加 string.Empty
app.UseInject(string.Empty);
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}
}
小提醒

如果 app.UseInject() 不输入参数,则默认地址为 /api,如果输入 string.Empty 则为 / 目录。如果输入任意字符串,则为 /任意字符串 目录。

2.4 启动浏览器#

启动浏览器查看效果。

说好一分钟上手,你们用了多长时间。😁

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/app/index.html b/docs/docs/global/app/index.html index e3991683e52..78465d0b88d 100644 --- a/docs/docs/global/app/index.html +++ b/docs/docs/global/app/index.html @@ -6,30 +6,30 @@ -1. App 静态类 | Furion - - - - - - - - - +1. App 静态类 | Furion + + + + + + + + +
-

1. App 静态类

1.1 获取全局配置#

var settings = App.Settings;

1.2 获取配置对象#

// 获取 IConfiguration 对象
var configuration = App.Configuration;
var value = configuration["xxx:xxx"];
+

1. App 静态类

1.1 获取全局配置#

var settings = App.Settings;

1.2 获取配置对象#

// 获取 IConfiguration 对象
var configuration = App.Configuration;
var value = configuration["xxx:xxx"];
// 获取指定节点值并转成 T 类型
var data = App.GetConfig<TConfig>("key:key2");

1.3 获取环境对象#

var webHostEnvironment = App.WebHostEnvironment;

1.4 获取项目所有程序集#

var assemblies = App.Assemblies;

1.5 获取项目所有有效类型#

var types = App.EffectiveTypes;

1.6 获取 HttpContext#

var httpContext = App.HttpContext;

1.7 获取登录的 User 对象#

var contextUser = App.User;

1.8 获取服务提供器#

var serviceProvider = App.ServiceProvider;

1.9 解析服务#

var service = App.GetService<TService>();
var service2 = App.GetService(typeof(TService));
var service3 = App.GetRequiredService<TService>();
var service4 = App.GetRequiredService(typeof(TService));

1.10 获取选项配置#

var options = App.GetOptions<TOptions>();
var options2 = App.GetOptionsMonitor<TOptions>();
var options3 = App.GetOptionsSnapshot<TOptions>();

1.11 打印数据到 MiniProfiler#

App.PrintToMiniProfiler("分类", "状态", "要打印的消息");
Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/datavalidator/index.html b/docs/docs/global/datavalidator/index.html index 0dc26936e87..c5b551a819a 100644 --- a/docs/docs/global/datavalidator/index.html +++ b/docs/docs/global/datavalidator/index.html @@ -6,29 +6,29 @@ -3. DataValidator 静态类 | Furion - - - - - - - - - +3. DataValidator 静态类 | Furion + + + + + + + + +
-

3. DataValidator 静态类

3.1 验证对象数据#

var result = DataValidator.TryValidateObject(obj);

3.2 验证单个值#

var result = DataValidator.TryValidateValue(value, typeof(RequiredAttribure), typeof(RangeAttribute));

3.3 正则表达式验证单个值#

var result = DataValidator.TryValidateValue(value,"正则表达式");

3.4 验证类型验证单个值#

var result = DataValidator.TryValidateValue(value, ValidationTypes.Number);
+

3. DataValidator 静态类

3.1 验证对象数据#

var result = DataValidator.TryValidateObject(obj);

3.2 验证单个值#

var result = DataValidator.TryValidateValue(value, typeof(RequiredAttribure), typeof(RangeAttribute));

3.3 正则表达式验证单个值#

var result = DataValidator.TryValidateValue(value,"正则表达式");

3.4 验证类型验证单个值#

var result = DataValidator.TryValidateValue(value, ValidationTypes.Number);
var result2 = DataValidator.TryValidateValue(value, ValidationPattern.AllOfThem, ValidationTypes.Number, ValidationTypes.Required);
Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/db/index.html b/docs/docs/global/db/index.html index a18038440b8..0dacba74f61 100644 --- a/docs/docs/global/db/index.html +++ b/docs/docs/global/db/index.html @@ -6,28 +6,28 @@ -2. Db 静态类 | Furion - - - - - - - - - +2. Db 静态类 | Furion + + + + + + + + +
-

2. Db 静态类

2.1 获取非泛型仓储#

var repository = Db.GetRepository();

2.2 获取泛型仓储#

var entityRepository = Db.GetRepository<TEntity>();

2.3 获取带定位器泛型仓储#

var locatorRepository = Db.GetRepository<TEntity, TDbContextLocator>();

2.4 获取 Sql 仓储#

var sqlRepository = Db.GetSqlRepository();

2.5 获取 Sql 定位器仓储#

var sqlLocatorRepository = Db.GetSqlRepository<TDbContextLocator>();

2.6 获取 Sql 代理对象#

var sqlProxy= Db.GetSqlProxy<TSqlDispatchProxy>();

2.7 获取默认数据库上下文#

var dbContext = Db.GetDbContext();

2.7 获取定位器数据库上下文#

var locatorDbContext = Db.GetDbContext<TDbContextLocator>();
var locatorDbContext2 = Db.GetDbContext(typeof(TDbContextLocator));

2.8 创建新的默认数据库上下文#

var dbContext = Db.GetNewDbContext();

2.9 创建新的定位器数据库上下文#

var locatorDbContext = Db.GetNewDbContext<TDbContextLocator>();
var locatorDbContext2 = Db.GetNewDbContext(typeof(TDbContextLocator));
Last updated on by 百小僧
- - - - - - - - - +

2. Db 静态类

2.1 获取非泛型仓储#

var repository = Db.GetRepository();

2.2 获取泛型仓储#

var entityRepository = Db.GetRepository<TEntity>();

2.3 获取带定位器泛型仓储#

var locatorRepository = Db.GetRepository<TEntity, TDbContextLocator>();

2.4 获取 Sql 仓储#

var sqlRepository = Db.GetSqlRepository();

2.5 获取 Sql 定位器仓储#

var sqlLocatorRepository = Db.GetSqlRepository<TDbContextLocator>();

2.6 获取 Sql 代理对象#

var sqlProxy= Db.GetSqlProxy<TSqlDispatchProxy>();

2.7 获取默认数据库上下文#

var dbContext = Db.GetDbContext();

2.7 获取定位器数据库上下文#

var locatorDbContext = Db.GetDbContext<TDbContextLocator>();
var locatorDbContext2 = Db.GetDbContext(typeof(TDbContextLocator));

2.8 创建新的默认数据库上下文#

var dbContext = Db.GetNewDbContext();

2.9 创建新的定位器数据库上下文#

var locatorDbContext = Db.GetNewDbContext<TDbContextLocator>();
var locatorDbContext2 = Db.GetNewDbContext(typeof(TDbContextLocator));
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/jsonserializer/index.html b/docs/docs/global/jsonserializer/index.html index 3207935abf8..92f19b73533 100644 --- a/docs/docs/global/jsonserializer/index.html +++ b/docs/docs/global/jsonserializer/index.html @@ -6,28 +6,28 @@ -7. JsonSerializerUtility 静态类 | Furion - - - - - - - - - +7. JsonSerializerUtility 静态类 | Furion + + + + + + + + +
-

7. JsonSerializerUtility 静态类

7.1 序列化#

var str = JsonSerializerUtility.Serialize(obj, [options]);

7.3 反序列化#

var obj = JsonSerializerUtility.Deserialize<T>(str, [options]);

7.4 获取默认序列化配置#

var options = JsonSerializerUtility.GetDefaultJsonSerializerOptionss);
Last updated on by 百小僧
- - - - - - - - - +

7. JsonSerializerUtility 静态类

7.1 序列化#

var str = JsonSerializerUtility.Serialize(obj, [options]);

7.3 反序列化#

var obj = JsonSerializerUtility.Deserialize<T>(str, [options]);

7.4 获取默认序列化配置#

var options = JsonSerializerUtility.GetDefaultJsonSerializerOptionss);
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/l/index.html b/docs/docs/global/l/index.html index 41c765ef556..1a6a6d78931 100644 --- a/docs/docs/global/l/index.html +++ b/docs/docs/global/l/index.html @@ -6,28 +6,28 @@ -8. L 静态类 | Furion - - - - - - - - - +8. L 静态类 | Furion + + + + + + + + +
-

8. L 静态类

8.1 转换文本多语言#

var apiInterface = L.Text["API 接口"];

8.2 转换Html多语言#

var name = L.Html["<b>Hello</b><i> {0}</i>", name];

8.3 设置当前语言#

L.SetCulture("en-US");

8.4 获取系统语言列表#

var list = L.GetCultures();
Last updated on by 百小僧
- - - - - - - - - +

8. L 静态类

8.1 转换文本多语言#

var apiInterface = L.Text["API 接口"];

8.2 转换Html多语言#

var name = L.Html["<b>Hello</b><i> {0}</i>", name];

8.3 设置当前语言#

L.SetCulture("en-US");

8.4 获取系统语言列表#

var list = L.GetCultures();
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/linqexpression/index.html b/docs/docs/global/linqexpression/index.html index f9bdc0bda97..88f5f1729be 100644 --- a/docs/docs/global/linqexpression/index.html +++ b/docs/docs/global/linqexpression/index.html @@ -6,28 +6,28 @@ -5. LinqExpression 静态类 | Furion - - - - - - - - - +5. LinqExpression 静态类 | Furion + + + + + + + + +
-

5. LinqExpression 静态类

5.1 创建一个表达式#

var expression = LinqExpression.Create<T>(u => u.Id == 1);
var expression2 = LinqExpression.Create<T>((u,i) => u.Id ==1 && i > 0);

5.2 拼接两个表达式#

var expression = LinqExpression.And(expression1, expression2);
var expression2 = LinqExpression.IndexAnd(expression1, expression2);
var expression3 = LinqExpression.Or(expression2, expression3);
var expression4 = LinqExpression.IndexOr(expression2, expression3);
Last updated on by 百小僧
- - - - - - - - - +

5. LinqExpression 静态类

5.1 创建一个表达式#

var expression = LinqExpression.Create<T>(u => u.Id == 1);
var expression2 = LinqExpression.Create<T>((u,i) => u.Id ==1 && i > 0);

5.2 拼接两个表达式#

var expression = LinqExpression.And(expression1, expression2);
var expression2 = LinqExpression.IndexAnd(expression1, expression2);
var expression3 = LinqExpression.Or(expression2, expression3);
var expression4 = LinqExpression.IndexOr(expression2, expression3);
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/messagecenter/index.html b/docs/docs/global/messagecenter/index.html index 90ca3b2e8fd..685fe0eae84 100644 --- a/docs/docs/global/messagecenter/index.html +++ b/docs/docs/global/messagecenter/index.html @@ -6,29 +6,29 @@ -9. MessageCenter 静态类 | Furion - - - - - - - - - +9. MessageCenter 静态类 | Furion + + + + + + + + +
-

9. MessageCenter 静态类

9.1 订阅消息#

MessageCenter.Subscribe<T>("messageId", (i,p) => {
+

9. MessageCenter 静态类

9.1 订阅消息#

MessageCenter.Subscribe<T>("messageId", (i,p) => {
});

9.2 发送消息#

MessageCenter.Send("messageId", new {});

9.3 取消订阅#

MessageCenter.Unsubscribe("messageId");
Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/oops/index.html b/docs/docs/global/oops/index.html index 5c3de606818..6e7a7dc16a5 100644 --- a/docs/docs/global/oops/index.html +++ b/docs/docs/global/oops/index.html @@ -6,28 +6,28 @@ -4. Oops 静态类 | Furion - - - - - - - - - +4. Oops 静态类 | Furion + + + + + + + + +
-

4. Oops 静态类

4.1 抛出字符串异常#

throw Oops.Oh("异常消息");
throw Oops.Oh("异常消息:{0}", "出错了");

4.2 指定类型的异常#

throw Oops.Oh("异常消息", typeof(ArgumentNullException));
throw Oops.Oh("异常消息:{0}", typeof(ArgumentNullException), "出错了");

4.3 状态码异常#

throw Oops.Oh(1000);
throw Oops.Oh(1000, "出错了");

4.4 状态码异常#

throw Oops.Oh(1000, typeof(ArgumentNullException));
throw Oops.Oh(1000, typeof(ArgumentNullException), "出错了");
Last updated on by 百小僧
- - - - - - - - - +

4. Oops 静态类

4.1 抛出字符串异常#

throw Oops.Oh("异常消息");
throw Oops.Oh("异常消息:{0}", "出错了");

4.2 指定类型的异常#

throw Oops.Oh("异常消息", typeof(ArgumentNullException));
throw Oops.Oh("异常消息:{0}", typeof(ArgumentNullException), "出错了");

4.3 状态码异常#

throw Oops.Oh(1000);
throw Oops.Oh(1000, "出错了");

4.4 状态码异常#

throw Oops.Oh(1000, typeof(ArgumentNullException));
throw Oops.Oh(1000, typeof(ArgumentNullException), "出错了");
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/global/shttp/index.html b/docs/docs/global/shttp/index.html index 4de6695b860..09b2c44de14 100644 --- a/docs/docs/global/shttp/index.html +++ b/docs/docs/global/shttp/index.html @@ -6,28 +6,28 @@ -6. Http 静态类 | Furion - - - - - - - - - +6. Http 静态类 | Furion + + + + + + + + + - - - - - - - - - +
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/gooduse/index.html b/docs/docs/gooduse/index.html deleted file mode 100644 index 51005fbaccf..00000000000 --- a/docs/docs/gooduse/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - -31.3 最佳实践 | Furion - - - - - - - - - - - -
-
Last updated on by 百小僧
- - - - - - - - - - - \ No newline at end of file diff --git a/docs/docs/grpc/index.html b/docs/docs/grpc/index.html index 20a8ff1cebf..95bc93fc780 100644 --- a/docs/docs/grpc/index.html +++ b/docs/docs/grpc/index.html @@ -6,28 +6,28 @@ -26. Grpc 服务 | Furion - - - - - - - - - +26. Grpc 服务 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/http/index.html b/docs/docs/http/index.html index 693c5b2aad7..e2ab101713a 100644 --- a/docs/docs/http/index.html +++ b/docs/docs/http/index.html @@ -6,20 +6,20 @@ -19. 远程请求 | Furion - - - - - - - - - +19. 远程请求 | Furion + + + + + + + + +
-

19. 远程请求

19.1 关于远程请求#

在互联网大数据的驱动下,平台或系统免不了需要和第三方进行数据交互,而第三方往往提供了 RESTful API 结果规范,这个时候就需要通过 Http 请求第三方接口进行数据传输交互。

也就是本章节所说的远程请求。

19.2 远程请求的作用#

  • 跨系统、跨设备通信
  • 实现多个系统数据传输交互
  • 跨编程语言协同开发

19.3 基础使用#

19.3.1 注册服务#

使用之前需在 Startup.cs 注册 远程请求服务

public void ConfigureServices(IServiceCollection services)
{
services.AddRemoteRequest();
}

19.3.2 使用方式#

  • IHttpDispatchProxy 代理方式

定义代理请求的 接口 并继承 IHttpDispatchProxy 接口

[Host("http://47.100.247.61/", 5000)]
public interface IHttp : IHttpDispatchProxy
{
[Get("api/sysdata/categories")]
Task<RESTfulResult<List<Data>>> GetCategoryAsync();
}

通过构造函数注入 接口

using Furion.DynamicApiController;
using Furion.RemoteRequest;
+

19. 远程请求

19.1 关于远程请求#

在互联网大数据的驱动下,平台或系统免不了需要和第三方进行数据交互,而第三方往往提供了 RESTful API 结果规范,这个时候就需要通过 Http 请求第三方接口进行数据传输交互。

也就是本章节所说的远程请求。

19.2 远程请求的作用#

  • 跨系统、跨设备通信
  • 实现多个系统数据传输交互
  • 跨编程语言协同开发

19.3 基础使用#

19.3.1 注册服务#

使用之前需在 Startup.cs 注册 远程请求服务

public void ConfigureServices(IServiceCollection services)
{
services.AddRemoteRequest();
}

19.3.2 使用方式#

  • IHttpDispatchProxy 代理方式

定义代理请求的 接口 并继承 IHttpDispatchProxy 接口

[Host("http://47.100.247.61/", 5000)]
public interface IHttp : IHttpDispatchProxy
{
[Get("api/sysdata/categories")]
Task<RESTfulResult<List<Data>>> GetCategoryAsync();
}

通过构造函数注入 接口

using Furion.DynamicApiController;
using Furion.RemoteRequest;
namespace Furion.Application
{
public class RemoteRequestService : IDynamicApiController
{
private readonly IHttp _http;
public RemoteRequestService(IHttp http)
{
_http = http;
}
public async Task GetData()
{
var data = await _http.GetCategoryAsync();
}
}
}
  • 字符串方式
var data = await "http://47.100.247.61/api/sysdata/categories".GetAsAsync<object>();

19.4 使用示例#

19.4.1 字符串方式#

  • [METHOD]Async/[METHOD]AsAsync 方式
// ============ GET 请求 ============
// 返回 HttpResponseMessage 对象
var response = await "https://www.furion.pro/data".GetAsync();
@@ -58,14 +58,14 @@
return httpClient;
}
}
字符串方式拦截

字符串方式只提供了请求拦截,不提供响应拦截

// 设置请求拦截
var data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync<object>(new { parm1="", parm2="" }, interceptor: request=>{
request.Headers.Add("Authorization","Bearer token字符串");
});

19.5.5 Body 参数序列化问题#

由于一些第三方接口不规范或对参数大小写敏感,这个时候我们可以配置特性的 PropertyNamingPolicy 属性,如:

[Post("https://www.furion.pro/getdata", PropertyNamingPolicy = JsonNamingPolicyOptions.Null)]
Task<User> GetData();
  • JsonNamingPolicyOptions 可选值:
    • CamelCase:默认,首字母小写属性名
    • Null:保持原有属性名称定义规则

19.5.6 Body 内容配置#

默认情况下,支持 Body 参数配置的请求都会序列化成 Json 内容配置,我们也可以通过 HttpContentType 属性指定,如:

[Post("https://www.furion.pro/getdata", HttpContentType = HttpContentTypeOptions.JsonStringContent)]
Task<User> GetData();
  • HttpContentTypeOptions 可选值:
    • StringContent:字符串内容
    • JsonStringContentJson 字符串内容
    • XmlStringContentXml 字符串内容
    • MultipartFormDataContentmultipart/form-data 类型内容
    • FormUrlEncodedContentx-www-form-urlencoded 类型内容

19.5.7 多个请求客户端配置#

Furion 框架也提供了多个请求客户端配置,可以为多个客户端请求配置默认请求信息,如:

services.AddRemoteRequest(options=>
{
// 配置 Github 基本信息
options.AddHttpClient("github", c =>
{
c.BaseAddress = new Uri("https://api.github.com/");
c.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json");
c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");
});
// 配置 Facebook 基本信息
options.AddHttpClient("facebook", c =>
{
c.BaseAddress = new Uri("https://api.facebook.com/");
c.DefaultRequestHeaders.Add("Accept", "application/vnd.facebook.v3+json");
c.DefaultRequestHeaders.Add("User-Agent", "HttpClientFactory-Sample");
});
})

配置了命名客户端后,每次请求都会自动加上这些配置。

代理请求 使用

[Get("api/getdata"), Client("github")]
Task<User> GetData();
[Put("api/getdata"), Client("facebook")]
Task<User> GetData();

字符串拓展 使用

// 设置请求拦截
var data = await "http://47.100.247.61/api/sysdata/categories".PostAsAsync<object>(new { parm1="", parm2="" }, clientName = "github");

19.6 代理内置特性#

19.6.1 接口特性#

  • 主机 特性
    • [Host]:配置主机地址和端口
  • 请求头 特性
    • [Header]:配置请求报文头,支持多个
  • 客户端 特性
    • [Client]:配置客户端

接口的特性会影响所有的成员方法,也就是会应用到每一个方法中,当然方法可可以重写或忽略。

19.6.2 方法特性#

  • 请求谓词 特性
    • [Get]Get 请求方式
    • [Post]Post 请求方式
    • [Put]Put 请求方式
    • [Delete]Delete 请求方式
    • [Patch]Patch 请求方式
    • [Head]Head 请求方式
  • 主机 特性
    • [Host]:配置主机地址和端口
  • 请求头 特性
    • [Header]:配置请求报文头,支持多个
  • 客户端 特性
    • [Client]:配置客户端
  • 内容类型 特性
    • [MediaTypeHeader]:配置内容类型

19.6.3 方法参数特性#

  • [Query]:自动将参数替换地址中的占位符,占位符格式 {参数名},如:https://www.furion.pro/user/{id},默认基元类型或基元类型数组应用该特性
  • [Body]:自动将参数添加到请求报文体中,默认非基元类型会引用该特性。

19.7 关于同步请求#

Furion 框架内部默认不提供同步请求操作,建议总是使用异步的方式请求。如在不能使用异步的情况下,可自行转换为同步执行。

19.8 异常处理#

默认情况下,如果接口请求异常会抛出请求异常,有时这不是我们想要的结果,我们希望如果接口请求异常,那么直接返回默认值即可,这时候我们只需要在接口或方法贴 [Safety] 特性即可。

19.9 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 日志 知识可查阅 ASP.NET Core - HTTP 请求 章节

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/index.html b/docs/docs/index.html index d91a012a8e8..1cf63e70609 100644 --- a/docs/docs/index.html +++ b/docs/docs/index.html @@ -6,28 +6,28 @@ -1.1 介绍 | Furion - - - - - - - - - +1.1 介绍 | Furion + + + + + + + + +
-

1.1 介绍

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

🌭 开源地址#

🍿 Docker 镜像#

  • Docker Hub 线上镜像
docker run --name furion -p 5000:80 monksoul/furion:v1.4.3
  • 手动 打包镜像

打开 CMD/Shell/PowerShell 进入 Furion 项目根目录打包 Furion 镜像:

docker build -t furion:v1.4.3 .

打包成功后,直接 docker run

docker run --name furion -p 5000:80 furion:v1.4.3

🥥 框架拓展包#

包类型名称版本描述
nugetFurionnugetFurion 核心包
nugetFurion.Extras.Authentication.JwtBearernugetFurion Jwt 拓展包
nugetFurion.Extras.DependencyModel.CodeAnalysisnugetFurion CodeAnalysis 拓展包
nugetFurion.Extras.Web.HttpContextnugetFurion HttpContext 拓展包
nugetFurion.Extras.ObjectMapper.MapsternugetFurion Mapster 拓展包
nugetFurion.Extras.DatabaseAccessor.SqlSugarnugetFurion SqlSugar 拓展包
nugetFurion.Extras.DatabaseAccessor.DappernugetFurion Dapper 拓展包
nugetFurion.Extras.Logging.SerilognugetFurion Serilog 拓展包

🍄 框架脚手架#

模板类型名称版本描述
nugetFurion.Template.MvcnugetMvc 模板
nugetFurion.Template.ApinugetWebApi 模板
nugetFurion.Template.AppnugetMvc/WebApi 模板
nugetFurion.Template.RazornugetRazorPages 模板
nugetFurion.Template.RazorWithWebApinugetRazorPages/WebApi 模板
nugetFurion.Template.BlazornugetBlazor 模板
nugetFurion.Template.BlazorWithWebApinugetBlazor/WebApi 模板

如何使用脚手架

🍎 框架特点#

  • 全新面貌:基于 .NET 5 平台,没有历史包袱
  • 极易入门:只需要一个 Inject() 即可完成配置
  • 极速开发:内置丰富的企业应用开发功能
  • 极少依赖:框架只依赖两个第三方包
  • 极其灵活:轻松面对多变复杂的需求
  • 极易维护:采用独特的架构思想,只为长久维护设计
  • 完整文档:提供完善的开发文档

🥞 架构设计#

正在整理中...

🥝 功能模块#

🥐 框架依赖#

Furion 为了追求极速入门,极致性能,尽可能的不使用或减少第三方依赖。目前 Furion 仅集成了以下两个依赖:

麻雀虽小五脏俱全。Furion 即使只集成了这两个依赖,但是主流的 依赖注入/控制反转AOP 面向切面编程,事件总线数据验证数据库操作 等等一个都不少。

🥗 环境要求#

  • Visual Studio 2019 16.8 +
  • .NET 5 SDK +
  • .Net Standard 2.1 +

🥪 支持平台#

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
    • Xamarin/MAUI
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • MariaDB
    • PostgreSQL
    • InMemoryDatabase
    • Oracle(并未完全适配
    • Firebird
    • 达梦数据库
  • 应用部署
    • Kestrel
    • Nginx
    • Jexus
    • IIS
    • Apache
    • PM2
    • Supervisor
    • 单文件
    • 容器(Docker/K8S/K3S/Rancher)

🍖 关于性能#

Furion 目前采用 Visual Studio 2019 16.8 自带性能测试和 JMeter 进行测试,由于篇幅有限,只贴部分测试图,测试结果如下:


🍚 关于作者#

一个拥有近 13 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎,MIP(dotNET China Most Influential Professionals) 专家,同时多次获得开源中国 Gitee 授予 GVP 证书。

🍤 项目成员#

🎈 欢迎更多的开发者加入 Furion 大家庭。

🍝 他们都在用#

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 夫上技术(阳江)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司
  • 深圳市品立方科技有限公司
  • 上海奥达科股份有限公司
  • 中山市泓升软件科技有限公司
  • 唐山天权建筑科技有限公司
  • 北京帝龙科技有限公司
  • 深圳市希立网络有限公司
  • 广州市飞帆计算机技术有限公司
  • 泉州市润海信息科技有限公司
  • 成都市彼岸里信息科技有限公司
  • 福建省山水生活服务集团有限公司
  • 安徽宝典网络科技有限公司
  • 西安空岛网络科技有限公司
  • 果糖大数据科技(南通)有限公司
  • 上海楷青信息技术有限公司
  • 上海邮银通信发展有限公司
  • 合纵动力软件科技有限公司
  • 深圳合纵动力软件科技有限公司
  • 北京帝龙科技有限公司

如果您的项目使用到 Furion 开发,可以告诉我们。

🍻 贡献代码#

Furion 遵循 Apache-2.0 开源协议,欢迎大家提交 PRIssue

如果要为项目做出贡献,请查看贡献指南

🍍 捐赠列表#

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...
😤 好人!10Nice 的小僧,我们的 dotnetchina 马上火起来了
😮 木木 Woody10感谢您的开源项目!
😚 Joker HouQQ 超级会员一个月
🤠 ccdfzQQ 专属红包 199
🌝 天夫李总支付宝 6666Furion 非常有意思,持续关注
😝 六尘子微信红包 199公司已经使用,小小敬意
🤠 ccdfzQQ 专属红包 200赞助一根内存条
🤑 邓亮灯28.88感谢您的开源项目!
😬 天道酬勤微信二维码 188小小心意
🥰 却月居士QQ 专属红包 100恭喜发财
🤩 鲁旭100感谢您的开源项目!
😬 散客行微信二维码 666终于找到一个不错的框架
😌 本心100项目功能很强大
🙆‍♂️ 毕业生100请你喝杯咖啡
🦹‍♀️ 猪鼻子微信二维码 668
🧟‍♂️ 明年·今日200使用的框架里最爽的,最理想的!加油
👨‍🎓 过去的过去50感谢您的开源项目!
👨‍🔧 万里兮100新公司的第一个项目从 Furion 开始
👴 Muphalem20很热心很亲切的开发者,加油!
💂‍♂️ 吃锅巴的码农微信二维码 500就冲你的文档写得好!
🤴 三重罗生门微信红包 200下次烤鱼你请!
🤵 李涛10加油,我们看到了 dotnet 美好的明天 :)
😂 !@#$%^&QQ 专属红包 100刚接触 furion,文档真棒
😵 李斌20看到一个不错的框架,学习学习,感谢作者的无私奉献
😞 逞强QQ 专属红包 20恭喜发财
🤒 顾锦松QQ 专属红包 200期待文档完成时候
🧟‍♀️ 哈哈微信赞赏码 1000点赞作者!
🍍 Z微信赞赏码 100恭喜孩子诞生,谢谢大佬
🍲 海涛50恭喜
😣 h微信赞赏码 100qq82683656
👱‍♀️ 冷大大微信赞赏码 100加快文档和教学补充哦,另外需要钉钉群,平常不用 QQ
👜 腾坤微信赞赏码 10感谢您的开源项目,QQ:565728589

非常感谢您们的支持,正是因为您们,中国开源才可以越走越远,Furion 越走越远。

如果想成为 Furion 支持者或赞助商,请考虑:

🥔 QQ 交流群#

dotNET 中国 ① 🥇(已满

dotNET 中国 ②(空余)

🧆 友情链接#

👉 Furion 👉 SqlSugar 👉 Layx 👉 t-io 👉 ThinkPHP 👉 Hutool 👉 BootstrapAdmin 👉 BootstrapBlazor 👉 IoTSharp 👉 Anno.Core 👉 WaterCloud 👉 OpenAuth.Net

🍵 特别鸣谢#

在这里特别感谢 QQ 网名:蓝狐星Furion 提供演示云服务器。

Last updated on by 百小僧
- - - - - - - - - +

1.1 介绍

star fork GitHub stars GitHub forks GitHub license nuget

让 .NET 开发更简单,更通用,更流行。

💐 序言#

无私奉献不是天方夜谭,有时候,我们也可以做到。

🍕 名字的由来#

故事是这样子的:

自微软宣布 .NET 5 平台消息之后,就琢磨着开发一个基于 .NET 5 平台的开发框架,想做第一个吃 .NET 5 螃蟹尝鲜之人。

一开始想到了 Lazier 作为框架的名称,中文有 更懒 的意思。符合我的 “一切从简,只为了更懒” 的开发理念。

但是 更懒更烂 中文读音相近且没有特色,而且寓意也不是很好,对此换名问题苦恼了好些天。

刚好有一次在 QQ 群中无意间刷到了群友发的 “先知” 单词:Furion,就那一刻,就认定它了!

Furion 中文有 先知 的意思,恰好符合我创造框架的初衷。所以,Furion 就诞生了。

🍔 关于 LOGO#

Furion 标志设计理念是借鉴著名的 袋鼠理论 设计的。

袋鼠具有长腿、育袋、自我奔跑特点。

  • 长腿:代表着 Furion 拥有稳健的双腿,走在科技的前沿,走的更远,跑的更快。
  • 育袋:小育袋、大作为。期待 Furion 能够育孕出更多 .NET 优秀开发者和生机勃勃的生态。
  • 自我奔跑Furion 自身也要不断学习、不断进步、不断创新、不断开拓。

🍯 开源案例#

  • 考试君:基于 Furion 的在线考试系统
  • 园丁:基于 Furion + Blazor 的超简单后台管理系统
  • Queer:基于 Furion + Layui 的通用型管理系统
  • Pear AdminPearAdmin 官方和 Furion 官方合作管理系统
  • JoyAdmin:基于 Furion + iviewadmin 开发的管理系统

🍟 文档地址#

目前文档正在逐步完善中。

🥦 系列教程#

🌭 开源地址#

🍿 Docker 镜像#

  • Docker Hub 线上镜像
docker run --name furion -p 5000:80 monksoul/furion:v1.4.3
  • 手动 打包镜像

打开 CMD/Shell/PowerShell 进入 Furion 项目根目录打包 Furion 镜像:

docker build -t furion:v1.4.3 .

打包成功后,直接 docker run

docker run --name furion -p 5000:80 furion:v1.4.3

🥥 框架拓展包#

包类型名称版本描述
nugetFurionnugetFurion 核心包
nugetFurion.Extras.Authentication.JwtBearernugetFurion Jwt 拓展包
nugetFurion.Extras.DependencyModel.CodeAnalysisnugetFurion CodeAnalysis 拓展包
nugetFurion.Extras.Web.HttpContextnugetFurion HttpContext 拓展包
nugetFurion.Extras.ObjectMapper.MapsternugetFurion Mapster 拓展包
nugetFurion.Extras.DatabaseAccessor.SqlSugarnugetFurion SqlSugar 拓展包
nugetFurion.Extras.DatabaseAccessor.DappernugetFurion Dapper 拓展包
nugetFurion.Extras.Logging.SerilognugetFurion Serilog 拓展包

🍄 框架脚手架#

模板类型名称版本描述
nugetFurion.Template.MvcnugetMvc 模板
nugetFurion.Template.ApinugetWebApi 模板
nugetFurion.Template.AppnugetMvc/WebApi 模板
nugetFurion.Template.RazornugetRazorPages 模板
nugetFurion.Template.RazorWithWebApinugetRazorPages/WebApi 模板
nugetFurion.Template.BlazornugetBlazor 模板
nugetFurion.Template.BlazorWithWebApinugetBlazor/WebApi 模板

如何使用脚手架

🍎 框架特点#

  • 全新面貌:基于 .NET 5 平台,没有历史包袱
  • 极易入门:只需要一个 Inject() 即可完成配置
  • 极速开发:内置丰富的企业应用开发功能
  • 极少依赖:框架只依赖两个第三方包
  • 极其灵活:轻松面对多变复杂的需求
  • 极易维护:采用独特的架构思想,只为长久维护设计
  • 完整文档:提供完善的开发文档

🥞 架构设计#

正在整理中...

🥝 功能模块#

🥐 框架依赖#

Furion 为了追求极速入门,极致性能,尽可能的不使用或减少第三方依赖。目前 Furion 仅集成了以下两个依赖:

麻雀虽小五脏俱全。Furion 即使只集成了这两个依赖,但是主流的 依赖注入/控制反转AOP 面向切面编程,事件总线数据验证数据库操作 等等一个都不少。

🥗 环境要求#

  • Visual Studio 2019 16.8 +
  • .NET 5 SDK +
  • .Net Standard 2.1 +

🥪 支持平台#

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
    • Xamarin/MAUI
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • MariaDB
    • PostgreSQL
    • InMemoryDatabase
    • Oracle(并未完全适配
    • Firebird
    • 达梦数据库
  • 应用部署
    • Kestrel
    • Nginx
    • Jexus
    • IIS
    • Apache
    • PM2
    • Supervisor
    • 单文件
    • 容器(Docker/K8S/K3S/Rancher)

🍖 关于性能#

Furion 目前采用 Visual Studio 2019 16.8 自带性能测试和 JMeter 进行测试,由于篇幅有限,只贴部分测试图,测试结果如下:


🍚 关于作者#

一个拥有近 13 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎,MIP(dotNET China Most Influential Professionals) 专家,同时多次获得开源中国 Gitee 授予 GVP 证书。

🍤 项目成员#

🎈 欢迎更多的开发者加入 Furion 大家庭。

🍝 他们都在用#

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 夫上技术(阳江)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司
  • 深圳市品立方科技有限公司
  • 上海奥达科股份有限公司
  • 中山市泓升软件科技有限公司
  • 唐山天权建筑科技有限公司
  • 北京帝龙科技有限公司
  • 深圳市希立网络有限公司
  • 广州市飞帆计算机技术有限公司
  • 泉州市润海信息科技有限公司
  • 成都市彼岸里信息科技有限公司
  • 福建省山水生活服务集团有限公司
  • 安徽宝典网络科技有限公司
  • 西安空岛网络科技有限公司
  • 果糖大数据科技(南通)有限公司
  • 上海楷青信息技术有限公司
  • 上海邮银通信发展有限公司
  • 合纵动力软件科技有限公司
  • 深圳合纵动力软件科技有限公司
  • 北京帝龙科技有限公司

如果您的项目使用到 Furion 开发,可以告诉我们。

🍻 贡献代码#

Furion 遵循 Apache-2.0 开源协议,欢迎大家提交 PRIssue

如果要为项目做出贡献,请查看贡献指南

🍍 捐赠列表#

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...
😤 好人!10Nice 的小僧,我们的 dotnetchina 马上火起来了
😮 木木 Woody10感谢您的开源项目!
😚 Joker HouQQ 超级会员一个月
🤠 ccdfzQQ 专属红包 199
🌝 天夫李总支付宝 6666Furion 非常有意思,持续关注
😝 六尘子微信红包 199公司已经使用,小小敬意
🤠 ccdfzQQ 专属红包 200赞助一根内存条
🤑 邓亮灯28.88感谢您的开源项目!
😬 天道酬勤微信二维码 188小小心意
🥰 却月居士QQ 专属红包 100恭喜发财
🤩 鲁旭100感谢您的开源项目!
😬 散客行微信二维码 666终于找到一个不错的框架
😌 本心100项目功能很强大
🙆‍♂️ 毕业生100请你喝杯咖啡
🦹‍♀️ 猪鼻子微信二维码 668
🧟‍♂️ 明年·今日200使用的框架里最爽的,最理想的!加油
👨‍🎓 过去的过去50感谢您的开源项目!
👨‍🔧 万里兮100新公司的第一个项目从 Furion 开始
👴 Muphalem20很热心很亲切的开发者,加油!
💂‍♂️ 吃锅巴的码农微信二维码 500就冲你的文档写得好!
🤴 三重罗生门微信红包 200下次烤鱼你请!
🤵 李涛10加油,我们看到了 dotnet 美好的明天 :)
😂 !@#$%^&QQ 专属红包 100刚接触 furion,文档真棒
😵 李斌20看到一个不错的框架,学习学习,感谢作者的无私奉献
😞 逞强QQ 专属红包 20恭喜发财
🤒 顾锦松QQ 专属红包 200期待文档完成时候
🧟‍♀️ 哈哈微信赞赏码 1000点赞作者!
🍍 Z微信赞赏码 100恭喜孩子诞生,谢谢大佬
🍲 海涛50恭喜
😣 h微信赞赏码 100qq82683656
👱‍♀️ 冷大大微信赞赏码 100加快文档和教学补充哦,另外需要钉钉群,平常不用 QQ
👜 腾坤微信赞赏码 10感谢您的开源项目,QQ:565728589

非常感谢您们的支持,正是因为您们,中国开源才可以越走越远,Furion 越走越远。

如果想成为 Furion 支持者或赞助商,请考虑:

🥔 QQ 交流群#

dotNET 中国 ① 🥇(已满

dotNET 中国 ②(空余)

🧆 友情链接#

👉 Furion 👉 SqlSugar 👉 Layx 👉 t-io 👉 ThinkPHP 👉 Hutool 👉 BootstrapAdmin 👉 BootstrapBlazor 👉 IoTSharp 👉 Anno.Core 👉 WaterCloud 👉 OpenAuth.Net

🍵 特别鸣谢#

在这里特别感谢 QQ 网名:蓝狐星Furion 提供演示云服务器。

Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/job/index.html b/docs/docs/job/index.html index 95dfe647afa..0c62333d9f0 100644 --- a/docs/docs/job/index.html +++ b/docs/docs/job/index.html @@ -6,28 +6,28 @@ -24. 任务调度 | Furion - - - - - - - - - +24. 任务调度 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/local-language/index.html b/docs/docs/local-language/index.html index 09e0a837d80..41526d5f1e6 100644 --- a/docs/docs/local-language/index.html +++ b/docs/docs/local-language/index.html @@ -6,20 +6,20 @@ -21. 全球化和本地化 | Furion - - - - - - - - - +21. 全球化和本地化 | Furion + + + + + + + + +
-

21. 全球化和本地化

21.1 全球化和本地化#

全球化 是设计支持不同区域性的应用程序的过程。 全球化添加了对一组有关特定地理区域的已定义语言脚本的输入、显示和输出支持。

本地化 是将已经针对可本地化性进行处理的全球化应用调整为特定的区域性/区域设置的过程。

通俗来说,就是使应用或系统支持多语言切换。Furion 框架提供了完整支持多语言处理的服务。

21.2 注册服务#

在使用多语言服务之前,必须先注册服务,如:

public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews()
.AddAppLocalization(); // 注册多语言
}
+

21. 全球化和本地化

21.1 全球化和本地化#

全球化 是设计支持不同区域性的应用程序的过程。 全球化添加了对一组有关特定地理区域的已定义语言脚本的输入、显示和输出支持。

本地化 是将已经针对可本地化性进行处理的全球化应用调整为特定的区域性/区域设置的过程。

通俗来说,就是使应用或系统支持多语言切换。Furion 框架提供了完整支持多语言处理的服务。

21.2 注册服务#

在使用多语言服务之前,必须先注册服务,如:

public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews()
.AddAppLocalization(); // 注册多语言
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
// 配置多语言,必须在 路由注册之前
app.UseAppLocalization();
app.UseStaticFiles();
app.UseRouting();
@@ -29,14 +29,14 @@
namespace Furion.Application
{
[ErrorCodeType]
public enum ErrorCodes
{
[ErrorCodeItemMetadata("用户名不能为空")]
z1000
}
}

所有异常消息特性已经自动支持多语言配置了,无需通过 L.Text[] 调用。

throw Oops.Oh(ErrorCodes.z1000); // 自动应用多语言

21.6 创建语言翻译文件#

Furion 框架中,如果没找到对应的语言翻译文件,则自动显示字符串文本,如:

L.Text["没找到"]; // => 如果设置为英文,但是没有文件,则直接输出 “没找到”

21.6.1 在 Resources 文件夹中创建语言文件#

接下来,我们只需要在刚刚的 Resources 文件夹中添加 资源文件 即可,资源文件命名规则:Lang.区域码.resx,如:Lang.en-US.resx

接下来,只需要把对应语言版本的键值对填写即可。

21.7 切换语言#

Furion 提供了三种语言切换方式进行切换语言:

  • URL 参数 方式: ?culture=en-US此方式优先级最高,格式为:culture=区域码
  • Cookies 方式:调用 L.SetCulture(区域码) 方式切换
  • 客户端浏览器语言自动匹配:如果前面两种方式都没有设置,支持自动根据客户端浏览器语言进行匹配。

21.7.1 URL 参数 方式#

21.7.2 Cookies 方式#

此方式只需要提供一个 api 或设置代码即可:

L.SetCulture("en-US"); // en-US 也可以通过前端传递过来,这样就可以不用 `culture` 参数了,可以自定义参数。

这样就可以直接根据客户端存储的 cookies 自动切换了。

21.7.3 客户端浏览器语言自动切换#

推荐此方式,可以自动根据浏览器的语言自动配置:

21.8 依赖注入方式使用#

Furion 框架也兼容 .NET Core 自带的依赖注入方式,如:

public class TestController : Controller
{
private readonly IStringLocalizer _localizer;
public TestController(IStringLocalizerFactory factory)
{
_localizer = factory.Create(L.LangType);
}
public IActionResult About()
{
ViewData["Message"] = _localizer["Your application description page."];
}
}

21.9 LocalizationSettings 配置#

  • LocalizationSettings 多语言配置根节点
    • ResourcesPath:资源目录,string 类型,默认 Resources
    • SupportedCultures:支持的语言区域码类别,string[] 类型
    • DefaultCulture:默认语言区域码,如果为空,则取 SupportedCultures 第一项

21.10 区域码列表#

  • af 公用荷兰语
  • af-ZA 公用荷兰语 - 南非
  • sq 阿尔巴尼亚
  • sq-AL 阿尔巴尼亚 -阿尔巴尼亚
  • ar 阿拉伯语
  • ar-DZ 阿拉伯语 -阿尔及利亚
  • ar-BH 阿拉伯语 -巴林
  • ar-EG 阿拉伯语 -埃及
  • ar-IQ 阿拉伯语 -伊拉克
  • ar-JO 阿拉伯语 -约旦
  • ar-KW 阿拉伯语 -科威特
  • ar-LB 阿拉伯语 -黎巴嫩
  • ar-LY 阿拉伯语 -利比亚
  • ar-MA 阿拉伯语 -摩洛哥
  • ar-OM 阿拉伯语 -阿曼
  • ar-QA 阿拉伯语 -卡塔尔
  • ar-SA 阿拉伯语 - 沙特阿拉伯
  • ar-SY 阿拉伯语 -叙利亚共和国
  • ar-TN 阿拉伯语 -北非的共和国
  • ar-AE 阿拉伯语 - 阿拉伯联合酋长国
  • ar-YE 阿拉伯语 -也门
  • hy 亚美尼亚
  • hy-AM 亚美尼亚的 -亚美尼亚
  • az Azeri
  • az-AZ-Cyrl Azeri-(西里尔字母的) 阿塞拜疆
  • az-AZ-Latn Azeri(拉丁文)- 阿塞拜疆
  • eu 巴斯克
  • eu-ES 巴斯克 -巴斯克
  • be Belarusian
  • be-BY Belarusian-白俄罗斯
  • bg 保加利亚
  • bg-BG 保加利亚 -保加利亚
  • ca 嘉泰罗尼亚
  • ca-ES 嘉泰罗尼亚 -嘉泰罗尼亚
  • zh-HK 华 - 香港的 SAR
  • zh-MO 华 - 澳门的 SAR
  • zh-CN 华 -中国
  • zh-CHS 华 (单一化)
  • zh-SG 华 -新加坡
  • zh-TW 华 -台湾
  • zh-CHT 华 (传统的)
  • hr 克罗埃西亚
  • hr-HR 克罗埃西亚 -克罗埃西亚
  • cs 捷克
  • cs-CZ 捷克 - 捷克
  • da 丹麦文
  • da-DK 丹麦文 -丹麦
  • div Dhivehi
  • div-MV Dhivehi-马尔代夫
  • nl 荷兰
  • nl-BE 荷兰 -比利时
  • nl-NL 荷兰 - 荷兰
  • en 英国
  • en-AU 英国 -澳洲
  • en-BZ 英国 -伯利兹
  • en-CA 英国 -加拿大
  • en-CB 英国 -加勒比海
  • en-IE 英国 -爱尔兰
  • en-JM 英国 -牙买加
  • en-NZ 英国 - 新西兰
  • en-PH 英国 -菲律宾共和国
  • en-ZA 英国 - 南非
  • en-TT 英国 - 千里达托贝哥共和国
  • en-GB 英国 - 英国
  • en-US 英国 - 美国
  • en-ZW 英国 -津巴布韦
  • et 爱沙尼亚
  • et-EE 爱沙尼亚的 -爱沙尼亚
  • fo Faroese
  • fo-FO Faroese- 法罗群岛
  • fa 波斯语
  • fa-IR 波斯语 -伊朗王国
  • fi 芬兰语
  • fi-FI 芬兰语 -芬兰
  • fr 法国
  • fr-BE 法国 -比利时
  • fr-CA 法国 -加拿大
  • fr-FR 法国 -法国
  • fr-LU 法国 -卢森堡
  • fr-MC 法国 -摩纳哥
  • fr-CH 法国 -瑞士
  • gl 加利西亚
  • gl-ES 加利西亚 -加利西亚
  • ka 格鲁吉亚州
  • ka-GE 格鲁吉亚州 -格鲁吉亚州
  • de 德国
  • de-AT 德国 -奥地利
  • de-DE 德国 -德国
  • de-LI 德国 -列支敦士登
  • de-LU 德国 -卢森堡
  • de-CH 德国 -瑞士
  • el 希腊
  • el-GR 希腊 -希腊
  • gu Gujarati
  • gu-IN Gujarati-印度
  • he 希伯来
  • he-IL 希伯来 -以色列
  • hi 北印度语
  • hi-IN 北印度的 -印度
  • hu 匈牙利
  • hu-HU 匈牙利的 -匈牙利
  • is 冰岛语
  • is-IS 冰岛的 -冰岛
  • id 印尼
  • id-ID 印尼 -印尼
  • it 意大利
  • it-IT 意大利 -意大利
  • it-CH 意大利 -瑞士
  • ja 日本
  • ja-JP 日本 -日本
  • kn 卡纳达语
  • kn-IN 卡纳达语 -印度
  • kk Kazakh
  • kk-KZ Kazakh-哈萨克
  • kok Konkani
  • kok-IN Konkani-印度
  • ko 韩国
  • ko-KR 韩国 -韩国
  • ky Kyrgyz
  • ky-KZ Kyrgyz-哈萨克
  • lv 拉脱维亚
  • lv-LV 拉脱维亚的 -拉脱维亚
  • lt 立陶宛
  • lt-LT 立陶宛 -立陶宛
  • mk 马其顿
  • mk-MK 马其顿 -FYROM
  • ms 马来
  • ms-BN 马来 -汶莱
  • ms-MY 马来 -马来西亚
  • mr 马拉地语
  • mr-IN 马拉地语 -印度
  • mn 蒙古
  • mn-MN 蒙古 -蒙古
  • no 挪威
  • nb-NO 挪威 (Bokm?l) - 挪威
  • nn-NO 挪威 (Nynorsk)- 挪威
  • pl 波兰
  • pl-PL 波兰 -波兰
  • pt 葡萄牙
  • pt-BR 葡萄牙 -巴西
  • pt-PT 葡萄牙 -葡萄牙
  • pa Punjab 语
  • pa-IN Punjab 语 -印度
  • ro 罗马尼亚语
  • ro-RO 罗马尼亚语 -罗马尼亚
  • ru 俄国
  • ru-RU 俄国 -俄国
  • sa 梵文
  • sa-IN 梵文 -印度
  • sr-SP-Cyrl 塞尔维亚 -(西里尔字母的) 塞尔维亚共和国
  • sr-SP-Latn 塞尔维亚 (拉丁文)- 塞尔维亚共和国
  • sk 斯洛伐克
  • sk-SK 斯洛伐克 -斯洛伐克
  • sl 斯洛文尼亚
  • sl-SI 斯洛文尼亚 -斯洛文尼亚
  • es 西班牙
  • es-AR 西班牙 -阿根廷
  • es-BO 西班牙 -玻利维亚
  • es-CL 西班牙 -智利
  • es-CO 西班牙 -哥伦比亚
  • es-CR 西班牙 - 哥斯达黎加
  • es-DO 西班牙 - 多米尼加共和国
  • es-EC 西班牙 -厄瓜多尔
  • es-SV 西班牙 - 萨尔瓦多
  • es-GT 西班牙 -危地马拉
  • es-HN 西班牙 -洪都拉斯
  • es-MX 西班牙 -墨西哥
  • es-NI 西班牙 -尼加拉瓜
  • es-PA 西班牙 -巴拿马
  • es-PY 西班牙 -巴拉圭
  • es-PE 西班牙 -秘鲁
  • es-PR 西班牙 - 波多黎各
  • es-ES 西班牙 -西班牙
  • es-UY 西班牙 -乌拉圭
  • es-VE 西班牙 -委内瑞拉
  • sw Swahili
  • sw-KE Swahili-肯尼亚
  • sv 瑞典
  • sv-FI 瑞典 -芬兰
  • sv-SE 瑞典 -瑞典
  • syr Syriac
  • syr-SY Syriac-叙利亚共和国
  • ta 坦米尔
  • ta-IN 坦米尔 -印度
  • tt Tatar
  • tt-RU Tatar-俄国
  • te Telugu
  • te-IN Telugu-印度
  • th 泰国
  • th-TH 泰国 -泰国
  • tr 土耳其语
  • tr-TR 土耳其语 -土耳其
  • uk 乌克兰
  • uk-UA 乌克兰 -乌克兰
  • ur Urdu
  • ur-PK Urdu-巴基斯坦
  • uz Uzbek
  • uz-UZ-Cyrl Uzbek-(西里尔字母的) 乌兹别克斯坦
  • uz-UZ-Latn Uzbek(拉丁文)- 乌兹别克斯坦
  • vi 越南
  • vi-VN 越南 -越南

21.11 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 多语言 知识可查阅 ASP.NET Core - 全局化和本地化 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/logging/index.html b/docs/docs/logging/index.html index cb51b82de6b..fda4aed62ee 100644 --- a/docs/docs/logging/index.html +++ b/docs/docs/logging/index.html @@ -6,20 +6,20 @@ -18. 日志记录 | Furion - - - - - - - - - +18. 日志记录 | Furion + + + + + + + + +
-

18. 日志记录

18.1 关于日志#

通常日志指的是系统日志程序日志

系统日志 是记录系统中硬件、软件和系统问题的信息,同时还可以监视系统中发生的事件。用户可以通过它来检查错误发生的原因,或者寻找受到攻击时攻击者留下的痕迹。系统日志包括系统日志、应用程序日志和安全日志。

程序日志 是程序运行中产生的日志,通常由框架运行时或开发者提供的日志。包括请求日志,异常日志、审计日志、行为日志等。

18.2 日志作用#

在项目开发中,都不可避免的使用到日志。没有日志虽然不会影响项目的正确运行,但是没有日志的项目可以说是不完整的。日志在调试,错误或者异常定位,数据分析中的作用是不言而喻的。

  • 调试

在项目调试时,查看栈信息可以方便地知道当前程序的运行状态,输出的日志便于记录程序在之前的运行结果。

  • 错误定位

不要以为项目能正确跑起来就可以高枕无忧,项目在运行一段时候后,可能由于数据问题,网络问题,内存问题等出现异常。这时日志可以帮助开发或者运维人员快速定位错误位置,提出解决方案。

  • 数据分析

大数据的兴起,使得大量的日志分析成为可能,ELK 也让日志分析门槛降低了很多。日志中蕴含了大量的用户数据,包括点击行为,兴趣偏好等,用户画像对于公司下一步的战略方向有一定指引作用。

18.3 日志级别#

日志级别可以有效的对日志信息进行归类,方便准确的查看特定日志内容。通常日志类别有以下级别:

级别方法描述
Trace0LogTrace包含最详细的消息。 这些消息可能包含敏感的应用数据。 这些消息默认情况下处于禁用状态,并且不应在生产中启用。
调试1LogDebug用于调试和开发。 由于量大,请在生产中小心使用。
信息2LogInformation跟踪应用的常规流。 可能具有长期值。
警告3LogWarning对于异常事件或意外事件。 通常包括不会导致应用失败的错误或情况。
错误4LogError表示无法处理的错误和异常。 这些消息表示当前操作或请求失败,而不是整个应用失败。
严重5LogCritical需要立即关注的失败。 例如数据丢失、磁盘空间不足。
动态-LogDynamic运行时动态日志基本,由 AppSettings:DynamicLogLevel 配置决定

18.4 如何使用#

.NET 5 框架中,微软已经为我们内置了 日志组件,正常情况下,无需我们引用第三方包进行日志记录。.NET 5 框架为我们提供了两种日志对象创建方式。

18.4.1 ILogger<T> 泛型方式#

使用非常简单,可以通过 ILogger<T> 对象进行注入,如:

public class PrivacyModel : PageModel
{
private readonly ILogger<PrivacyModel> _logger;
+

18. 日志记录

18.1 关于日志#

通常日志指的是系统日志程序日志

系统日志 是记录系统中硬件、软件和系统问题的信息,同时还可以监视系统中发生的事件。用户可以通过它来检查错误发生的原因,或者寻找受到攻击时攻击者留下的痕迹。系统日志包括系统日志、应用程序日志和安全日志。

程序日志 是程序运行中产生的日志,通常由框架运行时或开发者提供的日志。包括请求日志,异常日志、审计日志、行为日志等。

18.2 日志作用#

在项目开发中,都不可避免的使用到日志。没有日志虽然不会影响项目的正确运行,但是没有日志的项目可以说是不完整的。日志在调试,错误或者异常定位,数据分析中的作用是不言而喻的。

  • 调试

在项目调试时,查看栈信息可以方便地知道当前程序的运行状态,输出的日志便于记录程序在之前的运行结果。

  • 错误定位

不要以为项目能正确跑起来就可以高枕无忧,项目在运行一段时候后,可能由于数据问题,网络问题,内存问题等出现异常。这时日志可以帮助开发或者运维人员快速定位错误位置,提出解决方案。

  • 数据分析

大数据的兴起,使得大量的日志分析成为可能,ELK 也让日志分析门槛降低了很多。日志中蕴含了大量的用户数据,包括点击行为,兴趣偏好等,用户画像对于公司下一步的战略方向有一定指引作用。

18.3 日志级别#

日志级别可以有效的对日志信息进行归类,方便准确的查看特定日志内容。通常日志类别有以下级别:

级别方法描述
Trace0LogTrace包含最详细的消息。 这些消息可能包含敏感的应用数据。 这些消息默认情况下处于禁用状态,并且不应在生产中启用。
调试1LogDebug用于调试和开发。 由于量大,请在生产中小心使用。
信息2LogInformation跟踪应用的常规流。 可能具有长期值。
警告3LogWarning对于异常事件或意外事件。 通常包括不会导致应用失败的错误或情况。
错误4LogError表示无法处理的错误和异常。 这些消息表示当前操作或请求失败,而不是整个应用失败。
严重5LogCritical需要立即关注的失败。 例如数据丢失、磁盘空间不足。
动态-LogDynamic运行时动态日志基本,由 AppSettings:DynamicLogLevel 配置决定

18.4 如何使用#

.NET 5 框架中,微软已经为我们内置了 日志组件,正常情况下,无需我们引用第三方包进行日志记录。.NET 5 框架为我们提供了两种日志对象创建方式。

18.4.1 ILogger<T> 泛型方式#

使用非常简单,可以通过 ILogger<T> 对象进行注入,如:

public class PrivacyModel : PageModel
{
private readonly ILogger<PrivacyModel> _logger;
public PrivacyModel(ILogger<PrivacyModel> logger)
{
_logger = logger;
}
public void OnGet()
{
_logger.LogInformation("GET Pages.PrivacyModel called.");
}
}
小知识

通过泛型 ILogger<T> 方式写入日志,那么默认将 T 类型完整类型名称作为 日志类别

18.4.2 ILoggerFactory 工厂方式#

使用工厂方式,需手动传入 日志类别,如:

public class ContactModel : PageModel
{
private readonly ILogger _logger;
public ContactModel(ILoggerFactory logger)
{
_logger = logger.CreateLogger("MyCategory");
}
@@ -28,14 +28,14 @@
"这是自定义类别日志".LogInformation("类别");

通过字符串拓展方式可以在任何时候方便记录日志,专门为懒人提供的。

18.5 写入其他介质#

.NET 5 框架中并未提供写入文件、数据库 或其他介质的提供器,默认只提供了 Debug、Console 两种方式。这个时候我们就需要引用第三方日志组件,方便我们写入到多个介质中。

在这里,Furion 官方推荐使用 Serilog 日志组件,为此,Furion 提供了 Furion.Extras.Logging.Serilog 拓展包,方便快速和 Furion 框架结合。

18.5.1 Serilog 拓展包使用#

  • 安装 Furion.Extras.Logging.Serilog 拓展包

Furion.Core 层安装 Furion.Extras.Logging.Serilog 拓展包

  • Program.cs 中调用 UseSerilogDefault()
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Furion.Web.Entry
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.Inject()
.UseStartup<Startup>();
})
.UseSerilogDefault();
}
}
}
特别注意

.UseSerilogDefault() 默认集成了 控制台文件 方式。如需自定义写入,则传入需要写入的介质即可:

.UseSerilogDefault(config =>
{
config.WriteTo.Console(outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {Properties:j}{NewLine}{Exception}")
.WriteTo.File("log.txt", rollingInterval: RollingInterval.Day, rollOnFileSizeLimit: true);
});
  • 替换 appsetting.json 默认日志内容
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.EntityFrameworkCore": "Information"
}
}

替换为:

"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"System": "Warning",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information",
"Microsoft.EntityFrameworkCore": "Information"
}
}
}

18.5.2 记录请求日志#

Serilog 日志组件也提供了非常方便快捷的请求日志中间件,只需要在 Startup.cs 中启用即可。如:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseStaticFiles();
app.UseSerilogRequestLogging(); // 必须在 UseStaticFiles 和 UseRouting 之间
app.UseRouting();
}

18.6 日志示例#

下面便是日志输出日志的模板,支持各种自定义方式

2020-12-21 15:54:43.775 +08:00 [INF] Application started. Press Ctrl+C to shut down.
2020-12-21 15:54:43.897 +08:00 [INF] Hosting environment: Development
2020-12-21 15:54:43.899 +08:00 [INF] Content root path: D:\MONK\Furion\samples\Furion.Web.Entry
2020-12-21 15:55:00.651 +08:00 [WRN] Sensitive data logging is enabled. Log entries and exception messages may include sensitive application data; this mode should only be enabled during development.
2020-12-21 15:55:00.817 +08:00 [INF] Entity Framework Core 5.0.1 initialized 'DefaultDbContext' using provider 'Microsoft.EntityFrameworkCore.Sqlite' with options: SensitiveDataLoggingEnabled DetailedErrorsEnabled MaxPoolSize=100 MigrationsAssembly=Furion.Database.Migrations
2020-12-21 15:55:01.711 +08:00 [WRN] Compiling a query which loads related collections for more than one collection navigation either via 'Include' or through projection but no 'QuerySplittingBehavior' has been configured. By default Entity Framework will use 'QuerySplittingBehavior.SingleQuery' which can potentially result in slow query performance. See https://go.microsoft.com/fwlink/?linkid=2134277 for more information. To identify the query that's triggering this warning call 'ConfigureWarnings(w => w.Throw(RelationalEventId.MultipleCollectionIncludeWarning))'
2020-12-21 15:55:01.919 +08:00 [INF] Executed DbCommand (31ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
SELECT "p"."Id", "p"."Name", "p"."Age", "p"."Address", "p0"."PhoneNumber", "p0"."QQ", "p"."CreatedTime", "p0"."Id", "c"."Id", "c"."Name", "c"."Gender", "t"."Id", "t"."Name", "t"."PersonsId", "t"."PostsId"
FROM "Person" AS "p"
LEFT JOIN "PersonDetail" AS "p0" ON "p"."Id" = "p0"."PersonId"
LEFT JOIN "Children" AS "c" ON "p"."Id" = "c"."PersonId"
LEFT JOIN (
SELECT "p2"."Id", "p2"."Name", "p1"."PersonsId", "p1"."PostsId"
FROM "PersonPost" AS "p1"
INNER JOIN "Post" AS "p2" ON "p1"."PostsId" = "p2"."Id"
) AS "t" ON "p"."Id" = "t"."PersonsId"
ORDER BY "p"."Id", "p0"."Id", "c"."Id", "t"."PersonsId", "t"."PostsId", "t"."Id"
2020-12-21 15:55:25.354 +08:00 [INF] Executed DbCommand (3ms) [Parameters=[], CommandType='"Text"', CommandTimeout='30']
SELECT "p"."Id", "p"."Name", "p"."Age", "p"."Address", "p0"."PhoneNumber", "p0"."QQ", "p"."CreatedTime", "p0"."Id", "c"."Id", "c"."Name", "c"."Gender", "t"."Id", "t"."Name", "t"."PersonsId", "t"."PostsId"
FROM "Person" AS "p"
LEFT JOIN "PersonDetail" AS "p0" ON "p"."Id" = "p0"."PersonId"
LEFT JOIN "Children" AS "c" ON "p"."Id" = "c"."PersonId"
LEFT JOIN (
SELECT "p2"."Id", "p2"."Name", "p1"."PersonsId", "p1"."PostsId"
FROM "PersonPost" AS "p1"
INNER JOIN "Post" AS "p2" ON "p1"."PostsId" = "p2"."Id"
) AS "t" ON "p"."Id" = "t"."PersonsId"
ORDER BY "p"."Id", "p0"."Id", "c"."Id", "t"."PersonsId", "t"."PostsId", "t"."Id"
2020-12-21 15:58:27.328 +08:00 [INF] Application started. Press Ctrl+C to shut down.
2020-12-21 15:58:27.442 +08:00 [INF] Hosting environment: Development
2020-12-21 15:58:27.444 +08:00 [INF] Content root path: D:\MONK\Furion\samples\Furion.Web.Entry
2020-12-21 15:58:27.909 +08:00 [INF] HTTP GET / responded 200 in 457.0657 ms
2020-12-21 15:58:33.336 +08:00 [INF] HTTP GET /api/index.html responded 200 in 95.9277 ms
2020-12-21 15:58:34.187 +08:00 [INF] HTTP GET /swagger/Default/swagger.json responded 200 in 674.9800 ms

18.7 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 日志 知识可查阅 ASP.NET Core - 日志 章节 和 Serilog 文档。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/object-mapper/index.html b/docs/docs/object-mapper/index.html index e645e217982..c42de1131f2 100644 --- a/docs/docs/object-mapper/index.html +++ b/docs/docs/object-mapper/index.html @@ -6,30 +6,30 @@ -13. 对象数据映射 | Furion - - - - - - - - - +13. 对象数据映射 | Furion + + + + + + + + +
-

13. 对象数据映射

13.1 对象映射#

简单来说,就是将一个对象的数据根据特定规则批量映射到另一个对象中,减少手工操作和降低人为出错率。如将 DTO 对象映射到 Entity 实体中,反之亦然。

13.2 先看例子#

在过去,我们需要将一个对象的值转换到另一个对象中,我们需要这样做,如:

var entity = repository.Find(1);
+

13. 对象数据映射

13.1 对象映射#

简单来说,就是将一个对象的数据根据特定规则批量映射到另一个对象中,减少手工操作和降低人为出错率。如将 DTO 对象映射到 Entity 实体中,反之亦然。

13.2 先看例子#

在过去,我们需要将一个对象的值转换到另一个对象中,我们需要这样做,如:

var entity = repository.Find(1);
var dto = new Dto();
dto.Id = entity.Id;
dto.Name = entity.Name;
dto.Age = entity.Age;
dto.Address = entity.Address;
dto.FullName = entity.FirstName + entity.LastName;
dto.IdCard = entity.IdCard.Replace("1234", "****");

上面的例子似乎没有任何问题,但是如果很多地方需要这样的赋值操作、或者相同的赋值操作在多个地方使用,又或者一个类中含有非常多的属性或自定义赋值操作。那么这样的操作效率极低,容易出错,且代码非常臃肿和冗余。

所以,实现自动映射赋值和支持特殊配置的需求就有了。目前 C# 平台有两个优秀的对象映射工具:MapsterAutoMapperFurion 框架中,默认集成的是 MapsterMapster 是一款极易使用且超高性能的对象映射框架。

13.3 Mapster 使用#

现在,我们可以通过 Mapster 提供的对象映射方法:Adapt 方法改造上面的例子:

安装拓展包

Furion.Core 层(推荐)安装 Furion.Extras.ObjectMapper.Mapster 拓展包,无需手动调用,Furion 会自动加载并调用。

13.3.1 极易入门#

var entity = repository.Find(1);
var dto = entity.Adapt<Dto>();

仅仅一行代码就可以实现 entity -> dto 的转换,如果涉及到赋值的复制操作,如 dto.FullNamedto.IdCard,我们只需要自定义映射规则类即可。

13.3.2 自定义映射规则#

using Mapster;
using System;
namespace Furion.Application
{
public class Mapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
config.ForType<Entity, Dto>()
.Map(dest => dest.FullName, src => src.FirstName + src.LastName)
.Map(dest => dest.IdCard, src => src.IdCard.Replace("1234", "****"));
}
}
}
小知识

该映射文件 Mapper.cs 可以放在任何项目或文件夹中,Furion 会在程序启动的时候自动扫描并注入配置。

13.3.3 依赖注入方式#

Mapster 除了提供 Adapt 拓展方法以外,同时还提供依赖注入的方式。

public Person(IMapper mapper)
{
var dto = _mapper.Map<Dto>(entity);
}

13.3.4 和 EFCore 配合#

Mapster 还提供了 ProjectToType Linq 拓展方法减少我们手动 Select 操作,如:

正常的操作:

var destinations = context.Sources
.Select(c => new Destination {
Id = p.Id,
Name = p.Name,
Surname = p.Surname,
....
})
.ToList();

使用 Mapster 之后:

var destinations = context.Sources.ProjectToType<Destination>().ToList();

13.5 全局默认配置#

Furion 提供全局默认映射配置选项 TypeAdapterConfig.GlobalSettings.Default,可在 Startup 中配置即可,如:

TypeAdapterConfig.GlobalSettings.Default
.PreserveReference(true);

13.6 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 Mapster 知识可查阅 Mapster - Wiki 文档。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/options/index.html b/docs/docs/options/index.html index 91f089a6aaf..562f2322510 100644 --- a/docs/docs/options/index.html +++ b/docs/docs/options/index.html @@ -6,20 +6,20 @@ -4.2 选项 | Furion - - - - - - - - - +4.2 选项 | Furion + + + + + + + + +
-

4.2 选项

4.2.1 什么是选项#

选项是 ASP.NET Core 推荐的动态读取配置的方式,这种方式将配置文件数据用一个强类型来托管,能够实现配置验证、默认值配置、实时读取等功能。

4.2.2 与配置的区别#

选项实际上也是配置,但在后者的基础上添加了配置验证、默认值/后期配置设定及提供了多种接口读取配置信息,同时还支持供配置更改通知等强大灵活功能。

所以,除了一次性读取使用的配置以外,都应该选用 选项 替换 配置

知识导航

有关配置说明可查看《4.1 配置》 章节。

4.2.3 选项的使用#

假设我们需要在系统运行时获取系统名称、版本号及版权信息,这些信息可能随时变化而且需要在多个地方使用。这时就需要将这些信息配置起来。具体步骤如下:

4.2.3.1 配置 appsettings.json 信息#

{
"AppInfo": {
"Name": "Furion",
"Version": "1.0.0",
"Company": "Baiqian"
}
}

4.2.3.2 创建 AppInfoOptions 强类型类#

using Furion.ConfigurableOptions;
+

4.2 选项

4.2.1 什么是选项#

选项是 ASP.NET Core 推荐的动态读取配置的方式,这种方式将配置文件数据用一个强类型来托管,能够实现配置验证、默认值配置、实时读取等功能。

4.2.2 与配置的区别#

选项实际上也是配置,但在后者的基础上添加了配置验证、默认值/后期配置设定及提供了多种接口读取配置信息,同时还支持供配置更改通知等强大灵活功能。

所以,除了一次性读取使用的配置以外,都应该选用 选项 替换 配置

知识导航

有关配置说明可查看《4.1 配置》 章节。

4.2.3 选项的使用#

假设我们需要在系统运行时获取系统名称、版本号及版权信息,这些信息可能随时变化而且需要在多个地方使用。这时就需要将这些信息配置起来。具体步骤如下:

4.2.3.1 配置 appsettings.json 信息#

{
"AppInfo": {
"Name": "Furion",
"Version": "1.0.0",
"Company": "Baiqian"
}
}

4.2.3.2 创建 AppInfoOptions 强类型类#

using Furion.ConfigurableOptions;
namespace Furion.Application
{
public class AppInfoOptions : IConfigurableOptions
{
public string Name { get; set; }
public string Version { get; set; }
public string Company { get; set; }
}
}
温馨提示

建议所有选项类都应该以 Options 命名结尾。

另外,Furion 框架提供了非常灵活的注册选项服务的方法,只需要继承 IConfigurableOptions 接口即可,该接口位于 Furion.ConfigurableOptions 命名空间下。

4.2.3.3 注册 AppInfoOptions 服务#

选项不同于配置,需在应用启动时注册

Furion.Web.Core\FurWebCoreStartup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
namespace Furion.Web.Core
{
[AppStartup(800)]
public sealed class FurWebCoreStartup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddConfigurableOptions<AppInfoOptions>();
}
}
}

4.2.3.4 读取 AppInfoOptions 信息#

Furion 框架中,提供了多种读取方式:

  • 通过 App.GetOptions<TOptions>(jsonKey) 读取(不推荐
  • 通过依赖注入以下实例读取:
    • IOptions<TOptions>
    • IOptionsSnapshot<TOptions>
    • IOptionsMonitor<TOptions>
  • 通过 App 静态类提供的静态方法获取:
    • App.GetOptions<TOptions>()
    • App.GetOptionsMonitor<TOptions>()
    • App.GetOptionsSnapshot<TOptions>()
using Furion.Application;
using Microsoft.AspNetCore.Mvc;
namespace Furion.Web.Entry.Controllers
{
[Route("api/[controller]")]
public class DefaultController : ControllerBase
{
[HttpGet]
public string Get()
{
// 不推荐采用此方式读取
var appInfo = App.GetOptions<AppInfoOptions>("AppInfo");
return $@"名称:{appInfo.Name},
版本:{appInfo.Version},
公司:{appInfo.Company}";
}
}
}
Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/performance/index.html b/docs/docs/performance/index.html index 142fea79356..ffdb5898aa5 100644 --- a/docs/docs/performance/index.html +++ b/docs/docs/performance/index.html @@ -6,28 +6,28 @@ -29.2 性能测试 | Furion - - - - - - - - - +29.2 性能测试 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/process-service/index.html b/docs/docs/process-service/index.html index 69aa54261e8..a101fdf11e2 100644 --- a/docs/docs/process-service/index.html +++ b/docs/docs/process-service/index.html @@ -6,28 +6,28 @@ -23. 辅助角色服务 | Furion - - - - - - - - - +23. 辅助角色服务 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/reference/index.html b/docs/docs/reference/index.html index aeeda2db3c5..53baee2e02e 100644 --- a/docs/docs/reference/index.html +++ b/docs/docs/reference/index.html @@ -6,30 +6,30 @@ -2.3 框架项目引用 | Furion - - - - - - - - - +2.3 框架项目引用 | Furion + + + + + + + + +
-

2.3 框架项目引用

2.3.1 关于项目引用#

Furion 框架默认采用多层项目设计架构,每一个项目层的依赖分别是:

  • Furion:核心层,无项目依赖
  • Furion.Application:添加 Furion.Core 引用
  • Furion.Core:添加 Furion 引用
  • Furion.Database.Migrations:添加 Furion.EntityFramework.Core 引用
  • Furion.EntityFramework.Core:添加 Furion.Core 引用
  • Furion.Web.Core:添加 Furion.ApplicationFurion.Database.Migrations 引用
  • Furion.Web.Entry:添加 Furion.Web.Core 引用 和 Microsoft.EntityFrameworkCore.Tools

如果开发者搭建自己的项目,则只需要在 Furion.Core 层引用 Nuget 中最新的 Furion 包即可。

2.3.2 集成 Furion 功能#

项目搭建好之后,集成 Furion 框架只需要在 Program.cs 中 添加 Inject() 方法即可:

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
+

2.3 框架项目引用

2.3.1 关于项目引用#

Furion 框架默认采用多层项目设计架构,每一个项目层的依赖分别是:

  • Furion:核心层,无项目依赖
  • Furion.Application:添加 Furion.Core 引用
  • Furion.Core:添加 Furion 引用
  • Furion.Database.Migrations:添加 Furion.EntityFramework.Core 引用
  • Furion.EntityFramework.Core:添加 Furion.Core 引用
  • Furion.Web.Core:添加 Furion.ApplicationFurion.Database.Migrations 引用
  • Furion.Web.Entry:添加 Furion.Web.Core 引用 和 Microsoft.EntityFrameworkCore.Tools

如果开发者搭建自己的项目,则只需要在 Furion.Core 层引用 Nuget 中最新的 Furion 包即可。

2.3.2 集成 Furion 功能#

项目搭建好之后,集成 Furion 框架只需要在 Program.cs 中 添加 Inject() 方法即可:

using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Hosting;
namespace Furion.Web.Entry
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}
public static IHostBuilder CreateHostBuilder(string[] args)
{
return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.Inject()
.UseStartup<Startup>();
});
}
}
}

2.3.3 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/saas/index.html b/docs/docs/saas/index.html index 3624623ba3a..0700d7a4de4 100644 --- a/docs/docs/saas/index.html +++ b/docs/docs/saas/index.html @@ -6,20 +6,20 @@ -11. SaaS 多租户 | Furion - - - - - - - - - +11. SaaS 多租户 | Furion + + + + + + + + +
-

11. SaaS 多租户

11.1 什么是 SaaS#

SaaS 是 Software-as-a-Service(软件即服务)的简称,随着互联网技术的发展和应用软件的成熟, 在 21 世纪开始兴起的一种完全创新的软件应用模式。它与“on-demand software”,the application service provider(ASP,应用服务提供商),hosted software(托管软件)所具有相似的含义。

它是一种通过 Internet 提供软件的模式,厂商将应用软件统一部署在自己的服务器上,客户可以根据自己实际需求,通过互联网向厂商定购所需的应用软件服务,按定购的服务多少和时间长短向厂商支付费用,并通过互联网获得厂商提供的服务。用户不用再购买软件,而改用向提供商租用基于 Web 的软件,来管理企业经营活动,且无需对软件进行维护,服务提供商会全权管理和维护软件,软件厂商在向客户提供互联网应用的同时,也提供软件的离线操作和本地数据存储,让用户随时随地都可以使用其定购的软件和服务。

对于许多小型企业来说,SaaS 是采用先进技术的最好途径,它消除了企业购买、构建和维护基础设施和应用程序的需要。

11.2 什么是多租户#

多租户技术或称多重租赁技术,简称 SaaS,是一种软件架构技术,是实现如何在多用户环境下(此处的多用户一般是面向企业用户)共用相同的系统或程序组件,并且可确保各用户间数据的隔离性。

简单讲:在一台服务器上运行单个应用实例,它为多个租户(客户)提供服务。从定义中我们可以理解:多租户是一种架构,目的是为了让多用户环境下使用同一套程序,且保证用户间数据隔离。那么重点就很浅显易懂了,多租户的重点就是同一套程序下实现多用户数据的隔离。

11.3 实现多租户方案#

11.3.1 独立数据库(基于 Database 的方式)#

这是第一种方案,即一个租户一个数据库,这种方案的用户数据隔离级别最高,安全性最好,但成本较高。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/appsettings/index.html b/docs/docs/settings/appsettings/index.html index 6615adc9942..449df1c69c3 100644 --- a/docs/docs/settings/appsettings/index.html +++ b/docs/docs/settings/appsettings/index.html @@ -6,28 +6,28 @@ -1. 应用配置 | Furion - - - - - - - - - +1. 应用配置 | Furion + + + + + + + + +
-

1. 应用配置

1.1 关于配置#

应用配置指的是 Furion 框架全局配置选项。

1.2 配置信息#

  • AppSettings:配置根节点
    • InjectMiniProfiler:是否注入 MiniProfilerbool 类型,默认 true
    • InjectSpecificationDocument:是否启用 Swagger 文档,bool 类型,默认 true
    • EnabledReferenceAssemblyScan:是否启用通过 dll 方式添加的引用程序集扫描,bool 类型,默认 false
    • ExternalAssemblies:配置外部程序集完整路径,支持动态加载,string[] 类型,默认 []
    • DynamicLogLevel:配置动态日志级别,LogLevel 枚举类型,默认 LogLevel.Information

1.3 配置示例#

{
"AppSettings": {
"InjectMiniProfiler": false
}
}

1.4 特别注意#

默认情况下,Furion 框架会自动扫描 *.json*.config.xml 文件载入配置中,如需忽略个别文件,需在 appsettings.json 配置文件根节点下配置 IgnoreConfigurationFiles 节点即可,string[] 类型,如:

{
"IgnoreConfigurationFiles": ["runtime.json"]
}

必须在 appsettings.json 文件中配置才有效

Last updated on by 百小僧
- - - - - - - - - +

1. 应用配置

1.1 关于配置#

应用配置指的是 Furion 框架全局配置选项。

1.2 配置信息#

  • AppSettings:配置根节点
    • InjectMiniProfiler:是否注入 MiniProfilerbool 类型,默认 true
    • InjectSpecificationDocument:是否启用 Swagger 文档,bool 类型,默认 true
    • EnabledReferenceAssemblyScan:是否启用通过 dll 方式添加的引用程序集扫描,bool 类型,默认 false
    • ExternalAssemblies:配置外部程序集完整路径,支持动态加载,string[] 类型,默认 []
    • DynamicLogLevel:配置动态日志级别,LogLevel 枚举类型,默认 LogLevel.Information

1.3 配置示例#

{
"AppSettings": {
"InjectMiniProfiler": false
}
}

1.4 特别注意#

默认情况下,Furion 框架会自动扫描 *.json*.config.xml 文件载入配置中,如需忽略个别文件,需在 appsettings.json 配置文件根节点下配置 IgnoreConfigurationFiles 节点即可,string[] 类型,如:

{
"IgnoreConfigurationFiles": ["runtime.json"]
}

必须在 appsettings.json 文件中配置才有效

Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/corsaccessorsettings/index.html b/docs/docs/settings/corsaccessorsettings/index.html index 7cbd75ee393..b76bfd1a7f7 100644 --- a/docs/docs/settings/corsaccessorsettings/index.html +++ b/docs/docs/settings/corsaccessorsettings/index.html @@ -6,28 +6,28 @@ -2. 跨域配置 | Furion - - - - - - - - - +2. 跨域配置 | Furion + + + + + + + + +
-

2. 跨域配置

2.1 关于配置#

跨域配置指的是 Furion 框架客户端跨域配置选项。

2.2 配置信息#

  • CorsAccessorSettings:配置根节点
    • PolicyName:跨域策略名,sting 类型,必填,默认 FurCorsAccessor
    • WithOrigins:允许跨域的域名列表,string[] 类型,默认 [ "http://localhost:4200" ]
    • WithHeaders:请求表头,没有配置则允许所有表头,string[] 类型
    • WithExposedHeaders:响应标头,string[] 类型
    • WithMethods:设置跨域允许请求谓词,没有配置则允许所有,string[] 类型
    • AllowCredentials:跨域请求中的凭据,bool 类型
    • SetPreflightMaxAge:设置预检过期时间,int 类型

2.3 配置示例#

{
"CorsAccessorSettings": {
"PolicyName": "MyPolicy",
"WithOrigins": ["http://localhost:4200", "https://furion.pro"]
}
}
Last updated on by 百小僧
- - - - - - - - - +

2. 跨域配置

2.1 关于配置#

跨域配置指的是 Furion 框架客户端跨域配置选项。

2.2 配置信息#

  • CorsAccessorSettings:配置根节点
    • PolicyName:跨域策略名,sting 类型,必填,默认 FurCorsAccessor
    • WithOrigins:允许跨域的域名列表,string[] 类型,默认 [ "http://localhost:4200" ]
    • WithHeaders:请求表头,没有配置则允许所有表头,string[] 类型
    • WithExposedHeaders:响应标头,string[] 类型
    • WithMethods:设置跨域允许请求谓词,没有配置则允许所有,string[] 类型
    • AllowCredentials:跨域请求中的凭据,bool 类型
    • SetPreflightMaxAge:设置预检过期时间,int 类型

2.3 配置示例#

{
"CorsAccessorSettings": {
"PolicyName": "MyPolicy",
"WithOrigins": ["http://localhost:4200", "https://furion.pro"]
}
}
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/dependencyinjectionsettings/index.html b/docs/docs/settings/dependencyinjectionsettings/index.html index 0ed560a2613..37f7e55741a 100644 --- a/docs/docs/settings/dependencyinjectionsettings/index.html +++ b/docs/docs/settings/dependencyinjectionsettings/index.html @@ -6,28 +6,28 @@ -4. 依赖注入配置 | Furion - - - - - - - - - +4. 依赖注入配置 | Furion + + + + + + + + +
-

4. 依赖注入配置

4.1 关于配置#

依赖注入配置指的是 Furion 框架依赖注入配置选项。

4.2 配置信息#

  • DependencyInjectionSettings:依赖注入配置根节点
    • Definitions:动态依赖注入配置节点,ExternalService 数组类型
      • ExternalService:配置单个依赖注入信息
        • Interface:配置依赖接口信息,格式:程序集名称;接口完整名称,如:Furion.Application;Furion.Application.ITestService
        • Service:配置接口实现信息,格式同上
        • RegisterType:配置依赖注入的对象生存期,取值:TransientScopedSingleton
        • Action:注册行为,可选值:AddTryAdd,参见 依赖注入-特性配置
        • Pattern:注册选项,参见 依赖注入-特性配置置
        • Named:注册别名,参见 依赖注入-特性配置
        • Order:注册排序,参见 依赖注入-特性配置
        • Proxy:配置代理拦截,,格式:程序集名称;代理类完整名称,参见 依赖注入-特性配置

4.3 配置示例#

{
"DependencyInjectionSettings": {
"Definitions": [
{
"Interface": "Furion.Application;Furion.Application.ITestService",
"Service": "Furion.Application;Furion.Application.TestService",
"RegisterType": "Transient",
"Action": "Add",
"Pattern": "SelfWithFirstInterface",
"Named": "TestService",
"Order": 1,
"Proxy": "Furion.Application;Furion.Application.LogDispathProxy"
}
]
}
}
Last updated on by 百小僧
- - - - - - - - - +

4. 依赖注入配置

4.1 关于配置#

依赖注入配置指的是 Furion 框架依赖注入配置选项。

4.2 配置信息#

  • DependencyInjectionSettings:依赖注入配置根节点
    • Definitions:动态依赖注入配置节点,ExternalService 数组类型
      • ExternalService:配置单个依赖注入信息
        • Interface:配置依赖接口信息,格式:程序集名称;接口完整名称,如:Furion.Application;Furion.Application.ITestService
        • Service:配置接口实现信息,格式同上
        • RegisterType:配置依赖注入的对象生存期,取值:TransientScopedSingleton
        • Action:注册行为,可选值:AddTryAdd,参见 依赖注入-特性配置
        • Pattern:注册选项,参见 依赖注入-特性配置置
        • Named:注册别名,参见 依赖注入-特性配置
        • Order:注册排序,参见 依赖注入-特性配置
        • Proxy:配置代理拦截,,格式:程序集名称;代理类完整名称,参见 依赖注入-特性配置

4.3 配置示例#

{
"DependencyInjectionSettings": {
"Definitions": [
{
"Interface": "Furion.Application;Furion.Application.ITestService",
"Service": "Furion.Application;Furion.Application.TestService",
"RegisterType": "Transient",
"Action": "Add",
"Pattern": "SelfWithFirstInterface",
"Named": "TestService",
"Order": 1,
"Proxy": "Furion.Application;Furion.Application.LogDispathProxy"
}
]
}
}
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/dynamicapicontrollersettings/index.html b/docs/docs/settings/dynamicapicontrollersettings/index.html index 052a4c97e7b..bb46a1d7e1d 100644 --- a/docs/docs/settings/dynamicapicontrollersettings/index.html +++ b/docs/docs/settings/dynamicapicontrollersettings/index.html @@ -6,28 +6,28 @@ -5. 动态API配置 | Furion - - - - - - - - - +5. 动态API配置 | Furion + + + + + + + + +
-

5. 动态API配置

5.1 关于配置#

动态 API 配置指的是 Furion 框架动态 API 配置选项。

5.2 配置信息#

  • DynamicApiControllerSettings:配置根节点

    • DefaultRoutePrefix:默认路由前缀,string,默认 api
    • DefaultHttpMethod:默认请求谓词,string,默认:POST
    • DefaultModule:默认模块名称(区域),可用作接口版本,string,默认:v1
    • LowercaseRoute:小写路由格式,bool,默认:true
    • KeepVerb:是否保留动作谓词,bool,默认:false
    • KeepName:是否保留默认名称,bool,默认:fasle
    • CamelCaseSeparator:骆驼命名分隔符,string,默认:-
    • VersionSeparator:版本分隔符,string,默认:@
    • ModelToQueryGET/HEAD 请求将 类类型参数转查询参数bool,默认 false
    • SupportedMvcController:是否支持 Mvc Controller 动态配置,bool,默认 false
    • AbandonControllerAffixes:默认去除控制器名称前后缀列表名,string[],默认:
      • AppServices
      • AppService
      • ApiController
      • Controller
      • Services
      • Service
    • AbandonActionAffixes:默认去除动作方法名称前后缀列表名,string[],默认:
      • Async
    • VerbToHttpMethods:复写默认方法名转 [HttpMethod] 规则,string[][] 二维数组类型,内置匹配规则为:
      ["post"] = "POST",
      ["add"] = "POST",
      ["create"] = "POST",
      ["insert"] = "POST",
      ["submit"] = "POST",
      ["get"] = "GET",
      ["find"] = "GET",
      ["fetch"] = "GET",
      ["query"] = "GET",
      ["getlist"] = "GET",
      ["getall"] = "GET",
      ["put"] = "PUT",
      ["update"] = "PUT",
      ["delete"] = "DELETE",
      ["remove"] = "DELETE",
      ["clear"] = "DELETE",
      ["patch"] = "PATCH"
      • 复写示例
      "DynamicApiControllerSettings": {
      "VerbToHttpMethods": [
      [ "getall", "HEAD" ], // => getall 会被复写为 `[HttpHead]`
      [ "other", "PUT" ] // => 新增一条新规则,比如,一 `[other]` 开头会转换为 `[HttpPut]` 请求
      ]
      }

5.3 配置示例#

{
"DynamicApiControllerSettings": {
"SupportedMvcController": true
}
}
Last updated on by 百小僧
- - - - - - - - - +

5. 动态API配置

5.1 关于配置#

动态 API 配置指的是 Furion 框架动态 API 配置选项。

5.2 配置信息#

  • DynamicApiControllerSettings:配置根节点

    • DefaultRoutePrefix:默认路由前缀,string,默认 api
    • DefaultHttpMethod:默认请求谓词,string,默认:POST
    • DefaultModule:默认模块名称(区域),可用作接口版本,string,默认:v1
    • LowercaseRoute:小写路由格式,bool,默认:true
    • KeepVerb:是否保留动作谓词,bool,默认:false
    • KeepName:是否保留默认名称,bool,默认:fasle
    • CamelCaseSeparator:骆驼命名分隔符,string,默认:-
    • VersionSeparator:版本分隔符,string,默认:@
    • ModelToQueryGET/HEAD 请求将 类类型参数转查询参数bool,默认 false
    • SupportedMvcController:是否支持 Mvc Controller 动态配置,bool,默认 false
    • AbandonControllerAffixes:默认去除控制器名称前后缀列表名,string[],默认:
      • AppServices
      • AppService
      • ApiController
      • Controller
      • Services
      • Service
    • AbandonActionAffixes:默认去除动作方法名称前后缀列表名,string[],默认:
      • Async
    • VerbToHttpMethods:复写默认方法名转 [HttpMethod] 规则,string[][] 二维数组类型,内置匹配规则为:
      ["post"] = "POST",
      ["add"] = "POST",
      ["create"] = "POST",
      ["insert"] = "POST",
      ["submit"] = "POST",
      ["get"] = "GET",
      ["find"] = "GET",
      ["fetch"] = "GET",
      ["query"] = "GET",
      ["getlist"] = "GET",
      ["getall"] = "GET",
      ["put"] = "PUT",
      ["update"] = "PUT",
      ["delete"] = "DELETE",
      ["remove"] = "DELETE",
      ["clear"] = "DELETE",
      ["patch"] = "PATCH"
      • 复写示例
      "DynamicApiControllerSettings": {
      "VerbToHttpMethods": [
      [ "getall", "HEAD" ], // => getall 会被复写为 `[HttpHead]`
      [ "other", "PUT" ] // => 新增一条新规则,比如,一 `[other]` 开头会转换为 `[HttpPut]` 请求
      ]
      }

5.3 配置示例#

{
"DynamicApiControllerSettings": {
"SupportedMvcController": true
}
}
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/friendlyexceptionsettings/index.html b/docs/docs/settings/friendlyexceptionsettings/index.html index cb3c34af38d..bc38ba5824c 100644 --- a/docs/docs/settings/friendlyexceptionsettings/index.html +++ b/docs/docs/settings/friendlyexceptionsettings/index.html @@ -6,28 +6,28 @@ -6. 友好异常配置 | Furion - - - - - - - - - +6. 友好异常配置 | Furion + + + + + + + + +
-

6. 友好异常配置

6.1 关于配置#

友好异常配置指的是 Furion 框架友好异常配置选项。

6.2 配置信息#

  • FriendlyExceptionSettings:配置根节点
    • HideErrorCode:隐藏错误码,bool 类型,默认 false
    • DefaultErrorCode:默认错误码,string 类型
    • DefaultErrorMessage:默认错误消息,string 类型

6.3 配置示例#

{
"FriendlyExceptionSettings": {
"DefaultErrorMessage": "系统异常,请联系管理员"
}
}

6.4 异常消息配置#

Furion 框架还为友好异常消息提供外部配置

6.4.1 配置信息#

  • ErrorCodeMessageSettings:配置根节点
    • Definitions:配置异常错误码消息类型,[错误状态码,错误消息][] 类型,如:[5000, "{0} 不能小于 {1}"]

6.4.2 配置示例#

{
"ErrorCodeMessageSettings": {
"Definitions": [
[5000, "{0} 不能小于 {1}"],
[5001, "我叫 {0} 名字", "百小僧"],
[5002, "Oops! 出错了"]
]
}
}
Last updated on by 百小僧
- - - - - - - - - +

6. 友好异常配置

6.1 关于配置#

友好异常配置指的是 Furion 框架友好异常配置选项。

6.2 配置信息#

  • FriendlyExceptionSettings:配置根节点
    • HideErrorCode:隐藏错误码,bool 类型,默认 false
    • DefaultErrorCode:默认错误码,string 类型
    • DefaultErrorMessage:默认错误消息,string 类型

6.3 配置示例#

{
"FriendlyExceptionSettings": {
"DefaultErrorMessage": "系统异常,请联系管理员"
}
}

6.4 异常消息配置#

Furion 框架还为友好异常消息提供外部配置

6.4.1 配置信息#

  • ErrorCodeMessageSettings:配置根节点
    • Definitions:配置异常错误码消息类型,[错误状态码,错误消息][] 类型,如:[5000, "{0} 不能小于 {1}"]

6.4.2 配置示例#

{
"ErrorCodeMessageSettings": {
"Definitions": [
[5000, "{0} 不能小于 {1}"],
[5001, "我叫 {0} 名字", "百小僧"],
[5002, "Oops! 出错了"]
]
}
}
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/localizationsettings/index.html b/docs/docs/settings/localizationsettings/index.html index 0919ade14ab..87a8b42d26c 100644 --- a/docs/docs/settings/localizationsettings/index.html +++ b/docs/docs/settings/localizationsettings/index.html @@ -6,28 +6,28 @@ -8. 多语言配置 | Furion - - - - - - - - - +8. 多语言配置 | Furion + + + + + + + + +
-

8. 多语言配置

8.1 关于配置#

多语言配置指的是 Furion 框架全球化和本地化选项。

8.2 配置信息#

  • LocalizationSettings 多语言配置根节点
    • ResourcesPath:资源目录,string 类型,默认 Resources
    • SupportedCultures:支持的语言区域码类别,string[] 类型
    • DefaultCulture:默认语言区域码,如果为空,则取 SupportedCultures 第一项

8.3 配置示例#

{
"LocalizationSettings": {
"SupportedCultures": ["zh-CN", "en-US"], // 配置支持的语言列表
"DefaultCulture": "zh-CN" // 配置默认语言,如果不配置,取 SupportedCultures 的第一项
}
}
Last updated on by 百小僧
- - - - - - - - - +

8. 多语言配置

8.1 关于配置#

多语言配置指的是 Furion 框架全球化和本地化选项。

8.2 配置信息#

  • LocalizationSettings 多语言配置根节点
    • ResourcesPath:资源目录,string 类型,默认 Resources
    • SupportedCultures:支持的语言区域码类别,string[] 类型
    • DefaultCulture:默认语言区域码,如果为空,则取 SupportedCultures 第一项

8.3 配置示例#

{
"LocalizationSettings": {
"SupportedCultures": ["zh-CN", "en-US"], // 配置支持的语言列表
"DefaultCulture": "zh-CN" // 配置默认语言,如果不配置,取 SupportedCultures 的第一项
}
}
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/specificationdocumentsettings/index.html b/docs/docs/settings/specificationdocumentsettings/index.html index bc0ffc04760..6248c0a91f0 100644 --- a/docs/docs/settings/specificationdocumentsettings/index.html +++ b/docs/docs/settings/specificationdocumentsettings/index.html @@ -6,28 +6,28 @@ -7. 规范化文档配置 | Furion - - - - - - - - - +7. 规范化文档配置 | Furion + + + + + + + + +
-

7. 规范化文档配置

7.1 关于配置#

规范化文档配置指的是 Furion 框架Swagger文档配置选项。

7.2 配置信息#

  • SpecificationDocumentSettings:配置根节点
    • DocumentTitle:文档标题,string,默认 Specification Api Document
    • DefaultGroupName:默认分组名,string,默认 Default
    • EnableAuthorized:是否启用权限控制,bool,默认 true
    • FormatAsV2:采用 Swagger 2.0 版本,bool,默认 false
    • RoutePrefix:规范化文档地址,string,默认 api如果希望在首页,改为空字符串即可
    • DocExpansionState:文档显示方式,DocExpansion,默认 List,取值:
      • List:列表式(展开子类),默认值
      • Full:完全展开
      • None:列表式(不展开子类)
    • XmlComments:程序集注释描述文件名(可带 .xmlstring,默认 Furion.Application, Furion.Web.Entry, Furion.Web.Core
    • GroupOpenApiInfos:分组信息配置,SpecificationOpenApiInfo[],默认 { 'Group': 'Default'}
    • SecurityDefinitions:安全策略定义配置,SpecificationOpenApiSecurityScheme[],默认 []
    • Servers:配置 Server 下拉列表,OpenApiServer[] 类型,默认 [],如:{Servers:[ { Url:"地址", Description:"描述"} ]}
    • HideServers:是否隐藏 Server 下拉列表,bool 类型,默认 false

7.3 配置示例#

{
"SpecificationDocumentSettings": {
"GroupOpenApiInfos": [
{
"Group": "Group1",
"Title": "分组标题",
"Description": "这里是分组描述",
"Version": "版本号",
"TermsOfService": "https://furion.pro",
"Contact": {
"Name": "百小僧",
"Url": "https://gitee.com/monksoul",
"Email": "monksoul@outlook.com"
},
"License": {
"Name": "Apache-2.0",
"Url": "https://gitee.com/monksoul/Furion/blob/alpha/LICENSE"
}
}
]
}
}
Last updated on by 百小僧
- - - - - - - - - +

7. 规范化文档配置

7.1 关于配置#

规范化文档配置指的是 Furion 框架Swagger文档配置选项。

7.2 配置信息#

  • SpecificationDocumentSettings:配置根节点
    • DocumentTitle:文档标题,string,默认 Specification Api Document
    • DefaultGroupName:默认分组名,string,默认 Default
    • EnableAuthorized:是否启用权限控制,bool,默认 true
    • FormatAsV2:采用 Swagger 2.0 版本,bool,默认 false
    • RoutePrefix:规范化文档地址,string,默认 api如果希望在首页,改为空字符串即可
    • DocExpansionState:文档显示方式,DocExpansion,默认 List,取值:
      • List:列表式(展开子类),默认值
      • Full:完全展开
      • None:列表式(不展开子类)
    • XmlComments:程序集注释描述文件名(可带 .xmlstring,默认 Furion.Application, Furion.Web.Entry, Furion.Web.Core
    • GroupOpenApiInfos:分组信息配置,SpecificationOpenApiInfo[],默认 { 'Group': 'Default'}
    • SecurityDefinitions:安全策略定义配置,SpecificationOpenApiSecurityScheme[],默认 []
    • Servers:配置 Server 下拉列表,OpenApiServer[] 类型,默认 [],如:{Servers:[ { Url:"地址", Description:"描述"} ]}
    • HideServers:是否隐藏 Server 下拉列表,bool 类型,默认 false

7.3 配置示例#

{
"SpecificationDocumentSettings": {
"GroupOpenApiInfos": [
{
"Group": "Group1",
"Title": "分组标题",
"Description": "这里是分组描述",
"Version": "版本号",
"TermsOfService": "https://furion.pro",
"Contact": {
"Name": "百小僧",
"Url": "https://gitee.com/monksoul",
"Email": "monksoul@outlook.com"
},
"License": {
"Name": "Apache-2.0",
"Url": "https://gitee.com/monksoul/Furion/blob/alpha/LICENSE"
}
}
]
}
}
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/settings/validationTypemessagesettings/index.html b/docs/docs/settings/validationTypemessagesettings/index.html index 1cd1921f381..064dd670172 100644 --- a/docs/docs/settings/validationTypemessagesettings/index.html +++ b/docs/docs/settings/validationTypemessagesettings/index.html @@ -6,28 +6,28 @@ -3. 验证消息配置 | Furion - - - - - - - - - +3. 验证消息配置 | Furion + + + + + + + + +
-

3. 验证消息配置

3.1 关于配置#

验证消息配置指的是 Furion 框架数据校验中验证类型默认消息配置选项。

3.2 配置信息#

  • ValidationTypeMessageSettings:配置根节点
    • Definitions:配置验证类型对应的消息类型,[类型名称,类型消息][] 类型,如:["Required", "值不能为空或Null"]

3.3 配置示例#

{
"ValidationTypeMessageSettings": {
"Definitions": [
["Required", "值不能为空或Null"],
["Numeric", "必须是数值类型"],
["StrongPassword", "密码太简单了!!!"]
]
}
}
Last updated on by 百小僧
- - - - - - - - - +

3. 验证消息配置

3.1 关于配置#

验证消息配置指的是 Furion 框架数据校验中验证类型默认消息配置选项。

3.2 配置信息#

  • ValidationTypeMessageSettings:配置根节点
    • Definitions:配置验证类型对应的消息类型,[类型名称,类型消息][] 类型,如:["Required", "值不能为空或Null"]

3.3 配置示例#

{
"ValidationTypeMessageSettings": {
"Definitions": [
["Required", "值不能为空或Null"],
["Numeric", "必须是数值类型"],
["StrongPassword", "密码太简单了!!!"]
]
}
}
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/signalr/index.html b/docs/docs/signalr/index.html index a4f11396dc0..afd0c7fdefd 100644 --- a/docs/docs/signalr/index.html +++ b/docs/docs/signalr/index.html @@ -6,28 +6,28 @@ -25. 即时通讯 | Furion - - - - - - - - - +25. 即时通讯 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/source/index.html b/docs/docs/source/index.html index 2518716a5a7..802b19a7767 100644 --- a/docs/docs/source/index.html +++ b/docs/docs/source/index.html @@ -6,20 +6,20 @@ -1.3 源码结构 | Furion - - - - - - - - - +1.3 源码结构 | Furion + + + + + + + + +
-

1.3 源码结构

1.3.1 源码架构#

Furion 创建采用多层分层设计,主要设计是 自动抽象工厂DDD 领域驱动设计 相结合。

Furion 框架项目结构如下:

  • Furion.Tests:测试层
  • Solution Items:解决方案配置层
  • Furion:框架核心层
  • Furion.Application:业务应用层
  • Furion.Core:核心层(实体,层次,其他核心代码)
  • Furion.Database.Migrations:架构维护层
  • Furion.EntityFramework.Core:EF Core 配置层
  • Furion.Web.Core:Web 核心层
  • Furion.Web.Entry:Web 入口层/启动层

1.3.2 Furion.Tests 测试层#

Furion.Tests 是项目的测试层,目前还未整理完成。

1.3.3 Solution Items 解决方案配置层#

源码结构:

Solution Items
└.editorconfig

Solution Items 是用来配置解决方案中一些全局配置的,如每个文件的顶部版权信息,如:

// -----------------------------------------------------------------------------
// 让 .NET 开发更简单,更通用,更流行。
// Copyright © 2020 Furion, Baiqian Co.,Ltd.
//
// 框架名称:Furion
// 框架作者:百小僧
// 框架版本:1.0.0
// 源码地址:Gitee:https://gitee.com/monksoul/Furion
// Github:https://github.com/monksoul/Furion
// 开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)
// -----------------------------------------------------------------------------

相关配置在 .editorconfig 最后面一行,如:

# Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\MONK\Furion\framework codebase based on best match to current usage at 2020/9/2
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs]
+

1.3 源码结构

1.3.1 源码架构#

Furion 创建采用多层分层设计,主要设计是 自动抽象工厂DDD 领域驱动设计 相结合。

Furion 框架项目结构如下:

  • Furion.Tests:测试层
  • Solution Items:解决方案配置层
  • Furion:框架核心层
  • Furion.Application:业务应用层
  • Furion.Core:核心层(实体,层次,其他核心代码)
  • Furion.Database.Migrations:架构维护层
  • Furion.EntityFramework.Core:EF Core 配置层
  • Furion.Web.Core:Web 核心层
  • Furion.Web.Entry:Web 入口层/启动层

1.3.2 Furion.Tests 测试层#

Furion.Tests 是项目的测试层,目前还未整理完成。

1.3.3 Solution Items 解决方案配置层#

源码结构:

Solution Items
└.editorconfig

Solution Items 是用来配置解决方案中一些全局配置的,如每个文件的顶部版权信息,如:

// -----------------------------------------------------------------------------
// 让 .NET 开发更简单,更通用,更流行。
// Copyright © 2020 Furion, Baiqian Co.,Ltd.
//
// 框架名称:Furion
// 框架作者:百小僧
// 框架版本:1.0.0
// 源码地址:Gitee:https://gitee.com/monksoul/Furion
// Github:https://github.com/monksoul/Furion
// 开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)
// -----------------------------------------------------------------------------

相关配置在 .editorconfig 最后面一行,如:

# Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\MONK\Furion\framework codebase based on best match to current usage at 2020/9/2
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs]
#Core editorconfig formatting - indentation
#use soft tabs (spaces) for indentation
indent_style = space
@@ -52,14 +52,14 @@
#Style - qualification options
#prefer fields not to be prefaced with this. or Me. in Visual Basic
dotnet_style_qualification_for_field = false:suggestion
#prefer methods not to be prefaced with this. or Me. in Visual Basic
dotnet_style_qualification_for_method = false:suggestion
#prefer properties not to be prefaced with this. or Me. in Visual Basic
dotnet_style_qualification_for_property = false:suggestion
# Add file header
file_header_template = -----------------------------------------------------------------------------\nFur 是 .NET 5 平台下企业应用开发最佳实践框架。\nCopyright © 2020 Furion, Baiqian Co.,Ltd.\n\n框架名称:Furion\n框架作者:百小僧\n框架版本:1.0.0\n源码地址:Gitee:https://gitee.com/monksoul/Furion \n Github:https://github.com/monksoul/Furion \n开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)\n-----------------------------------------------------------------------------

1.3.4 Furion 核心层#

Furion 核心层是 Furion 框架的中心,也是 Furion 能够支撑起来的必备层。

源码结构:

Furion
├─Furion.csproj
├─Furion.csproj.user
├─FurStartup.cs
├─ViewEngine
| ├─IViewEngine.cs
| ├─ViewEngine.cs
| ├─Templates
| | ├─IViewEngineCompiledTemplate.cs
| | ├─IViewEngineTemplate.cs
| | ├─ViewEngineCompiledTemplate.cs
| | └ViewEngineTemplate.cs
| ├─Options
| | └ViewEngineCompilationOptions.cs
| ├─Models
| | └AnonymousTypeWrapper.cs
| ├─Exceptions
| | ├─ViewEngineCompilationException.cs
| | └ViewEngineException.cs
| ├─Compilations
| | ├─IViewEngineCompilationOptionsBuilder.cs
| | └ViewEngineCompilationOptionsBuilder.cs
├─UnifyResult
| ├─Providers
| | ├─IUnifyResultProvider.cs
| | └RESTfulResultProvider.cs
| ├─Models
| | └RESTfulResult.cs
| ├─Filters
| | └SuccessUnifyResultFilter.cs
| ├─Extensions
| | └UnifyResultServiceCollectionExtensions.cs
├─SpecificationDocument
| ├─Options
| | └SpecificationDocumentSettingsOptions.cs
| ├─Models
| | ├─GroupOrder.cs
| | ├─SpecificationOpenApiInfo.cs
| | ├─SpecificationOpenApiSecurityRequirementItem.cs
| | └SpecificationOpenApiSecurityScheme.cs
| ├─Extensions
| | ├─SpecificationDocumentApplicationBuilderExtensions.cs
| | └SpecificationDocumentServiceCollectionExtensions.cs
| ├─Builders
| | └SpecificationDocumentBuilder.cs
| ├─Assets
| | └index-mini-profiler.html
├─ObjectMapper
| ├─Extensions
| | └ObjectMapperServiceCollectionExtensions.cs
| ├─Dependencies
| | └IObjectMapper.cs
├─LinqBuilder
| ├─Visitors
| | └ParameterReplaceExpressionVisitor.cs
| ├─Extensions
| | └LinqExtensions.cs
| ├─Builders
| | └LinqExpression.cs
├─FriendlyException
| ├─Oops.cs
| ├─Providers
| | └IErrorCodeTypeProvider.cs
| ├─Options
| | └ErrorCodeMessageSettingsOptions.cs
| ├─Models
| | └MethodIfException.cs
| ├─Filters
| | └FriendlyExceptionFilter.cs
| ├─Extensions
| | └FriendlyExceptionServiceCollectionExtensions.cs
| ├─Attributes
| | ├─ErrorCodeItemMetadataAttribute.cs
| | ├─ErrorCodeTypeAttribute.cs
| | └IfExceptionAttribute.cs
├─DynamicApiController
| ├─Penetrates.cs
| ├─Providers
| | └DynamicApiControllerFeatureProvider.cs
| ├─Options
| | └DynamicApiControllerSettingsOptions.cs
| ├─Models
| | └ParameterRouteTemplate.cs
| ├─Extensions
| | └DynamicApiControllerServiceCollectionExtensions.cs
| ├─Enums
| | └ApiSeats.cs
| ├─Dependencies
| | └IDynamicApiController.cs
| ├─Conventions
| | └DynamicApiControllerApplicationModelConvention.cs
| ├─Attributes
| | ├─ApiDescriptionSettingsAttribute.cs
| | ├─ApiSeatAttribute.cs
| | └DynamicApiControllerAttribute.cs
├─DependencyInjection
| ├─Options
| | └DependencyInjectionSettingsOptions.cs
| ├─Models
| | └ExternalService.cs
| ├─Extensions
| | └DependencyInjectionServiceCollectionExtensions.cs
| ├─Enums
| | ├─InjectionActions.cs
| | ├─InjectionPatterns.cs
| | └RegisterType.cs
| ├─Dependencies
| | ├─IPrivateDependency.cs
| | ├─IScoped.cs
| | ├─ISingleton.cs
| | ├─ITransient.cs
| | ├─Proxies
| | | └IDispatchProxy.cs
| ├─Attributes
| | ├─InjectionAttribute.cs
| | └SkipScanAttribute.cs
├─DataValidation
| ├─Validators
| | └DataValidator.cs
| ├─Providers
| | └IValidationMessageTypeProvider.cs
| ├─Options
| | └ValidationTypeMessageSettingsOptions.cs
| ├─Models
| | └DataValidationResult.cs
| ├─Filters
| | └DataValidationFilter.cs
| ├─Extensions
| | ├─DataValidationExtensions.cs
| | └DataValidationServiceCollectionExtensions.cs
| ├─Enums
| | ├─ValidationPattern.cs
| | └ValidationTypes.cs
| ├─Attributes
| | ├─DataValidationAttribute.cs
| | ├─NonValidationAttribute.cs
| | ├─ValidationItemMetadataAttribute.cs
| | ├─ValidationMessageAttribute.cs
| | ├─ValidationMessageTypeAttribute.cs
| | └ValidationTypeAttribute.cs
├─DataEncryption
| ├─AESEncryption.cs
| ├─DESCEncryption.cs
| └MD5Encryption.cs
├─DatabaseAccessor
| ├─UnitOfWork
| | ├─Filters
| | | └UnitOfWorkFilter.cs
| | ├─Attributes
| | | ├─NonTransactAttribute.cs
| | | └UnitOfWorkAttribute.cs
| ├─Repositories
| | ├─EFCoreRepository.cs
| | ├─IMSRepository.cs
| | ├─IRepository.cs
| | ├─ISqlRepository.cs
| | ├─MSRepository.cs
| | ├─SqlRepository.cs
| | ├─Implantations
| | | ├─DeletableRepository.cs
| | | ├─InsertableRepository.cs
| | | ├─OperableRepository.cs
| | | ├─ReadableRepository.cs
| | | ├─SqlExecutableRepository.cs
| | | ├─SqlReaderRepository.cs
| | | ├─UpdateableRepository.cs
| | | └WritableRepository.cs
| | ├─Dependencies
| | | ├─IDeletableRepository.cs
| | | ├─IInsertableRepository.cs
| | | ├─IOperableRepository.cs
| | | ├─IReadableRepository.cs
| | | ├─IRepositoryDependency.cs
| | | ├─ISqlExecutableRepository.cs
| | | ├─ISqlReaderRepository.cs
| | | ├─IUpdateableRepository.cs
| | | └IWritableRepository.cs
| ├─Pools
| | ├─DbContextPool.cs
| | └IDbContextPool.cs
| ├─MultiTenants
| | ├─Locators
| | | └MultiTenantDbContextLocator.cs
| | ├─Enums
| | | └MultiTenantOptions.cs
| | ├─Entities
| | | └Tenant.cs
| | ├─Dependencies
| | | ├─IMultiTenantOnDatabase.cs
| | | ├─IMultiTenantOnSchema.cs
| | | ├─IMultiTenantOnTable.cs
| | | └IPrivateMultiTenant.cs
| ├─Models
| | ├─DbProvider.cs
| | ├─PagedList.cs
| | ├─ProcedureOutputResult.cs
| | ├─ProcedureOutputValue.cs
| | ├─SqlTemplate.cs
| | └SqlTemplateParameter.cs
| ├─Locators
| | ├─IDbContextLocator.cs
| | └MasterDbContextLocator.cs
| ├─Interceptors
| | ├─DbContextSaveChangesInterceptor.cs
| | ├─SqlCommandProfilerInterceptor.cs
| | └SqlConnectionProfilerInterceptor.cs
| ├─Helpers
| | └DbHelpers.cs
| ├─Extensions
| | ├─DatabaseAccessorServiceCollectionExtensions.cs
| | ├─PagedQueryableExtensions.cs
| | ├─Repositories
| | | ├─IEntityExtensions.cs
| | | ├─IEntityWithDbContextLocatorExtensions.cs
| | | └SqlExtensions.cs
| | ├─DatabaseProvider
| | | ├─DatabaseProviderServiceCollectionExtensions.cs
| | | └Penetrates.cs
| | ├─DatabaseFacade
| | | ├─DbDataConvertExtensions.cs
| | | ├─DbObjectExtensions.cs
| | | └SqlAdoNetExtensions.cs
| ├─Enums
| | ├─DbFunctionType.cs
| | ├─EFCoreErrorCodes.cs
| | └ManualOptions.cs
| ├─Entities
| | ├─Dependencies
| | | ├─Entity.cs
| | | ├─EntityBase.cs
| | | ├─EntityNotKey.cs
| | | ├─IEntity.cs
| | | └IEntityNotKey.cs
| | ├─Configures
| | | ├─IEntitySeedData.cs
| | | ├─IEntityTypeBuilder.cs
| | | ├─IModelBuilderFilter.cs
| | | └IPrivateModelBuilder.cs
| | ├─Attributes
| | | ├─FakeDeleteAttribute.cs
| | | ├─NonAutomaticAttribute.cs
| | | └QueryableFunctionAttribute.cs
| ├─DynamicModels
| | ├─DynamicModelCacheKeyFactory.cs
| | └IEntityMutableTable.cs
| ├─Contexts
| | ├─AppDbContext.cs
| | ├─Builders
| | | ├─AppDbContextBuilder.cs
| | | ├─Models
| | | | └DbContextCorrelationType.cs
| | ├─Attributes
| | | └AppDbContextAttribute.cs
| ├─Attributes
| | └DbParameterAttribute.cs
| ├─Advances
| | ├─Proxies
| | | └SqlDispatchProxy.cs
| | ├─Models
| | | └SqlProxyMethod.cs
| | ├─Dependencies
| | | └ISqlDispatchProxy.cs
| | ├─Attributes
| | | ├─SqlExecuteAttribute.cs
| | | ├─SqlFunctionAttribute.cs
| | | ├─SqlProcedureAttribute.cs
| | | ├─Basics
| | | | ├─SqlObjectProxyAttribute.cs
| | | | ├─SqlProxyAttribute.cs
| | | | └SqlSentenceProxyAttribute.cs
├─CorsAccessor
| ├─Options
| | └CorsAccessorSettingsOptions.cs
| ├─Extensions
| | ├─CorsAccessorApplicationBuilderExtensions.cs
| | └CorsAccessorServiceCollectionExtensions.cs
├─ConfigurableOptions
| ├─Options
| | └IConfigurableOptions.cs
| ├─Extensions
| | └ConfigurableOptionsServiceCollectionExtensions.cs
| ├─Attributes
| | └OptionsSettingsAttribute.cs
├─Authorization
| ├─Penetrates.cs
| ├─Requirements
| | └AuthorizePolicyRequirement.cs
| ├─Providers
| | └AuthorizePolicyProvider.cs
| ├─Options
| | └JWTSettingsOptions.cs
| ├─Handlers
| | └AuthorizePolicyHandler.cs
| ├─Extensions
| | └PolicyAuthorizationServiceCollectionExtensions.cs
| ├─Attributes
| | └AuthorizePolicyAttribute.cs
├─App
| ├─App.cs
| ├─Startups
| | ├─AppStartup.cs
| | └HostingStartup.cs
| ├─Options
| | └AppSettingsOptions.cs
| ├─Filters
| | └StartupFilter.cs
| ├─Extensions
| | ├─AppApplicationBuilderExtensions.cs
| | ├─AppServiceCollectionExtensions.cs
| | ├─WebHostBuilderExtensions.cs
| | ├─Types
| | | └ObjectExtensions.cs
| ├─Attributes
| | └AppStartupAttribute.cs

1.3.5 Furion.Application 业务应用层#

Furion.Application 业务应用层是最常用的层,几乎所有的业务代码都在这个层中编写。

源码结构:

Furion.Application
├─Furion.Application.Core.csproj
├─Furion.Application.Core.xml
└FurApplicationStartup.cs

1.3.6 Furion.Core 仓储实体层#

Furion.Core 主要是存储自定义仓储和定义实体的层。

源码结构:

Furion.Core
├─Furion.Core.csproj
└FurCoreStartup.cs

1.3.7 Furion.Database.Migrations 数据库架构维护层#

Furion.Database.Migrations 主要是用来存放 Database FirstCode First 生成的维护文件。

源码结构:

Furion.Database.Migrations
└Furion.Database.Migrations.csproj

1.3.8 Furion.EntityFramework.Core 数据库上下文配置层#

Furion.EntityFramework.Core 主要是用来配置数据库上下文和其他数据库相关配置信息的。

源码结构:

Furion.EntityFramework.Core
└Furion.EntityFramework.Core.csproj

1.3.9 Furion.Web.Core 应用核心层#

Furion.Web.Core 主要是用来配置 Web 入口一些代码,如 FilterMiddlewares 等。

源码结构:

Furion.Web.Core
├─Furion.Web.Core.xml
└FurWebCoreStartup.cs

1.3.10 Furion.Web.Entry 应用入口层#

Furion.Web.Entry 是我们的应用层,也就是我们的 Web 项目层,发布层。

源码结构:

Furion.Web.Entry
├─appsettings.Development.json
├─appsettings.json
├─Furion.Web.Entry.csproj
├─Furion.Web.Entry.csproj.user
├─Furion.Web.Entry.xml
├─Program.cs
├─Startup.cs
├─wwwroot
| └README.md
├─Properties
| └launchSettings.json
├─Controllers
Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/specification-document/index.html b/docs/docs/specification-document/index.html index 30a918e5055..5b72bb7006d 100644 --- a/docs/docs/specification-document/index.html +++ b/docs/docs/specification-document/index.html @@ -6,20 +6,20 @@ -6. 规范化接口文档 | Furion - - - - - - - - - +6. 规范化接口文档 | Furion + + + + + + + + +
-

6. 规范化接口文档

6.1 什么是接口文档#

在现在移动为王、多端互辅、前端百花齐放的开放时代,不再是一人包揽式开发,大家各司其职,后端工程师负责接口开发,前端负责接口联调,也就是互联网现在流行的前后端分离架构。

所以就需要由前后端工程师共同定义接口,编写接口文档,之后大家按照这个接口文档进行开发、维护及开放给第三方。

6.2 为什么要写接口文档#

  • 能够让前端开发与后台开发人员更好的配合,提高工作效率
  • 项目迭代或者项目人员更迭时,方便后期人员查看和维护
  • 方便测试人员进行接口测试

6.3 为什么需要规范化文档#

由于每个公司后端人员技术参差不齐,技术文档能力也不例外,导致接口定义及文档五花八门,不同项目或不同公司对接极其困难,而且体验糟糕。所以,无规矩不成方圆,为了开发人员间更好的配合,迫切需要整理出一套规范。

通常接口规范分为六个部分:

6.3.1 协议规范#

为了确保不同系统/模块间的数据交互,需要事先约定好通讯协议,如:TCP、HTTP、HTTPS 协议。为了确保数据交互安全,建议使用 HTTPS 协议

6.3.2 接口路径规范#

作为接口路径,为了方便清晰的区分来自不同的系统,可以采用不同系统/模块名作为接口路径前缀,如:支付模块:/pay/xxx,订单模块:/order/xxx

6.3.3 版本控制规范#

为了便于后期接口的升级和维护,建议在接口路径中加入版本号,便于管理,实现接口多版本的可维护性。如:接口路径中添加类似"v1"、"v2"等版本号

6.3.4 接口命名规范#

和 C# 命名规范一样,好的、统一的接口命名规范,不仅可以增强其可读性,而且还会减少很多不必要的口头/书面上的解释。,可使用"驼峰命名法"按照实现接口的业务类型、业务场景等命名,有必要时可采取多级目录命名,但目录不宜过长,两级目录较为适宜

  • 常见命名方式:
    • 接口名称动词前/后缀化: 接口名称以接口数据操作的动词为前/后缀,常见动词有:Add、Delete、Update、Query、Get、Send、Save、Detail、List等,如:新建用户 AddUser、查询订单详情 QueryOrderDetail
    • 接口名称动词 + 请求方式:接口路径中包含具体接口名称的名词,接口数据操作动作以 HTTP 请求方式来区分。常用的 HTTP 请求方式有:
      • GET:从服务器取出资源(一项或多项)
      • POST:在服务器新建一个资源
      • PUT:在服务器更新资源(客户端提供改变后的完整资源)
      • PATCH:在服务器更新资源(客户端提供改变的属性)
      • DELETE:从服务器删除资源

6.3.5 请求参数规范#

  • 请求方式:按照 GET、POST、PUT 等含义定义,避免出现不一致现象,对人造成误解、歧义
    • 请求头:请求头根据项目需求添加配置参数。如:请求数据格式,accept=application/json 等。如有需要,请求头可根据项目需求要求传入用户 token、唯一验签码等加密数据
    • 请求参数/请求体: 请求参数字段,尽可能与数据库表字段、对象属性名等保持一致,因为保持一致是最省事,最舒服的一件事

6.3.6 返回数据规范#

统一规范返回数据的格式,对己对彼都有好处,此处以 json 格式为例。返回数据应包含:返回状态码、返回状态信息、具体数据返回数据中的状态码、状态信息,常指具体的业务状态,不建议和 HTTP 状态码混在一起。HTTP 状态,是用来体现 HTTP 链路状态情况,如:404-Not Found。HTTP 状态码和 json 结果中的状态码,并存尚可,用于体现不同维度的状态。

6.4 什么是 Swagger#

相信无论是前端还是后端开发,都或多或少地被接口文档折磨过。前端经常抱怨后端给的接口文档与实际情况不一致。后端又觉得编写及维护接口文档会耗费不少精力,经常来不及更新。

其实无论是前端调用后端,还是后端调用后端,都期望有一个好的接口文档。但是这个接口文档对于程序员来说,就跟注释一样,经常会抱怨别人写的代码没有写注释,然而自己写起代码起来,最讨厌的,也是写注释。所以仅仅只通过强制来规范大家是不够的,随着时间推移,版本迭代,接口文档往往很容易就跟不上代码了。

发现了痛点就要去找解决方案。解决方案用的人多了,就成了标准的规范,这就是 Swagger 的由来

通过这套规范,你只需要按照它的规范去定义接口及接口相关的信息。再通过 Swagger 衍生出来的一系列项目和工具,就可以做到生成各种格式的接口文档,生成多种语言的客户端和服务端的代码,以及在线接口调试页面等等。

这样,如果按照新的开发模式,在开发新版本或者迭代版本的时候,只需要更新 Swagger 描述文件,就可以自动生成接口文档和客户端服务端代码,做到调用端代码、服务端代码以及接口文档的一致性。

所以,Swagger 是一个规范和完整的框架,用于生成、描述、调用和可视化RESTful 风格的 Web 服务。

总体目标是使客户端和文件系统作为服务器以同样的速度来更新。文件的方法、参数和模型紧密集成到服务器端的代码,允许 API 来始终保持同步。Swagger 让部署管理和使用功能强大的 API 从未如此简单。

6.5 Swagger 使用#

Furion 框架提供了非常方便且灵活的 Swagger 配置,无需增加额外学习成本。

6.5.1 注册服务#

备注

.AddSpecificationDocuments() 默认已经继承在 AddInject() 中了,无需再次注册。

另外 .UseInject() 也已经包含了 .UseSpecificationDocuments() 注册,无需再次注册。

Furion.Web.Core\FurWebCoreStartup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
+

6. 规范化接口文档

6.1 什么是接口文档#

在现在移动为王、多端互辅、前端百花齐放的开放时代,不再是一人包揽式开发,大家各司其职,后端工程师负责接口开发,前端负责接口联调,也就是互联网现在流行的前后端分离架构。

所以就需要由前后端工程师共同定义接口,编写接口文档,之后大家按照这个接口文档进行开发、维护及开放给第三方。

6.2 为什么要写接口文档#

  • 能够让前端开发与后台开发人员更好的配合,提高工作效率
  • 项目迭代或者项目人员更迭时,方便后期人员查看和维护
  • 方便测试人员进行接口测试

6.3 为什么需要规范化文档#

由于每个公司后端人员技术参差不齐,技术文档能力也不例外,导致接口定义及文档五花八门,不同项目或不同公司对接极其困难,而且体验糟糕。所以,无规矩不成方圆,为了开发人员间更好的配合,迫切需要整理出一套规范。

通常接口规范分为六个部分:

6.3.1 协议规范#

为了确保不同系统/模块间的数据交互,需要事先约定好通讯协议,如:TCP、HTTP、HTTPS 协议。为了确保数据交互安全,建议使用 HTTPS 协议

6.3.2 接口路径规范#

作为接口路径,为了方便清晰的区分来自不同的系统,可以采用不同系统/模块名作为接口路径前缀,如:支付模块:/pay/xxx,订单模块:/order/xxx

6.3.3 版本控制规范#

为了便于后期接口的升级和维护,建议在接口路径中加入版本号,便于管理,实现接口多版本的可维护性。如:接口路径中添加类似"v1"、"v2"等版本号

6.3.4 接口命名规范#

和 C# 命名规范一样,好的、统一的接口命名规范,不仅可以增强其可读性,而且还会减少很多不必要的口头/书面上的解释。,可使用"驼峰命名法"按照实现接口的业务类型、业务场景等命名,有必要时可采取多级目录命名,但目录不宜过长,两级目录较为适宜

  • 常见命名方式:
    • 接口名称动词前/后缀化: 接口名称以接口数据操作的动词为前/后缀,常见动词有:Add、Delete、Update、Query、Get、Send、Save、Detail、List等,如:新建用户 AddUser、查询订单详情 QueryOrderDetail
    • 接口名称动词 + 请求方式:接口路径中包含具体接口名称的名词,接口数据操作动作以 HTTP 请求方式来区分。常用的 HTTP 请求方式有:
      • GET:从服务器取出资源(一项或多项)
      • POST:在服务器新建一个资源
      • PUT:在服务器更新资源(客户端提供改变后的完整资源)
      • PATCH:在服务器更新资源(客户端提供改变的属性)
      • DELETE:从服务器删除资源

6.3.5 请求参数规范#

  • 请求方式:按照 GET、POST、PUT 等含义定义,避免出现不一致现象,对人造成误解、歧义
    • 请求头:请求头根据项目需求添加配置参数。如:请求数据格式,accept=application/json 等。如有需要,请求头可根据项目需求要求传入用户 token、唯一验签码等加密数据
    • 请求参数/请求体: 请求参数字段,尽可能与数据库表字段、对象属性名等保持一致,因为保持一致是最省事,最舒服的一件事

6.3.6 返回数据规范#

统一规范返回数据的格式,对己对彼都有好处,此处以 json 格式为例。返回数据应包含:返回状态码、返回状态信息、具体数据返回数据中的状态码、状态信息,常指具体的业务状态,不建议和 HTTP 状态码混在一起。HTTP 状态,是用来体现 HTTP 链路状态情况,如:404-Not Found。HTTP 状态码和 json 结果中的状态码,并存尚可,用于体现不同维度的状态。

6.4 什么是 Swagger#

相信无论是前端还是后端开发,都或多或少地被接口文档折磨过。前端经常抱怨后端给的接口文档与实际情况不一致。后端又觉得编写及维护接口文档会耗费不少精力,经常来不及更新。

其实无论是前端调用后端,还是后端调用后端,都期望有一个好的接口文档。但是这个接口文档对于程序员来说,就跟注释一样,经常会抱怨别人写的代码没有写注释,然而自己写起代码起来,最讨厌的,也是写注释。所以仅仅只通过强制来规范大家是不够的,随着时间推移,版本迭代,接口文档往往很容易就跟不上代码了。

发现了痛点就要去找解决方案。解决方案用的人多了,就成了标准的规范,这就是 Swagger 的由来

通过这套规范,你只需要按照它的规范去定义接口及接口相关的信息。再通过 Swagger 衍生出来的一系列项目和工具,就可以做到生成各种格式的接口文档,生成多种语言的客户端和服务端的代码,以及在线接口调试页面等等。

这样,如果按照新的开发模式,在开发新版本或者迭代版本的时候,只需要更新 Swagger 描述文件,就可以自动生成接口文档和客户端服务端代码,做到调用端代码、服务端代码以及接口文档的一致性。

所以,Swagger 是一个规范和完整的框架,用于生成、描述、调用和可视化RESTful 风格的 Web 服务。

总体目标是使客户端和文件系统作为服务器以同样的速度来更新。文件的方法、参数和模型紧密集成到服务器端的代码,允许 API 来始终保持同步。Swagger 让部署管理和使用功能强大的 API 从未如此简单。

6.5 Swagger 使用#

Furion 框架提供了非常方便且灵活的 Swagger 配置,无需增加额外学习成本。

6.5.1 注册服务#

备注

.AddSpecificationDocuments() 默认已经继承在 AddInject() 中了,无需再次注册。

另外 .UseInject() 也已经包含了 .UseSpecificationDocuments() 注册,无需再次注册。

Furion.Web.Core\FurWebCoreStartup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace Furion.Web.Core
{
[AppStartup(800)]
public sealed class FurWebCoreStartup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddSpecificationDocuments();
services.AddControllers();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
// Other Codes
app.UseSpecificationDocuments();
@@ -54,14 +54,14 @@
/// <summary>
/// 验证失败返回值
/// </summary>
/// <param name="context"></param>
/// <param name="modelStates"></param>
/// <param name="validationResults"></param>
/// <param name="validateFailedMessage"></param>
/// <returns></returns>
public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, Dictionary<string, IEnumerable<string>> validationResults, string validateFailedMessage)
{
return new JsonResult(new RESTfulResult<object>
{
StatusCode = StatusCodes.Status400BadRequest,
Succeeded = false,
Data = null,
Errors = validationResults,
Extras = UnifyContext.Take(),
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
});
}
/// <summary>
/// 处理输出状态码
/// </summary>
/// <param name="context"></param>
/// <param name="statusCode"></param>
/// <returns></returns>
public async Task OnResponseStatusCodes(HttpContext context, int statusCode)
{
switch (statusCode)
{
// 处理 401 状态码
case StatusCodes.Status401Unauthorized:
await context.Response.WriteAsJsonAsync(new RESTfulResult<object>
{
StatusCode = StatusCodes.Status401Unauthorized,
Succeeded = false,
Data = null,
Errors = "401 Unauthorized",
Extras = UnifyContext.Take(),
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
}, JsonSerializerUtility.GetDefaultJsonSerializerOptions());
break;
// 处理 403 状态码
case StatusCodes.Status403Forbidden:
await context.Response.WriteAsJsonAsync(new RESTfulResult<object>
{
StatusCode = StatusCodes.Status403Forbidden,
Succeeded = false,
Data = null,
Errors = "403 Forbidden",
Extras = UnifyContext.Take(),
Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
}, JsonSerializerUtility.GetDefaultJsonSerializerOptions());
break;
default:
break;
}
}
}
}

之后在 Startup.cs 中注册即可:

services.AddControllers()
.AddInjectWithUnifyResult<RESTfulResultProvider>();
特别注意

默认情况下,规范化结果不会对 401403 状态码进行规范化处理,如需启动该状态码处理,只需在 Startup.cs 中的 Configure 中启用接口:

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
// 添加规范化结果状态码,需要在这里注册
app.UseUnifyResultStatusCodes();
// 其他注册...
}

6.7.1 排除规范化处理#

有些时候,我们某些接口不需要进行规范化处理,这时,我们只需要帖 [NonUnify] 特性即可。

6.7.2 规范化结果添加额外数据#

默认的规范化结果中包含 extras 属性,可以配置额外数据返回到客户端:

UnifyContext.Fill(new { Message = "操作成功" });

6.8 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/split-db/index.html b/docs/docs/split-db/index.html index 0a896dade11..31a8e57842d 100644 --- a/docs/docs/split-db/index.html +++ b/docs/docs/split-db/index.html @@ -6,31 +6,31 @@ -9.28 分表分库 | Furion - - - - - - - - - +9.28 分表分库 | Furion + + + + + + + + +
-

9.28 分表分库

特此声明

本章 9.28.29.28.5 小节挪用博主:雨点的名字分库分表 - 理论 博客内容。特此声明。

9.28.1 应用场景#

数据库中的数据量不一定是可控的,在未进行分库分表的情况下,随着时间和业务的发展,库中的表会越来越多,表中的数据量也会越来越大,相应地,数据操作增删改查的开销也会越来越大。

另外,由于无法进行分布式式部署,而一台服务器的资源(CPU、磁盘、内存、IO 等)是有限的,最终数据库所能承载的数据量、数据处理能力都将遭遇瓶颈。

这个时候就需要对数据库或数据表进行拆分。

数据切分可以分为:垂直切分水平切分

9.28.2 垂直切分#

垂直切分又可以分为: 垂直分库和垂直分表。

9.28.2.1 垂直分库#

根据业务耦合性,将关联度低的不同表存储在不同的数据库。做法与大系统拆分为多个小系统类似,按业务分类进行独立划分。与"微服务治理"的做法相似,每个微服务使用单独的一个数据库。

说明

一开始我们是单体服务,所以只有一个数据库,所有的表都在这个库里。

后来因为业务需求,单体服务变成微服务治理。所以将之前的一个商品库,拆分成多个数据库。每个微服务对于一个数据库。

9.28.2.2 垂直分表#

把一个表的多个字段分别拆成多个表,一般按字段的冷热拆分,热字段一个表,冷字段一个表。从而提升了数据库性能。

说明

一开始商品表中包含商品的所有字段,但是我们发现:

1.商品详情和商品属性字段较长。2.商品列表的时候我们是不需要显示商品详情和商品属性信息,只有在点进商品商品的时候才会展示商品详情信息。

所以可以考虑把商品详情和商品属性单独切分一张表,提高查询效率。

9.28.2.3 优缺点#

  • 优点

    • 解决业务系统层面的耦合,业务清晰
    • 与微服务的治理类似,也能对不同业务的数据进行分级管理、维护、监控、扩展等
    • 高并发场景下,垂直切分一定程度的提升 IO、数据库连接数、单机硬件资源的瓶颈
  • 缺点

    • 分库后无法 Join,只能通过接口聚合方式解决,提升了开发的复杂度
    • 分库后分布式事务处理复杂
    • 依然存在单表数据量过大的问题(需要水平切分)

9.28.3 水平切分#

当一个应用难以再细粒度的垂直切分或切分后数据量行数巨大,存在单库读写、存储性能瓶颈,这时候就需要进行水平切分了。

水平切分也可以分为:水平分库和水平分表。

9.28.3.1 水平分库#

上面虽然已经把商品库分成 3 个库,但是随着业务的增加一个订单库也出现 QPS 过高,数据库响应速度来不及,一般 mysql 单机也就 1000 左右的 QPS,如果超过 1000 就要考虑分库。

9.28.3.2 水平分表#

一般我们一张表的数据不要超过 1 千万,如果表数据超过 1 千万,并且还在不断增加数据,那就可以考虑分表。

9.28.3.3 优缺点#

  • 优点

    • 不存在单库数据量过大、高并发的性能瓶颈,提升系统稳定性和负载能力
    • 应用端改造较小,不需要拆分业务模块
  • 缺点

    • 跨分片的事务一致性难以保证
    • 跨库的 Join 关联查询性能较差
    • 数据多次扩展难度和维护量极大

9.28.4 数据分片规则#

我们考虑去水平切分表,将一张表水平切分成多张表,这就涉及到数据分片的规则,比较常见的有:Hash 取模分表、数值 Range 分表、一致性 Hash 算法分表。

9.28.4.1 Hash 取模分表#

一般采用 Hash 取模的切分方式,例如:假设按 goods_id 分 4 张表。(goods_id%4 取整确定表)

优缺点

- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/sqlsugar/index.html b/docs/docs/sqlsugar/index.html index 078f8446781..e2729dc28a9 100644 --- a/docs/docs/sqlsugar/index.html +++ b/docs/docs/sqlsugar/index.html @@ -6,20 +6,20 @@ -10.1. SqlSugar 集成 | Furion - - - - - - - - - +10.1. SqlSugar 集成 | Furion + + + + + + + + +
-

10.1. SqlSugar 集成

10.1.1 关于 SqlSugar#

SqlSugar 是 .NET/C# 平台非常优秀的 ORM 框架,目前 Nuget 总下载突破 700K,Github 关注量也高达 3.2K,是目前当之无愧的国产优秀 ORM 框架之一。

SqlSugar 官方地址:http://www.donet5.com/

SqlSugar 与 EF 优势: 性能比 EF 更快、语法上手更容易

SqlSugar 与 Dapper 优势: SqlSugar 功能更加丰富,性能丝毫不逊色于 Dapper,并且批量操作性能更好

10.1.2 如何集成#

Furion 框架中,已经推出 SqlSugar 拓展包 Furion.Extras.DatabaseAccessor.SqlSugar

10.1.2.1 注册 SqlSugar 服务#

使用非常简单,只需要在 Startup.cs 中添加 services.AddSqlSugar(config) 即可。如:

services.AddSqlSugar(new ConnectionConfig
{
ConnectionString = "Server=.xxxxx",//连接符字串
DbType = DbType.SqlServer,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute//从特性读取主键自增信息
});

同时也可以添加更多配置,如:

services.AddSqlSugar(new ConnectionConfig
{
ConnectionString = "Server=.xxxxx",//连接符字串
DbType = DbType.SqlServer,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute//从特性读取主键自增信息
},
db =>
{
//处理日志事务
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql);
Console.WriteLine(string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));
Console.WriteLine();
};
});
安装拓展包位置

Furion 框架中,推荐将拓展包 Furion.Extras.DatabaseAccessor.SqlSugar 安装到 Furion.Core 层中。

10.1.3 基本使用#

在使用之前,我们可以通过构造函数注入 ISqlSugarRepository<TEntity> 接口,如:

private readonly ISqlSugarRepository<Person> repository; // 仓储对象:封装简单的CRUD
private readonly ISqlSugarClient db; // 核心对象:拥有完整的SqlSugar全部功能
public PersonService(ISqlSugarRepository<Person> sqlSugarRepository)
{
repository = sqlSugarRepository;
db = repository.Context; // 推荐操作
}

10.1.4 数据库操作示例#

// ================== SqlSugarClient ================
+

10.1. SqlSugar 集成

10.1.1 关于 SqlSugar#

SqlSugar 是 .NET/C# 平台非常优秀的 ORM 框架,目前 Nuget 总下载突破 700K,Github 关注量也高达 3.2K,是目前当之无愧的国产优秀 ORM 框架之一。

SqlSugar 官方地址:http://www.donet5.com/

SqlSugar 与 EF 优势: 性能比 EF 更快、语法上手更容易

SqlSugar 与 Dapper 优势: SqlSugar 功能更加丰富,性能丝毫不逊色于 Dapper,并且批量操作性能更好

10.1.2 如何集成#

Furion 框架中,已经推出 SqlSugar 拓展包 Furion.Extras.DatabaseAccessor.SqlSugar

10.1.2.1 注册 SqlSugar 服务#

使用非常简单,只需要在 Startup.cs 中添加 services.AddSqlSugar(config) 即可。如:

services.AddSqlSugar(new ConnectionConfig
{
ConnectionString = "Server=.xxxxx",//连接符字串
DbType = DbType.SqlServer,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute//从特性读取主键自增信息
});

同时也可以添加更多配置,如:

services.AddSqlSugar(new ConnectionConfig
{
ConnectionString = "Server=.xxxxx",//连接符字串
DbType = DbType.SqlServer,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute//从特性读取主键自增信息
},
db =>
{
//处理日志事务
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql);
Console.WriteLine(string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));
Console.WriteLine();
};
});
安装拓展包位置

Furion 框架中,推荐将拓展包 Furion.Extras.DatabaseAccessor.SqlSugar 安装到 Furion.Core 层中。

10.1.3 基本使用#

在使用之前,我们可以通过构造函数注入 ISqlSugarRepository<TEntity> 接口,如:

private readonly ISqlSugarRepository<Person> repository; // 仓储对象:封装简单的CRUD
private readonly ISqlSugarClient db; // 核心对象:拥有完整的SqlSugar全部功能
public PersonService(ISqlSugarRepository<Person> sqlSugarRepository)
{
repository = sqlSugarRepository;
db = repository.Context; // 推荐操作
}

10.1.4 数据库操作示例#

// ================== SqlSugarClient ================
//查询功能
var data1 =db.Queryable<Student>().First(it=>it.Id==1); //db.GetById(1);
var data2 = db.Queryable<Student>().ToList();// db.GetList();
var data3 = db.GetList(it => it.Id == 1);
@@ -40,14 +40,14 @@
//原生Sql用法
var dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new List<SugarParameter>(){
new SugarParameter("@id",1),
new SugarParameter("@name",2)
});
//参数2
var dt=db.Ado.GetDataTable("select * from table where id=@id and name=@name",new{id=1,name=2});
//存储过程用法
var nameP= new SugarParameter("@name", "张三");
var ageP= new SugarParameter("@age", null, true);//设置为output
var dt = db.Ado.UseStoredProcedure().GetDataTable("sp_school",nameP,ageP);
方法名描述返回值
SqlQuery< T >查询所有返回实体集合List
SqlQuery<T,T2>可以返回 2 个结果集Tuple<List, List>
SqlQuerySingle查询第一条记录T
GetDataTable查询所有DataTable
GetDataReader读取 DR 需要手动释放 DRDataReader
GetDataSetAll获取多个结果集DataSet
ExecuteCommand返回受影响行数,一般用于增删改int
GetScalar获取首行首列object
GetString获取首行首列string
GetInt获取首行首列int
GetLong获取首行首列long
GetDouble获取首行首列Double
GetDecimal获取首行首列Decimal
GetDateTime获取首行首列DateTime

想了解更多 SqlSugar 知识可查阅 SqlSugar 官网

10.1.7 打印 sqlSwagger#

services.AddSqlSugar(new ConnectionConfig
{
ConnectionString = "Server=.xxxxx",//连接符字串
DbType = DbType.SqlServer,
IsAutoCloseConnection = true,
InitKeyType = InitKeyType.Attribute//从特性读取主键自增信息
},
db =>
{
db.Aop.OnLogExecuting = (sql, pars) =>
{
App.PrintToMiniProfiler("SqlSugar", "Info", sql + "\r\n" +string.Join(",", pars?.Select(it => it.ParameterName + ":" + it.Value)));
};
});

10.1.8 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/template/index.html b/docs/docs/template/index.html index c5ebdfa7e4e..619d7e2f66c 100644 --- a/docs/docs/template/index.html +++ b/docs/docs/template/index.html @@ -6,28 +6,28 @@ -2.2 官方脚手架 | Furion - - - - - - - - - +2.2 官方脚手架 | Furion + + + + + + + + +
-

2.2 官方脚手架

特别说明

脚手架不是安装在项目中的! 而是通过 CMDPowerShell 安装到操作系统中的。

2.2.1 脚手架#

Furion 官方提供了多种 Web 应用类型的脚手架,方便大家快速创建多层架构项目。目前支持以下应用脚手架:

模板类型名称版本关键词描述
nugetFurion.Template.Mvcnuget👉 furionmvcMvc 模板
nugetFurion.Template.Apinuget👉 furionapiWebApi 模板
nugetFurion.Template.Appnuget👉 furionappMvc/WebApi 模板
nugetFurion.Template.Razornuget👉 furionrazorRazorPages 模板
nugetFurion.Template.RazorWithWebApinuget👉 furionrazorapiRazorPages/WebApi 模板
nugetFurion.Template.Blazornuget👉 furionblazorBlazor 模板
nugetFurion.Template.BlazorWithWebApinuget👉 furionblazorapiBlazor/WebApi 模板

2.2.2 安装脚手架#

打开 CMDPowershell 执行模板安装命令:

dotnet new --install Furion.Template.Mvc::1.11.0

2.2.3 使用脚手架#

dotnet new furionmvc -n 项目名称

这样就可以生成项目代码了,生成之后推荐将所有的 nuget 包更新到最新版本。

特别提醒

furionmvc 对应的是上面列表的 关键字,我们也可以通过 dotnet new --list 查看。

想了解更多可以使用 dotnet new 关键字 --help 查看更多参数。

2.2.4 脚手架更新#

只需要重新安装最新版替换即可,如:

dotnet new --install Furion.Template.Mvc::1.x.x

不带版本号总是安装最新的版本。

2.2.5 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 模板知识 知识可查阅 dotnet-new 模板 章节。

Last updated on by 百小僧
- - - - - - - - - +

2.2 官方脚手架

特别说明

脚手架不是安装在项目中的! 而是通过 CMDPowerShell 安装到操作系统中的。

2.2.1 脚手架#

Furion 官方提供了多种 Web 应用类型的脚手架,方便大家快速创建多层架构项目。目前支持以下应用脚手架:

模板类型名称版本关键词描述
nugetFurion.Template.Mvcnuget👉 furionmvcMvc 模板
nugetFurion.Template.Apinuget👉 furionapiWebApi 模板
nugetFurion.Template.Appnuget👉 furionappMvc/WebApi 模板
nugetFurion.Template.Razornuget👉 furionrazorRazorPages 模板
nugetFurion.Template.RazorWithWebApinuget👉 furionrazorapiRazorPages/WebApi 模板
nugetFurion.Template.Blazornuget👉 furionblazorBlazor 模板
nugetFurion.Template.BlazorWithWebApinuget👉 furionblazorapiBlazor/WebApi 模板

2.2.2 安装脚手架#

打开 CMDPowershell 执行模板安装命令:

dotnet new --install Furion.Template.Mvc::1.11.0

2.2.3 使用脚手架#

dotnet new furionmvc -n 项目名称

这样就可以生成项目代码了,生成之后推荐将所有的 nuget 包更新到最新版本。

特别提醒

furionmvc 对应的是上面列表的 关键字,我们也可以通过 dotnet new --list 查看。

想了解更多可以使用 dotnet new 关键字 --help 查看更多参数。

2.2.4 脚手架更新#

只需要重新安装最新版替换即可,如:

dotnet new --install Furion.Template.Mvc::1.x.x

不带版本号总是安装最新的版本。

2.2.5 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 模板知识 知识可查阅 dotnet-new 模板 章节。

Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/tran/index.html b/docs/docs/tran/index.html index 063d8951580..2458c0973e6 100644 --- a/docs/docs/tran/index.html +++ b/docs/docs/tran/index.html @@ -6,20 +6,20 @@ -9.26 事务和工作单元 | Furion - - - - - - - - - +9.26 事务和工作单元 | Furion + + + + + + + + +
-

9.26 事务和工作单元

9.26.1 事务#

事务指作为单个逻辑工作单元执行的一系列操作,要么完全地执行,要么完全地不执行

简单的说,事务就是并发控制的单位,是用户定义的一个操作序列。 而一个逻辑工作单元要成为事务,就必须满足 ACID 属性。

  • A:原子性(Atomicity):事务中的操作要么都不做,要么就全做
  • C:一致性(Consistency):事务执行的结果必须是从数据库从一个一致性状态转换到另一个一致性状态
  • I:隔离性(Isolation):一个事务的执行不能被其他事务干扰
  • D:持久性(Durability):一个事务一旦提交,它对数据库中数据的改变就应该是永久性的

9.26.2 工作单元#

简单来说,就是为了保证一次完整的功能操作所产生的一些列提交数据的完整性,起着事务的作用。在计算机领域中,工作单元通常用 UnitOfWork 名称表示。

通常我们保证用户的每一次请求都是处于在一个功能单元中,也就是工作单元。

9.26.3 如何使用#

9.26.3.1 自动管理#

Furion 框架中,我们只需要在控制器 Action 中贴 [UnitOfWork] 特性即可开启工作单元模式,保证了每一次请求都是一个 工作单元,要么同时成功,要么同时失败。

9.26.3.2 手动管理#

// 开启事务
using (var transaction = _testRepository.Database.BeginTransaction())
{
try
{
_testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });
_testRepository.SaveChanges();
+

9.26 事务和工作单元

9.26.1 事务#

事务指作为单个逻辑工作单元执行的一系列操作,要么完全地执行,要么完全地不执行

简单的说,事务就是并发控制的单位,是用户定义的一个操作序列。 而一个逻辑工作单元要成为事务,就必须满足 ACID 属性。

  • A:原子性(Atomicity):事务中的操作要么都不做,要么就全做
  • C:一致性(Consistency):事务执行的结果必须是从数据库从一个一致性状态转换到另一个一致性状态
  • I:隔离性(Isolation):一个事务的执行不能被其他事务干扰
  • D:持久性(Durability):一个事务一旦提交,它对数据库中数据的改变就应该是永久性的

9.26.2 工作单元#

简单来说,就是为了保证一次完整的功能操作所产生的一些列提交数据的完整性,起着事务的作用。在计算机领域中,工作单元通常用 UnitOfWork 名称表示。

通常我们保证用户的每一次请求都是处于在一个功能单元中,也就是工作单元。

9.26.3 如何使用#

9.26.3.1 自动管理#

Furion 框架中,我们只需要在控制器 Action 中贴 [UnitOfWork] 特性即可开启工作单元模式,保证了每一次请求都是一个 工作单元,要么同时成功,要么同时失败。

9.26.3.2 手动管理#

// 开启事务
using (var transaction = _testRepository.Database.BeginTransaction())
{
try
{
_testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/dotnet" });
_testRepository.SaveChanges();
_testRepository.Insert(new Blog { Url = "http://blogs.msdn.com/visualstudio" });
_testRepository.SaveChanges();
var blogs = _testRepository.Entity
.OrderBy(b => b.Url)
.ToList();
// 提交事务
transaction.Commit();
}
catch (Exception)
{
// 回滚事务
transaction.RollBack();
}
}

9.26.4 工作单元特性说明#

9.26.4.1 [UnitOfWork]#

[UnitOfWork] 特性用来标记事务信息,如作用范围,隔离级别等。

  • Enabled:是否启动工作单元,默认 true
  • ScopeOption:定义事务范围行为,默认 TransactionScopeOption.Required
  • IsolationLevel:设置事务隔离级别,默认 IsolationLevel.ReadCommitted;
  • AsyncFlowOption:允许跨线程连续任务的事务流,如有异步操作需开启该选项,默认开启
特别注意

一旦方法贴了 [UnitOfWork(false)] 特性后,那么该方法不再启用工作单元模式,也就是不包含事务,也不会自动提交数据库。慎用!

9.26.5 反馈与建议#

与我们交流

给 Furion 提 Issue


了解更多

想了解更多 事务 知识可查阅 EF Core - 使用事务 章节。

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/unittest/index.html b/docs/docs/unittest/index.html index f500966dc56..5221eac5732 100644 --- a/docs/docs/unittest/index.html +++ b/docs/docs/unittest/index.html @@ -6,28 +6,28 @@ -29.1 单元测试 | Furion - - - - - - - - - +29.1 单元测试 | Furion + + + + + + + + +
-
Last updated on by 百小僧
- - - - - - - - - +
Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/docs/view-engine/index.html b/docs/docs/view-engine/index.html index b93d957fed1..a31c83905b4 100644 --- a/docs/docs/view-engine/index.html +++ b/docs/docs/view-engine/index.html @@ -6,33 +6,33 @@ -17. 视图引擎 | Furion - - - - - - - - - +17. 视图引擎 | Furion + + + + + + + + +
-

17. 视图引擎

17.1 关于视图引擎#

视图引擎负责根据视图模板创建 HTML。视图通常是 HTML 和编程语言的某种混合。支持变量定义、方法调用及逻辑编写。

Furion 框架中,底层集成了微软提供的 Razor 视图引擎组件并提供更加灵活方便的语法糖。

17.2 视图引擎作用#

  • 支持 ASP.NET Core 完整的 Razor 语法
  • 根据不同的数据编译模板产生不同的输出
  • 实现强大的插件化机制
  • 实现全站页面静态化
  • 可以用作邮件模板、短信模板、优惠券信息模板等

17.3 基础使用#

17.3.1 注册服务#

使用之前需在 Startup.cs 中注册 视图引擎服务

public void ConfigureServices(IServiceCollection services)
{
services.AddViewEngine();
}

17.3.2 使用方式#

  • 构造函数注入 IViewEngine
using Furion.DynamicApiController;
using Furion.ViewEngine;
+

17. 视图引擎

17.1 关于视图引擎#

视图引擎负责根据视图模板创建 HTML。视图通常是 HTML 和编程语言的某种混合。支持变量定义、方法调用及逻辑编写。

Furion 框架中,底层集成了微软提供的 Razor 视图引擎组件并提供更加灵活方便的语法糖。

17.2 视图引擎作用#

  • 支持 ASP.NET Core 完整的 Razor 语法
  • 根据不同的数据编译模板产生不同的输出
  • 实现强大的插件化机制
  • 实现全站页面静态化
  • 可以用作邮件模板、短信模板、优惠券信息模板等

17.3 基础使用#

17.3.1 注册服务#

使用之前需在 Startup.cs 中注册 视图引擎服务

public void ConfigureServices(IServiceCollection services)
{
services.AddViewEngine();
}

17.3.2 使用方式#

  • 构造函数注入 IViewEngine
using Furion.DynamicApiController;
using Furion.ViewEngine;
namespace Furion.Application
{
public class ViewEngineService : IDynamicApiController
{
private readonly IViewEngine _viewEngine;
public ViewEngineService(IViewEngine viewEngine)
{
_viewEngine = viewEngine;
var result = _viewEngine.RunCompile("Hello @Model.Name", new { Name = "Furion" });
}
}
}
  • 字符串方式
var result = "Hello @Model.Name".RunCompile(new { Name = "Furion" });

17.3.3 弱类型模板#

var result = _viewEngine.RunCompile("Hello @Model.Name", new { Name = "Furion" });

结果:

Hello Furion

支持异步 RunCompileAsync

17.3.4 强类型模板#

var result = _viewEngine.RunCompile(@"
Hello @Model.Name
@foreach(var item in Model.Items)
{
<p>@item</p>
}
", new TestModel
{
Name = "Furion",
Items = new[] { 3, 1, 2 }
});

结果:

Hello Furion
<p>3</p>
<p>1</p>
<p>2</p>

支持异步 RunCompileAsync

17.3.5 高性能模板缓存 🥇#

由于模板编译需要消耗大量的性能,所以建议使用带 FromCached 结尾的 RunCompileFromCached 替代。调用该方法后会自动将模板编译成 .dll 以便下次使用。减少第二次之后使用模板的性能损耗。

如,强类型模板:

var result = _viewEngine.RunCompileFromCached(@"
Hello @Model.Name
@foreach(var item in Model.Items)
{
<p>@item</p>
}
", new TestModel
{
Name = "Furion",
Items = new[] { 3, 1, 2 }
});

结果:

Hello Furion
<p>3</p>
<p>1</p>
<p>2</p>

调用 RunCompileFromCached 方法之后将会使用 MD5 加密模板并生成 MD5字符串的 .dll 存放在网站根目录下的 templates 目录中。只要模板内容不变,数据发生改变也不会重新编译模板。这样大大的提高了首次之后的性能。

如,传入新的数据:

var result = _viewEngine.RunCompileFromCached(@"
Hello @Model.Name
@foreach(var item in Model.Items)
{
<p>@item</p>
}
", new TestModel
{
Name = "Furion",
Items = new[] { 5,6,7,8 }
});

结果:

Hello Furion
<p>5</p>
<p>6</p>
<p>7</p>
<p>8</p>

模板不再重新编译,只是重新替换数据。

17.4 高级用法#

高级用法支持将特定程序集、特定命名空间、特定类型引入到模板中使用。

17.4.1 添加程序集#

比如这里添加 System.IO 程序集:

var result = _viewEngine.RunCompileFromCached(@"<div>@System.IO.Path.Combine(""Furion"", ""ViewEngine"")</div>", builderAction: builder =>
{
builder.AddAssemblyReferenceByName("System.IO");
});

结果:

<div>Furion\\ViewEngine</div>

另外,Furion 提供多种方式加载程序集:

builder.AddAssemblyReferenceByName("System.Security"); // 通过名称
builder.AddAssemblyReference(typeof(System.IO.File)); // 通过类型
builder.AddAssemblyReference(Assembly.Load("source")); // 通过元数据引用

17.4.2 添加命名空间#

var result = _viewEngine.RunCompileFromCached(@"<div>@Path.Combine(""Furion"", ""ViewEngine"")</div>", builderAction: builder =>
{
builder.AddUsing("System.IO");
builder.AddAssemblyReferenceByName("System.IO");
});

结果:

<div>Furion\\ViewEngine</div>

也支持加入多个 using

builder.AddUsing("System.IO");
builder.AddUsing("Furion");

17.4.3 定义模板方法#

var result = _viewEngine.RunCompileFromCached(@"
<area>
@{ RecursionTest(3); }
</area>
@{
void RecursionTest(int level)
{
if (level <= 0)
{
return;
}
<div>LEVEL: @level</div>
@{ RecursionTest(level - 1); }
}
}
");

结果:

<area>
<div>LEVEL: 3</div>
<div>LEVEL: 2</div>
<div>LEVEL: 1</div>
</area>

17.4.4 调用类方法#

定义 CustomModel 类并继承 ViewEngineModel 基类

public class CustomModel : ViewEngineModel
{
public int A { get; set; }
public string B { get; set; }
public string Decorator(object value)
{
return "-=" + value + "=-";
}
}

在模板中调用 Decorator(value) 方法:

var content = @"Hello @A, @B, @Decorator(123)";
var template = _viewEngine.Compile<CustomModel>(content);
var result = template.Run(instance =>
{
instance.A = 10;
instance.B = "Alex";
});

结果:

Hello 10, Alex, -=123=-

17.5 IViewEngine 接口#

IViewEngine 提供了简单方便的 RunCompile 方法,也提供了最原始化的 CompileRun 方法。

通过原始的 CompileRun 方法可以实现很多复杂的逻辑和自定义指令集。

/// <summary>
/// 编译模板
/// </summary>
/// <param name="content"></param>
/// <param name="builderAction"></param>
/// <returns></returns>
IViewEngineTemplate Compile(string content, Action<IViewEngineOptionsBuilder> builderAction = null);
/// <summary>
/// 编译模板
/// </summary>
/// <param name="content"></param>
/// <param name="builderAction"></param>
/// <returns></returns>
Task<IViewEngineTemplate> CompileAsync(string content, Action<IViewEngineOptionsBuilder> builderAction = null);
/// <summary>
/// 编译模板
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="content"></param>
/// <param name="builderAction"></param>
/// <returns></returns>
IViewEngineTemplate<T> Compile<T>(string content, Action<IViewEngineOptionsBuilder> builderAction = null)
where T : IViewEngineModel;
/// <summary>
/// 编译模板
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="content"></param>
/// <param name="builderAction"></param>
/// <returns></returns>
Task<IViewEngineTemplate<T>> CompileAsync<T>(string content, Action<IViewEngineOptionsBuilder> builderAction = null)
where T : IViewEngineModel;

17.6 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - + + + + + + + + + \ No newline at end of file diff --git a/docs/docs/virtual-deploy/index.html b/docs/docs/virtual-deploy/index.html index 33f2afda6ff..fb2e8a2f289 100644 --- a/docs/docs/virtual-deploy/index.html +++ b/docs/docs/virtual-deploy/index.html @@ -6,28 +6,28 @@ -27.4 二级虚拟目录部署 | Furion - - - - - - - - - +27.4 二级虚拟目录部署 | Furion + + + + + + + + +
-

27.4 二级虚拟目录部署

27.4.1 关于二级虚拟目录#

通常我们的站点都是部署在网站的根目录下的,但是有些时候,我们可能将网站根目录下的目录作为二级站点或子站点,这个时候,就会出现 404 错误了。

这个时候就需要进行一些特殊配置了。

27.4.1.2 配置 Startup.cs#

首先,我们需要配置 Startup.cs 中的 Configure,如:

public void Configure(IApplicationBuilder application, IWebHostEnvironment env)
{
application.Map("/二级目录", app=>
{
// 其他中间件代码全部在这里面写
});
}

27.4.1.3 启用 Swagger 虚拟目录支持#

第二步,在 appsettings.json 配置文件(其他配置文件也可以)中添加以下配置:

{
"SpecificationDocumentSettings": {
"VirtualPath": "/二级目录"
}
}

27.4.2 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
- - - - - - - - - +

27.4 二级虚拟目录部署

27.4.1 关于二级虚拟目录#

通常我们的站点都是部署在网站的根目录下的,但是有些时候,我们可能将网站根目录下的目录作为二级站点或子站点,这个时候,就会出现 404 错误了。

这个时候就需要进行一些特殊配置了。

27.4.1.2 配置 Startup.cs#

首先,我们需要配置 Startup.cs 中的 Configure,如:

public void Configure(IApplicationBuilder application, IWebHostEnvironment env)
{
application.Map("/二级目录", app=>
{
// 其他中间件代码全部在这里面写
});
}

27.4.1.3 启用 Swagger 虚拟目录支持#

第二步,在 appsettings.json 配置文件(其他配置文件也可以)中添加以下配置:

{
"SpecificationDocumentSettings": {
"VirtualPath": "/二级目录"
}
}

27.4.2 反馈与建议#

与我们交流

给 Furion 提 Issue

Last updated on by 百小僧
+ + + + + + + + + \ No newline at end of file diff --git a/docs/e0678751.866af405.js b/docs/e0678751.464279b0.js similarity index 98% rename from docs/e0678751.866af405.js rename to docs/e0678751.464279b0.js index 84f6c196b9b..45d95454646 100644 --- a/docs/e0678751.866af405.js +++ b/docs/e0678751.464279b0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[95],{169:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return p})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return u})),t.d(n,"default",(function(){return d}));var a=t(3),i=t(7),r=(t(0),t(192)),c=t(190),b=t(199),l=t(200),o=t(193),p={id:"specification-document",title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",sidebar_label:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863"},s={unversionedId:"specification-document",id:"specification-document",isDocsHomePage:!1,title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",description:"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",source:"@site/docs\\specification-document.mdx",slug:"/specification-document",permalink:"/docs/specification-document",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/specification-document.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",sidebar:"docs",previous:{title:"5. \u52a8\u6001 WebAPI",permalink:"/docs/dynamic-api-controller"},next:{title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",permalink:"/docs/friendly-exception"}},u=[{value:"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",id:"61-\u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",children:[]},{value:"6.2 \u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863",id:"62-\u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863",children:[]},{value:"6.3 \u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863",id:"63-\u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863",children:[{value:"6.3.1 \u534f\u8bae\u89c4\u8303",id:"631-\u534f\u8bae\u89c4\u8303",children:[]},{value:"6.3.2 \u63a5\u53e3\u8def\u5f84\u89c4\u8303",id:"632-\u63a5\u53e3\u8def\u5f84\u89c4\u8303",children:[]},{value:"6.3.3 \u7248\u672c\u63a7\u5236\u89c4\u8303",id:"633-\u7248\u672c\u63a7\u5236\u89c4\u8303",children:[]},{value:"6.3.4 \u63a5\u53e3\u547d\u540d\u89c4\u8303",id:"634-\u63a5\u53e3\u547d\u540d\u89c4\u8303",children:[]},{value:"6.3.5 \u8bf7\u6c42\u53c2\u6570\u89c4\u8303",id:"635-\u8bf7\u6c42\u53c2\u6570\u89c4\u8303",children:[]},{value:"6.3.6 \u8fd4\u56de\u6570\u636e\u89c4\u8303",id:"636-\u8fd4\u56de\u6570\u636e\u89c4\u8303",children:[]}]},{value:"6.4 \u4ec0\u4e48\u662f Swagger",id:"64-\u4ec0\u4e48\u662f-swagger",children:[]},{value:"6.5 Swagger \u4f7f\u7528",id:"65-swagger-\u4f7f\u7528",children:[{value:"6.5.1 \u6ce8\u518c\u670d\u52a1",id:"651-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"6.5.2 \u9ed8\u8ba4\u5730\u5740",id:"652-\u9ed8\u8ba4\u5730\u5740",children:[]},{value:"6.5.3 \u9ed8\u8ba4\u5206\u7ec4",id:"653-\u9ed8\u8ba4\u5206\u7ec4",children:[]},{value:"6.5.4 \u6587\u6863\u6ce8\u91ca",id:"654-\u6587\u6863\u6ce8\u91ca",children:[]},{value:"6.5.5 \u591a\u5206\u7ec4\u652f\u6301",id:"655-\u591a\u5206\u7ec4\u652f\u6301",children:[]},{value:"6.5.6 \u591a\u5206\u7ec4\u6392\u5e8f",id:"656-\u591a\u5206\u7ec4\u6392\u5e8f",children:[]},{value:"6.5.7 \u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e",id:"657-\u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e",children:[]},{value:"6.5.8 \u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09",id:"658-\u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09",children:[]},{value:"6.5.9 \u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863",id:"659-\u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863",children:[]},{value:"6.5.10 \u914d\u7f6e\u6587\u6863\u6807\u9898",id:"6510-\u914d\u7f6e\u6587\u6863\u6807\u9898",children:[]},{value:"6.5.11 \u6388\u6743\u63a7\u5236",id:"6511-\u6388\u6743\u63a7\u5236",children:[]},{value:"6.5.12 \u5728\u7ebf\u6d4b\u8bd5",id:"6512-\u5728\u7ebf\u6d4b\u8bd5",children:[]},{value:"6.5.13 \u6027\u80fd\u76d1\u89c6 MiniProfiler",id:"6513-\u6027\u80fd\u76d1\u89c6-miniprofiler",children:[]},{value:"6.5.14 \u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b",id:"6514-\u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b",children:[]},{value:"6.5.15 \u9690\u85cf\u7279\u5b9a\u5206\u7ec4",id:"6515-\u9690\u85cf\u7279\u5b9a\u5206\u7ec4",children:[]},{value:"6.5.16 \u4e2d\u6587\u4e71\u7801\u95ee\u9898",id:"6516-\u4e2d\u6587\u4e71\u7801\u95ee\u9898",children:[]}]},{value:"6.6 SpecificationDocumentSettings \u914d\u7f6e",id:"66-specificationdocumentsettings-\u914d\u7f6e",children:[]},{value:"6.7 \u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b",id:"67-\u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b",children:[{value:"6.7.1 \u6392\u9664\u89c4\u8303\u5316\u5904\u7406",id:"671-\u6392\u9664\u89c4\u8303\u5316\u5904\u7406",children:[]},{value:"6.7.2 \u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e",id:"672-\u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e",children:[]}]},{value:"6.8 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"68-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:u};function d(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},m,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(o.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"61-\u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863"},"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863"),Object(r.b)("p",null,"\u5728\u73b0\u5728\u79fb\u52a8\u4e3a\u738b\u3001\u591a\u7aef\u4e92\u8f85\u3001\u524d\u7aef\u767e\u82b1\u9f50\u653e\u7684\u5f00\u653e\u65f6\u4ee3\uff0c\u4e0d\u518d\u662f\u4e00\u4eba\u5305\u63fd\u5f0f\u5f00\u53d1\uff0c\u5927\u5bb6\u5404\u53f8\u5176\u804c\uff0c\u540e\u7aef\u5de5\u7a0b\u5e08\u8d1f\u8d23\u63a5\u53e3\u5f00\u53d1\uff0c\u524d\u7aef\u8d1f\u8d23\u63a5\u53e3\u8054\u8c03\uff0c\u4e5f\u5c31\u662f\u4e92\u8054\u7f51\u73b0\u5728\u6d41\u884c\u7684\u524d\u540e\u7aef\u5206\u79bb\u67b6\u6784\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\u5c31\u9700\u8981\u7531\u524d\u540e\u7aef\u5de5\u7a0b\u5e08\u5171\u540c\u5b9a\u4e49\u63a5\u53e3\uff0c\u7f16\u5199\u63a5\u53e3\u6587\u6863\uff0c\u4e4b\u540e\u5927\u5bb6\u6309\u7167\u8fd9\u4e2a\u63a5\u53e3\u6587\u6863\u8fdb\u884c\u5f00\u53d1\u3001\u7ef4\u62a4\u53ca\u5f00\u653e\u7ed9\u7b2c\u4e09\u65b9\u3002"),Object(r.b)("h2",{id:"62-\u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863"},"6.2 \u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u80fd\u591f\u8ba9\u524d\u7aef\u5f00\u53d1\u4e0e\u540e\u53f0\u5f00\u53d1\u4eba\u5458\u66f4\u597d\u7684\u914d\u5408\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387"),Object(r.b)("li",{parentName:"ul"},"\u9879\u76ee\u8fed\u4ee3\u6216\u8005\u9879\u76ee\u4eba\u5458\u66f4\u8fed\u65f6\uff0c\u65b9\u4fbf\u540e\u671f\u4eba\u5458\u67e5\u770b\u548c\u7ef4\u62a4"),Object(r.b)("li",{parentName:"ul"},"\u65b9\u4fbf\u6d4b\u8bd5\u4eba\u5458\u8fdb\u884c\u63a5\u53e3\u6d4b\u8bd5")),Object(r.b)("h2",{id:"63-\u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863"},"6.3 \u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863"),Object(r.b)("p",null,"\u7531\u4e8e\u6bcf\u4e2a\u516c\u53f8\u540e\u7aef\u4eba\u5458\u6280\u672f\u53c2\u5dee\u4e0d\u9f50\uff0c\u6280\u672f\u6587\u6863\u80fd\u529b\u4e5f\u4e0d\u4f8b\u5916\uff0c\u5bfc\u81f4\u63a5\u53e3\u5b9a\u4e49\u53ca\u6587\u6863\u4e94\u82b1\u516b\u95e8\uff0c\u4e0d\u540c\u9879\u76ee\u6216\u4e0d\u540c\u516c\u53f8\u5bf9\u63a5\u6781\u5176\u56f0\u96be\uff0c\u800c\u4e14\u4f53\u9a8c\u7cdf\u7cd5\u3002\u6240\u4ee5\uff0c\u65e0\u89c4\u77e9\u4e0d\u6210\u65b9\u5706\uff0c\u4e3a\u4e86\u5f00\u53d1\u4eba\u5458\u95f4\u66f4\u597d\u7684\u914d\u5408\uff0c\u8feb\u5207\u9700\u8981\u6574\u7406\u51fa\u4e00\u5957\u89c4\u8303\u3002"),Object(r.b)("p",null,"\u901a\u5e38\u63a5\u53e3\u89c4\u8303\u5206\u4e3a\u516d\u4e2a\u90e8\u5206\uff1a"),Object(r.b)("h3",{id:"631-\u534f\u8bae\u89c4\u8303"},"6.3.1 \u534f\u8bae\u89c4\u8303"),Object(r.b)("p",null,"\u4e3a\u4e86\u786e\u4fdd\u4e0d\u540c\u7cfb\u7edf/\u6a21\u5757\u95f4\u7684\u6570\u636e\u4ea4\u4e92\uff0c\u9700\u8981\u4e8b\u5148\u7ea6\u5b9a\u597d\u901a\u8baf\u534f\u8bae\uff0c\u5982\uff1aTCP\u3001HTTP\u3001HTTPS \u534f\u8bae\u3002\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u4ea4\u4e92\u5b89\u5168\uff0c\u5efa\u8bae\u4f7f\u7528 HTTPS \u534f\u8bae"),Object(r.b)("h3",{id:"632-\u63a5\u53e3\u8def\u5f84\u89c4\u8303"},"6.3.2 \u63a5\u53e3\u8def\u5f84\u89c4\u8303"),Object(r.b)("p",null,"\u4f5c\u4e3a\u63a5\u53e3\u8def\u5f84\uff0c\u4e3a\u4e86\u65b9\u4fbf\u6e05\u6670\u7684\u533a\u5206\u6765\u81ea\u4e0d\u540c\u7684\u7cfb\u7edf\uff0c\u53ef\u4ee5\u91c7\u7528\u4e0d\u540c\u7cfb\u7edf/\u6a21\u5757\u540d\u4f5c\u4e3a\u63a5\u53e3\u8def\u5f84\u524d\u7f00\uff0c\u5982\uff1a\u652f\u4ed8\u6a21\u5757\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"/pay/xxx"),"\uff0c\u8ba2\u5355\u6a21\u5757\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"/order/xxx")),Object(r.b)("h3",{id:"633-\u7248\u672c\u63a7\u5236\u89c4\u8303"},"6.3.3 \u7248\u672c\u63a7\u5236\u89c4\u8303"),Object(r.b)("p",null,'\u4e3a\u4e86\u4fbf\u4e8e\u540e\u671f\u63a5\u53e3\u7684\u5347\u7ea7\u548c\u7ef4\u62a4\uff0c\u5efa\u8bae\u5728\u63a5\u53e3\u8def\u5f84\u4e2d\u52a0\u5165\u7248\u672c\u53f7\uff0c\u4fbf\u4e8e\u7ba1\u7406\uff0c\u5b9e\u73b0\u63a5\u53e3\u591a\u7248\u672c\u7684\u53ef\u7ef4\u62a4\u6027\u3002\u5982\uff1a\u63a5\u53e3\u8def\u5f84\u4e2d\u6dfb\u52a0\u7c7b\u4f3c"',Object(r.b)("inlineCode",{parentName:"p"},"v1"),'"\u3001"',Object(r.b)("inlineCode",{parentName:"p"},"v2"),'"\u7b49\u7248\u672c\u53f7'),Object(r.b)("h3",{id:"634-\u63a5\u53e3\u547d\u540d\u89c4\u8303"},"6.3.4 \u63a5\u53e3\u547d\u540d\u89c4\u8303"),Object(r.b)("p",null,'\u548c C# \u547d\u540d\u89c4\u8303\u4e00\u6837\uff0c\u597d\u7684\u3001\u7edf\u4e00\u7684\u63a5\u53e3\u547d\u540d\u89c4\u8303\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u589e\u5f3a\u5176\u53ef\u8bfb\u6027\uff0c\u800c\u4e14\u8fd8\u4f1a\u51cf\u5c11\u5f88\u591a\u4e0d\u5fc5\u8981\u7684\u53e3\u5934/\u4e66\u9762\u4e0a\u7684\u89e3\u91ca\u3002\uff0c\u53ef\u4f7f\u7528"\u9a7c\u5cf0\u547d\u540d\u6cd5"\u6309\u7167\u5b9e\u73b0\u63a5\u53e3\u7684',Object(r.b)("strong",{parentName:"p"},"\u4e1a\u52a1\u7c7b\u578b\u3001\u4e1a\u52a1\u573a\u666f"),"\u7b49\u547d\u540d\uff0c\u6709\u5fc5\u8981\u65f6\u53ef\u91c7\u53d6\u591a\u7ea7\u76ee\u5f55\u547d\u540d\uff0c\u4f46\u76ee\u5f55\u4e0d\u5b9c\u8fc7\u957f\uff0c\u4e24\u7ea7\u76ee\u5f55\u8f83\u4e3a\u9002\u5b9c"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5e38\u89c1\u547d\u540d\u65b9\u5f0f"),":",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63a5\u53e3\u540d\u79f0\u52a8\u8bcd\u524d/\u540e\u7f00\u5316"),"\uff1a \u63a5\u53e3\u540d\u79f0\u4ee5\u63a5\u53e3\u6570\u636e\u64cd\u4f5c\u7684\u52a8\u8bcd\u4e3a\u524d/\u540e\u7f00\uff0c\u5e38\u89c1\u52a8\u8bcd\u6709\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Add\u3001Delete\u3001Update\u3001Query\u3001Get\u3001Send\u3001Save\u3001Detail\u3001List"),"\u7b49\uff0c\u5982\uff1a\u65b0\u5efa\u7528\u6237 ",Object(r.b)("inlineCode",{parentName:"li"},"AddUser"),"\u3001\u67e5\u8be2\u8ba2\u5355\u8be6\u60c5 ",Object(r.b)("inlineCode",{parentName:"li"},"QueryOrderDetail"),"\u3002"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63a5\u53e3\u540d\u79f0\u52a8\u8bcd + \u8bf7\u6c42\u65b9\u5f0f"),"\uff1a\u63a5\u53e3\u8def\u5f84\u4e2d\u5305\u542b\u5177\u4f53\u63a5\u53e3\u540d\u79f0\u7684\u540d\u8bcd\uff0c\u63a5\u53e3\u6570\u636e\u64cd\u4f5c\u52a8\u4f5c\u4ee5 HTTP \u8bf7\u6c42\u65b9\u5f0f\u6765\u533a\u5206\u3002\u5e38\u7528\u7684 HTTP \u8bf7\u6c42\u65b9\u5f0f\u6709\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"GET"),"\uff1a\u4ece\u670d\u52a1\u5668\u53d6\u51fa\u8d44\u6e90\uff08\u4e00\u9879\u6216\u591a\u9879\uff09"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"POST"),"\uff1a\u5728\u670d\u52a1\u5668\u65b0\u5efa\u4e00\u4e2a\u8d44\u6e90"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"PUT"),"\uff1a\u5728\u670d\u52a1\u5668\u66f4\u65b0\u8d44\u6e90\uff08\u5ba2\u6237\u7aef\u63d0\u4f9b\u6539\u53d8\u540e\u7684\u5b8c\u6574\u8d44\u6e90\uff09"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"PATCH"),"\uff1a\u5728\u670d\u52a1\u5668\u66f4\u65b0\u8d44\u6e90\uff08\u5ba2\u6237\u7aef\u63d0\u4f9b\u6539\u53d8\u7684\u5c5e\u6027\uff09"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DELETE"),"\uff1a\u4ece\u670d\u52a1\u5668\u5220\u9664\u8d44\u6e90")))))),Object(r.b)("h3",{id:"635-\u8bf7\u6c42\u53c2\u6570\u89c4\u8303"},"6.3.5 \u8bf7\u6c42\u53c2\u6570\u89c4\u8303"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u65b9\u5f0f"),"\uff1a\u6309\u7167 ",Object(r.b)("inlineCode",{parentName:"li"},"GET\u3001POST\u3001PUT")," \u7b49\u542b\u4e49\u5b9a\u4e49\uff0c\u907f\u514d\u51fa\u73b0\u4e0d\u4e00\u81f4\u73b0\u8c61\uff0c\u5bf9\u4eba\u9020\u6210\u8bef\u89e3\u3001\u6b67\u4e49",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u5934"),"\uff1a\u8bf7\u6c42\u5934\u6839\u636e\u9879\u76ee\u9700\u6c42\u6dfb\u52a0\u914d\u7f6e\u53c2\u6570\u3002\u5982\uff1a\u8bf7\u6c42\u6570\u636e\u683c\u5f0f\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"accept=application/json")," \u7b49\u3002\u5982\u6709\u9700\u8981\uff0c\u8bf7\u6c42\u5934\u53ef\u6839\u636e\u9879\u76ee\u9700\u6c42\u8981\u6c42\u4f20\u5165\u7528\u6237 token\u3001\u552f\u4e00\u9a8c\u7b7e\u7801\u7b49\u52a0\u5bc6\u6570\u636e"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u53c2\u6570/\u8bf7\u6c42\u4f53"),"\uff1a \u8bf7\u6c42\u53c2\u6570\u5b57\u6bb5\uff0c\u5c3d\u53ef\u80fd\u4e0e\u6570\u636e\u5e93\u8868\u5b57\u6bb5\u3001\u5bf9\u8c61\u5c5e\u6027\u540d\u7b49\u4fdd\u6301\u4e00\u81f4\uff0c\u56e0\u4e3a\u4fdd\u6301\u4e00\u81f4\u662f\u6700\u7701\u4e8b\uff0c\u6700\u8212\u670d\u7684\u4e00\u4ef6\u4e8b")))),Object(r.b)("h3",{id:"636-\u8fd4\u56de\u6570\u636e\u89c4\u8303"},"6.3.6 \u8fd4\u56de\u6570\u636e\u89c4\u8303"),Object(r.b)("p",null,"\u7edf\u4e00\u89c4\u8303\u8fd4\u56de\u6570\u636e\u7684\u683c\u5f0f\uff0c\u5bf9\u5df1\u5bf9\u5f7c\u90fd\u6709\u597d\u5904\uff0c\u6b64\u5904\u4ee5 json \u683c\u5f0f\u4e3a\u4f8b\u3002\u8fd4\u56de\u6570\u636e\u5e94\u5305\u542b\uff1a",Object(r.b)("strong",{parentName:"p"},"\u8fd4\u56de\u72b6\u6001\u7801\u3001\u8fd4\u56de\u72b6\u6001\u4fe1\u606f\u3001\u5177\u4f53\u6570\u636e"),"\u3002",Object(r.b)("strong",{parentName:"p"},"\u8fd4\u56de\u6570\u636e\u4e2d\u7684\u72b6\u6001\u7801\u3001\u72b6\u6001\u4fe1\u606f\uff0c\u5e38\u6307\u5177\u4f53\u7684\u4e1a\u52a1\u72b6\u6001\uff0c\u4e0d\u5efa\u8bae\u548c HTTP \u72b6\u6001\u7801\u6df7\u5728\u4e00\u8d77"),"\u3002HTTP \u72b6\u6001\uff0c\u662f\u7528\u6765\u4f53\u73b0 HTTP \u94fe\u8def\u72b6\u6001\u60c5\u51b5\uff0c\u5982\uff1a404-Not Found\u3002HTTP \u72b6\u6001\u7801\u548c json \u7ed3\u679c\u4e2d\u7684\u72b6\u6001\u7801\uff0c\u5e76\u5b58\u5c1a\u53ef\uff0c\u7528\u4e8e\u4f53\u73b0\u4e0d\u540c\u7ef4\u5ea6\u7684\u72b6\u6001\u3002"),Object(r.b)("h2",{id:"64-\u4ec0\u4e48\u662f-swagger"},"6.4 \u4ec0\u4e48\u662f Swagger"),Object(r.b)("p",null,"\u76f8\u4fe1\u65e0\u8bba\u662f\u524d\u7aef\u8fd8\u662f\u540e\u7aef\u5f00\u53d1\uff0c\u90fd\u6216\u591a\u6216\u5c11\u5730\u88ab\u63a5\u53e3\u6587\u6863\u6298\u78e8\u8fc7\u3002\u524d\u7aef\u7ecf\u5e38\u62b1\u6028\u540e\u7aef\u7ed9\u7684\u63a5\u53e3\u6587\u6863\u4e0e\u5b9e\u9645\u60c5\u51b5\u4e0d\u4e00\u81f4\u3002\u540e\u7aef\u53c8\u89c9\u5f97\u7f16\u5199\u53ca\u7ef4\u62a4\u63a5\u53e3\u6587\u6863\u4f1a\u8017\u8d39\u4e0d\u5c11\u7cbe\u529b\uff0c\u7ecf\u5e38\u6765\u4e0d\u53ca\u66f4\u65b0\u3002"),Object(r.b)("p",null,"\u5176\u5b9e\u65e0\u8bba\u662f\u524d\u7aef\u8c03\u7528\u540e\u7aef\uff0c\u8fd8\u662f\u540e\u7aef\u8c03\u7528\u540e\u7aef\uff0c\u90fd\u671f\u671b\u6709\u4e00\u4e2a\u597d\u7684\u63a5\u53e3\u6587\u6863\u3002\u4f46\u662f\u8fd9\u4e2a\u63a5\u53e3\u6587\u6863\u5bf9\u4e8e\u7a0b\u5e8f\u5458\u6765\u8bf4\uff0c\u5c31\u8ddf\u6ce8\u91ca\u4e00\u6837\uff0c\u7ecf\u5e38\u4f1a\u62b1\u6028\u522b\u4eba\u5199\u7684\u4ee3\u7801\u6ca1\u6709\u5199\u6ce8\u91ca\uff0c\u7136\u800c\u81ea\u5df1\u5199\u8d77\u4ee3\u7801\u8d77\u6765\uff0c\u6700\u8ba8\u538c\u7684\uff0c\u4e5f\u662f\u5199\u6ce8\u91ca\u3002\u6240\u4ee5\u4ec5\u4ec5\u53ea\u901a\u8fc7\u5f3a\u5236\u6765\u89c4\u8303\u5927\u5bb6\u662f\u4e0d\u591f\u7684\uff0c\u968f\u7740\u65f6\u95f4\u63a8\u79fb\uff0c\u7248\u672c\u8fed\u4ee3\uff0c\u63a5\u53e3\u6587\u6863\u5f80\u5f80\u5f88\u5bb9\u6613\u5c31\u8ddf\u4e0d\u4e0a\u4ee3\u7801\u4e86\u3002"),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u53d1\u73b0\u4e86\u75db\u70b9\u5c31\u8981\u53bb\u627e\u89e3\u51b3\u65b9\u6848\u3002\u89e3\u51b3\u65b9\u6848\u7528\u7684\u4eba\u591a\u4e86\uff0c\u5c31\u6210\u4e86\u6807\u51c6\u7684\u89c4\u8303\uff0c\u8fd9\u5c31\u662f ",Object(r.b)("inlineCode",{parentName:"strong"},"Swagger")," \u7684\u7531\u6765"),"\u3002"),Object(r.b)("p",null,"\u901a\u8fc7\u8fd9\u5957\u89c4\u8303\uff0c\u4f60\u53ea\u9700\u8981\u6309\u7167\u5b83\u7684\u89c4\u8303\u53bb\u5b9a\u4e49\u63a5\u53e3\u53ca\u63a5\u53e3\u76f8\u5173\u7684\u4fe1\u606f\u3002\u518d\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u884d\u751f\u51fa\u6765\u7684\u4e00\u7cfb\u5217\u9879\u76ee\u548c\u5de5\u5177\uff0c\u5c31\u53ef\u4ee5\u505a\u5230\u751f\u6210\u5404\u79cd\u683c\u5f0f\u7684\u63a5\u53e3\u6587\u6863\uff0c\u751f\u6210\u591a\u79cd\u8bed\u8a00\u7684\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u7aef\u7684\u4ee3\u7801\uff0c\u4ee5\u53ca\u5728\u7ebf\u63a5\u53e3\u8c03\u8bd5\u9875\u9762\u7b49\u7b49\u3002"),Object(r.b)("p",null,"\u8fd9\u6837\uff0c\u5982\u679c\u6309\u7167\u65b0\u7684\u5f00\u53d1\u6a21\u5f0f\uff0c\u5728\u5f00\u53d1\u65b0\u7248\u672c\u6216\u8005\u8fed\u4ee3\u7248\u672c\u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981\u66f4\u65b0 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u63cf\u8ff0\u6587\u4ef6\uff0c\u5c31\u53ef\u4ee5\u81ea\u52a8\u751f\u6210\u63a5\u53e3\u6587\u6863\u548c\u5ba2\u6237\u7aef\u670d\u52a1\u7aef\u4ee3\u7801\uff0c\u505a\u5230\u8c03\u7528\u7aef\u4ee3\u7801\u3001\u670d\u52a1\u7aef\u4ee3\u7801\u4ee5\u53ca\u63a5\u53e3\u6587\u6863\u7684\u4e00\u81f4\u6027\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0cSwagger \u662f\u4e00\u4e2a\u89c4\u8303\u548c\u5b8c\u6574\u7684\u6846\u67b6\uff0c\u7528\u4e8e\u751f\u6210\u3001\u63cf\u8ff0\u3001\u8c03\u7528\u548c\u53ef\u89c6\u5316",Object(r.b)("inlineCode",{parentName:"p"},"RESTful")," \u98ce\u683c\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Web")," \u670d\u52a1\u3002"),Object(r.b)("p",null,"\u603b\u4f53\u76ee\u6807\u662f\u4f7f\u5ba2\u6237\u7aef\u548c\u6587\u4ef6\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\u4ee5\u540c\u6837\u7684\u901f\u5ea6\u6765\u66f4\u65b0\u3002\u6587\u4ef6\u7684\u65b9\u6cd5\u3001\u53c2\u6570\u548c\u6a21\u578b\u7d27\u5bc6\u96c6\u6210\u5230\u670d\u52a1\u5668\u7aef\u7684\u4ee3\u7801\uff0c\u5141\u8bb8 API \u6765\u59cb\u7ec8\u4fdd\u6301\u540c\u6b65\u3002",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u8ba9\u90e8\u7f72\u7ba1\u7406\u548c\u4f7f\u7528\u529f\u80fd\u5f3a\u5927\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"API")," \u4ece\u672a\u5982\u6b64\u7b80\u5355\u3002"),Object(r.b)("h2",{id:"65-swagger-\u4f7f\u7528"},"6.5 Swagger \u4f7f\u7528"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u4e14\u7075\u6d3b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u914d\u7f6e\uff0c\u65e0\u9700\u589e\u52a0\u989d\u5916\u5b66\u4e60\u6210\u672c\u3002"),Object(r.b)("h3",{id:"651-\u6ce8\u518c\u670d\u52a1"},"6.5.1 \u6ce8\u518c\u670d\u52a1"),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},".AddSpecificationDocuments()")," \u9ed8\u8ba4\u5df2\u7ecf\u7ee7\u627f\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002"),Object(r.b)("p",{parentName:"div"},"\u53e6\u5916 ",Object(r.b)("inlineCode",{parentName:"p"},".UseInject()")," \u4e5f\u5df2\u7ecf\u5305\u542b\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},".UseSpecificationDocuments()")," \u6ce8\u518c\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002"))),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11,21} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11,21}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddSpecificationDocuments();\n services.AddControllers();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n // Other Codes\n\n app.UseSpecificationDocuments();\n\n app.UseEndpoints(endpoints =>\n {\n endpoints.MapControllers();\n });\n }\n }\n}\n")),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"services.AddSpecificationDocuments()")," \u901a\u5e38\u548c ",Object(r.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u6210\u5bf9\u51fa\u73b0\u3002"))),Object(r.b)("h3",{id:"652-\u9ed8\u8ba4\u5730\u5740"},"6.5.2 \u9ed8\u8ba4\u5730\u5740"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"p"},"\u89c4\u8303\u5316\u6587\u6863")," \u5730\u5740\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"/api")," \u76ee\u5f55\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"),"\u3002"),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger1.png")}),Object(r.b)("p",null,"\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},'app.UseInject("\u8def\u7531")')," \u65b9\u5f0f\uff0c\u5982")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'app.UseInject("testapi"); // \u90a3\u4e48 /testapi \u5c31\u662f\u89c4\u8303\u5316\u5730\u5740\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e"),"\uff1a")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),'{\n "SpecificationDocumentSettings": {\n "RoutePrefix": "testapi"\n }\n}\n')),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u914d\u7f6e\u6587\u4ef6\u4f18\u5148\u7ea7\u5927\u4e8e ",Object(r.b)("inlineCode",{parentName:"strong"},"UseInject()")," \u65b9\u5f0f")),Object(r.b)("h3",{id:"653-\u9ed8\u8ba4\u5206\u7ec4"},"6.5.3 \u9ed8\u8ba4\u5206\u7ec4"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u9ed8\u8ba4\u5206\u7ec4\u540d\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"Default"),"\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"),"\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),'{\n "SpecificationDocumentSettings": {\n "DefaultGroupName": "MyGroup"\n }\n}\n')),Object(r.b)("h3",{id:"654-\u6587\u6863\u6ce8\u91ca"},"6.5.4 \u6587\u6863\u6ce8\u91ca"),Object(r.b)("p",null,"\u89c4\u8303\u5316\u6587\u6863\u9ed8\u8ba4\u626b\u63cf ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Application"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Entry")," \u4e09\u4e2a\u7a0b\u5e8f\u96c6",Object(r.b)("inlineCode",{parentName:"p"},".xml")," \u6ce8\u91ca\u6587\u4ef6\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"),"\u3002"),Object(r.b)("p",null,"\u53ea\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"///")," \u6807\u8bc6\u7684\u6ce8\u91ca\u8bed\u6cd5\uff0c\u5982\uff1a",Object(r.b)("strong",{parentName:"p"},"\u7c7b\u3001\u65b9\u6cd5\u3001\u5c5e\u6027\u3001\u53c2\u6570\u3001\u8fd4\u56de\u503c\u3001\u9a8c\u8bc1\u7279\u6027"),"\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5-7,10-13,19-23}","{5-7,10-13,19-23}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n /// \n /// \u7c7b\u6ce8\u91ca\n /// \n public class FurAppService : IDynamicApiController\n {\n /// \n /// \u65b9\u6cd5\u6ce8\u91ca\n /// \n /// \n public string Get()\n {\n return nameof(Furion);\n }\n\n /// \n /// \u5e26 ID \u53c2\u6570\u7684\u65b9\u6cd5\u6ce8\u91ca\n /// \n /// \n /// \n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger2.png")}),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c\u6587\u6863\u6ce8\u91ca\u6ca1\u6709\u663e\u793a\uff0c\u8bf7\u68c0\u67e5\u9879\u76ee ",Object(r.b)("inlineCode",{parentName:"p"},"\u5c5e\u6027->\u751f\u6210->\u8f93\u51fa")," \u4e2d XML \u6587\u6863\u662f\u5426\u914d\u7f6e\u8f93\u51fa\u8def\u5f84\u3002"))),Object(r.b)("div",{className:"admonition admonition-info alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Debug")," \u6a21\u5f0f\u4e0b\u548c ",Object(r.b)("inlineCode",{parentName:"p"},"Release")," \u6a21\u5f0f\u4e0b\u7684\u6ce8\u91ca\u6587\u4ef6\u662f\u4e0d\u901a\u7528\u7684\uff0c\u6240\u4ee5\u5bfc\u81f4\u5f88\u591a\u5f00\u53d1\u8005\u53d1\u5e03\u5230\u670d\u52a1\u5668\u4e0a\u53d1\u73b0\u6ca1\u6709\u663e\u793a\u6ce8\u91ca\u3002\u6211\u4eec\u53ea\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Visual Studio")," \u4e2d\u5207\u6362 ",Object(r.b)("inlineCode",{parentName:"p"},"Debug")," \u6a21\u5f0f\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"Release"),"\uff0c\u7136\u540e\u91cd\u65b0\u914d\u7f6e\u4e00\u6b21\u5373\u53ef\u3002"),Object(r.b)("p",{parentName:"div"},"\u8fd9\u6837\u4e0d\u7ba1\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Debug")," \u8fd8\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Release")," \u6a21\u5f0f\u90fd\u4f1a\u663e\u793a\u6ce8\u91ca\u4e86\u3002"))),Object(r.b)("h3",{id:"655-\u591a\u5206\u7ec4\u652f\u6301"},"6.5.5 \u591a\u5206\u7ec4\u652f\u6301"),Object(r.b)("p",null,"\u591a\u5206\u7ec4\u662f\u4e00\u4e2a\u7cfb\u7edf\u4e2d\u5fc5\u5907\u529f\u80fd\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u7cfb\u7edf\u5212\u5206\u4e3a\u591a\u4e2a\u6a21\u5757\uff0c\u6bcf\u4e2a\u6a21\u5757\u90fd\u72ec\u7acb\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"api")," \u914d\u7f6e\u3002\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5b9e\u73b0\u591a\u5206\u7ec4\u975e\u5e38\u7b80\u5355\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,21,32}","{5,21,32}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings("Group1")]\n public class FurAppService : IDynamicApiController\n {\n /// \n /// \u968f\u7236\u7c7b Group1 \u5206\u7ec4\n /// \n /// \n public string Post()\n {\n return nameof(Furion);\n }\n\n /// \n /// \u5728 Group1\u3001Group3 \u90fd\u6709\u6211\n /// \n /// \n [ApiDescriptionSettings("Group1", "Group3")]\n public string Get()\n {\n return nameof(Furion);\n }\n\n /// \n /// \u6211\u53ea\u5728 Group2 \u51fa\u73b0\n /// \n /// \n /// \n [ApiDescriptionSettings("Group2")]\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger3.gif")}),Object(r.b)("h3",{id:"656-\u591a\u5206\u7ec4\u6392\u5e8f"},"6.5.6 \u591a\u5206\u7ec4\u6392\u5e8f"),Object(r.b)(b.a,{defaultValue:"fz1",values:[{label:"\u65b9\u5f0f\u4e00",value:"fz1"},{label:"\u65b9\u5f0f\u4e8c",value:"fz2"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"fz1",mdxType:"TabItem"},Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u901a\u8fc7\u5206\u7ec4\u540d\u79f0\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"strong"},"@\u6574\u6570")," \u8fdb\u884c\u6392\u5e8f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings("Group1@1")]\n public class FurAppService : IDynamicApiController\n {\n public string Post()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings("Group1", "Group3")]\n public string Get()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings("Group@2")]\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u53ef\u4ee5\u901a\u8fc7\u5728\u5206\u7ec4\u540d\u540e\u9762\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"p"},"@\u6574\u6570")," \u8fdb\u884c\u6392\u5e8f\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"\u6574\u6570")," \u8d8a\u5927\u6392\u524d\u9762\u3002\u5982\u679c\u5206\u7ec4\u540d\u79f0\u591a\u6b21\u6307\u5b9a\u4e14\u591a\u6b21\u6307\u5b9a\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"@\u6574\u6570")," \uff0c\u5219\u81ea\u52a8",Object(r.b)("strong",{parentName:"p"},"\u53d6\u8be5\u5206\u7ec4\u6700\u5927\u7684\u6574\u6570"),"\u8fdb\u884c\u6392\u5e8f\u3002")),Object(r.b)(l.a,{value:"fz2",mdxType:"TabItem"},Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e\u6392\u5e8f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-17} title="Furion.Web.Entry/appsettings.json"',"{2-17}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Order": 1\n },\n {\n "Group": "Group2",\n "Order": 2\n },\n {\n "Group": "Group3",\n "Order": 0\n }\n ]\n }\n}\n')))),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger5.png")}),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u6392\u5e8f\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5206\u7ec4\u9ed8\u8ba4\u6392\u5e8f ",Object(r.b)("inlineCode",{parentName:"p"},"Order")," \u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"0"),"\u3002\u5982\u679c\u540c\u65f6\u914d\u7f6e\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"@\u6574\u6570")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4e48\u4f18\u5148\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Order")))),Object(r.b)("h3",{id:"657-\u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e"},"6.5.7 \u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u53ef\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"appsetting.json")," \u914d\u7f6e\u5206\u7ec4\u4fe1\u606f\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{3-20} title="Furion.Web.Entry/appsettings.json"',"{3-20}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Title": "\u5206\u7ec4\u6807\u9898",\n "Description": "\u8fd9\u91cc\u662f\u5206\u7ec4\u63cf\u8ff0",\n "Version": "\u7248\u672c\u53f7",\n "TermsOfService": "https://furion.pro",\n "Contact": {\n "Name": "\u767e\u5c0f\u50e7",\n "Url": "https://gitee.com/monksoul",\n "Email": "monksoul@outlook.com"\n },\n "License": {\n "Name": "Apache-2.0",\n "Url": "https://gitee.com/monksoul/Furion/blob/alpha/LICENSE"\n }\n }\n ]\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger5.png")}),Object(r.b)("h3",{id:"658-\u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09"},"6.5.8 \u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Tag")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u6807\u7b7e\u5206\u7ec4\u4fe1\u606f\u53ca\u5408\u5e76\u6807\u7b7e\u3002\u4e5f\u5c31\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"\u7ec4\u4e2d\u7ec4"),":"),Object(r.b)(b.a,{defaultValue:"tag1",values:[{label:"\u6807\u7b7e\u547d\u540d",value:"tag1"},{label:"\u5408\u5e76\u6807\u7b7e",value:"tag2"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"tag1",mdxType:"TabItem"},Object(r.b)("h4",{id:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"},"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n")),Object(r.b)("h4",{id:"\u8d34\u6807\u7b7e\u4e4b\u540e"},"\u8d34\u6807\u7b7e\u4e4b\u540e"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e00")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e8c")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/tag1.png")})),Object(r.b)(l.a,{value:"tag2",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/tag2.png")}))),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c ",Object(r.b)("inlineCode",{parentName:"p"},"Tag")," \u540d\u5b57\u4e00\u6837\uff0c\u5219\u4f1a\u81ea\u52a8\u5408\u5e76\uff0c\u5426\u5219\u53ea\u662f\u547d\u540d\u3002"))),Object(r.b)("h3",{id:"659-\u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863"},"6.5.9 \u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "DocExpansionState": "Full"\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger6.gif")}),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"DocExpansionState")," \u914d\u7f6e\u8bf4\u660e\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"List"),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",Object(r.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Full"),"\uff1a\u5b8c\u5168\u5c55\u5f00"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"None"),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09")),Object(r.b)("h3",{id:"6510-\u914d\u7f6e\u6587\u6863\u6807\u9898"},"6.5.10 \u914d\u7f6e\u6587\u6863\u6807\u9898"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "DocumentTitle": "\u6211\u662f\u81ea\u5b9a\u4e49\u6807\u9898"\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger7.png")}),Object(r.b)("h3",{id:"6511-\u6388\u6743\u63a7\u5236"},"6.5.11 \u6388\u6743\u63a7\u5236"),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u65b0\u7248\u672c ",Object(r.b)("inlineCode",{parentName:"strong"},"Furion")," \u5df2\u7ecf\u542f\u7528\u4e86\u9ed8\u8ba4\u6388\u6743\u4e86\uff0c\u65e0\u9700\u624b\u52a8\u6388\u6743"),"\uff0c\u5982\u9700\u624b\u52a8\u914d\u7f6e\uff0c\u53ef\u624b\u52a8\u6dfb\u52a0\u4ee5\u4e0b\u7c7b\u4f3c\u914d\u7f6e\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'title="Furion.Web.Entry/appsettings.json"',title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "EnableAuthorized": true,\n\n "SecurityDefinitions": [\n {\n "Id": "Bearer",\n "Type": "Http",\n "Name": "Authorization",\n "Description": "JWT Authorization header using the Bearer scheme.",\n "BearerFormat": "JWT",\n "Scheme": "bearer",\n "In": "Header",\n\n "Requirement": {\n "Scheme": {\n "Reference": {\n "Id": "Bearer",\n "Type": "SecurityScheme"\n },\n "Accesses": []\n }\n }\n }\n ]\n }\n}\n')),Object(r.b)("h3",{id:"6512-\u5728\u7ebf\u6d4b\u8bd5"},"6.5.12 \u5728\u7ebf\u6d4b\u8bd5"),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger8.gif")}),Object(r.b)("h3",{id:"6513-\u6027\u80fd\u76d1\u89c6-miniprofiler"},"6.5.13 \u6027\u80fd\u76d1\u89c6 ",Object(r.b)("inlineCode",{parentName:"h3"},"MiniProfiler")),Object(r.b)("p",null,"\u89c4\u8303\u5316\u6587\u6863\u9ed8\u8ba4\u96c6\u6210\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"MiniProfiler")," \u7b2c\u4e09\u65b9\u6027\u80fd\u7ec4\u4ef6\uff0c\u901a\u8fc7\u8be5\u7ec4\u4ef6\u53ef\u4ee5\u65b9\u4fbf\u67e5\u770b\u8bf7\u6c42\u6027\u80fd\u3001\u5f02\u5e38\u5806\u6808\u3001\u6570\u636e\u5e93\u64cd\u4f5c\u7b49\u4fe1\u606f\u3002\u9ed8\u8ba4\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u9996\u9875\u5de6\u4e0a\u89d2\u663e\u793a\u3002"),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/mipr.png")}),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"appsetting.json"))," \u4e2d ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"AppSettings:InjectMiniProfiler"))," \u8bbe\u4e3a ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"false"))," \u5173\u95ed\u3002"))),Object(r.b)("h3",{id:"6514-\u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b"},"6.5.14 \u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8-9}","{2,8-9}":!0}),"using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [ProducesResponseType(201, Type = typeof(TestDto))]\n [ProducesResponseType(400)]\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/fhzlx.png")}),Object(r.b)("h3",{id:"6515-\u9690\u85cf\u7279\u5b9a\u5206\u7ec4"},"6.5.15 \u9690\u85cf\u7279\u5b9a\u5206\u7ec4"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u65b0\u7248\u672c\u63d0\u4f9b\u4e86\u9690\u85cf\u5206\u7ec4\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Visible")," \u914d\u7f6e\uff0c\u8bbe\u7f6e\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"false")," \u4e4b\u540e\u8be5\u5206\u7ec4\u5c06\u4e0d\u663e\u793a\u5728\u89c4\u8303\u5316\u6587\u6863\u4e2d\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'title="appsetting.json"',title:'"appsetting.json"'}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Visible": false\n }\n ]\n }\n}\n')),Object(r.b)("h3",{id:"6516-\u4e2d\u6587\u4e71\u7801\u95ee\u9898"},"6.5.16 \u4e2d\u6587\u4e71\u7801\u95ee\u9898"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b,",Object(r.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\u5e76\u672a\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"utf-8")," \u7f16\u7801\uff0c\u6240\u4ee5\u5982\u679c\u914d\u7f6e\u4e2d\u6587\u5206\u7ec4\u4fe1\u606f\u5c31\u4f1a\u51fa\u73b0\u4e71\u7801\u60c5\u51b5\uff0c\u8fd9\u65f6\u5019\uff0c\u53ea\u9700\u8981\u4fee\u6539 ",Object(r.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\u7f16\u7801\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"utf-8")," \u5373\u53ef\u3002"),Object(r.b)("h2",{id:"66-specificationdocumentsettings-\u914d\u7f6e"},"6.6 ",Object(r.b)("inlineCode",{parentName:"h2"},"SpecificationDocumentSettings")," \u914d\u7f6e"),Object(r.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0\u4f8b\u5b50\u5916\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u4e00\u4e9b\u914d\u7f6e\u9009\u9879\uff0c\u5982\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DocumentTitle"),"\uff1a\u6587\u6863\u6807\u9898\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Specification Api Document")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DefaultGroupName"),"\uff1a\u9ed8\u8ba4\u5206\u7ec4\u540d\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Default")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EnableAuthorized"),"\uff1a\u662f\u5426\u542f\u7528\u6743\u9650\u63a7\u5236\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"true")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"FormatAsV2"),"\uff1a\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"Swagger 2.0")," \u7248\u672c\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"RoutePrefix"),"\uff1a\u89c4\u8303\u5316\u6587\u6863\u5730\u5740\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"api"),"\uff0c",Object(r.b)("strong",{parentName:"li"},"\u5982\u679c\u5e0c\u671b\u5728\u9996\u9875\uff0c\u6539\u4e3a\u7a7a\u5b57\u7b26\u4e32\u5373\u53ef"),"\u3002"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DocExpansionState"),"\uff1a\u6587\u6863\u663e\u793a\u65b9\u5f0f\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"DocExpansion"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"List"),"\uff0c\u53d6\u503c\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"List"),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",Object(r.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Full"),"\uff1a\u5b8c\u5168\u5c55\u5f00"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"None"),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"XmlComments"),"\uff1a\u7a0b\u5e8f\u96c6\u6ce8\u91ca\u63cf\u8ff0\u6587\u4ef6\u540d\uff08\u53ef\u5e26 ",Object(r.b)("inlineCode",{parentName:"li"},".xml"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Application, Furion.Web.Entry, Furion.Web.Core")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"GroupOpenApiInfos"),"\uff1a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiInfo[]"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"{ 'Group': 'Default'}")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SecurityDefinitions"),"\uff1a\u5b89\u5168\u7b56\u7565\u5b9a\u4e49\u914d\u7f6e\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiSecurityScheme[]"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"[]")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Servers"),"\uff1a\u914d\u7f6e Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"OpenApiServer[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"[]"),"\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},'{Servers:[ { Url:"\u5730\u5740", Description:"\u63cf\u8ff0"} ]}')),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"HideServers"),"\uff1a\u662f\u5426\u9690\u85cf Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false"))),Object(r.b)("h2",{id:"67-\u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b"},"6.7 \u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b ",Object(r.b)("inlineCode",{parentName:"p"},"\u89c4\u8303\u5316\u7ed3\u679c")," \u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9e\u73b0 ",Object(r.b)("inlineCode",{parentName:"p"},"IUnifyResultProvider")," \u63d0\u4f9b\u5668\u5b9e\u73b0\u7edf\u4e00\u89c4\u8303\u5316\u8fd4\u56de\u503c\u5b9a\u5236\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"RESTfulResultProvider"),"\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16,17}","{16,17}":!0}),'using Furion.DependencyInjection;\nusing Furion.Utilities;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing Microsoft.AspNetCore.Mvc.ModelBinding;\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Furion.UnifyResult\n{\n /// \n /// RESTful \u98ce\u683c\u8fd4\u56de\u503c\n /// \n [SkipScan, UnifyModel(typeof(RESTfulResult<>))]\n public class RESTfulResultProvider : IUnifyResultProvider\n {\n /// \n /// \u5f02\u5e38\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnException(ExceptionContext context)\n {\n // \u89e3\u6790\u5f02\u5e38\u4fe1\u606f\n var (ErrorCode, ErrorContent) = UnifyContext.GetExceptionMetadata(context);\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = ErrorCode,\n Succeeded = false,\n Data = null,\n Errors = ErrorContent,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u6210\u529f\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnSucceeded(ActionExecutedContext context)\n {\n object data;\n // \u5904\u7406\u5185\u5bb9\u7ed3\u679c\n if (context.Result is ContentResult contentResult) data = contentResult.Content;\n // \u5904\u7406\u5bf9\u8c61\u7ed3\u679c\n else if (context.Result is ObjectResult objectResult) data = objectResult.Value;\n else if (context.Result is EmptyResult) data = null;\n else return null;\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = context.Result is EmptyResult ? StatusCodes.Status204NoContent : StatusCodes.Status200OK, // \u5904\u7406\u6ca1\u6709\u8fd4\u56de\u503c\u60c5\u51b5 204\n Succeeded = true,\n Data = data,\n Errors = null,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u9a8c\u8bc1\u5931\u8d25\u8fd4\u56de\u503c\n /// \n /// \n /// \n /// \n /// \n /// \n public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, Dictionary> validationResults, string validateFailedMessage)\n {\n return new JsonResult(new RESTfulResult\n {\n StatusCode = StatusCodes.Status400BadRequest,\n Succeeded = false,\n Data = null,\n Errors = validationResults,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u5904\u7406\u8f93\u51fa\u72b6\u6001\u7801\n /// \n /// \n /// \n /// \n public async Task OnResponseStatusCodes(HttpContext context, int statusCode)\n {\n switch (statusCode)\n {\n // \u5904\u7406 401 \u72b6\u6001\u7801\n case StatusCodes.Status401Unauthorized:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status401Unauthorized,\n Succeeded = false,\n Data = null,\n Errors = "401 Unauthorized",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n // \u5904\u7406 403 \u72b6\u6001\u7801\n case StatusCodes.Status403Forbidden:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status403Forbidden,\n Succeeded = false,\n Data = null,\n Errors = "403 Forbidden",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n\n default:\n break;\n }\n }\n }\n}\n')),Object(r.b)("p",null,"\u4e4b\u540e\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u5373\u53ef\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddControllers()\n .AddInjectWithUnifyResult();\n")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u89c4\u8303\u5316\u7ed3\u679c\u4e0d\u4f1a\u5bf9 ",Object(r.b)("inlineCode",{parentName:"p"},"401")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"403")," \u72b6\u6001\u7801\u8fdb\u884c\u89c4\u8303\u5316\u5904\u7406\uff0c\u5982\u9700\u542f\u52a8\u8be5\u72b6\u6001\u7801\u5904\u7406\uff0c\u53ea\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Configure")," \u4e2d\u542f\u7528\u63a5\u53e3\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n // \u6dfb\u52a0\u89c4\u8303\u5316\u7ed3\u679c\u72b6\u6001\u7801\uff0c\u9700\u8981\u5728\u8fd9\u91cc\u6ce8\u518c\n app.UseUnifyResultStatusCodes();\n // \u5176\u4ed6\u6ce8\u518c...\n}\n")))),Object(r.b)("h3",{id:"671-\u6392\u9664\u89c4\u8303\u5316\u5904\u7406"},"6.7.1 \u6392\u9664\u89c4\u8303\u5316\u5904\u7406"),Object(r.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u67d0\u4e9b\u63a5\u53e3\u4e0d\u9700\u8981\u8fdb\u884c\u89c4\u8303\u5316\u5904\u7406\uff0c\u8fd9\u65f6\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5e16 ",Object(r.b)("inlineCode",{parentName:"p"},"[NonUnify]")," \u7279\u6027\u5373\u53ef\u3002"),Object(r.b)("h3",{id:"672-\u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e"},"6.7.2 \u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e"),Object(r.b)("p",null,"\u9ed8\u8ba4\u7684\u89c4\u8303\u5316\u7ed3\u679c\u4e2d\u5305\u542b ",Object(r.b)("inlineCode",{parentName:"p"},"extras")," \u5c5e\u6027\uff0c\u53ef\u4ee5\u914d\u7f6e\u989d\u5916\u6570\u636e\u8fd4\u56de\u5230\u5ba2\u6237\u7aef\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'UnifyContext.Fill(new { Message = "\u64cd\u4f5c\u6210\u529f" });\n')),Object(r.b)("h2",{id:"68-\u53cd\u9988\u4e0e\u5efa\u8bae"},"6.8 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),i=t(191);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return d}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var o=i.a.createContext({}),p=function(e){var n=i.a.useContext(o),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(o.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},m=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=p(t),m=a,d=s["".concat(c,".").concat(m)]||s[m]||u[m]||r;return t?i.a.createElement(d,b(b({ref:n},o),{},{components:t})):i.a.createElement(d,b({ref:n},o))}));function d(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=m;var b={};for(var l in n)hasOwnProperty.call(n,l)&&(b[l]=n[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,c[1]=b;for(var o=2;on(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&N(e)}const v=e=>{N(e),null!=u&&j(u,e)},f=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(c.a)("tabs",{"tabs--block":t},m)},s.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":O===e,className:Object(c.a)("tabs__item",l.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>f.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case p:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case o:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(f,e.target,e)},onFocus:()=>v(e),onClick:()=>{v(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===O)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==O}))))}},200:function(e,n,t){"use strict";var a=t(3),i=t(0),r=t.n(i);n.a=function({children:e,hidden:n,className:t}){return r.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[99],{173:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return p})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return u})),t.d(n,"default",(function(){return d}));var a=t(3),i=t(7),r=(t(0),t(196)),c=t(194),b=t(203),l=t(204),o=t(197),p={id:"specification-document",title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",sidebar_label:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863"},s={unversionedId:"specification-document",id:"specification-document",isDocsHomePage:!1,title:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",description:"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",source:"@site/docs\\specification-document.mdx",slug:"/specification-document",permalink:"/docs/specification-document",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/specification-document.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863",sidebar:"docs",previous:{title:"5. \u52a8\u6001 WebAPI",permalink:"/docs/dynamic-api-controller"},next:{title:"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406",permalink:"/docs/friendly-exception"}},u=[{value:"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",id:"61-\u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863",children:[]},{value:"6.2 \u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863",id:"62-\u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863",children:[]},{value:"6.3 \u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863",id:"63-\u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863",children:[{value:"6.3.1 \u534f\u8bae\u89c4\u8303",id:"631-\u534f\u8bae\u89c4\u8303",children:[]},{value:"6.3.2 \u63a5\u53e3\u8def\u5f84\u89c4\u8303",id:"632-\u63a5\u53e3\u8def\u5f84\u89c4\u8303",children:[]},{value:"6.3.3 \u7248\u672c\u63a7\u5236\u89c4\u8303",id:"633-\u7248\u672c\u63a7\u5236\u89c4\u8303",children:[]},{value:"6.3.4 \u63a5\u53e3\u547d\u540d\u89c4\u8303",id:"634-\u63a5\u53e3\u547d\u540d\u89c4\u8303",children:[]},{value:"6.3.5 \u8bf7\u6c42\u53c2\u6570\u89c4\u8303",id:"635-\u8bf7\u6c42\u53c2\u6570\u89c4\u8303",children:[]},{value:"6.3.6 \u8fd4\u56de\u6570\u636e\u89c4\u8303",id:"636-\u8fd4\u56de\u6570\u636e\u89c4\u8303",children:[]}]},{value:"6.4 \u4ec0\u4e48\u662f Swagger",id:"64-\u4ec0\u4e48\u662f-swagger",children:[]},{value:"6.5 Swagger \u4f7f\u7528",id:"65-swagger-\u4f7f\u7528",children:[{value:"6.5.1 \u6ce8\u518c\u670d\u52a1",id:"651-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"6.5.2 \u9ed8\u8ba4\u5730\u5740",id:"652-\u9ed8\u8ba4\u5730\u5740",children:[]},{value:"6.5.3 \u9ed8\u8ba4\u5206\u7ec4",id:"653-\u9ed8\u8ba4\u5206\u7ec4",children:[]},{value:"6.5.4 \u6587\u6863\u6ce8\u91ca",id:"654-\u6587\u6863\u6ce8\u91ca",children:[]},{value:"6.5.5 \u591a\u5206\u7ec4\u652f\u6301",id:"655-\u591a\u5206\u7ec4\u652f\u6301",children:[]},{value:"6.5.6 \u591a\u5206\u7ec4\u6392\u5e8f",id:"656-\u591a\u5206\u7ec4\u6392\u5e8f",children:[]},{value:"6.5.7 \u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e",id:"657-\u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e",children:[]},{value:"6.5.8 \u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09",id:"658-\u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09",children:[]},{value:"6.5.9 \u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863",id:"659-\u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863",children:[]},{value:"6.5.10 \u914d\u7f6e\u6587\u6863\u6807\u9898",id:"6510-\u914d\u7f6e\u6587\u6863\u6807\u9898",children:[]},{value:"6.5.11 \u6388\u6743\u63a7\u5236",id:"6511-\u6388\u6743\u63a7\u5236",children:[]},{value:"6.5.12 \u5728\u7ebf\u6d4b\u8bd5",id:"6512-\u5728\u7ebf\u6d4b\u8bd5",children:[]},{value:"6.5.13 \u6027\u80fd\u76d1\u89c6 MiniProfiler",id:"6513-\u6027\u80fd\u76d1\u89c6-miniprofiler",children:[]},{value:"6.5.14 \u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b",id:"6514-\u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b",children:[]},{value:"6.5.15 \u9690\u85cf\u7279\u5b9a\u5206\u7ec4",id:"6515-\u9690\u85cf\u7279\u5b9a\u5206\u7ec4",children:[]},{value:"6.5.16 \u4e2d\u6587\u4e71\u7801\u95ee\u9898",id:"6516-\u4e2d\u6587\u4e71\u7801\u95ee\u9898",children:[]}]},{value:"6.6 SpecificationDocumentSettings \u914d\u7f6e",id:"66-specificationdocumentsettings-\u914d\u7f6e",children:[]},{value:"6.7 \u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b",id:"67-\u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b",children:[{value:"6.7.1 \u6392\u9664\u89c4\u8303\u5316\u5904\u7406",id:"671-\u6392\u9664\u89c4\u8303\u5316\u5904\u7406",children:[]},{value:"6.7.2 \u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e",id:"672-\u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e",children:[]}]},{value:"6.8 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"68-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:u};function d(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(r.b)("wrapper",Object(a.a)({},m,t,{components:n,mdxType:"MDXLayout"}),Object(r.b)(o.a,{mdxType:"JoinGroup"}),Object(r.b)("h2",{id:"61-\u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863"},"6.1 \u4ec0\u4e48\u662f\u63a5\u53e3\u6587\u6863"),Object(r.b)("p",null,"\u5728\u73b0\u5728\u79fb\u52a8\u4e3a\u738b\u3001\u591a\u7aef\u4e92\u8f85\u3001\u524d\u7aef\u767e\u82b1\u9f50\u653e\u7684\u5f00\u653e\u65f6\u4ee3\uff0c\u4e0d\u518d\u662f\u4e00\u4eba\u5305\u63fd\u5f0f\u5f00\u53d1\uff0c\u5927\u5bb6\u5404\u53f8\u5176\u804c\uff0c\u540e\u7aef\u5de5\u7a0b\u5e08\u8d1f\u8d23\u63a5\u53e3\u5f00\u53d1\uff0c\u524d\u7aef\u8d1f\u8d23\u63a5\u53e3\u8054\u8c03\uff0c\u4e5f\u5c31\u662f\u4e92\u8054\u7f51\u73b0\u5728\u6d41\u884c\u7684\u524d\u540e\u7aef\u5206\u79bb\u67b6\u6784\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\u5c31\u9700\u8981\u7531\u524d\u540e\u7aef\u5de5\u7a0b\u5e08\u5171\u540c\u5b9a\u4e49\u63a5\u53e3\uff0c\u7f16\u5199\u63a5\u53e3\u6587\u6863\uff0c\u4e4b\u540e\u5927\u5bb6\u6309\u7167\u8fd9\u4e2a\u63a5\u53e3\u6587\u6863\u8fdb\u884c\u5f00\u53d1\u3001\u7ef4\u62a4\u53ca\u5f00\u653e\u7ed9\u7b2c\u4e09\u65b9\u3002"),Object(r.b)("h2",{id:"62-\u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863"},"6.2 \u4e3a\u4ec0\u4e48\u8981\u5199\u63a5\u53e3\u6587\u6863"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},"\u80fd\u591f\u8ba9\u524d\u7aef\u5f00\u53d1\u4e0e\u540e\u53f0\u5f00\u53d1\u4eba\u5458\u66f4\u597d\u7684\u914d\u5408\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387"),Object(r.b)("li",{parentName:"ul"},"\u9879\u76ee\u8fed\u4ee3\u6216\u8005\u9879\u76ee\u4eba\u5458\u66f4\u8fed\u65f6\uff0c\u65b9\u4fbf\u540e\u671f\u4eba\u5458\u67e5\u770b\u548c\u7ef4\u62a4"),Object(r.b)("li",{parentName:"ul"},"\u65b9\u4fbf\u6d4b\u8bd5\u4eba\u5458\u8fdb\u884c\u63a5\u53e3\u6d4b\u8bd5")),Object(r.b)("h2",{id:"63-\u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863"},"6.3 \u4e3a\u4ec0\u4e48\u9700\u8981\u89c4\u8303\u5316\u6587\u6863"),Object(r.b)("p",null,"\u7531\u4e8e\u6bcf\u4e2a\u516c\u53f8\u540e\u7aef\u4eba\u5458\u6280\u672f\u53c2\u5dee\u4e0d\u9f50\uff0c\u6280\u672f\u6587\u6863\u80fd\u529b\u4e5f\u4e0d\u4f8b\u5916\uff0c\u5bfc\u81f4\u63a5\u53e3\u5b9a\u4e49\u53ca\u6587\u6863\u4e94\u82b1\u516b\u95e8\uff0c\u4e0d\u540c\u9879\u76ee\u6216\u4e0d\u540c\u516c\u53f8\u5bf9\u63a5\u6781\u5176\u56f0\u96be\uff0c\u800c\u4e14\u4f53\u9a8c\u7cdf\u7cd5\u3002\u6240\u4ee5\uff0c\u65e0\u89c4\u77e9\u4e0d\u6210\u65b9\u5706\uff0c\u4e3a\u4e86\u5f00\u53d1\u4eba\u5458\u95f4\u66f4\u597d\u7684\u914d\u5408\uff0c\u8feb\u5207\u9700\u8981\u6574\u7406\u51fa\u4e00\u5957\u89c4\u8303\u3002"),Object(r.b)("p",null,"\u901a\u5e38\u63a5\u53e3\u89c4\u8303\u5206\u4e3a\u516d\u4e2a\u90e8\u5206\uff1a"),Object(r.b)("h3",{id:"631-\u534f\u8bae\u89c4\u8303"},"6.3.1 \u534f\u8bae\u89c4\u8303"),Object(r.b)("p",null,"\u4e3a\u4e86\u786e\u4fdd\u4e0d\u540c\u7cfb\u7edf/\u6a21\u5757\u95f4\u7684\u6570\u636e\u4ea4\u4e92\uff0c\u9700\u8981\u4e8b\u5148\u7ea6\u5b9a\u597d\u901a\u8baf\u534f\u8bae\uff0c\u5982\uff1aTCP\u3001HTTP\u3001HTTPS \u534f\u8bae\u3002\u4e3a\u4e86\u786e\u4fdd\u6570\u636e\u4ea4\u4e92\u5b89\u5168\uff0c\u5efa\u8bae\u4f7f\u7528 HTTPS \u534f\u8bae"),Object(r.b)("h3",{id:"632-\u63a5\u53e3\u8def\u5f84\u89c4\u8303"},"6.3.2 \u63a5\u53e3\u8def\u5f84\u89c4\u8303"),Object(r.b)("p",null,"\u4f5c\u4e3a\u63a5\u53e3\u8def\u5f84\uff0c\u4e3a\u4e86\u65b9\u4fbf\u6e05\u6670\u7684\u533a\u5206\u6765\u81ea\u4e0d\u540c\u7684\u7cfb\u7edf\uff0c\u53ef\u4ee5\u91c7\u7528\u4e0d\u540c\u7cfb\u7edf/\u6a21\u5757\u540d\u4f5c\u4e3a\u63a5\u53e3\u8def\u5f84\u524d\u7f00\uff0c\u5982\uff1a\u652f\u4ed8\u6a21\u5757\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"/pay/xxx"),"\uff0c\u8ba2\u5355\u6a21\u5757\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"/order/xxx")),Object(r.b)("h3",{id:"633-\u7248\u672c\u63a7\u5236\u89c4\u8303"},"6.3.3 \u7248\u672c\u63a7\u5236\u89c4\u8303"),Object(r.b)("p",null,'\u4e3a\u4e86\u4fbf\u4e8e\u540e\u671f\u63a5\u53e3\u7684\u5347\u7ea7\u548c\u7ef4\u62a4\uff0c\u5efa\u8bae\u5728\u63a5\u53e3\u8def\u5f84\u4e2d\u52a0\u5165\u7248\u672c\u53f7\uff0c\u4fbf\u4e8e\u7ba1\u7406\uff0c\u5b9e\u73b0\u63a5\u53e3\u591a\u7248\u672c\u7684\u53ef\u7ef4\u62a4\u6027\u3002\u5982\uff1a\u63a5\u53e3\u8def\u5f84\u4e2d\u6dfb\u52a0\u7c7b\u4f3c"',Object(r.b)("inlineCode",{parentName:"p"},"v1"),'"\u3001"',Object(r.b)("inlineCode",{parentName:"p"},"v2"),'"\u7b49\u7248\u672c\u53f7'),Object(r.b)("h3",{id:"634-\u63a5\u53e3\u547d\u540d\u89c4\u8303"},"6.3.4 \u63a5\u53e3\u547d\u540d\u89c4\u8303"),Object(r.b)("p",null,'\u548c C# \u547d\u540d\u89c4\u8303\u4e00\u6837\uff0c\u597d\u7684\u3001\u7edf\u4e00\u7684\u63a5\u53e3\u547d\u540d\u89c4\u8303\uff0c\u4e0d\u4ec5\u53ef\u4ee5\u589e\u5f3a\u5176\u53ef\u8bfb\u6027\uff0c\u800c\u4e14\u8fd8\u4f1a\u51cf\u5c11\u5f88\u591a\u4e0d\u5fc5\u8981\u7684\u53e3\u5934/\u4e66\u9762\u4e0a\u7684\u89e3\u91ca\u3002\uff0c\u53ef\u4f7f\u7528"\u9a7c\u5cf0\u547d\u540d\u6cd5"\u6309\u7167\u5b9e\u73b0\u63a5\u53e3\u7684',Object(r.b)("strong",{parentName:"p"},"\u4e1a\u52a1\u7c7b\u578b\u3001\u4e1a\u52a1\u573a\u666f"),"\u7b49\u547d\u540d\uff0c\u6709\u5fc5\u8981\u65f6\u53ef\u91c7\u53d6\u591a\u7ea7\u76ee\u5f55\u547d\u540d\uff0c\u4f46\u76ee\u5f55\u4e0d\u5b9c\u8fc7\u957f\uff0c\u4e24\u7ea7\u76ee\u5f55\u8f83\u4e3a\u9002\u5b9c"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u5e38\u89c1\u547d\u540d\u65b9\u5f0f"),":",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63a5\u53e3\u540d\u79f0\u52a8\u8bcd\u524d/\u540e\u7f00\u5316"),"\uff1a \u63a5\u53e3\u540d\u79f0\u4ee5\u63a5\u53e3\u6570\u636e\u64cd\u4f5c\u7684\u52a8\u8bcd\u4e3a\u524d/\u540e\u7f00\uff0c\u5e38\u89c1\u52a8\u8bcd\u6709\uff1a",Object(r.b)("inlineCode",{parentName:"li"},"Add\u3001Delete\u3001Update\u3001Query\u3001Get\u3001Send\u3001Save\u3001Detail\u3001List"),"\u7b49\uff0c\u5982\uff1a\u65b0\u5efa\u7528\u6237 ",Object(r.b)("inlineCode",{parentName:"li"},"AddUser"),"\u3001\u67e5\u8be2\u8ba2\u5355\u8be6\u60c5 ",Object(r.b)("inlineCode",{parentName:"li"},"QueryOrderDetail"),"\u3002"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u63a5\u53e3\u540d\u79f0\u52a8\u8bcd + \u8bf7\u6c42\u65b9\u5f0f"),"\uff1a\u63a5\u53e3\u8def\u5f84\u4e2d\u5305\u542b\u5177\u4f53\u63a5\u53e3\u540d\u79f0\u7684\u540d\u8bcd\uff0c\u63a5\u53e3\u6570\u636e\u64cd\u4f5c\u52a8\u4f5c\u4ee5 HTTP \u8bf7\u6c42\u65b9\u5f0f\u6765\u533a\u5206\u3002\u5e38\u7528\u7684 HTTP \u8bf7\u6c42\u65b9\u5f0f\u6709\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"GET"),"\uff1a\u4ece\u670d\u52a1\u5668\u53d6\u51fa\u8d44\u6e90\uff08\u4e00\u9879\u6216\u591a\u9879\uff09"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"POST"),"\uff1a\u5728\u670d\u52a1\u5668\u65b0\u5efa\u4e00\u4e2a\u8d44\u6e90"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"PUT"),"\uff1a\u5728\u670d\u52a1\u5668\u66f4\u65b0\u8d44\u6e90\uff08\u5ba2\u6237\u7aef\u63d0\u4f9b\u6539\u53d8\u540e\u7684\u5b8c\u6574\u8d44\u6e90\uff09"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"PATCH"),"\uff1a\u5728\u670d\u52a1\u5668\u66f4\u65b0\u8d44\u6e90\uff08\u5ba2\u6237\u7aef\u63d0\u4f9b\u6539\u53d8\u7684\u5c5e\u6027\uff09"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DELETE"),"\uff1a\u4ece\u670d\u52a1\u5668\u5220\u9664\u8d44\u6e90")))))),Object(r.b)("h3",{id:"635-\u8bf7\u6c42\u53c2\u6570\u89c4\u8303"},"6.3.5 \u8bf7\u6c42\u53c2\u6570\u89c4\u8303"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u65b9\u5f0f"),"\uff1a\u6309\u7167 ",Object(r.b)("inlineCode",{parentName:"li"},"GET\u3001POST\u3001PUT")," \u7b49\u542b\u4e49\u5b9a\u4e49\uff0c\u907f\u514d\u51fa\u73b0\u4e0d\u4e00\u81f4\u73b0\u8c61\uff0c\u5bf9\u4eba\u9020\u6210\u8bef\u89e3\u3001\u6b67\u4e49",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u5934"),"\uff1a\u8bf7\u6c42\u5934\u6839\u636e\u9879\u76ee\u9700\u6c42\u6dfb\u52a0\u914d\u7f6e\u53c2\u6570\u3002\u5982\uff1a\u8bf7\u6c42\u6570\u636e\u683c\u5f0f\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"accept=application/json")," \u7b49\u3002\u5982\u6709\u9700\u8981\uff0c\u8bf7\u6c42\u5934\u53ef\u6839\u636e\u9879\u76ee\u9700\u6c42\u8981\u6c42\u4f20\u5165\u7528\u6237 token\u3001\u552f\u4e00\u9a8c\u7b7e\u7801\u7b49\u52a0\u5bc6\u6570\u636e"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u8bf7\u6c42\u53c2\u6570/\u8bf7\u6c42\u4f53"),"\uff1a \u8bf7\u6c42\u53c2\u6570\u5b57\u6bb5\uff0c\u5c3d\u53ef\u80fd\u4e0e\u6570\u636e\u5e93\u8868\u5b57\u6bb5\u3001\u5bf9\u8c61\u5c5e\u6027\u540d\u7b49\u4fdd\u6301\u4e00\u81f4\uff0c\u56e0\u4e3a\u4fdd\u6301\u4e00\u81f4\u662f\u6700\u7701\u4e8b\uff0c\u6700\u8212\u670d\u7684\u4e00\u4ef6\u4e8b")))),Object(r.b)("h3",{id:"636-\u8fd4\u56de\u6570\u636e\u89c4\u8303"},"6.3.6 \u8fd4\u56de\u6570\u636e\u89c4\u8303"),Object(r.b)("p",null,"\u7edf\u4e00\u89c4\u8303\u8fd4\u56de\u6570\u636e\u7684\u683c\u5f0f\uff0c\u5bf9\u5df1\u5bf9\u5f7c\u90fd\u6709\u597d\u5904\uff0c\u6b64\u5904\u4ee5 json \u683c\u5f0f\u4e3a\u4f8b\u3002\u8fd4\u56de\u6570\u636e\u5e94\u5305\u542b\uff1a",Object(r.b)("strong",{parentName:"p"},"\u8fd4\u56de\u72b6\u6001\u7801\u3001\u8fd4\u56de\u72b6\u6001\u4fe1\u606f\u3001\u5177\u4f53\u6570\u636e"),"\u3002",Object(r.b)("strong",{parentName:"p"},"\u8fd4\u56de\u6570\u636e\u4e2d\u7684\u72b6\u6001\u7801\u3001\u72b6\u6001\u4fe1\u606f\uff0c\u5e38\u6307\u5177\u4f53\u7684\u4e1a\u52a1\u72b6\u6001\uff0c\u4e0d\u5efa\u8bae\u548c HTTP \u72b6\u6001\u7801\u6df7\u5728\u4e00\u8d77"),"\u3002HTTP \u72b6\u6001\uff0c\u662f\u7528\u6765\u4f53\u73b0 HTTP \u94fe\u8def\u72b6\u6001\u60c5\u51b5\uff0c\u5982\uff1a404-Not Found\u3002HTTP \u72b6\u6001\u7801\u548c json \u7ed3\u679c\u4e2d\u7684\u72b6\u6001\u7801\uff0c\u5e76\u5b58\u5c1a\u53ef\uff0c\u7528\u4e8e\u4f53\u73b0\u4e0d\u540c\u7ef4\u5ea6\u7684\u72b6\u6001\u3002"),Object(r.b)("h2",{id:"64-\u4ec0\u4e48\u662f-swagger"},"6.4 \u4ec0\u4e48\u662f Swagger"),Object(r.b)("p",null,"\u76f8\u4fe1\u65e0\u8bba\u662f\u524d\u7aef\u8fd8\u662f\u540e\u7aef\u5f00\u53d1\uff0c\u90fd\u6216\u591a\u6216\u5c11\u5730\u88ab\u63a5\u53e3\u6587\u6863\u6298\u78e8\u8fc7\u3002\u524d\u7aef\u7ecf\u5e38\u62b1\u6028\u540e\u7aef\u7ed9\u7684\u63a5\u53e3\u6587\u6863\u4e0e\u5b9e\u9645\u60c5\u51b5\u4e0d\u4e00\u81f4\u3002\u540e\u7aef\u53c8\u89c9\u5f97\u7f16\u5199\u53ca\u7ef4\u62a4\u63a5\u53e3\u6587\u6863\u4f1a\u8017\u8d39\u4e0d\u5c11\u7cbe\u529b\uff0c\u7ecf\u5e38\u6765\u4e0d\u53ca\u66f4\u65b0\u3002"),Object(r.b)("p",null,"\u5176\u5b9e\u65e0\u8bba\u662f\u524d\u7aef\u8c03\u7528\u540e\u7aef\uff0c\u8fd8\u662f\u540e\u7aef\u8c03\u7528\u540e\u7aef\uff0c\u90fd\u671f\u671b\u6709\u4e00\u4e2a\u597d\u7684\u63a5\u53e3\u6587\u6863\u3002\u4f46\u662f\u8fd9\u4e2a\u63a5\u53e3\u6587\u6863\u5bf9\u4e8e\u7a0b\u5e8f\u5458\u6765\u8bf4\uff0c\u5c31\u8ddf\u6ce8\u91ca\u4e00\u6837\uff0c\u7ecf\u5e38\u4f1a\u62b1\u6028\u522b\u4eba\u5199\u7684\u4ee3\u7801\u6ca1\u6709\u5199\u6ce8\u91ca\uff0c\u7136\u800c\u81ea\u5df1\u5199\u8d77\u4ee3\u7801\u8d77\u6765\uff0c\u6700\u8ba8\u538c\u7684\uff0c\u4e5f\u662f\u5199\u6ce8\u91ca\u3002\u6240\u4ee5\u4ec5\u4ec5\u53ea\u901a\u8fc7\u5f3a\u5236\u6765\u89c4\u8303\u5927\u5bb6\u662f\u4e0d\u591f\u7684\uff0c\u968f\u7740\u65f6\u95f4\u63a8\u79fb\uff0c\u7248\u672c\u8fed\u4ee3\uff0c\u63a5\u53e3\u6587\u6863\u5f80\u5f80\u5f88\u5bb9\u6613\u5c31\u8ddf\u4e0d\u4e0a\u4ee3\u7801\u4e86\u3002"),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u53d1\u73b0\u4e86\u75db\u70b9\u5c31\u8981\u53bb\u627e\u89e3\u51b3\u65b9\u6848\u3002\u89e3\u51b3\u65b9\u6848\u7528\u7684\u4eba\u591a\u4e86\uff0c\u5c31\u6210\u4e86\u6807\u51c6\u7684\u89c4\u8303\uff0c\u8fd9\u5c31\u662f ",Object(r.b)("inlineCode",{parentName:"strong"},"Swagger")," \u7684\u7531\u6765"),"\u3002"),Object(r.b)("p",null,"\u901a\u8fc7\u8fd9\u5957\u89c4\u8303\uff0c\u4f60\u53ea\u9700\u8981\u6309\u7167\u5b83\u7684\u89c4\u8303\u53bb\u5b9a\u4e49\u63a5\u53e3\u53ca\u63a5\u53e3\u76f8\u5173\u7684\u4fe1\u606f\u3002\u518d\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u884d\u751f\u51fa\u6765\u7684\u4e00\u7cfb\u5217\u9879\u76ee\u548c\u5de5\u5177\uff0c\u5c31\u53ef\u4ee5\u505a\u5230\u751f\u6210\u5404\u79cd\u683c\u5f0f\u7684\u63a5\u53e3\u6587\u6863\uff0c\u751f\u6210\u591a\u79cd\u8bed\u8a00\u7684\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u7aef\u7684\u4ee3\u7801\uff0c\u4ee5\u53ca\u5728\u7ebf\u63a5\u53e3\u8c03\u8bd5\u9875\u9762\u7b49\u7b49\u3002"),Object(r.b)("p",null,"\u8fd9\u6837\uff0c\u5982\u679c\u6309\u7167\u65b0\u7684\u5f00\u53d1\u6a21\u5f0f\uff0c\u5728\u5f00\u53d1\u65b0\u7248\u672c\u6216\u8005\u8fed\u4ee3\u7248\u672c\u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981\u66f4\u65b0 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u63cf\u8ff0\u6587\u4ef6\uff0c\u5c31\u53ef\u4ee5\u81ea\u52a8\u751f\u6210\u63a5\u53e3\u6587\u6863\u548c\u5ba2\u6237\u7aef\u670d\u52a1\u7aef\u4ee3\u7801\uff0c\u505a\u5230\u8c03\u7528\u7aef\u4ee3\u7801\u3001\u670d\u52a1\u7aef\u4ee3\u7801\u4ee5\u53ca\u63a5\u53e3\u6587\u6863\u7684\u4e00\u81f4\u6027\u3002"),Object(r.b)("p",null,"\u6240\u4ee5\uff0cSwagger \u662f\u4e00\u4e2a\u89c4\u8303\u548c\u5b8c\u6574\u7684\u6846\u67b6\uff0c\u7528\u4e8e\u751f\u6210\u3001\u63cf\u8ff0\u3001\u8c03\u7528\u548c\u53ef\u89c6\u5316",Object(r.b)("inlineCode",{parentName:"p"},"RESTful")," \u98ce\u683c\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Web")," \u670d\u52a1\u3002"),Object(r.b)("p",null,"\u603b\u4f53\u76ee\u6807\u662f\u4f7f\u5ba2\u6237\u7aef\u548c\u6587\u4ef6\u7cfb\u7edf\u4f5c\u4e3a\u670d\u52a1\u5668\u4ee5\u540c\u6837\u7684\u901f\u5ea6\u6765\u66f4\u65b0\u3002\u6587\u4ef6\u7684\u65b9\u6cd5\u3001\u53c2\u6570\u548c\u6a21\u578b\u7d27\u5bc6\u96c6\u6210\u5230\u670d\u52a1\u5668\u7aef\u7684\u4ee3\u7801\uff0c\u5141\u8bb8 API \u6765\u59cb\u7ec8\u4fdd\u6301\u540c\u6b65\u3002",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u8ba9\u90e8\u7f72\u7ba1\u7406\u548c\u4f7f\u7528\u529f\u80fd\u5f3a\u5927\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"API")," \u4ece\u672a\u5982\u6b64\u7b80\u5355\u3002"),Object(r.b)("h2",{id:"65-swagger-\u4f7f\u7528"},"6.5 Swagger \u4f7f\u7528"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u4e14\u7075\u6d3b\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u914d\u7f6e\uff0c\u65e0\u9700\u589e\u52a0\u989d\u5916\u5b66\u4e60\u6210\u672c\u3002"),Object(r.b)("h3",{id:"651-\u6ce8\u518c\u670d\u52a1"},"6.5.1 \u6ce8\u518c\u670d\u52a1"),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5907\u6ce8")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},".AddSpecificationDocuments()")," \u9ed8\u8ba4\u5df2\u7ecf\u7ee7\u627f\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"AddInject()")," \u4e2d\u4e86\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002"),Object(r.b)("p",{parentName:"div"},"\u53e6\u5916 ",Object(r.b)("inlineCode",{parentName:"p"},".UseInject()")," \u4e5f\u5df2\u7ecf\u5305\u542b\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},".UseSpecificationDocuments()")," \u6ce8\u518c\uff0c\u65e0\u9700\u518d\u6b21\u6ce8\u518c\u3002"))),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{11,21} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{11,21}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddSpecificationDocuments();\n services.AddControllers();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n // Other Codes\n\n app.UseSpecificationDocuments();\n\n app.UseEndpoints(endpoints =>\n {\n endpoints.MapControllers();\n });\n }\n }\n}\n")),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"services.AddSpecificationDocuments()")," \u901a\u5e38\u548c ",Object(r.b)("inlineCode",{parentName:"p"},".AddDynamicApiControllers()")," \u6210\u5bf9\u51fa\u73b0\u3002"))),Object(r.b)("h3",{id:"652-\u9ed8\u8ba4\u5730\u5740"},"6.5.2 \u9ed8\u8ba4\u5730\u5740"),Object(r.b)("p",null,"\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"p"},"\u89c4\u8303\u5316\u6587\u6863")," \u5730\u5740\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"/api")," \u76ee\u5f55\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"),"\u3002"),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger1.png")}),Object(r.b)("p",null,"\u53ef\u4ee5\u901a\u8fc7\u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},'app.UseInject("\u8def\u7531")')," \u65b9\u5f0f\uff0c\u5982")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'app.UseInject("testapi"); // \u90a3\u4e48 /testapi \u5c31\u662f\u89c4\u8303\u5316\u5730\u5740\n')),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e"),"\uff1a")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),'{\n "SpecificationDocumentSettings": {\n "RoutePrefix": "testapi"\n }\n}\n')),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u914d\u7f6e\u6587\u4ef6\u4f18\u5148\u7ea7\u5927\u4e8e ",Object(r.b)("inlineCode",{parentName:"strong"},"UseInject()")," \u65b9\u5f0f")),Object(r.b)("h3",{id:"653-\u9ed8\u8ba4\u5206\u7ec4"},"6.5.3 \u9ed8\u8ba4\u5206\u7ec4"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\u9ed8\u8ba4\u5206\u7ec4\u540d\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"Default"),"\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"),"\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),'{\n "SpecificationDocumentSettings": {\n "DefaultGroupName": "MyGroup"\n }\n}\n')),Object(r.b)("h3",{id:"654-\u6587\u6863\u6ce8\u91ca"},"6.5.4 \u6587\u6863\u6ce8\u91ca"),Object(r.b)("p",null,"\u89c4\u8303\u5316\u6587\u6863\u9ed8\u8ba4\u626b\u63cf ",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Application"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Core"),"\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion.Web.Entry")," \u4e09\u4e2a\u7a0b\u5e8f\u96c6",Object(r.b)("inlineCode",{parentName:"p"},".xml")," \u6ce8\u91ca\u6587\u4ef6\uff0c",Object(r.b)("strong",{parentName:"p"},"\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e"),"\u3002"),Object(r.b)("p",null,"\u53ea\u652f\u6301 ",Object(r.b)("inlineCode",{parentName:"p"},"///")," \u6807\u8bc6\u7684\u6ce8\u91ca\u8bed\u6cd5\uff0c\u5982\uff1a",Object(r.b)("strong",{parentName:"p"},"\u7c7b\u3001\u65b9\u6cd5\u3001\u5c5e\u6027\u3001\u53c2\u6570\u3001\u8fd4\u56de\u503c\u3001\u9a8c\u8bc1\u7279\u6027"),"\u3002"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5-7,10-13,19-23}","{5-7,10-13,19-23}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n /// \n /// \u7c7b\u6ce8\u91ca\n /// \n public class FurAppService : IDynamicApiController\n {\n /// \n /// \u65b9\u6cd5\u6ce8\u91ca\n /// \n /// \n public string Get()\n {\n return nameof(Furion);\n }\n\n /// \n /// \u5e26 ID \u53c2\u6570\u7684\u65b9\u6cd5\u6ce8\u91ca\n /// \n /// \n /// \n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger2.png")}),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c\u6587\u6863\u6ce8\u91ca\u6ca1\u6709\u663e\u793a\uff0c\u8bf7\u68c0\u67e5\u9879\u76ee ",Object(r.b)("inlineCode",{parentName:"p"},"\u5c5e\u6027->\u751f\u6210->\u8f93\u51fa")," \u4e2d XML \u6587\u6863\u662f\u5426\u914d\u7f6e\u8f93\u51fa\u8def\u5f84\u3002"))),Object(r.b)("div",{className:"admonition admonition-info alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},Object(r.b)("inlineCode",{parentName:"p"},"Debug")," \u6a21\u5f0f\u4e0b\u548c ",Object(r.b)("inlineCode",{parentName:"p"},"Release")," \u6a21\u5f0f\u4e0b\u7684\u6ce8\u91ca\u6587\u4ef6\u662f\u4e0d\u901a\u7528\u7684\uff0c\u6240\u4ee5\u5bfc\u81f4\u5f88\u591a\u5f00\u53d1\u8005\u53d1\u5e03\u5230\u670d\u52a1\u5668\u4e0a\u53d1\u73b0\u6ca1\u6709\u663e\u793a\u6ce8\u91ca\u3002\u6211\u4eec\u53ea\u9700\u8981\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Visual Studio")," \u4e2d\u5207\u6362 ",Object(r.b)("inlineCode",{parentName:"p"},"Debug")," \u6a21\u5f0f\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"Release"),"\uff0c\u7136\u540e\u91cd\u65b0\u914d\u7f6e\u4e00\u6b21\u5373\u53ef\u3002"),Object(r.b)("p",{parentName:"div"},"\u8fd9\u6837\u4e0d\u7ba1\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Debug")," \u8fd8\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"Release")," \u6a21\u5f0f\u90fd\u4f1a\u663e\u793a\u6ce8\u91ca\u4e86\u3002"))),Object(r.b)("h3",{id:"655-\u591a\u5206\u7ec4\u652f\u6301"},"6.5.5 \u591a\u5206\u7ec4\u652f\u6301"),Object(r.b)("p",null,"\u591a\u5206\u7ec4\u662f\u4e00\u4e2a\u7cfb\u7edf\u4e2d\u5fc5\u5907\u529f\u80fd\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u7cfb\u7edf\u5212\u5206\u4e3a\u591a\u4e2a\u6a21\u5757\uff0c\u6bcf\u4e2a\u6a21\u5757\u90fd\u72ec\u7acb\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"api")," \u914d\u7f6e\u3002\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5b9e\u73b0\u591a\u5206\u7ec4\u975e\u5e38\u7b80\u5355\u3002\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,21,32}","{5,21,32}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings("Group1")]\n public class FurAppService : IDynamicApiController\n {\n /// \n /// \u968f\u7236\u7c7b Group1 \u5206\u7ec4\n /// \n /// \n public string Post()\n {\n return nameof(Furion);\n }\n\n /// \n /// \u5728 Group1\u3001Group3 \u90fd\u6709\u6211\n /// \n /// \n [ApiDescriptionSettings("Group1", "Group3")]\n public string Get()\n {\n return nameof(Furion);\n }\n\n /// \n /// \u6211\u53ea\u5728 Group2 \u51fa\u73b0\n /// \n /// \n /// \n [ApiDescriptionSettings("Group2")]\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger3.gif")}),Object(r.b)("h3",{id:"656-\u591a\u5206\u7ec4\u6392\u5e8f"},"6.5.6 \u591a\u5206\u7ec4\u6392\u5e8f"),Object(r.b)(b.a,{defaultValue:"fz1",values:[{label:"\u65b9\u5f0f\u4e00",value:"fz1"},{label:"\u65b9\u5f0f\u4e8c",value:"fz2"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"fz1",mdxType:"TabItem"},Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u901a\u8fc7\u5206\u7ec4\u540d\u79f0\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"strong"},"@\u6574\u6570")," \u8fdb\u884c\u6392\u5e8f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings("Group1@1")]\n public class FurAppService : IDynamicApiController\n {\n public string Post()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings("Group1", "Group3")]\n public string Get()\n {\n return nameof(Furion);\n }\n\n [ApiDescriptionSettings("Group@2")]\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u53ef\u4ee5\u901a\u8fc7\u5728\u5206\u7ec4\u540d\u540e\u9762\u6dfb\u52a0 ",Object(r.b)("inlineCode",{parentName:"p"},"@\u6574\u6570")," \u8fdb\u884c\u6392\u5e8f\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"\u6574\u6570")," \u8d8a\u5927\u6392\u524d\u9762\u3002\u5982\u679c\u5206\u7ec4\u540d\u79f0\u591a\u6b21\u6307\u5b9a\u4e14\u591a\u6b21\u6307\u5b9a\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"@\u6574\u6570")," \uff0c\u5219\u81ea\u52a8",Object(r.b)("strong",{parentName:"p"},"\u53d6\u8be5\u5206\u7ec4\u6700\u5927\u7684\u6574\u6570"),"\u8fdb\u884c\u6392\u5e8f\u3002")),Object(r.b)(l.a,{value:"fz2",mdxType:"TabItem"},Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e\u6392\u5e8f")),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-17} title="Furion.Web.Entry/appsettings.json"',"{2-17}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Order": 1\n },\n {\n "Group": "Group2",\n "Order": 2\n },\n {\n "Group": "Group3",\n "Order": 0\n }\n ]\n }\n}\n')))),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger5.png")}),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u6392\u5e8f\u8bf4\u660e")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5206\u7ec4\u9ed8\u8ba4\u6392\u5e8f ",Object(r.b)("inlineCode",{parentName:"p"},"Order")," \u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"0"),"\u3002\u5982\u679c\u540c\u65f6\u914d\u7f6e\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"@\u6574\u6570")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u914d\u7f6e\u6587\u4ef6\uff0c\u90a3\u4e48\u4f18\u5148\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Order")))),Object(r.b)("h3",{id:"657-\u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e"},"6.5.7 \u591a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u53ef\u901a\u8fc7 ",Object(r.b)("inlineCode",{parentName:"p"},"appsetting.json")," \u914d\u7f6e\u5206\u7ec4\u4fe1\u606f\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{3-20} title="Furion.Web.Entry/appsettings.json"',"{3-20}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Title": "\u5206\u7ec4\u6807\u9898",\n "Description": "\u8fd9\u91cc\u662f\u5206\u7ec4\u63cf\u8ff0",\n "Version": "\u7248\u672c\u53f7",\n "TermsOfService": "https://furion.pro",\n "Contact": {\n "Name": "\u767e\u5c0f\u50e7",\n "Url": "https://gitee.com/monksoul",\n "Email": "monksoul@outlook.com"\n },\n "License": {\n "Name": "Apache-2.0",\n "Url": "https://gitee.com/monksoul/Furion/blob/alpha/LICENSE"\n }\n }\n ]\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger5.png")}),Object(r.b)("h3",{id:"658-\u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09"},"6.5.8 \u7ec4\u4e2d\u7ec4\uff08\u6807\u7b7e\uff09"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Tag")," \u914d\u7f6e\u4e3b\u8981\u7528\u4e8e\u914d\u7f6e ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u6807\u7b7e\u5206\u7ec4\u4fe1\u606f\u53ca\u5408\u5e76\u6807\u7b7e\u3002\u4e5f\u5c31\u662f ",Object(r.b)("inlineCode",{parentName:"p"},"\u7ec4\u4e2d\u7ec4"),":"),Object(r.b)(b.a,{defaultValue:"tag1",values:[{label:"\u6807\u7b7e\u547d\u540d",value:"tag1"},{label:"\u5408\u5e76\u6807\u7b7e",value:"tag2"}],mdxType:"Tabs"},Object(r.b)(l.a,{value:"tag1",mdxType:"TabItem"},Object(r.b)("h4",{id:"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"},"\u672a\u8d34\u6807\u7b7e\u4e4b\u524d"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n")),Object(r.b)("h4",{id:"\u8d34\u6807\u7b7e\u4e4b\u540e"},"\u8d34\u6807\u7b7e\u4e4b\u540e"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e00")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5206\u7ec4\u4e8c")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/tag1.png")})),Object(r.b)(l.a,{value:"tag2",mdxType:"TabItem"},Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,19}","{5,19}":!0}),'using Furion.DynamicApiController;\n\nnamespace Furion.Application\n{\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class FurAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n\n [ApiDescriptionSettings(Tag = "\u5408\u5e76\u6240\u6709\u6807\u7b7e")]\n public class TestAppService : IDynamicApiController\n {\n public string Get()\n {\n return nameof(Furion);\n }\n\n public int Get(int id)\n {\n return id;\n }\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/tag2.png")}))),Object(r.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u5982\u679c ",Object(r.b)("inlineCode",{parentName:"p"},"Tag")," \u540d\u5b57\u4e00\u6837\uff0c\u5219\u4f1a\u81ea\u52a8\u5408\u5e76\uff0c\u5426\u5219\u53ea\u662f\u547d\u540d\u3002"))),Object(r.b)("h3",{id:"659-\u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863"},"6.5.9 \u9ed8\u8ba4\u5c55\u5f00\u6240\u6709\u6587\u6863"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "DocExpansionState": "Full"\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger6.gif")}),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"DocExpansionState")," \u914d\u7f6e\u8bf4\u660e\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"List"),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",Object(r.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Full"),"\uff1a\u5b8c\u5168\u5c55\u5f00"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"None"),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09")),Object(r.b)("h3",{id:"6510-\u914d\u7f6e\u6587\u6863\u6807\u9898"},"6.5.10 \u914d\u7f6e\u6587\u6863\u6807\u9898"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-4} title="Furion.Web.Entry/appsettings.json"',"{2-4}":!0,title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "DocumentTitle": "\u6211\u662f\u81ea\u5b9a\u4e49\u6807\u9898"\n }\n}\n')),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger7.png")}),Object(r.b)("h3",{id:"6511-\u6388\u6743\u63a7\u5236"},"6.5.11 \u6388\u6743\u63a7\u5236"),Object(r.b)("p",null,Object(r.b)("strong",{parentName:"p"},"\u65b0\u7248\u672c ",Object(r.b)("inlineCode",{parentName:"strong"},"Furion")," \u5df2\u7ecf\u542f\u7528\u4e86\u9ed8\u8ba4\u6388\u6743\u4e86\uff0c\u65e0\u9700\u624b\u52a8\u6388\u6743"),"\uff0c\u5982\u9700\u624b\u52a8\u914d\u7f6e\uff0c\u53ef\u624b\u52a8\u6dfb\u52a0\u4ee5\u4e0b\u7c7b\u4f3c\u914d\u7f6e\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'title="Furion.Web.Entry/appsettings.json"',title:'"Furion.Web.Entry/appsettings.json"'}),'{\n "SpecificationDocumentSettings": {\n "EnableAuthorized": true,\n\n "SecurityDefinitions": [\n {\n "Id": "Bearer",\n "Type": "Http",\n "Name": "Authorization",\n "Description": "JWT Authorization header using the Bearer scheme.",\n "BearerFormat": "JWT",\n "Scheme": "bearer",\n "In": "Header",\n\n "Requirement": {\n "Scheme": {\n "Reference": {\n "Id": "Bearer",\n "Type": "SecurityScheme"\n },\n "Accesses": []\n }\n }\n }\n ]\n }\n}\n')),Object(r.b)("h3",{id:"6512-\u5728\u7ebf\u6d4b\u8bd5"},"6.5.12 \u5728\u7ebf\u6d4b\u8bd5"),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/swagger8.gif")}),Object(r.b)("h3",{id:"6513-\u6027\u80fd\u76d1\u89c6-miniprofiler"},"6.5.13 \u6027\u80fd\u76d1\u89c6 ",Object(r.b)("inlineCode",{parentName:"h3"},"MiniProfiler")),Object(r.b)("p",null,"\u89c4\u8303\u5316\u6587\u6863\u9ed8\u8ba4\u96c6\u6210\u4e86 ",Object(r.b)("inlineCode",{parentName:"p"},"MiniProfiler")," \u7b2c\u4e09\u65b9\u6027\u80fd\u7ec4\u4ef6\uff0c\u901a\u8fc7\u8be5\u7ec4\u4ef6\u53ef\u4ee5\u65b9\u4fbf\u67e5\u770b\u8bf7\u6c42\u6027\u80fd\u3001\u5f02\u5e38\u5806\u6808\u3001\u6570\u636e\u5e93\u64cd\u4f5c\u7b49\u4fe1\u606f\u3002\u9ed8\u8ba4\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Swagger")," \u9996\u9875\u5de6\u4e0a\u89d2\u663e\u793a\u3002"),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/mipr.png")}),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u5c0f\u63d0\u793a")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u4e5f\u53ef\u4ee5\u901a\u8fc7 ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"appsetting.json"))," \u4e2d ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"AppSettings:InjectMiniProfiler"))," \u8bbe\u4e3a ",Object(r.b)("strong",{parentName:"p"},Object(r.b)("inlineCode",{parentName:"strong"},"false"))," \u5173\u95ed\u3002"))),Object(r.b)("h3",{id:"6514-\u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b"},"6.5.14 \u5b9a\u4e49\u63a5\u53e3\u8f93\u51fa\u7c7b\u578b"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8-9}","{2,8-9}":!0}),"using Furion.DynamicApiController;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Application\n{\n public class FurAppService : IDynamicApiController\n {\n [ProducesResponseType(201, Type = typeof(TestDto))]\n [ProducesResponseType(400)]\n public string Get()\n {\n return nameof(Furion);\n }\n }\n}\n")),Object(r.b)("p",null,"\u5982\u4e0b\u56fe\u6240\u793a\uff1a"),Object(r.b)("img",{src:Object(c.a)("img/fhzlx.png")}),Object(r.b)("h3",{id:"6515-\u9690\u85cf\u7279\u5b9a\u5206\u7ec4"},"6.5.15 \u9690\u85cf\u7279\u5b9a\u5206\u7ec4"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u65b0\u7248\u672c\u63d0\u4f9b\u4e86\u9690\u85cf\u5206\u7ec4\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Visible")," \u914d\u7f6e\uff0c\u8bbe\u7f6e\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"false")," \u4e4b\u540e\u8be5\u5206\u7ec4\u5c06\u4e0d\u663e\u793a\u5728\u89c4\u8303\u5316\u6587\u6863\u4e2d\uff0c\u5982\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'title="appsetting.json"',title:'"appsetting.json"'}),'{\n "SpecificationDocumentSettings": {\n "GroupOpenApiInfos": [\n {\n "Group": "Group1",\n "Visible": false\n }\n ]\n }\n}\n')),Object(r.b)("h3",{id:"6516-\u4e2d\u6587\u4e71\u7801\u95ee\u9898"},"6.5.16 \u4e2d\u6587\u4e71\u7801\u95ee\u9898"),Object(r.b)("p",null,"\u9ed8\u8ba4\u60c5\u51b5\u4e0b,",Object(r.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\u5e76\u672a\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"p"},"utf-8")," \u7f16\u7801\uff0c\u6240\u4ee5\u5982\u679c\u914d\u7f6e\u4e2d\u6587\u5206\u7ec4\u4fe1\u606f\u5c31\u4f1a\u51fa\u73b0\u4e71\u7801\u60c5\u51b5\uff0c\u8fd9\u65f6\u5019\uff0c\u53ea\u9700\u8981\u4fee\u6539 ",Object(r.b)("inlineCode",{parentName:"p"},".json")," \u6587\u4ef6\u7f16\u7801\u4e3a ",Object(r.b)("inlineCode",{parentName:"p"},"utf-8")," \u5373\u53ef\u3002"),Object(r.b)("h2",{id:"66-specificationdocumentsettings-\u914d\u7f6e"},"6.6 ",Object(r.b)("inlineCode",{parentName:"h2"},"SpecificationDocumentSettings")," \u914d\u7f6e"),Object(r.b)("p",null,"\u9664\u4e86\u4e0a\u8ff0\u4f8b\u5b50\u5916\uff0c",Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u4e00\u4e9b\u914d\u7f6e\u9009\u9879\uff0c\u5982\uff1a"),Object(r.b)("ul",null,Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DocumentTitle"),"\uff1a\u6587\u6863\u6807\u9898\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Specification Api Document")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DefaultGroupName"),"\uff1a\u9ed8\u8ba4\u5206\u7ec4\u540d\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Default")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"EnableAuthorized"),"\uff1a\u662f\u5426\u542f\u7528\u6743\u9650\u63a7\u5236\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"true")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"FormatAsV2"),"\uff1a\u91c7\u7528 ",Object(r.b)("inlineCode",{parentName:"li"},"Swagger 2.0")," \u7248\u672c\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"RoutePrefix"),"\uff1a\u89c4\u8303\u5316\u6587\u6863\u5730\u5740\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"api"),"\uff0c",Object(r.b)("strong",{parentName:"li"},"\u5982\u679c\u5e0c\u671b\u5728\u9996\u9875\uff0c\u6539\u4e3a\u7a7a\u5b57\u7b26\u4e32\u5373\u53ef"),"\u3002"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"DocExpansionState"),"\uff1a\u6587\u6863\u663e\u793a\u65b9\u5f0f\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"DocExpansion"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"List"),"\uff0c\u53d6\u503c\uff1a",Object(r.b)("ul",{parentName:"li"},Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"List"),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",Object(r.b)("strong",{parentName:"li"},"\u9ed8\u8ba4\u503c")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Full"),"\uff1a\u5b8c\u5168\u5c55\u5f00"),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"None"),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09"))),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"XmlComments"),"\uff1a\u7a0b\u5e8f\u96c6\u6ce8\u91ca\u63cf\u8ff0\u6587\u4ef6\u540d\uff08\u53ef\u5e26 ",Object(r.b)("inlineCode",{parentName:"li"},".xml"),"\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"string"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"Furion.Application, Furion.Web.Entry, Furion.Web.Core")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"GroupOpenApiInfos"),"\uff1a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiInfo[]"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"{ 'Group': 'Default'}")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"SecurityDefinitions"),"\uff1a\u5b89\u5168\u7b56\u7565\u5b9a\u4e49\u914d\u7f6e\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"SpecificationOpenApiSecurityScheme[]"),"\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"[]")),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"Servers"),"\uff1a\u914d\u7f6e Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"OpenApiServer[]")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"[]"),"\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"li"},'{Servers:[ { Url:"\u5730\u5740", Description:"\u63cf\u8ff0"} ]}')),Object(r.b)("li",{parentName:"ul"},Object(r.b)("inlineCode",{parentName:"li"},"HideServers"),"\uff1a\u662f\u5426\u9690\u85cf Server \u4e0b\u62c9\u5217\u8868\uff0c",Object(r.b)("inlineCode",{parentName:"li"},"bool")," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",Object(r.b)("inlineCode",{parentName:"li"},"false"))),Object(r.b)("h2",{id:"67-\u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b"},"6.7 \u7edf\u4e00\u8fd4\u56de\u503c\u6a21\u578b"),Object(r.b)("p",null,Object(r.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b ",Object(r.b)("inlineCode",{parentName:"p"},"\u89c4\u8303\u5316\u7ed3\u679c")," \u529f\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9e\u73b0 ",Object(r.b)("inlineCode",{parentName:"p"},"IUnifyResultProvider")," \u63d0\u4f9b\u5668\u5b9e\u73b0\u7edf\u4e00\u89c4\u8303\u5316\u8fd4\u56de\u503c\u5b9a\u5236\uff0c\u5982\uff1a",Object(r.b)("inlineCode",{parentName:"p"},"RESTfulResultProvider"),"\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{16,17}","{16,17}":!0}),'using Furion.DependencyInjection;\nusing Furion.Utilities;\nusing Microsoft.AspNetCore.Http;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.AspNetCore.Mvc.Filters;\nusing Microsoft.AspNetCore.Mvc.ModelBinding;\nusing System;\nusing System.Collections.Generic;\nusing System.Threading.Tasks;\n\nnamespace Furion.UnifyResult\n{\n /// \n /// RESTful \u98ce\u683c\u8fd4\u56de\u503c\n /// \n [SkipScan, UnifyModel(typeof(RESTfulResult<>))]\n public class RESTfulResultProvider : IUnifyResultProvider\n {\n /// \n /// \u5f02\u5e38\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnException(ExceptionContext context)\n {\n // \u89e3\u6790\u5f02\u5e38\u4fe1\u606f\n var (ErrorCode, ErrorContent) = UnifyContext.GetExceptionMetadata(context);\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = ErrorCode,\n Succeeded = false,\n Data = null,\n Errors = ErrorContent,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u6210\u529f\u8fd4\u56de\u503c\n /// \n /// \n /// \n public IActionResult OnSucceeded(ActionExecutedContext context)\n {\n object data;\n // \u5904\u7406\u5185\u5bb9\u7ed3\u679c\n if (context.Result is ContentResult contentResult) data = contentResult.Content;\n // \u5904\u7406\u5bf9\u8c61\u7ed3\u679c\n else if (context.Result is ObjectResult objectResult) data = objectResult.Value;\n else if (context.Result is EmptyResult) data = null;\n else return null;\n\n return new JsonResult(new RESTfulResult\n {\n StatusCode = context.Result is EmptyResult ? StatusCodes.Status204NoContent : StatusCodes.Status200OK, // \u5904\u7406\u6ca1\u6709\u8fd4\u56de\u503c\u60c5\u51b5 204\n Succeeded = true,\n Data = data,\n Errors = null,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u9a8c\u8bc1\u5931\u8d25\u8fd4\u56de\u503c\n /// \n /// \n /// \n /// \n /// \n /// \n public IActionResult OnValidateFailed(ActionExecutingContext context, ModelStateDictionary modelStates, Dictionary> validationResults, string validateFailedMessage)\n {\n return new JsonResult(new RESTfulResult\n {\n StatusCode = StatusCodes.Status400BadRequest,\n Succeeded = false,\n Data = null,\n Errors = validationResults,\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n });\n }\n\n /// \n /// \u5904\u7406\u8f93\u51fa\u72b6\u6001\u7801\n /// \n /// \n /// \n /// \n public async Task OnResponseStatusCodes(HttpContext context, int statusCode)\n {\n switch (statusCode)\n {\n // \u5904\u7406 401 \u72b6\u6001\u7801\n case StatusCodes.Status401Unauthorized:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status401Unauthorized,\n Succeeded = false,\n Data = null,\n Errors = "401 Unauthorized",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n // \u5904\u7406 403 \u72b6\u6001\u7801\n case StatusCodes.Status403Forbidden:\n await context.Response.WriteAsJsonAsync(new RESTfulResult\n {\n StatusCode = StatusCodes.Status403Forbidden,\n Succeeded = false,\n Data = null,\n Errors = "403 Forbidden",\n Extras = UnifyContext.Take(),\n Timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()\n }, JsonSerializerUtility.GetDefaultJsonSerializerOptions());\n break;\n\n default:\n break;\n }\n }\n }\n}\n')),Object(r.b)("p",null,"\u4e4b\u540e\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c\u5373\u53ef\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"services.AddControllers()\n .AddInjectWithUnifyResult();\n")),Object(r.b)("div",{className:"admonition admonition-important alert alert--info"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u89c4\u8303\u5316\u7ed3\u679c\u4e0d\u4f1a\u5bf9 ",Object(r.b)("inlineCode",{parentName:"p"},"401")," \u548c ",Object(r.b)("inlineCode",{parentName:"p"},"403")," \u72b6\u6001\u7801\u8fdb\u884c\u89c4\u8303\u5316\u5904\u7406\uff0c\u5982\u9700\u542f\u52a8\u8be5\u72b6\u6001\u7801\u5904\u7406\uff0c\u53ea\u9700\u5728 ",Object(r.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u7684 ",Object(r.b)("inlineCode",{parentName:"p"},"Configure")," \u4e2d\u542f\u7528\u63a5\u53e3\uff1a"),Object(r.b)("pre",{parentName:"div"},Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),"public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n{\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n // \u6dfb\u52a0\u89c4\u8303\u5316\u7ed3\u679c\u72b6\u6001\u7801\uff0c\u9700\u8981\u5728\u8fd9\u91cc\u6ce8\u518c\n app.UseUnifyResultStatusCodes();\n // \u5176\u4ed6\u6ce8\u518c...\n}\n")))),Object(r.b)("h3",{id:"671-\u6392\u9664\u89c4\u8303\u5316\u5904\u7406"},"6.7.1 \u6392\u9664\u89c4\u8303\u5316\u5904\u7406"),Object(r.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u67d0\u4e9b\u63a5\u53e3\u4e0d\u9700\u8981\u8fdb\u884c\u89c4\u8303\u5316\u5904\u7406\uff0c\u8fd9\u65f6\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5e16 ",Object(r.b)("inlineCode",{parentName:"p"},"[NonUnify]")," \u7279\u6027\u5373\u53ef\u3002"),Object(r.b)("h3",{id:"672-\u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e"},"6.7.2 \u89c4\u8303\u5316\u7ed3\u679c\u6dfb\u52a0\u989d\u5916\u6570\u636e"),Object(r.b)("p",null,"\u9ed8\u8ba4\u7684\u89c4\u8303\u5316\u7ed3\u679c\u4e2d\u5305\u542b ",Object(r.b)("inlineCode",{parentName:"p"},"extras")," \u5c5e\u6027\uff0c\u53ef\u4ee5\u914d\u7f6e\u989d\u5916\u6570\u636e\u8fd4\u56de\u5230\u5ba2\u6237\u7aef\uff1a"),Object(r.b)("pre",null,Object(r.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'UnifyContext.Fill(new { Message = "\u64cd\u4f5c\u6210\u529f" });\n')),Object(r.b)("h2",{id:"68-\u53cd\u9988\u4e0e\u5efa\u8bae"},"6.8 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(r.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(r.b)("h5",{parentName:"div"},Object(r.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(r.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(r.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(r.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(r.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(r.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}d.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return c}));var a=t(21),i=t(195);function r(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:r=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return r?e+c:c}(n,e,t,a)}}function c(e,n={}){const{withBaseUrl:t}=r();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return d}));var a=t(0),i=t.n(a);function r(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function b(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var o=i.a.createContext({}),p=function(e){var n=i.a.useContext(o),t=n;return e&&(t="function"==typeof e?e(n):b(b({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(o.Provider,{value:n},e.children)},u={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},m=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,r=e.originalType,c=e.parentName,o=l(e,["components","mdxType","originalType","parentName"]),s=p(t),m=a,d=s["".concat(c,".").concat(m)]||s[m]||u[m]||r;return t?i.a.createElement(d,b(b({ref:n},o),{},{components:t})):i.a.createElement(d,b({ref:n},o))}));function d(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var r=t.length,c=new Array(r);c[0]=m;var b={};for(var l in n)hasOwnProperty.call(n,l)&&(b[l]=n[l]);b.originalType=e,b.mdxType="string"==typeof e?e:a,c[1]=b;for(var o=2;on(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&N(e)}const v=e=>{N(e),null!=u&&j(u,e)},f=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(c.a)("tabs",{"tabs--block":t},m)},s.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":O===e,className:Object(c.a)("tabs__item",l.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>f.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case p:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case o:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(f,e.target,e)},onFocus:()=>v(e),onClick:()=>{v(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===O)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==O}))))}},204:function(e,n,t){"use strict";var a=t(3),i=t(0),r=t.n(i);n.a=function({children:e,hidden:n,className:t}){return r.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file diff --git a/docs/e1713ffa.95a13441.js b/docs/e1713ffa.95a13441.js new file mode 100644 index 00000000000..8d559bd20cf --- /dev/null +++ b/docs/e1713ffa.95a13441.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[100],{174:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return u}));var a=t(3),i=t(7),o=(t(0),t(196)),p=(t(194),t(203)),s=t(204),r=t(197),c={id:"options",title:"4.2 \u9009\u9879",sidebar_label:"4.2 \u9009\u9879"},b={unversionedId:"options",id:"options",isDocsHomePage:!1,title:"4.2 \u9009\u9879",description:"4.2.1 \u4ec0\u4e48\u662f\u9009\u9879",source:"@site/docs\\options.mdx",slug:"/options",permalink:"/docs/options",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/options.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4.2 \u9009\u9879",sidebar:"docs",previous:{title:"4.1 \u914d\u7f6e",permalink:"/docs/configuration"},next:{title:"5. \u52a8\u6001 WebAPI",permalink:"/docs/dynamic-api-controller"}},l=[{value:"4.2.1 \u4ec0\u4e48\u662f\u9009\u9879",id:"421-\u4ec0\u4e48\u662f\u9009\u9879",children:[]},{value:"4.2.2 \u4e0e\u914d\u7f6e\u7684\u533a\u522b",id:"422-\u4e0e\u914d\u7f6e\u7684\u533a\u522b",children:[]},{value:"4.2.3 \u9009\u9879\u7684\u4f7f\u7528",id:"423-\u9009\u9879\u7684\u4f7f\u7528",children:[{value:"4.2.3.1 \u914d\u7f6e appsettings.json \u4fe1\u606f",id:"4231-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.2.3.2 \u521b\u5efa AppInfoOptions \u5f3a\u7c7b\u578b\u7c7b",id:"4232-\u521b\u5efa-appinfooptions-\u5f3a\u7c7b\u578b\u7c7b",children:[]},{value:"4.2.3.3 \u6ce8\u518c AppInfoOptions \u670d\u52a1",id:"4233-\u6ce8\u518c-appinfooptions-\u670d\u52a1",children:[]},{value:"4.2.3.4 \u8bfb\u53d6 AppInfoOptions \u4fe1\u606f",id:"4234-\u8bfb\u53d6-appinfooptions-\u4fe1\u606f",children:[]},{value:"4.2.3.5 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",id:"4235-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",children:[]}]},{value:"4.2.4 \u9009\u9879\u63a5\u53e3\u8bf4\u660e",id:"424-\u9009\u9879\u63a5\u53e3\u8bf4\u660e",children:[]},{value:"4.2.5 \u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e",id:"425-\u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e",children:[{value:"4.2.5.1 \u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b",id:"4251-\u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b",children:[]}]},{value:"4.2.6 [OptionsSettings] \u8bf4\u660e",id:"426-optionssettings-\u8bf4\u660e",children:[]},{value:"4.2.7 \u9009\u9879\u9a8c\u8bc1",id:"427-\u9009\u9879\u9a8c\u8bc1",children:[]},{value:"4.2.8 \u9009\u9879\u540e\u671f\u914d\u7f6e",id:"428-\u9009\u9879\u540e\u671f\u914d\u7f6e",children:[]},{value:"4.2.9 \u9009\u9879\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",id:"429-\u9009\u9879\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",children:[]},{value:"4.2.10 \u9009\u9879\u7684\u4f18\u7f3a\u70b9",id:"4210-\u9009\u9879\u7684\u4f18\u7f3a\u70b9",children:[]},{value:"4.2.11 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"4211-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],O={toc:l};function u(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},O,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(r.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"421-\u4ec0\u4e48\u662f\u9009\u9879"},"4.2.1 \u4ec0\u4e48\u662f\u9009\u9879"),Object(o.b)("p",null,"\u9009\u9879\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63a8\u8350\u7684\u52a8\u6001\u8bfb\u53d6\u914d\u7f6e\u7684\u65b9\u5f0f\uff0c\u8fd9\u79cd\u65b9\u5f0f\u5c06\u914d\u7f6e\u6587\u4ef6\u6570\u636e\u7528\u4e00\u4e2a",Object(o.b)("strong",{parentName:"p"},"\u5f3a\u7c7b\u578b"),"\u6765\u6258\u7ba1\uff0c\u80fd\u591f\u5b9e\u73b0\u914d\u7f6e\u9a8c\u8bc1\u3001\u9ed8\u8ba4\u503c\u914d\u7f6e\u3001\u5b9e\u65f6\u8bfb\u53d6\u7b49\u529f\u80fd\u3002"),Object(o.b)("h2",{id:"422-\u4e0e\u914d\u7f6e\u7684\u533a\u522b"},"4.2.2 \u4e0e\u914d\u7f6e\u7684\u533a\u522b"),Object(o.b)("p",null,"\u9009\u9879\u5b9e\u9645\u4e0a\u4e5f\u662f\u914d\u7f6e\uff0c\u4f46\u5728\u540e\u8005\u7684\u57fa\u7840\u4e0a\u6dfb\u52a0\u4e86\u914d\u7f6e\u9a8c\u8bc1\u3001\u9ed8\u8ba4\u503c/\u540e\u671f\u914d\u7f6e\u8bbe\u5b9a\u53ca\u63d0\u4f9b\u4e86\u591a\u79cd\u63a5\u53e3\u8bfb\u53d6\u914d\u7f6e\u4fe1\u606f\uff0c\u540c\u65f6\u8fd8\u652f\u6301\u4f9b\u914d\u7f6e\u66f4\u6539\u901a\u77e5\u7b49\u5f3a\u5927\u7075\u6d3b\u529f\u80fd\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\uff0c\u9664\u4e86\u4e00\u6b21\u6027\u8bfb\u53d6\u4f7f\u7528\u7684\u914d\u7f6e\u4ee5\u5916\uff0c\u90fd\u5e94\u8be5\u9009\u7528 ",Object(o.b)("strong",{parentName:"p"},"\u9009\u9879")," \u66ff\u6362 ",Object(o.b)("strong",{parentName:"p"},"\u914d\u7f6e"),"\u3002"),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u77e5\u8bc6\u5bfc\u822a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6709\u5173\u914d\u7f6e\u8bf4\u660e\u53ef\u67e5\u770b\u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/configuration"}),"4.1 \u914d\u7f6e"),"\u300b \u7ae0\u8282\u3002"))),Object(o.b)("h2",{id:"423-\u9009\u9879\u7684\u4f7f\u7528"},"4.2.3 \u9009\u9879\u7684\u4f7f\u7528"),Object(o.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u83b7\u53d6",Object(o.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u540d\u79f0\u3001\u7248\u672c\u53f7\u53ca\u7248\u6743\u4fe1\u606f"),"\uff0c\u8fd9\u4e9b\u4fe1\u606f\u53ef\u80fd\u968f\u65f6\u53d8\u5316\u800c\u4e14\u9700\u8981\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u5c06\u8fd9\u4e9b\u4fe1\u606f\u914d\u7f6e\u8d77\u6765\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a"),Object(o.b)("h3",{id:"4231-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f"},"4.2.3.1 \u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2-6}","{2-6}":!0}),'{\n "AppInfo": {\n "Name": "Furion",\n "Version": "1.0.0",\n "Company": "Baiqian"\n }\n}\n')),Object(o.b)("h3",{id:"4232-\u521b\u5efa-appinfooptions-\u5f3a\u7c7b\u578b\u7c7b"},"4.2.3.2 \u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"AppInfoOptions")," \u5f3a\u7c7b\u578b\u7c7b"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.ConfigurableOptions;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n }\n}\n")),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5efa\u8bae\u6240\u6709\u9009\u9879\u7c7b\u90fd\u5e94\u8be5\u4ee5 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"Options"))," \u547d\u540d\u7ed3\u5c3e\u3002"),Object(o.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u6ce8\u518c\u9009\u9879\u670d\u52a1\u7684\u65b9\u6cd5\uff0c\u53ea\u9700\u8981\u7ee7\u627f ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions"))," \u63a5\u53e3\u5373\u53ef\uff0c\u8be5\u63a5\u53e3\u4f4d\u4e8e ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"Furion.ConfigurableOptions"))," \u547d\u540d\u7a7a\u95f4\u4e0b\u3002"))),Object(o.b)("h3",{id:"4233-\u6ce8\u518c-appinfooptions-\u670d\u52a1"},"4.2.3.3 \u6ce8\u518c ",Object(o.b)("inlineCode",{parentName:"h3"},"AppInfoOptions")," \u670d\u52a1"),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"\u9009\u9879\u4e0d\u540c\u4e8e\u914d\u7f6e\uff0c\u9700\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{12} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{12}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddConfigurableOptions();\n }\n }\n}\n")),Object(o.b)("h3",{id:"4234-\u8bfb\u53d6-appinfooptions-\u4fe1\u606f"},"4.2.3.4 \u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"h3"},"AppInfoOptions")," \u4fe1\u606f"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u8bfb\u53d6\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions(jsonKey)")," \u8bfb\u53d6\uff08",Object(o.b)("strong",{parentName:"li"},"\u4e0d\u63a8\u8350"),"\uff09"),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165\u4ee5\u4e0b\u5b9e\u4f8b\u8bfb\u53d6\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptions")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsSnapshot")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsMonitor")))),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"li"},"App")," \u9759\u6001\u7c7b\u63d0\u4f9b\u7684\u9759\u6001\u65b9\u6cd5\u83b7\u53d6\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions()")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptionsMonitor()")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptionsSnapshot()"))))),Object(o.b)(p.a,{defaultValue:"App.GetOptions(jsonKey)",values:[{label:"App.GetOptions(jsonKey)",value:"App.GetOptions(jsonKey)"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"},{label:"App.GetOptions()",value:"App.GetOptions()"}],mdxType:"Tabs"},Object(o.b)(s.a,{value:"App.GetOptions(jsonKey)",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13-16}","{13-16}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get()\n {\n // \u4e0d\u63a8\u8350\u91c7\u7528\u6b64\u65b9\u5f0f\u8bfb\u53d6\n var appInfo = App.GetOptions("AppInfo");\n return $@"\u540d\u79f0\uff1a{appInfo.Name}\uff0c\n \u7248\u672c\uff1a{appInfo.Version}\uff0c\n \u516c\u53f8\uff1a{appInfo.Company}";\n }\n }\n}\n'))),Object(o.b)(s.a,{value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3,15-17,27-29,31-33,35-37}","{3,15-17,27-29,31-33,35-37}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Options;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n private readonly AppInfoOptions options1;\n private readonly AppInfoOptions options2;\n private readonly AppInfoOptions options3;\n\n public DefaultController(\n IOptions options\n , IOptionsSnapshot optionsSnapshot\n , IOptionsMonitor optionsMonitor)\n {\n options1 = options.Value;\n options2 = optionsSnapshot.Value;\n options3 = optionsMonitor.CurrentValue;\n }\n\n [HttpGet]\n public string Get()\n {\n var info1 = $@"\u540d\u79f0\uff1a{options1.Name}\uff0c\n \u7248\u672c\uff1a{options1.Version}\uff0c\n \u516c\u53f8\uff1a{options1.Company}";\n\n var info2 = $@"\u540d\u79f0\uff1a{options3.Name}\uff0c\n \u7248\u672c\uff1a{options3.Version}\uff0c\n \u516c\u53f8\uff1a{options3.Company}";\n\n var info3 = $@"\u540d\u79f0\uff1a{options3.Name}\uff0c\n \u7248\u672c\uff1a{options3.Version}\uff0c\n \u516c\u53f8\uff1a{options3.Company}";\n\n return $"{info1}-{info2}-{info3}";\n }\n }\n}\n'))),Object(o.b)(s.a,{value:"App.GetOptions()",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12-15,17-20,22-25}","{12-15,17-20,22-25}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get()\n {\n var options1 = App.GetOptions();\n var info1 = $@"\u540d\u79f0\uff1a{options1.Name}\uff0c\n \u7248\u672c\uff1a{options1.Version}\uff0c\n \u516c\u53f8\uff1a{options1.Company}";\n\n var options2 = App.GetOptionsSnapshot();\n var info2 = $@"\u540d\u79f0\uff1a{options2.Name}\uff0c\n \u7248\u672c\uff1a{options2.Version}\uff0c\n \u516c\u53f8\uff1a{options2.Company}";\n\n var options3 = App.GetOptionsMonitor();\n var info3 = $@"\u540d\u79f0\uff1a{options3.Name}\uff0c\n \u7248\u672c\uff1a{options3.Version}\uff0c\n \u516c\u53f8\uff1a{options3.Company}";\n\n return $"{info1}-{info2}-{info3}";\n }\n }\n}\n')))),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"App.GetOptions(jsonKey)")," \u9759\u6001\u65b9\u6cd5 \u533a\u522b\u4e8e\u6ca1\u6709\u53c2\u6570\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"App.GetOptions()")," \u9759\u6001\u65b9\u6cd5\uff0c\u524d\u8005\u5b9e\u9645\u4e0a\u8fd8\u662f ",Object(o.b)("strong",{parentName:"p"},"\u914d\u7f6e"),"\uff0c\u53ea\u4e0d\u8fc7\u505a\u4e86\u5f3a\u7c7b\u578b\u89e3\u6790\uff0c\u540e\u8005\u5219\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"IOptions")," \u89e3\u6790\u3002"),Object(o.b)("p",{parentName:"div"},"\u4e24\u8005\u6e90\u7801\u5982\u4e0b\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{18-20,27-29} title="Furion/App/App.cs"',"{18-20,27-29}":!0,title:'"Furion/App/App.cs"'}),'using Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Options;\n\nnamespace Furion\n{\n /// \n /// \u5168\u5c40\u5e94\u7528\u7c7b\n /// \n public static class App\n {\n /// \n /// \u83b7\u53d6\u9009\u9879\n /// \n /// \u5f3a\u7c7b\u578b\u9009\u9879\u7c7b\n /// \u914d\u7f6e\u4e2d\u5bf9\u5e94\u7684Key\n /// \n public static TOptions GetOptions(string jsonKey)\n where TOptions : class\n => Configuration.GetSection(jsonKey).Get();\n\n /// \n /// \u83b7\u53d6\u9009\u9879\n /// \n /// \u5f3a\u7c7b\u578b\u9009\u9879\u7c7b\n /// \n public static TOptions GetOptions()\n where TOptions : class\n => ServiceProvider.GetService>().Value;\n\n // Other Codes...\n }\n}\n')),Object(o.b)("p",{parentName:"div"},"\u901a\u8fc7\u4e0a\u8ff0\u4ee3\u7801\u5f97\u77e5\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u63a8\u8350\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"App.GetOptions(jsonKey)")," \u8bfb\u53d6\uff0c\u56e0\u4e3a\u8fd9\u79cd\u65b9\u5f0f\u65e0\u6cd5\u5e94\u7528\u9009\u9879\u9a8c\u8bc1\u3001\u9ed8\u8ba4\u914d\u7f6e\u3001\u66f4\u6539\u901a\u77e5\u7b49\u529f\u80fd\u3002"))),Object(o.b)("h3",{id:"4235-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"},"4.2.3.5 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5982\u679c\u9009\u9879\u9700\u8981\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\uff0c\u5219\u65e0\u8bba\u4efb\u4f55\u65f6\u5019\u90fd\u4e0d\u63a8\u8350\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions(jsonKey)")),Object(o.b)("li",{parentName:"ul"},"\u5728\u53ef\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u4f9d\u8d56\u6ce8\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"IOptions[Snapshot|Monitor]")," \u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u5728\u9759\u6001\u7c7b/\u975e\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u9009\u62e9 ",Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions[Snapshot|Monitor]()")," \u8bfb\u53d6")),Object(o.b)("h2",{id:"424-\u9009\u9879\u63a5\u53e3\u8bf4\u660e"},"4.2.4 \u9009\u9879\u63a5\u53e3\u8bf4\u660e"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u63d0\u4f9b\u4e86\u591a\u79cd\u8bfb\u53d6\u9009\u9879\u7684\u63a5\u53e3\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptions"),"\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5728\u5e94\u7528\u542f\u52a8\u540e\u8bfb\u53d6\u914d\u7f6e\u6570\u636e"),Object(o.b)("li",{parentName:"ul"},"\u547d\u540d\u9009\u9879"))),Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e3a\u5355\u4e00\u5b9e\u4f8b\u4e14\u53ef\u4ee5\u6ce8\u5165\u5230\u4efb\u4f55\u670d\u52a1\u751f\u5b58\u671f"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsSnapshot"),"\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5728\u6bcf\u6b21\u8bf7\u6c42\u65f6\u5e94\u91cd\u65b0\u8ba1\u7b97\u9009\u9879\u7684\u65b9\u6848\u4e2d\u6709\u7528"),Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e3a\u8303\u56f4\u5185\uff0c\u56e0\u6b64\u65e0\u6cd5\u6ce8\u5165\u5230\u5355\u4e00\u5b9e\u4f8b\u670d\u52a1"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u547d\u540d\u9009\u9879"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsMonitor"),"\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u7528\u4e8e\u68c0\u7d22\u9009\u9879\u5e76\u7ba1\u7406 TOptions \u5b9e\u4f8b\u7684\u9009\u9879\u901a\u77e5\u3002"),Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e3a\u5355\u4e00\u5b9e\u4f8b\u4e14\u53ef\u4ee5\u6ce8\u5165\u5230\u4efb\u4f55\u670d\u52a1\u751f\u5b58\u671f\u3002"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u66f4\u6539\u901a\u77e5"),Object(o.b)("li",{parentName:"ul"},"\u547d\u540d\u9009\u9879"),Object(o.b)("li",{parentName:"ul"},"\u53ef\u91cd\u8f7d\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u9009\u62e9\u6027\u9009\u9879\u5931\u6548 ",Object(o.b)("inlineCode",{parentName:"li"},"(IOptionsMonitorCache)"))))))),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u9009\u9879\u63a5\u53e3")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/options?view=aspnetcore-5.0#options-interfaces"}),"ASP.NET Core - \u9009\u9879 - \u9009\u9879\u63a5\u53e3")," \u5c0f\u8282\u3002"))),Object(o.b)("h2",{id:"425-\u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e"},"4.2.5 \u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e"),Object(o.b)("p",null,"\u6211\u4eec\u77e5\u9053\uff0c\u9009\u9879\u5b9e\u9645\u4e0a\u9700\u8981\u548c\u914d\u7f6e\u6587\u4ef6\u7279\u5b9a\u952e\u503c\u6302\u94a9\uff0c\u90a3 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u662f\u5982\u4f55\u51c6\u786e\u7684\u627e\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u952e\u503c\u7684\u5462\uff1f"),Object(o.b)("h3",{id:"4251-\u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b"},"4.2.5.1 \u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"\u6ca1\u6709\u8d34 ",Object(o.b)("inlineCode",{parentName:"strong"},"[OptionsSettings]")," \u7279\u6027"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u4ee5 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u7ed3\u5c3e\uff0c\u5219\u53bb\u9664 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u5b57\u7b26\u4e32"),Object(o.b)("li",{parentName:"ul"},"\u5426\u5219\u8fd4\u56de ",Object(o.b)("inlineCode",{parentName:"li"},"\u7c7b\u540d\u79f0")))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"\u8d34\u4e86 ",Object(o.b)("inlineCode",{parentName:"strong"},"[OptionsSettings]")," \u7279\u6027"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5982\u679c\u914d\u7f6e\u4e86 ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u5c5e\u6027\uff0c\u5219\u8fd4\u56de ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u7684\u503c"),Object(o.b)("li",{parentName:"ul"},"\u5426\u5219\u8fd4\u56de ",Object(o.b)("inlineCode",{parentName:"li"},"\u7c7b\u540d\u79f0"))))),Object(o.b)(p.a,{defaultValue:"non-optionsettings",values:[{label:"\u65e0[OptionsSettings]",value:"non-optionsettings"},{label:"\u6709[OptionsSettings]",value:"has-optionsettings"}],mdxType:"Tabs"},Object(o.b)(s.a,{value:"non-optionsettings",mdxType:"TabItem"},Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u4ee5 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u7ed3\u5c3e\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppInfo"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public class AppInfoOptions : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u4e0d\u4ee5 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u7ed3\u5c3e\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppInfoSettings"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public class AppInfoSettings : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n"))),Object(o.b)(s.a,{value:"has-optionsettings",mdxType:"TabItem"},Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u914d\u7f6e\u4e86 ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u5c5e\u6027\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppSettings:AppInfo"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),'[OptionsSettings("AppSettings:AppInfo")]\npublic class AppInfoOptions : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n')),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u6ca1\u6709\u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u5c5e\u6027\uff0c\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppInfoSettings"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"[OptionsSettings]\npublic class AppInfoSettings : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n")))),Object(o.b)("h2",{id:"426-optionssettings-\u8bf4\u660e"},"4.2.6 ",Object(o.b)("inlineCode",{parentName:"h2"},"[OptionsSettings]")," \u8bf4\u660e"),Object(o.b)("p",null,"\u9009\u9879\u7c7b\u53ef\u4ee5\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"[OptionsSettings]")," \u6765\u914d\u7f6e\u67e5\u627e\u8def\u5f84\u503c\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"JsonKey"),"\uff1a\u5bf9\u5e94\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u952e\uff0c\u652f\u6301 ",Object(o.b)("strong",{parentName:"li"},"\u5206\u5c42\u952e")," \u5b57\u7b26\u4e32\uff0c\u53c2\u89c1\uff1a\u300a",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"configuration#%E5%A6%82%E4%BD%95%E9%80%89%E6%8B%A9%E8%AF%BB%E5%8F%96%E6%96%B9%E5%BC%8F"}),"4.2 \u914d\u7f6e - 3.1.3 \u5206\u5c42\u8bfb\u53d6\u6570\u636e"),"\u300b"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"PostConfigureAll"),"\uff1a\u9009\u9879\u540e\u671f\u914d\u7f6e\uff0c\u9ed8\u8ba4 ",Object(o.b)("inlineCode",{parentName:"li"},"false"),"\u3002",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/options?view=aspnetcore-3.1#options-post-configuration"}),"ASP.NET Core - \u9009\u9879 - \u9009\u9879\u540e\u671f\u914d\u7f6e"))),Object(o.b)("h2",{id:"427-\u9009\u9879\u9a8c\u8bc1"},"4.2.7 \u9009\u9879\u9a8c\u8bc1"),Object(o.b)("p",null,"\u9009\u9879\u652f\u6301\u9a8c\u8bc1\u914d\u7f6e\u6709\u6548\u6027\uff0c\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"services.AddConfigurableOptions()")," \u6ce8\u518c\u9009\u9879\u9ed8\u8ba4\u542f\u7528\u4e86\u9a8c\u8bc1\u652f\u6301\u3002"),Object(o.b)("p",null,"\u5305\u62ec\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u7279\u6027\u65b9\u5f0f ",Object(o.b)("inlineCode",{parentName:"li"},"DataAnnotations")),Object(o.b)("li",{parentName:"ul"},"\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1 ",Object(o.b)("inlineCode",{parentName:"li"},"IValidateOptions"))),Object(o.b)(p.a,{defaultValue:"texin",values:[{label:"\u7279\u6027\u65b9\u5f0f",value:"texin"},{label:"\u590d\u6742\u9a8c\u8bc1",value:"fuza"}],mdxType:"Tabs"},Object(o.b)(s.a,{value:"texin",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8,10,12}","{2,8,10,12}":!0}),'using Furion.ConfigurableOptions;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required, RegularExpression(@"^[0-9][0-9\\.]+[0-9]$", ErrorMessage = "\u4e0d\u662f\u6709\u6548\u7684\u7248\u672c\u53f7")]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n }\n}\n'))),Object(o.b)(s.a,{value:"fuza",mdxType:"TabItem"},Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b ",Object(o.b)("inlineCode",{parentName:"li"},"AppInfoValidation")," \u5e76\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"li"},"IValidateOptions")," \u63a5\u53e3\uff0c\u540c\u65f6\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"li"},"Validate")," \u65b9\u6cd5\u3002")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,8,12,15}","{1,6,8,12,15}":!0}),'using Microsoft.Extensions.Options;\nusing System.Text.RegularExpressions;\n\nnamespace Furion.Application\n{\n public class AppInfoValidation : IValidateOptions\n {\n public ValidateOptionsResult Validate(string name, AppInfoOptions options)\n {\n if (!Regex.IsMatch(options.Version, @"^[0-9][0-9\\.]+[0-9]$"))\n {\n return ValidateOptionsResult.Fail("\u4e0d\u662f\u6709\u6548\u7684\u7248\u672c\u53f7");\n }\n\n return ValidateOptionsResult.Success;\n }\n }\n}\n')),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u9009\u9879\u7c7b\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"li"},"IConfigurableOptions")," \u63a5\u53e3\uff0c\u5e76\u5b9e\u73b0\u8be5\u63a5\u53e3\u3002")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,16-18}","{6,16-18}":!0}),'using Furion.ConfigurableOptions;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n\n // \u9009\u9879\u540e\u671f\u914d\u7f6e\n public void PostConfigure(AppInfoOptions options, IConfiguration configuration)\n {\n }\n }\n}\n')),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,9,19,25,27,31,34}","{4,9,19,25,27,31,34}":!0}),'using Furion.ConfigurableOptions;\nusing Microsoft.Extensions.Options;\nusing System.ComponentModel.DataAnnotations;\nusing System.Text.RegularExpressions;\n\nnamespace Furion.Application\n{\n // \u7ee7\u627f IConfigurableOptions \u63a5\u53e3\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n\n // \u9009\u9879\u540e\u671f\u914d\u7f6e\n public void PostConfigure(AppInfoOptions options)\n {\n }\n }\n\n // \u521b\u5efa\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\n public class AppInfoValidation : IValidateOptions\n {\n public ValidateOptionsResult Validate(string name, AppInfoOptions options)\n {\n if (!Regex.IsMatch(options.Version, @"^[0-9][0-9\\.]+[0-9]$"))\n {\n return ValidateOptionsResult.Fail("\u4e0d\u662f\u6709\u6548\u7684\u7248\u672c\u53f7");\n }\n\n return ValidateOptionsResult.Success;\n }\n }\n}\n')))),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions"))," \u7ee7\u627f\u81ea ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions")),"\uff0c\u4e5f\u5c31\u662f\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1\u9ed8\u8ba4\u5177\u6709 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"PostConfigure(TOptions options)"))," \u9009\u9879\u540e\u671f\u914d\u7f6e\u65b9\u6cd5\u3002\u5173\u4e8e\u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"#227-%E9%80%89%E9%A1%B9%E5%90%8E%E6%9C%9F%E9%85%8D%E7%BD%AE"}),"4.2.8 \u9009\u9879\u540e\u671f\u914d\u7f6e"),"\u300b\u5c06\u5728\u4e0b\u4e00\u5c0f\u8282\u8bf4\u660e\u3002"))),Object(o.b)("h2",{id:"428-\u9009\u9879\u540e\u671f\u914d\u7f6e"},"4.2.8 \u9009\u9879\u540e\u671f\u914d\u7f6e"),Object(o.b)("p",null,"\u9009\u9879\u540e\u671f\u914d\u7f6e\u901a\u4fd7\u4e00\u70b9\u6765\u8bf4\uff0c\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u89e3\u6790\u503c\u6216\u8bbe\u5b9a\u9ed8\u8ba4\u503c/\u540e\u671f\u914d\u7f6e\u7b49\u3002"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u914d\u7f6e\u9009\u9879\u540e\u671f\u914d\u7f6e\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"p"},"IConfigurableOptions")," \u63a5\u53e3\u5e76\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"PostConfigure(TOptions options)")," \u65b9\u6cd5\u3002"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,16-21}","{7,16-21}":!0}),'using Furion.ConfigurableOptions;\nusing Microsoft.Extensions.Configuration;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n\n public void PostConfigure(AppInfoOptions options, IConfiguration configuration)\n {\n options.Name ??= "Furion";\n options.Version ??= "1.0.0";\n options.Company ??= "Baiqian";\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions"))," \u7ee7\u627f\u81ea ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions")),"\uff0c\u4e5f\u5c31\u662f\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1\u9ed8\u8ba4\u5177\u6709 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"PostConfigure(TOptions options, IConfiguration configuration)"))," \u9009\u9879\u540e\u671f\u914d\u7f6e\u65b9\u6cd5\u3002"))),Object(o.b)("h2",{id:"429-\u9009\u9879\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09"},"4.2.9 \u9009\u9879\u66f4\u6539\u901a\u77e5\uff08",Object(o.b)("inlineCode",{parentName:"h2"},"\u70ed\u66f4\u65b0"),"\uff09"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7b80\u5355\u4e14\u7075\u6d3b\u7684\u65b9\u5f0f\u76d1\u542c\u9009\u9879\u66f4\u6539\uff0c\u4e5f\u5c31\u662f ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u6216 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u53d1\u751f\u4efb\u4f55\u66f4\u6539\u90fd\u4f1a\u89e6\u53d1\u5904\u7406\u65b9\u6cd5"),"\u3002"),Object(o.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"p"},"IConfigurableOptionsListener")," \u63a5\u53e3\u5e76\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"void OnListener(TOptions options, IConfiguration configuration)")," \u65b9\u6cd5\u5373\u53ef\u3002"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,12-16}","{5,12-16}":!0}),"using Furion.ConfigurableOptions;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptionsListener\n {\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n }\n\n public void OnListener(AppInfoOptions options, IConfiguration configuration)\n {\n var name = options.Name; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n var version = options.Version; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n }\n\n public void PostConfigure(AppInfoOptions options, IConfiguration configuration)\n {\n }\n}\n")),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptionsListener"))," \u7ee7\u627f\u81ea ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions")),"\u3002"))),Object(o.b)("h2",{id:"4210-\u9009\u9879\u7684\u4f18\u7f3a\u70b9"},"4.2.10 \u9009\u9879\u7684\u4f18\u7f3a\u70b9"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5f3a\u7c7b\u578b\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u63d0\u4f9b\u591a\u79cd\u8bfb\u53d6\u65b9\u5f0f"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u70ed\u52a0\u8f7d"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u8bbe\u7f6e\u9ed8\u8ba4\u503c/\u540e\u671f\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u5728\u8fd0\u884c\u73af\u5883\u4e2d\u52a8\u6001\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u9a8c\u8bc1\u914d\u7f6e\u6709\u6548\u6027"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u66f4\u6539\u901a\u77e5"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u547d\u540d\u9009\u9879"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u9700\u8981\u5b9a\u4e49\u5bf9\u5e94\u7c7b\u578b"),Object(o.b)("li",{parentName:"ul"},"\u9700\u8981\u5728\u542f\u52a8\u65f6\u6ce8\u518c")))),Object(o.b)("h2",{id:"4211-\u53cd\u9988\u4e0e\u5efa\u8bae"},"4.2.11 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(o.b)("hr",null),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u9009\u9879")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/options?view=aspnetcore-5.0"}),"ASP.NET Core - \u9009\u9879")," \u7ae0\u8282\u3002"))))}u.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return p}));var a=t(21),i=t(195);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const p=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+p:p}(n,e,t,a)}}function p(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return l})),t.d(n,"b",(function(){return m}));var a=t(0),i=t.n(a);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function s(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=i.a.createContext({}),b=function(e){var n=i.a.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):s(s({},n),e)),t},l=function(e){var n=b(e.components);return i.a.createElement(c.Provider,{value:n},e.children)},O={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},u=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,p=e.parentName,c=r(e,["components","mdxType","originalType","parentName"]),l=b(t),u=a,m=l["".concat(p,".").concat(u)]||l[u]||O[u]||o;return t?i.a.createElement(m,s(s({ref:n},c),{},{components:t})):i.a.createElement(m,s({ref:n},c))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,p=new Array(o);p[0]=u;var s={};for(var r in n)hasOwnProperty.call(n,r)&&(s[r]=n[r]);s.originalType=e,s.mdxType="string"==typeof e?e:a,p[1]=s;for(var c=2;cn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&g(e)}const f=e=>{g(e),null!=O&&d(O,e)},v=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(p.a)("tabs",{"tabs--block":t},u)},l.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(p.a)("tabs__item",r.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>v.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case b:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case c:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(v,e.target,e)},onFocus:()=>f(e),onClick:()=>{f(e)}},n))),n?Object(a.cloneElement)(N.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},N.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==j}))))}},204:function(e,n,t){"use strict";var a=t(3),i=t(0),o=t.n(i);n.a=function({children:e,hidden:n,className:t}){return o.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file diff --git a/docs/e1713ffa.ecb8f7a2.js b/docs/e1713ffa.ecb8f7a2.js deleted file mode 100644 index 43e5030c743..00000000000 --- a/docs/e1713ffa.ecb8f7a2.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[96],{170:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return l})),t.d(n,"default",(function(){return u}));var a=t(3),i=t(7),o=(t(0),t(192)),p=(t(190),t(199)),s=t(200),r=t(193),c={id:"options",title:"4.2 \u9009\u9879",sidebar_label:"4.2 \u9009\u9879"},b={unversionedId:"options",id:"options",isDocsHomePage:!1,title:"4.2 \u9009\u9879",description:"4.2.1 \u4ec0\u4e48\u662f\u9009\u9879",source:"@site/docs\\options.mdx",slug:"/options",permalink:"/docs/options",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/options.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4.2 \u9009\u9879",sidebar:"docs",previous:{title:"4.1 \u914d\u7f6e",permalink:"/docs/configuration"},next:{title:"5. \u52a8\u6001 WebAPI",permalink:"/docs/dynamic-api-controller"}},l=[{value:"4.2.1 \u4ec0\u4e48\u662f\u9009\u9879",id:"421-\u4ec0\u4e48\u662f\u9009\u9879",children:[]},{value:"4.2.2 \u4e0e\u914d\u7f6e\u7684\u533a\u522b",id:"422-\u4e0e\u914d\u7f6e\u7684\u533a\u522b",children:[]},{value:"4.2.3 \u9009\u9879\u7684\u4f7f\u7528",id:"423-\u9009\u9879\u7684\u4f7f\u7528",children:[{value:"4.2.3.1 \u914d\u7f6e appsettings.json \u4fe1\u606f",id:"4231-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.2.3.2 \u521b\u5efa AppInfoOptions \u5f3a\u7c7b\u578b\u7c7b",id:"4232-\u521b\u5efa-appinfooptions-\u5f3a\u7c7b\u578b\u7c7b",children:[]},{value:"4.2.3.3 \u6ce8\u518c AppInfoOptions \u670d\u52a1",id:"4233-\u6ce8\u518c-appinfooptions-\u670d\u52a1",children:[]},{value:"4.2.3.4 \u8bfb\u53d6 AppInfoOptions \u4fe1\u606f",id:"4234-\u8bfb\u53d6-appinfooptions-\u4fe1\u606f",children:[]},{value:"4.2.3.5 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",id:"4235-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",children:[]}]},{value:"4.2.4 \u9009\u9879\u63a5\u53e3\u8bf4\u660e",id:"424-\u9009\u9879\u63a5\u53e3\u8bf4\u660e",children:[]},{value:"4.2.5 \u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e",id:"425-\u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e",children:[{value:"4.2.5.1 \u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b",id:"4251-\u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b",children:[]}]},{value:"4.2.6 [OptionsSettings] \u8bf4\u660e",id:"426-optionssettings-\u8bf4\u660e",children:[]},{value:"4.2.7 \u9009\u9879\u9a8c\u8bc1",id:"427-\u9009\u9879\u9a8c\u8bc1",children:[]},{value:"4.2.8 \u9009\u9879\u540e\u671f\u914d\u7f6e",id:"428-\u9009\u9879\u540e\u671f\u914d\u7f6e",children:[]},{value:"4.2.9 \u9009\u9879\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",id:"429-\u9009\u9879\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",children:[]},{value:"4.2.10 \u9009\u9879\u7684\u4f18\u7f3a\u70b9",id:"4210-\u9009\u9879\u7684\u4f18\u7f3a\u70b9",children:[]},{value:"4.2.11 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"4211-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],O={toc:l};function u(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},O,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(r.a,{mdxType:"JoinGroup"}),Object(o.b)("h2",{id:"421-\u4ec0\u4e48\u662f\u9009\u9879"},"4.2.1 \u4ec0\u4e48\u662f\u9009\u9879"),Object(o.b)("p",null,"\u9009\u9879\u662f ",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u63a8\u8350\u7684\u52a8\u6001\u8bfb\u53d6\u914d\u7f6e\u7684\u65b9\u5f0f\uff0c\u8fd9\u79cd\u65b9\u5f0f\u5c06\u914d\u7f6e\u6587\u4ef6\u6570\u636e\u7528\u4e00\u4e2a",Object(o.b)("strong",{parentName:"p"},"\u5f3a\u7c7b\u578b"),"\u6765\u6258\u7ba1\uff0c\u80fd\u591f\u5b9e\u73b0\u914d\u7f6e\u9a8c\u8bc1\u3001\u9ed8\u8ba4\u503c\u914d\u7f6e\u3001\u5b9e\u65f6\u8bfb\u53d6\u7b49\u529f\u80fd\u3002"),Object(o.b)("h2",{id:"422-\u4e0e\u914d\u7f6e\u7684\u533a\u522b"},"4.2.2 \u4e0e\u914d\u7f6e\u7684\u533a\u522b"),Object(o.b)("p",null,"\u9009\u9879\u5b9e\u9645\u4e0a\u4e5f\u662f\u914d\u7f6e\uff0c\u4f46\u5728\u540e\u8005\u7684\u57fa\u7840\u4e0a\u6dfb\u52a0\u4e86\u914d\u7f6e\u9a8c\u8bc1\u3001\u9ed8\u8ba4\u503c/\u540e\u671f\u914d\u7f6e\u8bbe\u5b9a\u53ca\u63d0\u4f9b\u4e86\u591a\u79cd\u63a5\u53e3\u8bfb\u53d6\u914d\u7f6e\u4fe1\u606f\uff0c\u540c\u65f6\u8fd8\u652f\u6301\u4f9b\u914d\u7f6e\u66f4\u6539\u901a\u77e5\u7b49\u5f3a\u5927\u7075\u6d3b\u529f\u80fd\u3002"),Object(o.b)("p",null,"\u6240\u4ee5\uff0c\u9664\u4e86\u4e00\u6b21\u6027\u8bfb\u53d6\u4f7f\u7528\u7684\u914d\u7f6e\u4ee5\u5916\uff0c\u90fd\u5e94\u8be5\u9009\u7528 ",Object(o.b)("strong",{parentName:"p"},"\u9009\u9879")," \u66ff\u6362 ",Object(o.b)("strong",{parentName:"p"},"\u914d\u7f6e"),"\u3002"),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u77e5\u8bc6\u5bfc\u822a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6709\u5173\u914d\u7f6e\u8bf4\u660e\u53ef\u67e5\u770b\u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/configuration"}),"4.1 \u914d\u7f6e"),"\u300b \u7ae0\u8282\u3002"))),Object(o.b)("h2",{id:"423-\u9009\u9879\u7684\u4f7f\u7528"},"4.2.3 \u9009\u9879\u7684\u4f7f\u7528"),Object(o.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u83b7\u53d6",Object(o.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u540d\u79f0\u3001\u7248\u672c\u53f7\u53ca\u7248\u6743\u4fe1\u606f"),"\uff0c\u8fd9\u4e9b\u4fe1\u606f\u53ef\u80fd\u968f\u65f6\u53d8\u5316\u800c\u4e14\u9700\u8981\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u5c06\u8fd9\u4e9b\u4fe1\u606f\u914d\u7f6e\u8d77\u6765\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a"),Object(o.b)("h3",{id:"4231-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f"},"4.2.3.1 \u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2-6}","{2-6}":!0}),'{\n "AppInfo": {\n "Name": "Furion",\n "Version": "1.0.0",\n "Company": "Baiqian"\n }\n}\n')),Object(o.b)("h3",{id:"4232-\u521b\u5efa-appinfooptions-\u5f3a\u7c7b\u578b\u7c7b"},"4.2.3.2 \u521b\u5efa ",Object(o.b)("inlineCode",{parentName:"h3"},"AppInfoOptions")," \u5f3a\u7c7b\u578b\u7c7b"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,5}","{1,5}":!0}),"using Furion.ConfigurableOptions;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n }\n}\n")),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5efa\u8bae\u6240\u6709\u9009\u9879\u7c7b\u90fd\u5e94\u8be5\u4ee5 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"Options"))," \u547d\u540d\u7ed3\u5c3e\u3002"),Object(o.b)("p",{parentName:"div"},"\u53e6\u5916\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u6ce8\u518c\u9009\u9879\u670d\u52a1\u7684\u65b9\u6cd5\uff0c\u53ea\u9700\u8981\u7ee7\u627f ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions"))," \u63a5\u53e3\u5373\u53ef\uff0c\u8be5\u63a5\u53e3\u4f4d\u4e8e ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"Furion.ConfigurableOptions"))," \u547d\u540d\u7a7a\u95f4\u4e0b\u3002"))),Object(o.b)("h3",{id:"4233-\u6ce8\u518c-appinfooptions-\u670d\u52a1"},"4.2.3.3 \u6ce8\u518c ",Object(o.b)("inlineCode",{parentName:"h3"},"AppInfoOptions")," \u670d\u52a1"),Object(o.b)("p",null,Object(o.b)("strong",{parentName:"p"},"\u9009\u9879\u4e0d\u540c\u4e8e\u914d\u7f6e\uff0c\u9700\u5728\u5e94\u7528\u542f\u52a8\u65f6\u6ce8\u518c")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{12} title="Furion.Web.Core\\FurWebCoreStartup.cs"',"{12}":!0,title:'"Furion.Web.Core\\FurWebCoreStartup.cs"'}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.DependencyInjection;\n\nnamespace Furion.Web.Core\n{\n [AppStartup(800)]\n public sealed class FurWebCoreStartup : AppStartup\n {\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddConfigurableOptions();\n }\n }\n}\n")),Object(o.b)("h3",{id:"4234-\u8bfb\u53d6-appinfooptions-\u4fe1\u606f"},"4.2.3.4 \u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"h3"},"AppInfoOptions")," \u4fe1\u606f"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u591a\u79cd\u8bfb\u53d6\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions(jsonKey)")," \u8bfb\u53d6\uff08",Object(o.b)("strong",{parentName:"li"},"\u4e0d\u63a8\u8350"),"\uff09"),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165\u4ee5\u4e0b\u5b9e\u4f8b\u8bfb\u53d6\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptions")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsSnapshot")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsMonitor")))),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"li"},"App")," \u9759\u6001\u7c7b\u63d0\u4f9b\u7684\u9759\u6001\u65b9\u6cd5\u83b7\u53d6\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions()")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptionsMonitor()")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptionsSnapshot()"))))),Object(o.b)(p.a,{defaultValue:"App.GetOptions(jsonKey)",values:[{label:"App.GetOptions(jsonKey)",value:"App.GetOptions(jsonKey)"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"},{label:"App.GetOptions()",value:"App.GetOptions()"}],mdxType:"Tabs"},Object(o.b)(s.a,{value:"App.GetOptions(jsonKey)",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{13-16}","{13-16}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get()\n {\n // \u4e0d\u63a8\u8350\u91c7\u7528\u6b64\u65b9\u5f0f\u8bfb\u53d6\n var appInfo = App.GetOptions("AppInfo");\n return $@"\u540d\u79f0\uff1a{appInfo.Name}\uff0c\n \u7248\u672c\uff1a{appInfo.Version}\uff0c\n \u516c\u53f8\uff1a{appInfo.Company}";\n }\n }\n}\n'))),Object(o.b)(s.a,{value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3,15-17,27-29,31-33,35-37}","{3,15-17,27-29,31-33,35-37}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Options;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n private readonly AppInfoOptions options1;\n private readonly AppInfoOptions options2;\n private readonly AppInfoOptions options3;\n\n public DefaultController(\n IOptions options\n , IOptionsSnapshot optionsSnapshot\n , IOptionsMonitor optionsMonitor)\n {\n options1 = options.Value;\n options2 = optionsSnapshot.Value;\n options3 = optionsMonitor.CurrentValue;\n }\n\n [HttpGet]\n public string Get()\n {\n var info1 = $@"\u540d\u79f0\uff1a{options1.Name}\uff0c\n \u7248\u672c\uff1a{options1.Version}\uff0c\n \u516c\u53f8\uff1a{options1.Company}";\n\n var info2 = $@"\u540d\u79f0\uff1a{options3.Name}\uff0c\n \u7248\u672c\uff1a{options3.Version}\uff0c\n \u516c\u53f8\uff1a{options3.Company}";\n\n var info3 = $@"\u540d\u79f0\uff1a{options3.Name}\uff0c\n \u7248\u672c\uff1a{options3.Version}\uff0c\n \u516c\u53f8\uff1a{options3.Company}";\n\n return $"{info1}-{info2}-{info3}";\n }\n }\n}\n'))),Object(o.b)(s.a,{value:"App.GetOptions()",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{12-15,17-20,22-25}","{12-15,17-20,22-25}":!0}),'using Furion.Application;\nusing Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get()\n {\n var options1 = App.GetOptions();\n var info1 = $@"\u540d\u79f0\uff1a{options1.Name}\uff0c\n \u7248\u672c\uff1a{options1.Version}\uff0c\n \u516c\u53f8\uff1a{options1.Company}";\n\n var options2 = App.GetOptionsSnapshot();\n var info2 = $@"\u540d\u79f0\uff1a{options2.Name}\uff0c\n \u7248\u672c\uff1a{options2.Version}\uff0c\n \u516c\u53f8\uff1a{options2.Company}";\n\n var options3 = App.GetOptionsMonitor();\n var info3 = $@"\u540d\u79f0\uff1a{options3.Name}\uff0c\n \u7248\u672c\uff1a{options3.Version}\uff0c\n \u516c\u53f8\uff1a{options3.Company}";\n\n return $"{info1}-{info2}-{info3}";\n }\n }\n}\n')))),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"App.GetOptions(jsonKey)")," \u9759\u6001\u65b9\u6cd5 \u533a\u522b\u4e8e\u6ca1\u6709\u53c2\u6570\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"App.GetOptions()")," \u9759\u6001\u65b9\u6cd5\uff0c\u524d\u8005\u5b9e\u9645\u4e0a\u8fd8\u662f ",Object(o.b)("strong",{parentName:"p"},"\u914d\u7f6e"),"\uff0c\u53ea\u4e0d\u8fc7\u505a\u4e86\u5f3a\u7c7b\u578b\u89e3\u6790\uff0c\u540e\u8005\u5219\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"IOptions")," \u89e3\u6790\u3002"),Object(o.b)("p",{parentName:"div"},"\u4e24\u8005\u6e90\u7801\u5982\u4e0b\uff1a"),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:'{18-20,27-29} title="Furion/App/App.cs"',"{18-20,27-29}":!0,title:'"Furion/App/App.cs"'}),'using Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Options;\n\nnamespace Furion\n{\n /// \n /// \u5168\u5c40\u5e94\u7528\u7c7b\n /// \n public static class App\n {\n /// \n /// \u83b7\u53d6\u9009\u9879\n /// \n /// \u5f3a\u7c7b\u578b\u9009\u9879\u7c7b\n /// \u914d\u7f6e\u4e2d\u5bf9\u5e94\u7684Key\n /// \n public static TOptions GetOptions(string jsonKey)\n where TOptions : class\n => Configuration.GetSection(jsonKey).Get();\n\n /// \n /// \u83b7\u53d6\u9009\u9879\n /// \n /// \u5f3a\u7c7b\u578b\u9009\u9879\u7c7b\n /// \n public static TOptions GetOptions()\n where TOptions : class\n => ServiceProvider.GetService>().Value;\n\n // Other Codes...\n }\n}\n')),Object(o.b)("p",{parentName:"div"},"\u901a\u8fc7\u4e0a\u8ff0\u4ee3\u7801\u5f97\u77e5\uff0c\u4e3a\u4ec0\u4e48\u4e0d\u63a8\u8350\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"App.GetOptions(jsonKey)")," \u8bfb\u53d6\uff0c\u56e0\u4e3a\u8fd9\u79cd\u65b9\u5f0f\u65e0\u6cd5\u5e94\u7528\u9009\u9879\u9a8c\u8bc1\u3001\u9ed8\u8ba4\u914d\u7f6e\u3001\u66f4\u6539\u901a\u77e5\u7b49\u529f\u80fd\u3002"))),Object(o.b)("h3",{id:"4235-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"},"4.2.3.5 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5982\u679c\u9009\u9879\u9700\u8981\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\uff0c\u5219\u65e0\u8bba\u4efb\u4f55\u65f6\u5019\u90fd\u4e0d\u63a8\u8350\u4f7f\u7528 ",Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions(jsonKey)")),Object(o.b)("li",{parentName:"ul"},"\u5728\u53ef\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u4f9d\u8d56\u6ce8\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"IOptions[Snapshot|Monitor]")," \u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u5728\u9759\u6001\u7c7b/\u975e\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u9009\u62e9 ",Object(o.b)("inlineCode",{parentName:"li"},"App.GetOptions[Snapshot|Monitor]()")," \u8bfb\u53d6")),Object(o.b)("h2",{id:"424-\u9009\u9879\u63a5\u53e3\u8bf4\u660e"},"4.2.4 \u9009\u9879\u63a5\u53e3\u8bf4\u660e"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u63d0\u4f9b\u4e86\u591a\u79cd\u8bfb\u53d6\u9009\u9879\u7684\u63a5\u53e3\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptions"),"\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5728\u5e94\u7528\u542f\u52a8\u540e\u8bfb\u53d6\u914d\u7f6e\u6570\u636e"),Object(o.b)("li",{parentName:"ul"},"\u547d\u540d\u9009\u9879"))),Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e3a\u5355\u4e00\u5b9e\u4f8b\u4e14\u53ef\u4ee5\u6ce8\u5165\u5230\u4efb\u4f55\u670d\u52a1\u751f\u5b58\u671f"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsSnapshot"),"\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5728\u6bcf\u6b21\u8bf7\u6c42\u65f6\u5e94\u91cd\u65b0\u8ba1\u7b97\u9009\u9879\u7684\u65b9\u6848\u4e2d\u6709\u7528"),Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e3a\u8303\u56f4\u5185\uff0c\u56e0\u6b64\u65e0\u6cd5\u6ce8\u5165\u5230\u5355\u4e00\u5b9e\u4f8b\u670d\u52a1"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u547d\u540d\u9009\u9879"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"IOptionsMonitor"),"\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u7528\u4e8e\u68c0\u7d22\u9009\u9879\u5e76\u7ba1\u7406 TOptions \u5b9e\u4f8b\u7684\u9009\u9879\u901a\u77e5\u3002"),Object(o.b)("li",{parentName:"ul"},"\u6ce8\u518c\u4e3a\u5355\u4e00\u5b9e\u4f8b\u4e14\u53ef\u4ee5\u6ce8\u5165\u5230\u4efb\u4f55\u670d\u52a1\u751f\u5b58\u671f\u3002"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\uff1a",Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u66f4\u6539\u901a\u77e5"),Object(o.b)("li",{parentName:"ul"},"\u547d\u540d\u9009\u9879"),Object(o.b)("li",{parentName:"ul"},"\u53ef\u91cd\u8f7d\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u9009\u62e9\u6027\u9009\u9879\u5931\u6548 ",Object(o.b)("inlineCode",{parentName:"li"},"(IOptionsMonitorCache)"))))))),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u9009\u9879\u63a5\u53e3")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/options?view=aspnetcore-5.0#options-interfaces"}),"ASP.NET Core - \u9009\u9879 - \u9009\u9879\u63a5\u53e3")," \u5c0f\u8282\u3002"))),Object(o.b)("h2",{id:"425-\u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e"},"4.2.5 \u9009\u9879\u81ea\u5b9a\u4e49\u914d\u7f6e"),Object(o.b)("p",null,"\u6211\u4eec\u77e5\u9053\uff0c\u9009\u9879\u5b9e\u9645\u4e0a\u9700\u8981\u548c\u914d\u7f6e\u6587\u4ef6\u7279\u5b9a\u952e\u503c\u6302\u94a9\uff0c\u90a3 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u662f\u5982\u4f55\u51c6\u786e\u7684\u627e\u5230\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u952e\u503c\u7684\u5462\uff1f"),Object(o.b)("h3",{id:"4251-\u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b"},"4.2.5.1 \u9009\u9879\u67e5\u627e\u952e\u6d41\u7a0b"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"\u6ca1\u6709\u8d34 ",Object(o.b)("inlineCode",{parentName:"strong"},"[OptionsSettings]")," \u7279\u6027"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u4ee5 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u7ed3\u5c3e\uff0c\u5219\u53bb\u9664 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u5b57\u7b26\u4e32"),Object(o.b)("li",{parentName:"ul"},"\u5426\u5219\u8fd4\u56de ",Object(o.b)("inlineCode",{parentName:"li"},"\u7c7b\u540d\u79f0")))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("strong",{parentName:"li"},"\u8d34\u4e86 ",Object(o.b)("inlineCode",{parentName:"strong"},"[OptionsSettings]")," \u7279\u6027"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5982\u679c\u914d\u7f6e\u4e86 ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u5c5e\u6027\uff0c\u5219\u8fd4\u56de ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u7684\u503c"),Object(o.b)("li",{parentName:"ul"},"\u5426\u5219\u8fd4\u56de ",Object(o.b)("inlineCode",{parentName:"li"},"\u7c7b\u540d\u79f0"))))),Object(o.b)(p.a,{defaultValue:"non-optionsettings",values:[{label:"\u65e0[OptionsSettings]",value:"non-optionsettings"},{label:"\u6709[OptionsSettings]",value:"has-optionsettings"}],mdxType:"Tabs"},Object(o.b)(s.a,{value:"non-optionsettings",mdxType:"TabItem"},Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u4ee5 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u7ed3\u5c3e\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppInfo"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public class AppInfoOptions : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n")),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u4e0d\u4ee5 ",Object(o.b)("inlineCode",{parentName:"li"},"Options")," \u7ed3\u5c3e\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppInfoSettings"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public class AppInfoSettings : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n"))),Object(o.b)(s.a,{value:"has-optionsettings",mdxType:"TabItem"},Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u914d\u7f6e\u4e86 ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u5c5e\u6027\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppSettings:AppInfo"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),'[OptionsSettings("AppSettings:AppInfo")]\npublic class AppInfoOptions : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n')),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u6ca1\u6709\u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"li"},"JsonKey")," \u5c5e\u6027\uff0c\uff0c\u5219\u952e\u540d\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppInfoSettings"))),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"[OptionsSettings]\npublic class AppInfoSettings : IConfigurableOptions\n{\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n}\n")))),Object(o.b)("h2",{id:"426-optionssettings-\u8bf4\u660e"},"4.2.6 ",Object(o.b)("inlineCode",{parentName:"h2"},"[OptionsSettings]")," \u8bf4\u660e"),Object(o.b)("p",null,"\u9009\u9879\u7c7b\u53ef\u4ee5\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"[OptionsSettings]")," \u6765\u914d\u7f6e\u67e5\u627e\u8def\u5f84\u503c\u3002"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"JsonKey"),"\uff1a\u5bf9\u5e94\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u952e\uff0c\u652f\u6301 ",Object(o.b)("strong",{parentName:"li"},"\u5206\u5c42\u952e")," \u5b57\u7b26\u4e32\uff0c\u53c2\u89c1\uff1a\u300a",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"configuration#%E5%A6%82%E4%BD%95%E9%80%89%E6%8B%A9%E8%AF%BB%E5%8F%96%E6%96%B9%E5%BC%8F"}),"4.2 \u914d\u7f6e - 3.1.3 \u5206\u5c42\u8bfb\u53d6\u6570\u636e"),"\u300b"),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"PostConfigureAll"),"\uff1a\u9009\u9879\u540e\u671f\u914d\u7f6e\uff0c\u9ed8\u8ba4 ",Object(o.b)("inlineCode",{parentName:"li"},"false"),"\u3002",Object(o.b)("a",Object(a.a)({parentName:"li"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/options?view=aspnetcore-3.1#options-post-configuration"}),"ASP.NET Core - \u9009\u9879 - \u9009\u9879\u540e\u671f\u914d\u7f6e"))),Object(o.b)("h2",{id:"427-\u9009\u9879\u9a8c\u8bc1"},"4.2.7 \u9009\u9879\u9a8c\u8bc1"),Object(o.b)("p",null,"\u9009\u9879\u652f\u6301\u9a8c\u8bc1\u914d\u7f6e\u6709\u6548\u6027\uff0c\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},"services.AddConfigurableOptions()")," \u6ce8\u518c\u9009\u9879\u9ed8\u8ba4\u542f\u7528\u4e86\u9a8c\u8bc1\u652f\u6301\u3002"),Object(o.b)("p",null,"\u5305\u62ec\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u7279\u6027\u65b9\u5f0f ",Object(o.b)("inlineCode",{parentName:"li"},"DataAnnotations")),Object(o.b)("li",{parentName:"ul"},"\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1 ",Object(o.b)("inlineCode",{parentName:"li"},"IValidateOptions"))),Object(o.b)(p.a,{defaultValue:"texin",values:[{label:"\u7279\u6027\u65b9\u5f0f",value:"texin"},{label:"\u590d\u6742\u9a8c\u8bc1",value:"fuza"}],mdxType:"Tabs"},Object(o.b)(s.a,{value:"texin",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,8,10,12}","{2,8,10,12}":!0}),'using Furion.ConfigurableOptions;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required, RegularExpression(@"^[0-9][0-9\\.]+[0-9]$", ErrorMessage = "\u4e0d\u662f\u6709\u6548\u7684\u7248\u672c\u53f7")]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n }\n}\n'))),Object(o.b)(s.a,{value:"fuza",mdxType:"TabItem"},Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b ",Object(o.b)("inlineCode",{parentName:"li"},"AppInfoValidation")," \u5e76\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"li"},"IValidateOptions")," \u63a5\u53e3\uff0c\u540c\u65f6\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"li"},"Validate")," \u65b9\u6cd5\u3002")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1,6,8,12,15}","{1,6,8,12,15}":!0}),'using Microsoft.Extensions.Options;\nusing System.Text.RegularExpressions;\n\nnamespace Furion.Application\n{\n public class AppInfoValidation : IValidateOptions\n {\n public ValidateOptionsResult Validate(string name, AppInfoOptions options)\n {\n if (!Regex.IsMatch(options.Version, @"^[0-9][0-9\\.]+[0-9]$"))\n {\n return ValidateOptionsResult.Fail("\u4e0d\u662f\u6709\u6548\u7684\u7248\u672c\u53f7");\n }\n\n return ValidateOptionsResult.Success;\n }\n }\n}\n')),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u9009\u9879\u7c7b\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"li"},"IConfigurableOptions")," \u63a5\u53e3\uff0c\u5e76\u5b9e\u73b0\u8be5\u63a5\u53e3\u3002")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{6,16-18}","{6,16-18}":!0}),'using Furion.ConfigurableOptions;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n\n // \u9009\u9879\u540e\u671f\u914d\u7f6e\n public void PostConfigure(AppInfoOptions options, IConfiguration configuration)\n {\n }\n }\n}\n')),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5b8c\u6574\u4ee3\u7801\u5982\u4e0b\uff1a")),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{4,9,19,25,27,31,34}","{4,9,19,25,27,31,34}":!0}),'using Furion.ConfigurableOptions;\nusing Microsoft.Extensions.Options;\nusing System.ComponentModel.DataAnnotations;\nusing System.Text.RegularExpressions;\n\nnamespace Furion.Application\n{\n // \u7ee7\u627f IConfigurableOptions \u63a5\u53e3\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n\n // \u9009\u9879\u540e\u671f\u914d\u7f6e\n public void PostConfigure(AppInfoOptions options)\n {\n }\n }\n\n // \u521b\u5efa\u81ea\u5b9a\u4e49\u9a8c\u8bc1\u7c7b\n public class AppInfoValidation : IValidateOptions\n {\n public ValidateOptionsResult Validate(string name, AppInfoOptions options)\n {\n if (!Regex.IsMatch(options.Version, @"^[0-9][0-9\\.]+[0-9]$"))\n {\n return ValidateOptionsResult.Fail("\u4e0d\u662f\u6709\u6548\u7684\u7248\u672c\u53f7");\n }\n\n return ValidateOptionsResult.Success;\n }\n }\n}\n')))),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions"))," \u7ee7\u627f\u81ea ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions")),"\uff0c\u4e5f\u5c31\u662f\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1\u9ed8\u8ba4\u5177\u6709 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"PostConfigure(TOptions options)"))," \u9009\u9879\u540e\u671f\u914d\u7f6e\u65b9\u6cd5\u3002\u5173\u4e8e\u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"#227-%E9%80%89%E9%A1%B9%E5%90%8E%E6%9C%9F%E9%85%8D%E7%BD%AE"}),"4.2.8 \u9009\u9879\u540e\u671f\u914d\u7f6e"),"\u300b\u5c06\u5728\u4e0b\u4e00\u5c0f\u8282\u8bf4\u660e\u3002"))),Object(o.b)("h2",{id:"428-\u9009\u9879\u540e\u671f\u914d\u7f6e"},"4.2.8 \u9009\u9879\u540e\u671f\u914d\u7f6e"),Object(o.b)("p",null,"\u9009\u9879\u540e\u671f\u914d\u7f6e\u901a\u4fd7\u4e00\u70b9\u6765\u8bf4\uff0c\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u89e3\u6790\u503c\u6216\u8bbe\u5b9a\u9ed8\u8ba4\u503c/\u540e\u671f\u914d\u7f6e\u7b49\u3002"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u914d\u7f6e\u9009\u9879\u540e\u671f\u914d\u7f6e\u5f88\u7b80\u5355\uff0c\u53ea\u9700\u8981\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"p"},"IConfigurableOptions")," \u63a5\u53e3\u5e76\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"PostConfigure(TOptions options)")," \u65b9\u6cd5\u3002"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{7,16-21}","{7,16-21}":!0}),'using Furion.ConfigurableOptions;\nusing Microsoft.Extensions.Configuration;\nusing System.ComponentModel.DataAnnotations;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptions\n {\n [Required(ErrorMessage = "\u540d\u79f0\u4e0d\u80fd\u4e3a\u7a7a")]\n public string Name { get; set; }\n [Required]\n public string Version { get; set; }\n [Required, MaxLength(100)]\n public string Company { get; set; }\n\n public void PostConfigure(AppInfoOptions options, IConfiguration configuration)\n {\n options.Name ??= "Furion";\n options.Version ??= "1.0.0";\n options.Company ??= "Baiqian";\n }\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions"))," \u7ee7\u627f\u81ea ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions")),"\uff0c\u4e5f\u5c31\u662f\u81ea\u5b9a\u4e49\u590d\u6742\u9a8c\u8bc1\u9ed8\u8ba4\u5177\u6709 ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"PostConfigure(TOptions options, IConfiguration configuration)"))," \u9009\u9879\u540e\u671f\u914d\u7f6e\u65b9\u6cd5\u3002"))),Object(o.b)("h2",{id:"429-\u9009\u9879\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09"},"4.2.9 \u9009\u9879\u66f4\u6539\u901a\u77e5\uff08",Object(o.b)("inlineCode",{parentName:"h2"},"\u70ed\u66f4\u65b0"),"\uff09"),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u4e86\u975e\u5e38\u7b80\u5355\u4e14\u7075\u6d3b\u7684\u65b9\u5f0f\u76d1\u542c\u9009\u9879\u66f4\u6539\uff0c\u4e5f\u5c31\u662f ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"appsettings.json")," \u6216 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u53d1\u751f\u4efb\u4f55\u66f4\u6539\u90fd\u4f1a\u89e6\u53d1\u5904\u7406\u65b9\u6cd5"),"\u3002"),Object(o.b)("p",null,"\u4f7f\u7528\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u7ee7\u627f ",Object(o.b)("inlineCode",{parentName:"p"},"IConfigurableOptionsListener")," \u63a5\u53e3\u5e76\u5b9e\u73b0 ",Object(o.b)("inlineCode",{parentName:"p"},"void OnListener(TOptions options, IConfiguration configuration)")," \u65b9\u6cd5\u5373\u53ef\u3002"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{5,12-16}","{5,12-16}":!0}),"using Furion.ConfigurableOptions;\n\nnamespace Furion.Application\n{\n public class AppInfoOptions : IConfigurableOptionsListener\n {\n public string Name { get; set; }\n public string Version { get; set; }\n public string Company { get; set; }\n }\n\n public void OnListener(AppInfoOptions options, IConfiguration configuration)\n {\n var name = options.Name; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n var version = options.Version; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n }\n\n public void PostConfigure(AppInfoOptions options, IConfiguration configuration)\n {\n }\n}\n")),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptionsListener"))," \u7ee7\u627f\u81ea ",Object(o.b)("strong",{parentName:"p"},Object(o.b)("inlineCode",{parentName:"strong"},"IConfigurableOptions")),"\u3002"))),Object(o.b)("h2",{id:"4210-\u9009\u9879\u7684\u4f18\u7f3a\u70b9"},"4.2.10 \u9009\u9879\u7684\u4f18\u7f3a\u70b9"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5f3a\u7c7b\u578b\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u63d0\u4f9b\u591a\u79cd\u8bfb\u53d6\u65b9\u5f0f"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u70ed\u52a0\u8f7d"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u8bbe\u7f6e\u9ed8\u8ba4\u503c/\u540e\u671f\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u5728\u8fd0\u884c\u73af\u5883\u4e2d\u52a8\u6001\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u9a8c\u8bc1\u914d\u7f6e\u6709\u6548\u6027"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u66f4\u6539\u901a\u77e5"),Object(o.b)("li",{parentName:"ul"},"\u652f\u6301\u547d\u540d\u9009\u9879"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u9700\u8981\u5b9a\u4e49\u5bf9\u5e94\u7c7b\u578b"),Object(o.b)("li",{parentName:"ul"},"\u9700\u8981\u5728\u542f\u52a8\u65f6\u6ce8\u518c")))),Object(o.b)("h2",{id:"4211-\u53cd\u9988\u4e0e\u5efa\u8bae"},"4.2.11 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(o.b)("hr",null),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u9009\u9879")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/options?view=aspnetcore-5.0"}),"ASP.NET Core - \u9009\u9879")," \u7ae0\u8282\u3002"))))}u.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return p}));var a=t(21),i=t(191);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const p=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+p:p}(n,e,t,a)}}function p(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return l})),t.d(n,"b",(function(){return m}));var a=t(0),i=t.n(a);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function p(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function s(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var c=i.a.createContext({}),b=function(e){var n=i.a.useContext(c),t=n;return e&&(t="function"==typeof e?e(n):s(s({},n),e)),t},l=function(e){var n=b(e.components);return i.a.createElement(c.Provider,{value:n},e.children)},O={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},u=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,p=e.parentName,c=r(e,["components","mdxType","originalType","parentName"]),l=b(t),u=a,m=l["".concat(p,".").concat(u)]||l[u]||O[u]||o;return t?i.a.createElement(m,s(s({ref:n},c),{},{components:t})):i.a.createElement(m,s({ref:n},c))}));function m(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,p=new Array(o);p[0]=u;var s={};for(var r in n)hasOwnProperty.call(n,r)&&(s[r]=n[r]);s.originalType=e,s.mdxType="string"==typeof e?e:a,p[1]=s;for(var c=2;cn(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&g(e)}const f=e=>{g(e),null!=O&&d(O,e)},v=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(p.a)("tabs",{"tabs--block":t},u)},l.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":j===e,className:Object(p.a)("tabs__item",r.a.tabItem,{"tabs__item--active":j===e}),key:e,ref:e=>v.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case b:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case c:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(v,e.target,e)},onFocus:()=>f(e),onClick:()=>{f(e)}},n))),n?Object(a.cloneElement)(N.filter(e=>e.props.value===j)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},N.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==j}))))}},200:function(e,n,t){"use strict";var a=t(3),i=t(0),o=t.n(i);n.a=function({children:e,hidden:n,className:t}){return o.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file diff --git a/docs/e408d11f.5069bb18.js b/docs/e408d11f.5069bb18.js new file mode 100644 index 00000000000..679ea0591ec --- /dev/null +++ b/docs/e408d11f.5069bb18.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[101],{175:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(3),o=n(7),c=(n(0),n(196)),i=(n(194),n(197)),a={id:"deploy-nginx",title:"27.3 \u5728 Nginx \u90e8\u7f72",sidebar_label:"27.3 \u5728 Nginx \u90e8\u7f72"},u={unversionedId:"deploy-nginx",id:"deploy-nginx",isDocsHomePage:!1,title:"27.3 \u5728 Nginx \u90e8\u7f72",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u67e5\u770b\u5b98\u65b9\u6587\u6863 https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-5.0",source:"@site/docs\\docker-nginx.mdx",slug:"/deploy-nginx",permalink:"/docs/deploy-nginx",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/docker-nginx.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.3 \u5728 Nginx \u90e8\u7f72",sidebar:"docs",previous:{title:"27.2 \u5728 Docker \u90e8\u7f72",permalink:"/docs/deploy-docker"},next:{title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",permalink:"/docs/virtual-deploy"}},s=[],p={toc:s};function l(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u67e5\u770b\u5b98\u65b9\u6587\u6863 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-5.0"}),"https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-5.0")))}l.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),o=n(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(n),f=r,b=l["".concat(i,".").concat(f)]||l[f]||d[f]||c;return n?o.a.createElement(b,a(a({ref:t},s),{},{components:n})):o.a.createElement(b,a({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=f;var a={};for(var u in t)hasOwnProperty.call(t,u)&&(a[u]=t[u]);a.originalType=e,a.mdxType="string"==typeof e?e:r,i[1]=a;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/e408d11f.7a0ff6e4.js b/docs/e408d11f.7a0ff6e4.js deleted file mode 100644 index 823c2354791..00000000000 --- a/docs/e408d11f.7a0ff6e4.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[97],{171:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return a})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return s})),n.d(t,"default",(function(){return l}));var r=n(3),o=n(7),c=(n(0),n(192)),i=(n(190),n(193)),a={id:"deploy-nginx",title:"27.3 \u5728 Nginx \u90e8\u7f72",sidebar_label:"27.3 \u5728 Nginx \u90e8\u7f72"},u={unversionedId:"deploy-nginx",id:"deploy-nginx",isDocsHomePage:!1,title:"27.3 \u5728 Nginx \u90e8\u7f72",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u67e5\u770b\u5b98\u65b9\u6587\u6863 https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-5.0",source:"@site/docs\\docker-nginx.mdx",slug:"/deploy-nginx",permalink:"/docs/deploy-nginx",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/docker-nginx.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"27.3 \u5728 Nginx \u90e8\u7f72",sidebar:"docs",previous:{title:"27.2 \u5728 Docker \u90e8\u7f72",permalink:"/docs/deploy-docker"},next:{title:"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72",permalink:"/docs/virtual-deploy"}},s=[],p={toc:s};function l(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u67e5\u770b\u5b98\u65b9\u6587\u6863 ",Object(c.b)("a",Object(r.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-5.0"}),"https://docs.microsoft.com/zh-cn/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-5.0")))}l.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return i}));var r=n(21),o=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const i=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+i:i}(t,e,n,r)}}function i(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return b}));var r=n(0),o=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var s=o.a.createContext({}),p=function(e){var t=o.a.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):a(a({},t),e)),n},l=function(e){var t=p(e.components);return o.a.createElement(s.Provider,{value:t},e.children)},d={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,i=e.parentName,s=u(e,["components","mdxType","originalType","parentName"]),l=p(n),f=r,b=l["".concat(i,".").concat(f)]||l[f]||d[f]||c;return n?o.a.createElement(b,a(a({ref:t},s),{},{components:n})):o.a.createElement(b,a({ref:t},s))}));function b(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,i=new Array(c);i[0]=f;var a={};for(var u in t)hasOwnProperty.call(t,u)&&(a[u]=t[u]);a.originalType=e,a.mdxType="string"==typeof e?e:r,i[1]=a;for(var s=2;st(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/e50e61ad.6c59c791.js b/docs/e50e61ad.6c59c791.js new file mode 100644 index 00000000000..953726c76b6 --- /dev/null +++ b/docs/e50e61ad.6c59c791.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[102],{176:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return a})),r.d(t,"metadata",(function(){return s})),r.d(t,"toc",(function(){return u})),r.d(t,"default",(function(){return l}));var n=r(3),o=r(7),c=(r(0),r(196)),i=r(197),a={id:"process-service",title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",sidebar_label:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1"},s={unversionedId:"process-service",id:"process-service",isDocsHomePage:!1,title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1ahttps://docs.microsoft.com/zh-cn/azure/azure-monitor/app/worker-service",source:"@site/docs\\process-service.mdx",slug:"/process-service",permalink:"/docs/process-service",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/process-service.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",sidebar:"docs",previous:{title:"22. \u4e8b\u4ef6\u603b\u7ebf",permalink:"/docs/event-bus"},next:{title:"24. \u4efb\u52a1\u8c03\u5ea6",permalink:"/docs/job"}},u=[],p={toc:u};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1a",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/azure/azure-monitor/app/worker-service"}),"https://docs.microsoft.com/zh-cn/azure/azure-monitor/app/worker-service")))}l.isMDXComponent=!0},194:function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(21),o=r(195);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const i=r.startsWith(t)?r:t+r.replace(/^\//,"");return c?e+i:i}(t,e,r,n)}}function i(e,t={}){const{withBaseUrl:r}=c();return r(e,t)}},195:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},196:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return m}));var n=r(0),o=r.n(n);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var u=o.a.createContext({}),p=function(e){var t=o.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},l=function(e){var t=p(e.components);return o.a.createElement(u.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,i=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),l=p(r),d=n,m=l["".concat(i,".").concat(d)]||l[d]||f[d]||c;return r?o.a.createElement(m,a(a({ref:t},u),{},{components:r})):o.a.createElement(m,a({ref:t},u))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,i=new Array(c);i[0]=d;var a={};for(var s in t)hasOwnProperty.call(t,s)&&(a[s]=t[s]);a.originalType=e,a.mdxType="string"==typeof e?e:n,i[1]=a;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/e50e61ad.de01fc16.js b/docs/e50e61ad.de01fc16.js deleted file mode 100644 index 9385feef179..00000000000 --- a/docs/e50e61ad.de01fc16.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[98],{172:function(e,t,r){"use strict";r.r(t),r.d(t,"frontMatter",(function(){return a})),r.d(t,"metadata",(function(){return s})),r.d(t,"toc",(function(){return u})),r.d(t,"default",(function(){return l}));var n=r(3),o=r(7),c=(r(0),r(192)),i=r(193),a={id:"process-service",title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",sidebar_label:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1"},s={unversionedId:"process-service",id:"process-service",isDocsHomePage:!1,title:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",description:"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1ahttps://docs.microsoft.com/zh-cn/azure/azure-monitor/app/worker-service",source:"@site/docs\\process-service.mdx",slug:"/process-service",permalink:"/docs/process-service",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/process-service.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1",sidebar:"docs",previous:{title:"22. \u4e8b\u4ef6\u603b\u7ebf",permalink:"/docs/event-bus"},next:{title:"24. \u4efb\u52a1\u8c03\u5ea6",permalink:"/docs/job"}},u=[],p={toc:u};function l(e){var t=e.components,r=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(n.a)({},p,r,{components:t,mdxType:"MDXLayout"}),Object(c.b)(i.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u6587\u6863\u7d27\u6025\u7f16\u5199\u4e2d\uff0c\u53ef\u4ee5\u5148\u770b\u5b98\u65b9\u6587\u6863\uff1a",Object(c.b)("a",Object(n.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/azure/azure-monitor/app/worker-service"}),"https://docs.microsoft.com/zh-cn/azure/azure-monitor/app/worker-service")))}l.isMDXComponent=!0},190:function(e,t,r){"use strict";r.d(t,"b",(function(){return c})),r.d(t,"a",(function(){return i}));var n=r(21),o=r(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(n.default)();return{withBaseUrl:(r,n)=>function(e,t,r,{forcePrependBaseUrl:n=!1,absolute:c=!1}={}){if(!r)return r;if(r.startsWith("#"))return r;if(Object(o.b)(r))return r;if(n)return t+r;const i=r.startsWith(t)?r:t+r.replace(/^\//,"");return c?e+i:i}(t,e,r,n)}}function i(e,t={}){const{withBaseUrl:r}=c();return r(e,t)}},191:function(e,t,r){"use strict";function n(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!n(e)}r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o}))},192:function(e,t,r){"use strict";r.d(t,"a",(function(){return l})),r.d(t,"b",(function(){return m}));var n=r(0),o=r.n(n);function c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var u=o.a.createContext({}),p=function(e){var t=o.a.useContext(u),r=t;return e&&(r="function"==typeof e?e(t):a(a({},t),e)),r},l=function(e){var t=p(e.components);return o.a.createElement(u.Provider,{value:t},e.children)},f={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},d=o.a.forwardRef((function(e,t){var r=e.components,n=e.mdxType,c=e.originalType,i=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),l=p(r),d=n,m=l["".concat(i,".").concat(d)]||l[d]||f[d]||c;return r?o.a.createElement(m,a(a({ref:t},u),{},{components:r})):o.a.createElement(m,a({ref:t},u))}));function m(e,t){var r=arguments,n=t&&t.mdxType;if("string"==typeof e||n){var c=r.length,i=new Array(c);i[0]=d;var a={};for(var s in t)hasOwnProperty.call(t,s)&&(a[s]=t[s]);a.originalType=e,a.mdxType="string"==typeof e?e:n,i[1]=a;for(var u=2;ut(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/e6346b20.31eebd4b.js b/docs/e6346b20.31eebd4b.js new file mode 100644 index 00000000000..88d7cffa56b --- /dev/null +++ b/docs/e6346b20.31eebd4b.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[103],{177:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return i})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return u})),t.d(n,"default",(function(){return b}));var r=t(3),a=t(7),o=(t(0),t(196)),c=t(197),i={id:"dbcontext-add",title:"9.5 \u65b0\u589e\u64cd\u4f5c",sidebar_label:"9.5 \u65b0\u589e\u64cd\u4f5c"},s={unversionedId:"dbcontext-add",id:"dbcontext-add",isDocsHomePage:!1,title:"9.5 \u65b0\u589e\u64cd\u4f5c",description:"Furion \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u591a\u7684\u8bed\u6cd5\u7cd6\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u3002",source:"@site/docs\\dbcontext-add.mdx",slug:"/dbcontext-add",permalink:"/docs/dbcontext-add",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-add.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.5 \u65b0\u589e\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",permalink:"/docs/dbcontext-repository"},next:{title:"9.6 \u66f4\u65b0\u64cd\u4f5c",permalink:"/docs/dbcontext-update"}},u=[{value:"9.5.1 \u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c",id:"951-\u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c",children:[]},{value:"9.5.2 \u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e",id:"952-\u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e",children:[]},{value:"9.5.3 \u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"953-\u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.5.4 \u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"954-\u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.5.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"955-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:u};function b(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(c.a,{mdxType:"JoinGroup"}),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u591a\u7684\u8bed\u6cd5\u7cd6\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u3002"),Object(o.b)("h2",{id:"951-\u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c"},"9.5.1 \u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var user = new User { Name = "\u767e\u5c0f\u50e7", Age = 27 };\n\n// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Insert(user);\n\n// \u793a\u4f8b\u4e8c\nuser.Insert();\n\n// \u793a\u4f8b\u4e09\nrepository.Entities.Add(user);\n\n// \u793a\u4f8b\u56db\nrepository.ChangeEntityState(user, EntityState.Added);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.InsertAsync();\n\n// \u793a\u4f8b\u4e09\nawait repository.Entities.AddAsync(user);\n\n')),Object(o.b)("h2",{id:"952-\u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e"},"9.5.2 \u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar newEntity = repository.InsertNow(user);\n\n// \u793a\u4f8b\u4e09\nvar newEntity = user.InsertNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e8c\nvar newEntity = await repository.InsertNowAsync(user); // \u6709\u4e09\u4e2a\u91cd\u8f7d\n\n// \u793a\u4f8b\u56db\nvar newEntity = await user.InsertNowAsync(); // \u6709\u4e09\u4e2a\u91cd\u8f7d\n")),Object(o.b)("h2",{id:"953-\u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.5.3 \u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Insert(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.Insert(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.Insert(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertAsync(new[] {user, user2 });\n")),Object(o.b)("h2",{id:"954-\u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.5.4 \u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertNow(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertNow(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.InsertNow(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertNowAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertNowAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertNowAsync(new[] {user, user2 });\n")),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6240\u6709\u5e26 ",Object(o.b)("inlineCode",{parentName:"p"},"Now")," \u7ed3\u5c3e\u7684\u8868\u793a\u7acb\u5373\u63d0\u4ea4\u5230\u6570\u636e\u5e93\uff0c\u4e5f\u5c31\u662f\u7acb\u5373\u8c03\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"SaveChanges")," \u6216 ",Object(o.b)("inlineCode",{parentName:"p"},"SaveChangesAsync"),"\u3002"))),Object(o.b)("h2",{id:"955-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.5.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return c}));var r=t(21),a=t(195);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(r)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+c:c}(n,e,t,r)}}function c(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},195:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return a}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return b})),t.d(n,"b",(function(){return m}));var r=t(0),a=t.n(r);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=a.a.createContext({}),d=function(e){var n=a.a.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},b=function(e){var n=d(e.components);return a.a.createElement(u.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},l=a.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),b=d(t),l=r,m=b["".concat(c,".").concat(l)]||b[l]||p[l]||o;return t?a.a.createElement(m,i(i({ref:n},u),{},{components:t})):a.a.createElement(m,i({ref:n},u))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,c=new Array(o);c[0]=l;var i={};for(var s in n)hasOwnProperty.call(n,s)&&(i[s]=n[s]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var u=2;un(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/e6346b20.7158abb1.js b/docs/e6346b20.7158abb1.js deleted file mode 100644 index 724e82ae9bc..00000000000 --- a/docs/e6346b20.7158abb1.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[99],{173:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return i})),t.d(n,"metadata",(function(){return s})),t.d(n,"toc",(function(){return u})),t.d(n,"default",(function(){return b}));var r=t(3),a=t(7),o=(t(0),t(192)),c=t(193),i={id:"dbcontext-add",title:"9.5 \u65b0\u589e\u64cd\u4f5c",sidebar_label:"9.5 \u65b0\u589e\u64cd\u4f5c"},s={unversionedId:"dbcontext-add",id:"dbcontext-add",isDocsHomePage:!1,title:"9.5 \u65b0\u589e\u64cd\u4f5c",description:"Furion \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u591a\u7684\u8bed\u6cd5\u7cd6\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u3002",source:"@site/docs\\dbcontext-add.mdx",slug:"/dbcontext-add",permalink:"/docs/dbcontext-add",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-add.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.5 \u65b0\u589e\u64cd\u4f5c",sidebar:"docs",previous:{title:"9.4 \u4ed3\u50a8\u6a21\u5f0f",permalink:"/docs/dbcontext-repository"},next:{title:"9.6 \u66f4\u65b0\u64cd\u4f5c",permalink:"/docs/dbcontext-update"}},u=[{value:"9.5.1 \u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c",id:"951-\u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c",children:[]},{value:"9.5.2 \u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e",id:"952-\u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e",children:[]},{value:"9.5.3 \u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",id:"953-\u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.5.4 \u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09",id:"954-\u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09",children:[]},{value:"9.5.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"955-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],d={toc:u};function b(e){var n=e.components,t=Object(a.a)(e,["components"]);return Object(o.b)("wrapper",Object(r.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(c.a,{mdxType:"JoinGroup"}),Object(o.b)("p",null,Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u63d0\u4f9b\u975e\u5e38\u591a\u7684\u8bed\u6cd5\u7cd6\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u3002"),Object(o.b)("h2",{id:"951-\u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c"},"9.5.1 \u65b0\u589e\u4e00\u6761\uff0c\u65e0\u8fd4\u56de\u503c"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),'var user = new User { Name = "\u767e\u5c0f\u50e7", Age = 27 };\n\n// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Insert(user);\n\n// \u793a\u4f8b\u4e8c\nuser.Insert();\n\n// \u793a\u4f8b\u4e09\nrepository.Entities.Add(user);\n\n// \u793a\u4f8b\u56db\nrepository.ChangeEntityState(user, EntityState.Added);\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertAsync(user);\n\n// \u793a\u4f8b\u4e8c\nawait user.InsertAsync();\n\n// \u793a\u4f8b\u4e09\nawait repository.Entities.AddAsync(user);\n\n')),Object(o.b)("h2",{id:"952-\u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e"},"9.5.2 \u65b0\u589e\u4e00\u6761\uff0c\u8fd4\u56de\u6700\u65b0\u6570\u636e"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nvar newEntity = repository.InsertNow(user);\n\n// \u793a\u4f8b\u4e09\nvar newEntity = user.InsertNow();\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e8c\nvar newEntity = await repository.InsertNowAsync(user); // \u6709\u4e09\u4e2a\u91cd\u8f7d\n\n// \u793a\u4f8b\u56db\nvar newEntity = await user.InsertNowAsync(); // \u6709\u4e09\u4e2a\u91cd\u8f7d\n")),Object(o.b)("h2",{id:"953-\u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"},"9.5.3 \u65b0\u589e\u591a\u6761\uff08\u4e0d\u7acb\u5373\u63d0\u4ea4\uff09"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.Insert(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.Insert(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.Insert(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertAsync(new[] {user, user2 });\n")),Object(o.b)("h2",{id:"954-\u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09"},"9.5.4 \u65b0\u589e\u591a\u6761\uff08\u7acb\u5373\u63d0\u4ea4\uff09"),Object(o.b)("pre",null,Object(o.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs"}),"// ==== \u540c\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nrepository.InsertNow(user, user2);\n\n// \u793a\u4f8b\u4e8c\nrepository.InsertNow(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nrepository.InsertNow(new[] {user, user2 });\n\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\n\n// \u793a\u4f8b\u4e00\nawait repository.InsertNowAsync(user, user2);\n\n// \u793a\u4f8b\u4e8c\nawait repository.InsertNowAsync(new List { user, user2 });\n\n// \u793a\u4f8b\u4e09\nawait repository.InsertNowAsync(new[] {user, user2 });\n")),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u5c0f\u77e5\u8bc6")),Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u6240\u6709\u5e26 ",Object(o.b)("inlineCode",{parentName:"p"},"Now")," \u7ed3\u5c3e\u7684\u8868\u793a\u7acb\u5373\u63d0\u4ea4\u5230\u6570\u636e\u5e93\uff0c\u4e5f\u5c31\u662f\u7acb\u5373\u8c03\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"SaveChanges")," \u6216 ",Object(o.b)("inlineCode",{parentName:"p"},"SaveChangesAsync"),"\u3002"))),Object(o.b)("h2",{id:"955-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.5.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(r.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}b.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return c}));var r=t(21),a=t(191);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(r.default)();return{withBaseUrl:(t,r)=>function(e,n,t,{forcePrependBaseUrl:r=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(a.b)(t))return t;if(r)return n+t;const c=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+c:c}(n,e,t,r)}}function c(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},191:function(e,n,t){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}t.d(n,"b",(function(){return r})),t.d(n,"a",(function(){return a}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return b})),t.d(n,"b",(function(){return m}));var r=t(0),a=t.n(r);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function c(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function i(e){for(var n=1;n=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}var u=a.a.createContext({}),d=function(e){var n=a.a.useContext(u),t=n;return e&&(t="function"==typeof e?e(n):i(i({},n),e)),t},b=function(e){var n=d(e.components);return a.a.createElement(u.Provider,{value:n},e.children)},p={inlineCode:"code",wrapper:function(e){var n=e.children;return a.a.createElement(a.a.Fragment,{},n)}},l=a.a.forwardRef((function(e,n){var t=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),b=d(t),l=r,m=b["".concat(c,".").concat(l)]||b[l]||p[l]||o;return t?a.a.createElement(m,i(i({ref:n},u),{},{components:t})):a.a.createElement(m,i({ref:n},u))}));function m(e,n){var t=arguments,r=n&&n.mdxType;if("string"==typeof e||r){var o=t.length,c=new Array(o);c[0]=l;var i={};for(var s in n)hasOwnProperty.call(n,s)&&(i[s]=n[s]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var u=2;un(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/e6c62f29.7f59024b.js b/docs/e6c62f29.dffe5bd8.js similarity index 97% rename from docs/e6c62f29.7f59024b.js rename to docs/e6c62f29.dffe5bd8.js index cba548f28bf..01752611522 100644 --- a/docs/e6c62f29.7f59024b.js +++ b/docs/e6c62f29.dffe5bd8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[100],{174:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return p})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return d}));var a=t(3),i=t(7),o=(t(0),t(192)),r=(t(190),t(199)),c=t(200),b=t(193),l={id:"configuration",title:"4.1 \u914d\u7f6e",sidebar_label:"4.1 \u914d\u7f6e"},p={unversionedId:"configuration",id:"configuration",isDocsHomePage:!1,title:"4.1 \u914d\u7f6e",description:"\u63a8\u8350\u4f7f\u7528 \u300a4.2 \u9009\u9879\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002\uff08\u4e3a\u4ec0\u4e48\uff09\uff1f",source:"@site/docs\\configuration.mdx",slug:"/configuration",permalink:"/docs/configuration",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/configuration.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4.1 \u914d\u7f6e",sidebar:"docs",previous:{title:"3. \u5e94\u7528\u542f\u52a8",permalink:"/docs/appstartup"},next:{title:"4.2 \u9009\u9879",permalink:"/docs/options"}},s=[{value:"4.1.1 \u4ec0\u4e48\u662f\u914d\u7f6e",id:"411-\u4ec0\u4e48\u662f\u914d\u7f6e",children:[]},{value:"4.1.2 \u914d\u7f6e\u7684\u4f7f\u7528",id:"412-\u914d\u7f6e\u7684\u4f7f\u7528",children:[{value:"4.1.2.1 \u914d\u7f6e appsettings.json \u4fe1\u606f",id:"4121-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.1.2.2 \u8bfb\u53d6 appsettings.json \u4fe1\u606f",id:"4122-\u8bfb\u53d6-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.1.2.3 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",id:"4123-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",children:[]}]},{value:"4.1.3 \u8def\u5f84\u7b26 \u67e5\u627e\u8282\u70b9",id:"413-\u8def\u5f84\u7b26-\u67e5\u627e\u8282\u70b9",children:[]},{value:"4.1.4 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6",id:"414-\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6",children:[{value:"4.1.4.1 \u8bfb\u53d6 emailsetting.json \u914d\u7f6e",id:"4141-\u8bfb\u53d6-emailsettingjson-\u914d\u7f6e",children:[]},{value:"4.1.4.2 \u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6",id:"4142-\u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6",children:[]}]},{value:"4.1.5 \u4e0d\u540c\u73af\u5883\u8bfb\u53d6",id:"415-\u4e0d\u540c\u73af\u5883\u8bfb\u53d6",children:[]},{value:"4.1.6 \u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",id:"416-\u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",children:[]},{value:"4.1.7 \u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6",id:"417-\u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6",children:[]},{value:"4.1.8 \u914d\u7f6e\u7684\u4f18\u7f3a\u70b9",id:"418-\u914d\u7f6e\u7684\u4f18\u7f3a\u70b9",children:[]},{value:"4.1.9 \u914d\u7f6e\u4f7f\u7528\u573a\u666f",id:"419-\u914d\u7f6e\u4f7f\u7528\u573a\u666f",children:[]},{value:"4.1.10 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"4110-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:s};function d(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},m,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(b.a,{mdxType:"JoinGroup"}),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/options"}),"4.2 \u9009\u9879"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002\uff08",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"#417-%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BC%98%E7%BC%BA%E7%82%B9"}),"\u4e3a\u4ec0\u4e48"),"\uff09\uff1f"))),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u81ea\u5b9a\u4e49\u914d\u7f6e\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5982\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"xxxx.json"),"\uff0c\u5fc5\u987b\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"VS Studio")," \u4e2d\u53f3\u952e\u5c5e\u6027\u8bbe\u7f6e ",Object(o.b)("inlineCode",{parentName:"p"},"\u590d\u5236"),"\u8f93\u51fa\u76ee\u5f55\u4e3a",Object(o.b)("inlineCode",{parentName:"p"},"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"),"\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"\u5185\u5bb9"),"\u3002"))),Object(o.b)("h2",{id:"411-\u4ec0\u4e48\u662f\u914d\u7f6e"},"4.1.1 \u4ec0\u4e48\u662f\u914d\u7f6e"),Object(o.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u914d\u7f6e\u5c06\u7cfb\u7edf\u5e94\u7528\u53ef\u52a8\u6001\u8c03\u914d\u7684\u9009\u9879\u653e\u5728\u7edf\u4e00\u5730\u65b9\u7ba1\u7406\uff0c\u901a\u8fc7\u4e0d\u540c\u7684\u914d\u7f6e\u8ba9\u7cfb\u7edf\u505a\u51fa\u52a8\u6001\u8c03\u6574\u3002"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u65f6\u9ed8\u8ba4\u52a0\u8f7d ",Object(o.b)("inlineCode",{parentName:"p"},"\u542f\u52a8\u9879\u76ee")," \u4e0b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4f5c\u4e3a\u5e94\u7528\u914d\u7f6e\u3002\u540c\u65f6\u8fd8\u652f\u6301",Object(o.b)("strong",{parentName:"p"},"\u4e0d\u540c\u7684\u8fd0\u884c\u73af\u5883"),"\u52a0\u8f7d\u5bf9\u5e94\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Development"),"\uff1a\u52a0\u8f7d ",Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Development.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Staging"),"\uff1a\u52a0\u8f7d ",Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Staging.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"{Environment}"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"appsettings.{Environment}.json"))),Object(o.b)("h2",{id:"412-\u914d\u7f6e\u7684\u4f7f\u7528"},"4.1.2 \u914d\u7f6e\u7684\u4f7f\u7528"),Object(o.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u83b7\u53d6",Object(o.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u540d\u79f0\u3001\u7248\u672c\u53f7\u53ca\u7248\u6743\u4fe1\u606f"),"\uff0c\u8fd9\u4e9b\u4fe1\u606f\u53ef\u80fd\u968f\u65f6\u53d8\u5316\u800c\u4e14\u9700\u8981\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u5c06\u8fd9\u4e9b\u4fe1\u606f\u914d\u7f6e\u8d77\u6765\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a"),Object(o.b)("h3",{id:"4121-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f"},"4.1.2.1 \u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2-6}","{2-6}":!0}),'{\n "AppInfo": {\n "Name": "Furion",\n "Version": "1.0.0",\n "Company": "Baiqian"\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u590d\u5236\u8f93\u51fa\u76ee\u5f55\u4e3a",Object(o.b)("inlineCode",{parentName:"p"},"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"),"\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"\u5185\u5bb9"),"\u3002"))),Object(o.b)("h3",{id:"4122-\u8bfb\u53d6-appsettingsjson-\u4fe1\u606f"},"4.1.2.2 \u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd\u8bfb\u53d6\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u4f9d\u8d56\u6ce8\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"IConfiguration")," \u5bf9\u8c61\u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"li"},"App.Configuration[jsonKey]")," \u8bfb\u53d6")),Object(o.b)(r.a,{defaultValue:"App.Configuration[jsonKey]",values:[{label:"App.Configuration[jsonKey]",value:"App.Configuration[jsonKey]"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"App.Configuration[jsonKey]",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11-13}","{11-13}":!0}),'using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get()\n {\n return $@"\u540d\u79f0\uff1a{App.Configuration["AppInfo:Name"]}\uff0c\n \u7248\u672c\uff1a{App.Configuration["AppInfo:Version"]}\uff0c\n \u516c\u53f8\uff1a{App.Configuration["AppInfo:Company"]}";\n }\n }\n}\n'))),Object(o.b)(c.a,{value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,10-15}","{2,10-15}":!0}),'using Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Configuration;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get([FromServices] IConfiguration configuration)\n {\n return $@"\u540d\u79f0\uff1a{configuration["AppInfo:Name"]}\uff0c\n \u7248\u672c\uff1a{configuration["AppInfo:Version"]}\uff0c\n \u516c\u53f8\uff1a{configuration["AppInfo:Company"]}";\n }\n }\n}\n')))),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u4f9d\u8d56\u6ce8\u5165\u7684\u65b9\u5f0f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165\u6ce8\u5165\u5b9e\u4f8b\u6709\u51e0\u79cd\u65b9\u5f0f\uff1a"),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u6784\u9020\u51fd\u6570\u6ce8\u5165\u65b9\u5f0f")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2}","{2}":!0}),"private readonly IConfiguration _configuration;\npublic DefaultController(IConfiguration configuration)\n{\n _configuration = configuration;\n}\n")),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u53c2\u6570\u6ce8\u5165\u65b9\u5f0f ",Object(o.b)("inlineCode",{parentName:"li"},"[FromServices]"))),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public string Get([FromServices] IConfiguration configuration)\n{\n}\n")),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u5c5e\u6027\u6ce8\u5165\u65b9\u5f0f")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public IConfiguration Configuration { get; set; }\n")),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.1"}),"ASP.NET Core - \u4f9d\u8d56\u6ce8\u5165"),"\u300b \u77e5\u8bc6"))),Object(o.b)("h3",{id:"4123-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"},"4.1.2.3 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5728\u53ef\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u4f9d\u8d56\u6ce8\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"IConfiguration")," \u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u5728\u9759\u6001\u7c7b/\u975e\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u9009\u62e9 ",Object(o.b)("inlineCode",{parentName:"li"},"App.Configuration[jsonKey]")," \u8bfb\u53d6")),Object(o.b)("h2",{id:"413-\u8def\u5f84\u7b26-\u67e5\u627e\u8282\u70b9"},"4.1.3 ",Object(o.b)("inlineCode",{parentName:"h2"},"\u8def\u5f84\u7b26")," \u67e5\u627e\u8282\u70b9"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u914d\u7f6e\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},":")," \u5206\u9694\u7b26\u6765\u8bfb\u53d6\u5206\u5c42\u914d\u7f6e\u6570\u636e\u3002\u5982\u4e0a\u8ff0\u4f8b\u5b50\u4e2d\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"AppInfo:Name"),"\u3002\u5982\u6709\u66f4\u591a\u5c42\u7ea7\u6570\u636e\u5219\u53ea\u9700\u8981\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},":")," \u8fdb\u5165\u4e0b\u4e00\u5c42\u8282\u70b9\u5373\u53ef\u3002"),Object(o.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u6709\u4ee5\u4e0b\u914d\u7f6e\u4fe1\u606f\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{5-12}","{5-12}":!0}),'{\n "AppInfo": {\n "Name": "Furion",\n "Version": "1.0.0",\n "Company": {\n "Name": "Baiqian",\n "Address": {\n "City": "\u4e2d\u56fd",\n "Province": "\u5e7f\u4e1c\u7701",\n "Detail": "\u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8"\n }\n }\n }\n}\n')),Object(o.b)(r.a,{defaultValue:"two",values:[{label:"\u8bfb\u53d6\u7b2c\u4e8c\u5c42",value:"two"},{label:"\u8bfb\u53d6\u7b2c\u4e09\u5c42",value:"three"},{label:"\u8bfb\u53d6\u7b2c\u56db\u5c42",value:"four"},{label:"\u8bfb\u53d6\u7b2cN\u5c42",value:"n"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"two",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Name"]; // => Furion\n'))),Object(o.b)(c.a,{value:"three",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Company:Name"]; // => Baiqian\n'))),Object(o.b)(c.a,{value:"four",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Company:Address:Detail"]; // => \u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8\n'))),Object(o.b)(c.a,{value:"n",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Tier2:Tier3:Tier4...Tiern1:Tiern3..."]; // => \u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8\n')))),Object(o.b)("h2",{id:"414-\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6"},"4.1.4 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6"),Object(o.b)("p",null,"\u5927\u591a\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u7684\u914d\u7f6e\u53ea\u9700\u8981\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff0c\u4f46\u4e00\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5e0c\u671b\u67d0\u4e9b\u7ec4\u4ef6\u6216\u529f\u80fd\u62e5\u6709\u72ec\u7acb\u7684\u914d\u7f6e\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u7528\u5230\u81ea\u5b9a\u4e49\u914d\u7f6e\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u76ee\u524d\u652f\u6301 ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},".xml")," \u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-13} title="Furion.Web.Entry/emailsetting.json"',"{2-13}":!0,title:'"Furion.Web.Entry/emailsetting.json"'}),'{\n "outlook": {\n "smtp": {\n "server": "smtp.office365.com",\n "port": "587",\n "ssl": "STARTTLS"\n },\n "pop": {\n "server": "outlook.office365.com",\n "port": "995",\n "ssl": "TLS"\n }\n }\n}\n')),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-xml"}),'\n\n MyXMLFile Value\n \n Title from MyXMLFile\n Name from MyXMLFile\n \n \n \n Information\n Warning\n \n \n\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"xml \u914d\u7f6e\u4e8b\u9879")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5982\u679c\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"xml")," \u914d\u7f6e\uff0c\u90a3\u4e48\u6587\u4ef6\u540d\u5fc5\u987b\u4ee5 ",Object(o.b)("inlineCode",{parentName:"p"},".config.xml")," \u7ed3\u5c3e\uff08\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff09\u3002"))),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u5728\u542f\u52a8\u65f6\u81ea\u52a8\u626b\u63cf\u6bcf\u4e00\u4e2a\u9879\u76ee\u5c42\u6839\u76ee\u5f55\u4e0b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"*.xml")," \u6587\u4ef6\u52a0\u5165\u914d\u7f6e\u4e2d\uff0c\u6240\u4ee5\u65e0\u9700\u624b\u5de5\u914d\u7f6e\u3002"),Object(o.b)("p",{parentName:"div"},"\u65b0\u589e ",Object(o.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"*.xml")," \u6587\u4ef6\u7684\u5c5e\u6027",Object(o.b)("inlineCode",{parentName:"p"},"\u590d\u5236\u5230\u8f93\u51fa\u76ee\u5f55"),"\u8bbe\u7f6e\u4e3a\u59cb\u7ec8\u590d\u5236\u6216\u8f83\u65b0\u590d\u5236\uff0c\u5426\u5219\u4e0d\u4f1a\u8f7d\u5165\u3002\u53e6\u5916\u914d\u7f6e\u6587\u4ef6\u4e0d\u80fd\u51fa\u73b0\u91cd\u540d\uff0c\u4e5f\u5c31\u662f\u4fdd\u8bc1\u6574\u4e2a\u9879\u76ee\u4e2d\u914d\u7f6e\u6587\u4ef6\u540d\u5b57\u552f\u4e00\u3002"))),Object(o.b)("p",null,"\u540c\u65f6 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u65b9\u5f0f\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u8bfb\u53d6\uff0c\u5982\uff1a"),Object(o.b)("h3",{id:"4141-\u8bfb\u53d6-emailsettingjson-\u914d\u7f6e"},"4.1.4.1 \u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"h3"},"emailsetting.json")," \u914d\u7f6e"),Object(o.b)("p",null,"\u8bfb\u53d6\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u548c\u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e00\u81f4\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u4ece\u591a\u4e2a\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bfb\u53d6\u8f93\u5165\uff0c\u5982\uff1a"),Object(o.b)(r.a,{defaultValue:"jtl",values:[{label:"App.Configuration[jsonKey]",value:"jtl"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"ylzr"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"jtl",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var smtpServer = App.Configuration["outlook:smtp:server"]; // => smtp.office365.com\n'))),Object(o.b)(c.a,{value:"ylzr",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var smtpServer = _configuration["outlook:smtp:server"]; // => smtp.office365.com\n')))),Object(o.b)("h3",{id:"4142-\u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6"},"4.1.4.2 \u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6"),Object(o.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u9700\u8981 ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u6216 ",Object(o.b)("inlineCode",{parentName:"p"},".xml")," \u81ea\u52a8\u8f7d\u5165\u914d\u7f6e\u4e2d\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u542f\u52a8\u5c42 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"p"},"IgnoreConfigurationFiles")," \u8282\u70b9\u5373\u53ef\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "IgnoreConfigurationFiles": ["runtime.json"]\n}\n')),Object(o.b)("h2",{id:"415-\u4e0d\u540c\u73af\u5883\u8bfb\u53d6"},"4.1.5 \u4e0d\u540c\u73af\u5883\u8bfb\u53d6"),Object(o.b)("p",null,"\u5728\u5b9e\u9645\u5e94\u7528\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u6839\u636e\u4e0d\u540c\u7684\u73af\u5883\u52a0\u8f7d\u4e0d\u540c\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32"),"\u3002"),Object(o.b)("p",null,"\u8fd9\u65f6\u6211\u4eec\u53ea\u9700\u8981\u9075\u5faa\u7279\u5b9a\u547d\u540d\u89c4\u8303 ",Object(o.b)("inlineCode",{parentName:"p"},"{name}.{Environment}.json")," \u5373\u53ef\u3002\u5982\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Development.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Staging.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Production.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"emailsetting.Development.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"emailsetting.Staging.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"emailsetting.Production.json"))),Object(o.b)("p",null,"\u8fd9\u65f6\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4f1a\u5728\u5e94\u7528\u542f\u52a8\u65f6\u81ea\u52a8\u52a0\u8f7d\u4e0d\u540c\u73af\u5883\u7684\u914d\u7f6e\u6587\u4ef6\u3002"),Object(o.b)("h2",{id:"416-\u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09"},"4.1.6 \u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08",Object(o.b)("inlineCode",{parentName:"h2"},"\u70ed\u66f4\u65b0"),"\uff09"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},".NET Core")," \u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u914d\u7f6e\u652f\u6301\u66f4\u6539\u901a\u77e5\uff0c\u4e5f\u5c31\u662f\u70ed\u66f4\u65b0\u64cd\u4f5c\u3002",Object(o.b)("strong",{parentName:"p"},"\u4e00\u65e6\u76d1\u542c\u5230 ",Object(o.b)("inlineCode",{parentName:"strong"},"appsetting.json")," \u6216\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u53d1\u751f\u53d8\u52a8\uff0c\u5c31\u4f1a\u89e6\u53d1 ",Object(o.b)("inlineCode",{parentName:"strong"},"OnChange")," \u65b9\u6cd5"),"\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,4-5}","{2,4-5}":!0}),'var appInfoConfiguration = App.Configuration["AppInfo"];\nChangeToken.OnChange(() => appInfoConfiguration.GetReloadToken(), () =>\n{\n var name = appInfoConfiguration["Name"]; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n var version = appInfoConfiguration["Version"]; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n});\n')),Object(o.b)("h2",{id:"417-\u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6"},"4.1.7 \u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6"),Object(o.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u7684\u914d\u7f6e\u6587\u4ef6\u6ca1\u6709\u653e\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u9700\u8981\u624b\u52a8\u8f7d\u5165\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\uff0c\u53ea\u9700\u8981\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Program.cs")," \u4e2d\u52a0\u8f7d\u5373\u53ef\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{10,13}","{10,13}":!0}),'public class Program\n{\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args) =>\n Host.CreateDefaultBuilder(args)\n .ConfigureAppConfiguration((hostingContext, config) =>\n {\n // \u52a0\u8f7d\u81ea\u5b9a\u4e49\u914d\u7f6e\n config.AddJsonFile("MyConfig.json", optional: true, reloadOnChange: true);\n })\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.UseStartup();\n });\n}\n')),Object(o.b)("div",{className:"admonition admonition-info alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u8865\u5145\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u83b7\u53d6\u9879\u76ee\u76ee\u5f55\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppContext.BaseDirectory")),Object(o.b)("li",{parentName:"ul"},"\u83b7\u53d6\u7f51\u7ad9\u6839\u76ee\u5f55\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Directory.GetCurrentDirectory()"))))),Object(o.b)("h2",{id:"418-\u914d\u7f6e\u7684\u4f18\u7f3a\u70b9"},"4.1.8 \u914d\u7f6e\u7684\u4f18\u7f3a\u70b9"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u5feb\u901f\u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u65e0\u9700\u989d\u5916\u914d\u7f6e"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5b58\u5728\u91cd\u590d\u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7\u786c\u7f16\u7801\u5b57\u7b26\u4e32\u8bfb\u53d6\uff0c\u5bb9\u6613\u51fa\u9519"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u8bbe\u7f6e\u9ed8\u8ba4\u503c"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u5728\u8fd0\u884c\u73af\u5883\u4e2d\u52a8\u6001\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u9a8c\u8bc1\u914d\u7f6e\u6709\u6548\u6027"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u66f4\u6539\u901a\u77e5")))),Object(o.b)("h2",{id:"419-\u914d\u7f6e\u4f7f\u7528\u573a\u666f"},"4.1.9 \u914d\u7f6e\u4f7f\u7528\u573a\u666f"),Object(o.b)("p",null,"\u5982\u679c\u53ea\u9700\u8981",Object(o.b)("strong",{parentName:"p"},"\u4e00\u6b21\u6027\u8bfb\u53d6"),"\u914d\u7f6e\u4fe1\u606f\uff0c\u5219\u4f7f\u7528\u914d\u7f6e\uff0c\u5426\u5219\u5e94\u8be5\u4f7f\u7528 \u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/options"}),"4.2 \u9009\u9879"),"\u300b\u4ee3\u66ff\u3002"),Object(o.b)("h2",{id:"4110-\u53cd\u9988\u4e0e\u5efa\u8bae"},"4.1.10 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(o.b)("hr",null),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u914d\u7f6e")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/?view=aspnetcore-5.0"}),"ASP.NET Core - \u914d\u7f6e")," \u7ae0\u8282\u3002"))))}d.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(191);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return u}));var a=t(0),i=t.n(a);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),s=p(t),d=a,u=s["".concat(r,".").concat(d)]||s[d]||m[d]||o;return t?i.a.createElement(u,c(c({ref:n},l),{},{components:t})):i.a.createElement(u,c({ref:n},l))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,r=new Array(o);r[0]=d;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,r[1]=c;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},194:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&N(e)}const v=e=>{N(e),null!=m&&j(m,e)},f=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(r.a)("tabs",{"tabs--block":t},d)},s.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":O===e,className:Object(r.a)("tabs__item",b.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>f.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case p:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case l:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(f,e.target,e)},onFocus:()=>v(e),onClick:()=>{v(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===O)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==O}))))}},200:function(e,n,t){"use strict";var a=t(3),i=t(0),o=t.n(i);n.a=function({children:e,hidden:n,className:t}){return o.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[104],{178:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return l})),t.d(n,"metadata",(function(){return p})),t.d(n,"toc",(function(){return s})),t.d(n,"default",(function(){return d}));var a=t(3),i=t(7),o=(t(0),t(196)),r=(t(194),t(203)),c=t(204),b=t(197),l={id:"configuration",title:"4.1 \u914d\u7f6e",sidebar_label:"4.1 \u914d\u7f6e"},p={unversionedId:"configuration",id:"configuration",isDocsHomePage:!1,title:"4.1 \u914d\u7f6e",description:"\u63a8\u8350\u4f7f\u7528 \u300a4.2 \u9009\u9879\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002\uff08\u4e3a\u4ec0\u4e48\uff09\uff1f",source:"@site/docs\\configuration.mdx",slug:"/configuration",permalink:"/docs/configuration",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/configuration.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"4.1 \u914d\u7f6e",sidebar:"docs",previous:{title:"3. \u5e94\u7528\u542f\u52a8",permalink:"/docs/appstartup"},next:{title:"4.2 \u9009\u9879",permalink:"/docs/options"}},s=[{value:"4.1.1 \u4ec0\u4e48\u662f\u914d\u7f6e",id:"411-\u4ec0\u4e48\u662f\u914d\u7f6e",children:[]},{value:"4.1.2 \u914d\u7f6e\u7684\u4f7f\u7528",id:"412-\u914d\u7f6e\u7684\u4f7f\u7528",children:[{value:"4.1.2.1 \u914d\u7f6e appsettings.json \u4fe1\u606f",id:"4121-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.1.2.2 \u8bfb\u53d6 appsettings.json \u4fe1\u606f",id:"4122-\u8bfb\u53d6-appsettingsjson-\u4fe1\u606f",children:[]},{value:"4.1.2.3 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",id:"4123-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f",children:[]}]},{value:"4.1.3 \u8def\u5f84\u7b26 \u67e5\u627e\u8282\u70b9",id:"413-\u8def\u5f84\u7b26-\u67e5\u627e\u8282\u70b9",children:[]},{value:"4.1.4 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6",id:"414-\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6",children:[{value:"4.1.4.1 \u8bfb\u53d6 emailsetting.json \u914d\u7f6e",id:"4141-\u8bfb\u53d6-emailsettingjson-\u914d\u7f6e",children:[]},{value:"4.1.4.2 \u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6",id:"4142-\u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6",children:[]}]},{value:"4.1.5 \u4e0d\u540c\u73af\u5883\u8bfb\u53d6",id:"415-\u4e0d\u540c\u73af\u5883\u8bfb\u53d6",children:[]},{value:"4.1.6 \u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",id:"416-\u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09",children:[]},{value:"4.1.7 \u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6",id:"417-\u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6",children:[]},{value:"4.1.8 \u914d\u7f6e\u7684\u4f18\u7f3a\u70b9",id:"418-\u914d\u7f6e\u7684\u4f18\u7f3a\u70b9",children:[]},{value:"4.1.9 \u914d\u7f6e\u4f7f\u7528\u573a\u666f",id:"419-\u914d\u7f6e\u4f7f\u7528\u573a\u666f",children:[]},{value:"4.1.10 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"4110-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],m={toc:s};function d(e){var n=e.components,t=Object(i.a)(e,["components"]);return Object(o.b)("wrapper",Object(a.a)({},m,t,{components:n,mdxType:"MDXLayout"}),Object(o.b)(b.a,{mdxType:"JoinGroup"}),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u6e29\u99a8\u63d0\u793a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/options"}),"4.2 \u9009\u9879"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002\uff08",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"#417-%E9%85%8D%E7%BD%AE%E7%9A%84%E4%BC%98%E7%BC%BA%E7%82%B9"}),"\u4e3a\u4ec0\u4e48"),"\uff09\uff1f"))),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u81ea\u5b9a\u4e49\u914d\u7f6e\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5982\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"xxxx.json"),"\uff0c\u5fc5\u987b\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"VS Studio")," \u4e2d\u53f3\u952e\u5c5e\u6027\u8bbe\u7f6e ",Object(o.b)("inlineCode",{parentName:"p"},"\u590d\u5236"),"\u8f93\u51fa\u76ee\u5f55\u4e3a",Object(o.b)("inlineCode",{parentName:"p"},"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"),"\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"\u5185\u5bb9"),"\u3002"))),Object(o.b)("h2",{id:"411-\u4ec0\u4e48\u662f\u914d\u7f6e"},"4.1.1 \u4ec0\u4e48\u662f\u914d\u7f6e"),Object(o.b)("p",null,"\u7b80\u5355\u6765\u8bf4\uff0c\u914d\u7f6e\u5c06\u7cfb\u7edf\u5e94\u7528\u53ef\u52a8\u6001\u8c03\u914d\u7684\u9009\u9879\u653e\u5728\u7edf\u4e00\u5730\u65b9\u7ba1\u7406\uff0c\u901a\u8fc7\u4e0d\u540c\u7684\u914d\u7f6e\u8ba9\u7cfb\u7edf\u505a\u51fa\u52a8\u6001\u8c03\u6574\u3002"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u5e94\u7528\u7a0b\u5e8f\u542f\u52a8\u65f6\u9ed8\u8ba4\u52a0\u8f7d ",Object(o.b)("inlineCode",{parentName:"p"},"\u542f\u52a8\u9879\u76ee")," \u4e0b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4f5c\u4e3a\u5e94\u7528\u914d\u7f6e\u3002\u540c\u65f6\u8fd8\u652f\u6301",Object(o.b)("strong",{parentName:"p"},"\u4e0d\u540c\u7684\u8fd0\u884c\u73af\u5883"),"\u52a0\u8f7d\u5bf9\u5e94\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Development"),"\uff1a\u52a0\u8f7d ",Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Development.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"Staging"),"\uff1a\u52a0\u8f7d ",Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Staging.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"{Environment}"),"\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"appsettings.{Environment}.json"))),Object(o.b)("h2",{id:"412-\u914d\u7f6e\u7684\u4f7f\u7528"},"4.1.2 \u914d\u7f6e\u7684\u4f7f\u7528"),Object(o.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u9700\u8981\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u83b7\u53d6",Object(o.b)("strong",{parentName:"p"},"\u7cfb\u7edf\u540d\u79f0\u3001\u7248\u672c\u53f7\u53ca\u7248\u6743\u4fe1\u606f"),"\uff0c\u8fd9\u4e9b\u4fe1\u606f\u53ef\u80fd\u968f\u65f6\u53d8\u5316\u800c\u4e14\u9700\u8981\u5728\u591a\u4e2a\u5730\u65b9\u4f7f\u7528\u3002\u8fd9\u65f6\u5c31\u9700\u8981\u5c06\u8fd9\u4e9b\u4fe1\u606f\u914d\u7f6e\u8d77\u6765\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a"),Object(o.b)("h3",{id:"4121-\u914d\u7f6e-appsettingsjson-\u4fe1\u606f"},"4.1.2.1 \u914d\u7f6e ",Object(o.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{2-6}","{2-6}":!0}),'{\n "AppInfo": {\n "Name": "Furion",\n "Version": "1.0.0",\n "Company": "Baiqian"\n }\n}\n')),Object(o.b)("div",{className:"admonition admonition-caution alert alert--warning"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M8.893 1.5c-.183-.31-.52-.5-.887-.5s-.703.19-.886.5L.138 13.499a.98.98 0 0 0 0 1.001c.193.31.53.501.886.501h13.964c.367 0 .704-.19.877-.5a1.03 1.03 0 0 0 .01-1.002L8.893 1.5zm.133 11.497H6.987v-2.003h2.039v2.003zm0-3.004H6.987V5.987h2.039v4.006z"})))),"\u7279\u522b\u6ce8\u610f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u590d\u5236\u8f93\u51fa\u76ee\u5f55\u4e3a",Object(o.b)("inlineCode",{parentName:"p"},"\u5982\u679c\u8f83\u65b0\u5219\u590d\u5236"),"\uff0c\u751f\u6210\u64cd\u4f5c\u4e3a\uff1a",Object(o.b)("inlineCode",{parentName:"p"},"\u5185\u5bb9"),"\u3002"))),Object(o.b)("h3",{id:"4122-\u8bfb\u53d6-appsettingsjson-\u4fe1\u606f"},"4.1.2.2 \u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"h3"},"appsettings.json")," \u4fe1\u606f"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u63d0\u4f9b\u4e86\u4e24\u79cd\u8bfb\u53d6\u65b9\u5f0f\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u4f9d\u8d56\u6ce8\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"IConfiguration")," \u5bf9\u8c61\u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"li"},"App.Configuration[jsonKey]")," \u8bfb\u53d6")),Object(o.b)(r.a,{defaultValue:"App.Configuration[jsonKey]",values:[{label:"App.Configuration[jsonKey]",value:"App.Configuration[jsonKey]"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"App.Configuration[jsonKey]",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11-13}","{11-13}":!0}),'using Microsoft.AspNetCore.Mvc;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get()\n {\n return $@"\u540d\u79f0\uff1a{App.Configuration["AppInfo:Name"]}\uff0c\n \u7248\u672c\uff1a{App.Configuration["AppInfo:Version"]}\uff0c\n \u516c\u53f8\uff1a{App.Configuration["AppInfo:Company"]}";\n }\n }\n}\n'))),Object(o.b)(c.a,{value:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,10-15}","{2,10-15}":!0}),'using Microsoft.AspNetCore.Mvc;\nusing Microsoft.Extensions.Configuration;\n\nnamespace Furion.Web.Entry.Controllers\n{\n [Route("api/[controller]")]\n public class DefaultController : ControllerBase\n {\n [HttpGet]\n public string Get([FromServices] IConfiguration configuration)\n {\n return $@"\u540d\u79f0\uff1a{configuration["AppInfo:Name"]}\uff0c\n \u7248\u672c\uff1a{configuration["AppInfo:Version"]}\uff0c\n \u516c\u53f8\uff1a{configuration["AppInfo:Company"]}";\n }\n }\n}\n')))),Object(o.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u4f9d\u8d56\u6ce8\u5165\u7684\u65b9\u5f0f")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u901a\u8fc7\u4f9d\u8d56\u6ce8\u5165\u6ce8\u5165\u5b9e\u4f8b\u6709\u51e0\u79cd\u65b9\u5f0f\uff1a"),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u6784\u9020\u51fd\u6570\u6ce8\u5165\u65b9\u5f0f")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2}","{2}":!0}),"private readonly IConfiguration _configuration;\npublic DefaultController(IConfiguration configuration)\n{\n _configuration = configuration;\n}\n")),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u53c2\u6570\u6ce8\u5165\u65b9\u5f0f ",Object(o.b)("inlineCode",{parentName:"li"},"[FromServices]"))),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public string Get([FromServices] IConfiguration configuration)\n{\n}\n")),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u5c5e\u6027\u6ce8\u5165\u65b9\u5f0f")),Object(o.b)("pre",{parentName:"div"},Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),"public IConfiguration Configuration { get; set; }\n")),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-3.1"}),"ASP.NET Core - \u4f9d\u8d56\u6ce8\u5165"),"\u300b \u77e5\u8bc6"))),Object(o.b)("h3",{id:"4123-\u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"},"4.1.2.3 \u5982\u4f55\u9009\u62e9\u8bfb\u53d6\u65b9\u5f0f"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},"\u5728\u53ef\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u4f9d\u8d56\u6ce8\u5165 ",Object(o.b)("inlineCode",{parentName:"li"},"IConfiguration")," \u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u5728\u9759\u6001\u7c7b/\u975e\u4f9d\u8d56\u6ce8\u5165\u7c7b\u4e2d\uff0c\u9009\u62e9 ",Object(o.b)("inlineCode",{parentName:"li"},"App.Configuration[jsonKey]")," \u8bfb\u53d6")),Object(o.b)("h2",{id:"413-\u8def\u5f84\u7b26-\u67e5\u627e\u8282\u70b9"},"4.1.3 ",Object(o.b)("inlineCode",{parentName:"h2"},"\u8def\u5f84\u7b26")," \u67e5\u627e\u8282\u70b9"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4e2d\uff0c\u914d\u7f6e\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},":")," \u5206\u9694\u7b26\u6765\u8bfb\u53d6\u5206\u5c42\u914d\u7f6e\u6570\u636e\u3002\u5982\u4e0a\u8ff0\u4f8b\u5b50\u4e2d\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"AppInfo:Name"),"\u3002\u5982\u6709\u66f4\u591a\u5c42\u7ea7\u6570\u636e\u5219\u53ea\u9700\u8981\u901a\u8fc7 ",Object(o.b)("inlineCode",{parentName:"p"},":")," \u8fdb\u5165\u4e0b\u4e00\u5c42\u8282\u70b9\u5373\u53ef\u3002"),Object(o.b)("p",null,"\u5047\u8bbe\u6211\u4eec\u6709\u4ee5\u4e0b\u914d\u7f6e\u4fe1\u606f\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:"{5-12}","{5-12}":!0}),'{\n "AppInfo": {\n "Name": "Furion",\n "Version": "1.0.0",\n "Company": {\n "Name": "Baiqian",\n "Address": {\n "City": "\u4e2d\u56fd",\n "Province": "\u5e7f\u4e1c\u7701",\n "Detail": "\u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8"\n }\n }\n }\n}\n')),Object(o.b)(r.a,{defaultValue:"two",values:[{label:"\u8bfb\u53d6\u7b2c\u4e8c\u5c42",value:"two"},{label:"\u8bfb\u53d6\u7b2c\u4e09\u5c42",value:"three"},{label:"\u8bfb\u53d6\u7b2c\u56db\u5c42",value:"four"},{label:"\u8bfb\u53d6\u7b2cN\u5c42",value:"n"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"two",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Name"]; // => Furion\n'))),Object(o.b)(c.a,{value:"three",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Company:Name"]; // => Baiqian\n'))),Object(o.b)(c.a,{value:"four",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Company:Address:Detail"]; // => \u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8\n'))),Object(o.b)(c.a,{value:"n",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var companyName = App.Configuration["AppInfo:Tier2:Tier3:Tier4...Tiern1:Tiern3..."]; // => \u4e2d\u5c71\u5e02\u4e1c\u533a\u7d2b\u9a6c\u516c\u56ed\u897f\u95e8\n')))),Object(o.b)("h2",{id:"414-\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6"},"4.1.4 \u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6"),Object(o.b)("p",null,"\u5927\u591a\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u7684\u914d\u7f6e\u53ea\u9700\u8981\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u914d\u7f6e\u5373\u53ef\uff0c\u4f46\u4e00\u4e9b\u7279\u6b8a\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u5e0c\u671b\u67d0\u4e9b\u7ec4\u4ef6\u6216\u529f\u80fd\u62e5\u6709\u72ec\u7acb\u7684\u914d\u7f6e\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u7528\u5230\u81ea\u5b9a\u4e49\u914d\u7f6e\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u76ee\u524d\u652f\u6301 ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},".xml")," \u4e24\u79cd\u65b9\u5f0f\u914d\u7f6e\uff0c\u5982\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json",metastring:'{2-13} title="Furion.Web.Entry/emailsetting.json"',"{2-13}":!0,title:'"Furion.Web.Entry/emailsetting.json"'}),'{\n "outlook": {\n "smtp": {\n "server": "smtp.office365.com",\n "port": "587",\n "ssl": "STARTTLS"\n },\n "pop": {\n "server": "outlook.office365.com",\n "port": "995",\n "ssl": "TLS"\n }\n }\n}\n')),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-xml"}),'\n\n MyXMLFile Value\n \n Title from MyXMLFile\n Name from MyXMLFile\n \n \n \n Information\n Warning\n \n \n\n')),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"xml \u914d\u7f6e\u4e8b\u9879")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u5982\u679c\u91c7\u7528 ",Object(o.b)("inlineCode",{parentName:"p"},"xml")," \u914d\u7f6e\uff0c\u90a3\u4e48\u6587\u4ef6\u540d\u5fc5\u987b\u4ee5 ",Object(o.b)("inlineCode",{parentName:"p"},".config.xml")," \u7ed3\u5c3e\uff08\u4e0d\u533a\u5206\u5927\u5c0f\u5199\uff09\u3002"))),Object(o.b)("div",{className:"admonition admonition-important alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4f1a\u5728\u542f\u52a8\u65f6\u81ea\u52a8\u626b\u63cf\u6bcf\u4e00\u4e2a\u9879\u76ee\u5c42\u6839\u76ee\u5f55\u4e0b\u7684 ",Object(o.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"*.xml")," \u6587\u4ef6\u52a0\u5165\u914d\u7f6e\u4e2d\uff0c\u6240\u4ee5\u65e0\u9700\u624b\u5de5\u914d\u7f6e\u3002"),Object(o.b)("p",{parentName:"div"},"\u65b0\u589e ",Object(o.b)("inlineCode",{parentName:"p"},"*.json")," \u548c ",Object(o.b)("inlineCode",{parentName:"p"},"*.xml")," \u6587\u4ef6\u7684\u5c5e\u6027",Object(o.b)("inlineCode",{parentName:"p"},"\u590d\u5236\u5230\u8f93\u51fa\u76ee\u5f55"),"\u8bbe\u7f6e\u4e3a\u59cb\u7ec8\u590d\u5236\u6216\u8f83\u65b0\u590d\u5236\uff0c\u5426\u5219\u4e0d\u4f1a\u8f7d\u5165\u3002\u53e6\u5916\u914d\u7f6e\u6587\u4ef6\u4e0d\u80fd\u51fa\u73b0\u91cd\u540d\uff0c\u4e5f\u5c31\u662f\u4fdd\u8bc1\u6574\u4e2a\u9879\u76ee\u4e2d\u914d\u7f6e\u6587\u4ef6\u540d\u5b57\u552f\u4e00\u3002"))),Object(o.b)("p",null,"\u540c\u65f6 ",Object(o.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u7684\u65b9\u5f0f\u652f\u6301\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u8bfb\u53d6\uff0c\u5982\uff1a"),Object(o.b)("h3",{id:"4141-\u8bfb\u53d6-emailsettingjson-\u914d\u7f6e"},"4.1.4.1 \u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"h3"},"emailsetting.json")," \u914d\u7f6e"),Object(o.b)("p",null,"\u8bfb\u53d6\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u548c\u8bfb\u53d6 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e00\u81f4\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u4ece\u591a\u4e2a\u914d\u7f6e\u6587\u4ef6\u4e2d\u8bfb\u53d6\u8f93\u5165\uff0c\u5982\uff1a"),Object(o.b)(r.a,{defaultValue:"jtl",values:[{label:"App.Configuration[jsonKey]",value:"jtl"},{label:"\u4f9d\u8d56\u6ce8\u5165\u65b9\u5f0f",value:"ylzr"}],mdxType:"Tabs"},Object(o.b)(c.a,{value:"jtl",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var smtpServer = App.Configuration["outlook:smtp:server"]; // => smtp.office365.com\n'))),Object(o.b)(c.a,{value:"ylzr",mdxType:"TabItem"},Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var smtpServer = _configuration["outlook:smtp:server"]; // => smtp.office365.com\n')))),Object(o.b)("h3",{id:"4142-\u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6"},"4.1.4.2 \u6392\u9664\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6"),Object(o.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u4e0d\u9700\u8981 ",Object(o.b)("inlineCode",{parentName:"p"},".json")," \u6216 ",Object(o.b)("inlineCode",{parentName:"p"},".xml")," \u81ea\u52a8\u8f7d\u5165\u914d\u7f6e\u4e2d\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5728\u542f\u52a8\u5c42 ",Object(o.b)("inlineCode",{parentName:"p"},"appsettings.json")," \u4e2d\u6dfb\u52a0 ",Object(o.b)("inlineCode",{parentName:"p"},"IgnoreConfigurationFiles")," \u8282\u70b9\u5373\u53ef\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "IgnoreConfigurationFiles": ["runtime.json"]\n}\n')),Object(o.b)("h2",{id:"415-\u4e0d\u540c\u73af\u5883\u8bfb\u53d6"},"4.1.5 \u4e0d\u540c\u73af\u5883\u8bfb\u53d6"),Object(o.b)("p",null,"\u5728\u5b9e\u9645\u5e94\u7528\u5f00\u53d1\u4e2d\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u6839\u636e\u4e0d\u540c\u7684\u73af\u5883\u52a0\u8f7d\u4e0d\u540c\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5982 ",Object(o.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u8fde\u63a5\u5b57\u7b26\u4e32"),"\u3002"),Object(o.b)("p",null,"\u8fd9\u65f6\u6211\u4eec\u53ea\u9700\u8981\u9075\u5faa\u7279\u5b9a\u547d\u540d\u89c4\u8303 ",Object(o.b)("inlineCode",{parentName:"p"},"{name}.{Environment}.json")," \u5373\u53ef\u3002\u5982\uff1a"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Development.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Staging.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"appsettings.Production.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"emailsetting.Development.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"emailsetting.Staging.json")),Object(o.b)("li",{parentName:"ul"},Object(o.b)("inlineCode",{parentName:"li"},"emailsetting.Production.json"))),Object(o.b)("p",null,"\u8fd9\u65f6\uff0c",Object(o.b)("inlineCode",{parentName:"p"},"ASP.NET Core")," \u4f1a\u5728\u5e94\u7528\u542f\u52a8\u65f6\u81ea\u52a8\u52a0\u8f7d\u4e0d\u540c\u73af\u5883\u7684\u914d\u7f6e\u6587\u4ef6\u3002"),Object(o.b)("h2",{id:"416-\u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08\u70ed\u66f4\u65b0\uff09"},"4.1.6 \u914d\u7f6e\u66f4\u6539\u901a\u77e5\uff08",Object(o.b)("inlineCode",{parentName:"h2"},"\u70ed\u66f4\u65b0"),"\uff09"),Object(o.b)("p",null,"\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},".NET Core")," \u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u914d\u7f6e\u652f\u6301\u66f4\u6539\u901a\u77e5\uff0c\u4e5f\u5c31\u662f\u70ed\u66f4\u65b0\u64cd\u4f5c\u3002",Object(o.b)("strong",{parentName:"p"},"\u4e00\u65e6\u76d1\u542c\u5230 ",Object(o.b)("inlineCode",{parentName:"strong"},"appsetting.json")," \u6216\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u53d1\u751f\u53d8\u52a8\uff0c\u5c31\u4f1a\u89e6\u53d1 ",Object(o.b)("inlineCode",{parentName:"strong"},"OnChange")," \u65b9\u6cd5"),"\u3002\u4ee3\u7801\u5982\u4e0b\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,4-5}","{2,4-5}":!0}),'var appInfoConfiguration = App.Configuration["AppInfo"];\nChangeToken.OnChange(() => appInfoConfiguration.GetReloadToken(), () =>\n{\n var name = appInfoConfiguration["Name"]; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n var version = appInfoConfiguration["Version"]; // \u5b9e\u65f6\u7684\u6700\u65b0\u503c\n});\n')),Object(o.b)("h2",{id:"417-\u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6"},"4.1.7 \u624b\u52a8\u6dfb\u52a0\u914d\u7f6e\u6587\u4ef6"),Object(o.b)("p",null,"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u7684\u914d\u7f6e\u6587\u4ef6\u6ca1\u6709\u653e\u5728\u9879\u76ee\u7684\u6839\u76ee\u5f55\u4e0b\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u9700\u8981\u624b\u52a8\u8f7d\u5165\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\uff0c\u53ea\u9700\u8981\u5728 ",Object(o.b)("inlineCode",{parentName:"p"},"Program.cs")," \u4e2d\u52a0\u8f7d\u5373\u53ef\uff1a"),Object(o.b)("pre",null,Object(o.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{10,13}","{10,13}":!0}),'public class Program\n{\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args) =>\n Host.CreateDefaultBuilder(args)\n .ConfigureAppConfiguration((hostingContext, config) =>\n {\n // \u52a0\u8f7d\u81ea\u5b9a\u4e49\u914d\u7f6e\n config.AddJsonFile("MyConfig.json", optional: true, reloadOnChange: true);\n })\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder.UseStartup();\n });\n}\n')),Object(o.b)("div",{className:"admonition admonition-info alert alert--info"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u8865\u5145\u8bf4\u660e")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("ul",{parentName:"div"},Object(o.b)("li",{parentName:"ul"},"\u83b7\u53d6\u9879\u76ee\u76ee\u5f55\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"AppContext.BaseDirectory")),Object(o.b)("li",{parentName:"ul"},"\u83b7\u53d6\u7f51\u7ad9\u6839\u76ee\u5f55\uff1a",Object(o.b)("inlineCode",{parentName:"li"},"Directory.GetCurrentDirectory()"))))),Object(o.b)("h2",{id:"418-\u914d\u7f6e\u7684\u4f18\u7f3a\u70b9"},"4.1.8 \u914d\u7f6e\u7684\u4f18\u7f3a\u70b9"),Object(o.b)("ul",null,Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u4f18\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u80fd\u591f\u5728\u7cfb\u7edf\u8fd0\u884c\u65f6\u5feb\u901f\u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u65e0\u9700\u989d\u5916\u914d\u7f6e"))),Object(o.b)("li",{parentName:"ul"},Object(o.b)("p",{parentName:"li"},"\u7f3a\u70b9"),Object(o.b)("ul",{parentName:"li"},Object(o.b)("li",{parentName:"ul"},"\u5b58\u5728\u91cd\u590d\u8bfb\u53d6"),Object(o.b)("li",{parentName:"ul"},"\u901a\u8fc7\u786c\u7f16\u7801\u5b57\u7b26\u4e32\u8bfb\u53d6\uff0c\u5bb9\u6613\u51fa\u9519"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u8bbe\u7f6e\u9ed8\u8ba4\u503c"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u5728\u8fd0\u884c\u73af\u5883\u4e2d\u52a8\u6001\u914d\u7f6e"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u80fd\u9a8c\u8bc1\u914d\u7f6e\u6709\u6548\u6027"),Object(o.b)("li",{parentName:"ul"},"\u4e0d\u652f\u6301\u66f4\u6539\u901a\u77e5")))),Object(o.b)("h2",{id:"419-\u914d\u7f6e\u4f7f\u7528\u573a\u666f"},"4.1.9 \u914d\u7f6e\u4f7f\u7528\u573a\u666f"),Object(o.b)("p",null,"\u5982\u679c\u53ea\u9700\u8981",Object(o.b)("strong",{parentName:"p"},"\u4e00\u6b21\u6027\u8bfb\u53d6"),"\u914d\u7f6e\u4fe1\u606f\uff0c\u5219\u4f7f\u7528\u914d\u7f6e\uff0c\u5426\u5219\u5e94\u8be5\u4f7f\u7528 \u300a",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"/docs/options"}),"4.2 \u9009\u9879"),"\u300b\u4ee3\u66ff\u3002"),Object(o.b)("h2",{id:"4110-\u53cd\u9988\u4e0e\u5efa\u8bae"},"4.1.10 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))),Object(o.b)("hr",null),Object(o.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(o.b)("h5",{parentName:"div"},Object(o.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(o.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(o.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e86\u89e3\u66f4\u591a")),Object(o.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(o.b)("p",{parentName:"div"},"\u60f3\u4e86\u89e3\u66f4\u591a ",Object(o.b)("inlineCode",{parentName:"p"},"\u914d\u7f6e")," \u77e5\u8bc6\u53ef\u67e5\u9605 ",Object(o.b)("a",Object(a.a)({parentName:"p"},{href:"https://docs.microsoft.com/zh-cn/aspnet/core/fundamentals/configuration/?view=aspnetcore-5.0"}),"ASP.NET Core - \u914d\u7f6e")," \u7ae0\u8282\u3002"))))}d.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return r}));var a=t(21),i=t(195);function o(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:o=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(i.b)(t))return t;if(a)return n+t;const r=t.startsWith(n)?t:n+t.replace(/^\//,"");return o?e+r:r}(n,e,t,a)}}function r(e,n={}){const{withBaseUrl:t}=o();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function i(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return i}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return s})),t.d(n,"b",(function(){return u}));var a=t(0),i=t.n(a);function o(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(i[t]=e[t]);return i}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}var l=i.a.createContext({}),p=function(e){var n=i.a.useContext(l),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},s=function(e){var n=p(e.components);return i.a.createElement(l.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return i.a.createElement(i.a.Fragment,{},n)}},d=i.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,o=e.originalType,r=e.parentName,l=b(e,["components","mdxType","originalType","parentName"]),s=p(t),d=a,u=s["".concat(r,".").concat(d)]||s[d]||m[d]||o;return t?i.a.createElement(u,c(c({ref:n},l),{},{components:t})):i.a.createElement(u,c({ref:n},l))}));function u(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var o=t.length,r=new Array(o);r[0]=d;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,r[1]=c;for(var l=2;ln(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},198:function(e,n,t){"use strict";function a(e){var n,t,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(n=0;nn.value===e)&&N(e)}const v=e=>{N(e),null!=m&&j(m,e)},f=[];return i.a.createElement("div",null,i.a.createElement("ul",{role:"tablist","aria-orientation":"horizontal",className:Object(r.a)("tabs",{"tabs--block":t},d)},s.map(({value:e,label:n})=>i.a.createElement("li",{role:"tab",tabIndex:0,"aria-selected":O===e,className:Object(r.a)("tabs__item",b.a.tabItem,{"tabs__item--active":O===e}),key:e,ref:e=>f.push(e),onKeyDown:e=>{((e,n,t)=>{switch(t.keyCode){case p:((e,n)=>{const t=e.indexOf(n)+1;e[t]?e[t].focus():e[0].focus()})(e,n);break;case l:((e,n)=>{const t=e.indexOf(n)-1;e[t]?e[t].focus():e[e.length-1].focus()})(e,n)}})(f,e.target,e)},onFocus:()=>v(e),onClick:()=>{v(e)}},n))),n?Object(a.cloneElement)(g.filter(e=>e.props.value===O)[0],{className:"margin-vert--md"}):i.a.createElement("div",{className:"margin-vert--md"},g.map((e,n)=>Object(a.cloneElement)(e,{key:n,hidden:e.props.value!==O}))))}},204:function(e,n,t){"use strict";var a=t(3),i=t(0),o=t.n(i);n.a=function({children:e,hidden:n,className:t}){return o.a.createElement("div",Object(a.a)({role:"tabpanel"},{hidden:n,className:t}),e)}}}]); \ No newline at end of file diff --git a/docs/ece76bd1.b080aab2.js b/docs/ece76bd1.e4c199a2.js similarity index 97% rename from docs/ece76bd1.b080aab2.js rename to docs/ece76bd1.e4c199a2.js index 7738febd276..371ec8196da 100644 --- a/docs/ece76bd1.b080aab2.js +++ b/docs/ece76bd1.e4c199a2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[101],{184:function(e,t,a){"use strict";a.r(t);var n=a(3),r=a(0),l=a.n(r),c=a(203),s=a(198),i=a(21),o=a(205),m=a(190);function u(){return(u=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var d=r.createElement("defs",null,r.createElement("style",null)),f=r.createElement("path",{d:"M459.5 485.75V182.094l-314.906 67.5V485.75H459.5zm52.5 0h367.313V92.187L512 170.938V485.75zm-52.5 52.5H144.687v236.156l314.907 67.5V538.25zm52.5 0v314.906l367.313 78.75V538.25H512z",fill:"#00adef"});var h=function(e){var t=e.title,a=e.titleId,n=p(e,["title","titleId"]);return r.createElement("svg",u({className:"windows_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,d,f)};function y(){return(y=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var v=r.createElement("defs",null,r.createElement("style",null)),E=r.createElement("path",{d:"M524.375 217.906c-8.063 5.25-14.25 12.938-17.719 21.938-3.562 11.625-3 24 1.406 35.344A59.437 59.437 0 00528.875 305a37.347 37.347 0 0017.063 6.563c6.187.75 12.375-.282 17.906-3.094a35.218 35.218 0 0014.906-16.219c3-6.938 4.688-14.344 4.875-21.844a73.847 73.847 0 00-3.563-28.219c-3.28-9.937-9.656-18.468-18.28-24.28-4.407-2.813-9.282-4.688-14.438-5.438a30.339 30.339 0 00-15.282 1.687 41.666 41.666 0 00-7.78 4.219",fill:"#FFF"}),b=r.createElement("path",{d:"M791.563 600.594a395.632 395.632 0 00-22.313-77.438c-6.844-18.562-16.125-36.187-27.656-52.312-11.625-15.469-26.344-28.5-37.688-44.156-6-8.157-11.062-17.25-17.343-25.22-2.532-5.25-4.97-10.5-7.407-15.75-7.5-16.406-14.343-33.187-23.25-48.75-1.406-2.437-2.906-4.874-4.312-7.218-1.125-15-2.719-30-3.563-45a425.74 425.74 0 00-7.593-89.906c-3.938-14.156-9.938-27.75-17.813-40.125-9.188-14.625-21-27.375-34.875-37.594a134.301 134.301 0 00-77.25-24.75c-20.344-.469-40.5 4.125-58.594 13.5-19.031 10.406-34.406 26.438-44.062 45.844a153.998 153.998 0 00-14.063 62.344c-.75 21.187 1.219 42.187 2.063 63.375.844 21.937.375 43.968 2.156 65.906.563 7.031 1.406 14.062 1.406 21.187 0 3.563-.187 7.125-.281 10.594l-.281.75a450.215 450.215 0 01-31.688 46.781c-8.062 10.219-16.125 20.344-24.281 30.375-10.594 11.906-19.594 25.125-26.719 39.375-4.781 12.375-8.625 25.125-11.625 38.063l-.281 1.031a296.022 296.022 0 01-16.875 43.313 142.935 142.935 0 00-1.875 3.937c-4.031 8.344-8.25 16.688-12.656 24.844l-5.063 9.468a159.66 159.66 0 00-8.437 17.625c-1.406 3.657-2.531 7.407-3.188 11.25-1.219 8.157-.656 16.407 1.5 24.282.469 1.968 1.125 3.937 1.781 5.906 2.063 5.813 4.5 11.531 7.407 16.969 1.312 2.531 2.719 4.968 4.031 7.5l1.219 1.781a169.016 169.016 0 004.125 6.938l.187.28c1.594 2.626 3.375 5.157 5.063 7.688l.281.375c1.781 2.438 3.563 4.969 5.438 7.407 6.937 27.093 19.687 52.312 37.218 74.062-2.719 4.781-5.156 9.469-7.875 14.156A216.887 216.887 0 00293 853.72c-2.531 8.062-3.188 16.593-1.781 24.937 1.312 8.438 5.625 16.032 12.187 21.563 4.406 3.375 9.469 5.718 14.813 6.843 5.344 1.125 10.875 1.688 16.406 1.407 20.813-1.594 41.438-5.719 61.313-12.094 12-3.188 24-6 36.187-8.438 12.656-2.906 25.5-4.687 38.438-5.25 3.187.094 6.375-.093 9.468-.28 8.813.937 17.625 1.312 26.531.937l3.282-.188c2.25.282 4.594.375 6.937.563a480.306 480.306 0 0146.407 4.781c13.5 2.063 27 4.688 40.312 7.969 20.531 6.187 41.625 10.312 63.094 12.093 5.625.282 11.25-.187 16.875-1.312 5.531-1.125 10.781-3.563 15.281-6.938 6.563-5.437 10.875-13.03 12.281-21.468 1.407-8.344.75-16.875-1.781-24.938-6.188-15.656-14.156-30.562-23.906-44.343-3.375-5.72-6.563-11.625-9.938-17.344a307.557 307.557 0 0038.157-52.969c6.562.375 13.03-.375 19.312-2.438a81.136 81.136 0 0040.594-30.468c3-4.219 5.343-8.907 6.75-13.875a89.449 89.449 0 0012.937-33.094c3-19.5 2.532-39.469-1.406-58.781h-.188zm0 0",fill:"#020204"}),k=r.createElement("path",{d:"M431 335a32.58 32.58 0 00-6 12.75c-1.031 4.594-1.688 9.375-1.781 14.063.281 9.468-.469 18.937-2.344 28.218-3.281 9.656-8.25 18.563-14.625 26.531-10.969 13.782-19.594 29.25-25.5 45.75-3 10.22-4.031 20.907-2.906 31.594a337.236 337.236 0 00-29.344 53.156c-12.563 28.032-20.625 57.938-23.906 88.5-4.031 37.594 1.5 75.563 15.937 110.438a182.552 182.552 0 0047.156 65.719c10.5 9.093 22.032 16.781 34.407 22.875 43.781 21.375 95.062 20.906 138.375-1.313a267.942 267.942 0 0058.687-46.406c11.157-10.125 21.094-21.469 29.813-33.844 14.531-25.218 23.062-53.531 24.843-82.593 9-50.25 3.47-102-15.843-149.25-7.594-15.75-17.625-30.188-29.813-42.75a236.719 236.719 0 00-18.937-63.75c-6.75-14.532-14.907-28.407-21.188-43.313-2.531-6.094-4.781-12.281-7.593-18.188-2.72-6-6.47-11.53-11.063-16.218-4.969-4.594-10.875-8.063-17.344-10.031a71.82 71.82 0 00-19.875-3.375c-13.5-.657-27.093 1.03-40.406.562-10.781-.469-21.375-2.344-32.156-1.688-5.344.282-10.688 1.313-15.656 3.282A31.379 31.379 0 00431 335.094m4.313-117.281c-5.063.375-9.844 2.53-13.5 6-3.657 3.468-6.375 7.875-7.875 12.656-2.532 9.75-3.188 19.969-1.782 30 .188 9.094 1.781 18.187 4.781 26.812 1.688 4.219 4.125 8.156 7.313 11.438 3.188 3.281 7.219 5.719 11.625 6.844a23.2 23.2 0 0012.656-.47c4.031-1.312 7.781-3.562 10.781-6.562 4.407-4.5 7.594-10.031 9.188-16.031a64.942 64.942 0 002.156-18.563c0-7.78-1.219-15.562-3.562-23.062s-6.375-14.344-11.813-20.063c-2.625-2.718-5.625-5.062-9-6.75-3.469-1.593-7.219-2.437-10.969-2.25m89.063 0c-8.063 5.25-14.25 12.938-17.719 21.938-3.562 11.625-3 24 1.406 35.344a59.437 59.437 0 0020.813 29.812 37.347 37.347 0 0017.063 6.563c6.187.75 12.375-.281 17.906-3.094a35.218 35.218 0 0014.906-16.219c3-6.937 4.688-14.344 4.875-21.844a73.847 73.847 0 00-3.563-28.218c-3.28-9.938-9.656-18.469-18.28-24.281-4.407-2.813-9.282-4.688-14.438-5.438a30.339 30.339 0 00-15.282 1.688 41.666 41.666 0 00-7.78 4.218",fill:"#FFF"}),N=r.createElement("path",{d:"M542.469 241.625c-3 .188-5.813 1.125-8.344 2.719s-4.688 3.75-6.375 6.187a32.028 32.028 0 00-5.063 16.781c-.28 4.407.375 8.907 1.782 13.125s4.031 7.97 7.406 10.782a21.713 21.713 0 0012.469 4.875c4.593.187 9.093-1.031 12.843-3.656 3-2.157 5.438-4.875 7.125-8.157 1.688-3.187 2.72-6.75 3.188-10.312.938-6.375-.188-12.938-3-18.656-2.906-5.813-7.875-10.22-13.875-12.563-2.625-1.031-5.344-1.406-8.156-1.313",fill:"#020204"}),O=r.createElement("path",{d:"M435.313 217.906c-5.063.375-9.844 2.531-13.5 6-3.657 3.469-6.375 7.875-7.875 12.656-2.532 9.75-3.188 19.97-1.782 30 .188 9.094 1.781 18.188 4.781 26.813 1.688 4.313 4.125 8.156 7.313 11.438 3.188 3.28 7.219 5.718 11.625 6.843a23.2 23.2 0 0012.656-.469c4.031-1.312 7.781-3.562 10.781-6.562 4.407-4.5 7.594-10.031 9.188-16.031a64.942 64.942 0 002.156-18.563c0-7.781-1.219-15.562-3.562-23.062s-6.375-14.344-11.813-20.063c-2.625-2.719-5.625-5.062-9-6.75-3.469-1.594-7.219-2.437-10.969-2.25",fill:"#FFF"}),j=r.createElement("path",{d:"M423.219 259.625c-1.219 6.281-.938 12.844 1.031 18.938 1.5 4.03 3.75 7.687 6.75 10.78 1.875 2.063 4.031 3.844 6.563 5.063 2.53 1.313 5.343 1.688 8.156 1.031 2.531-.656 4.687-2.156 6.281-4.218 1.594-2.063 2.719-4.406 3.469-6.844 2.156-7.313 1.969-15.094-.375-22.406-1.5-5.344-4.406-10.219-8.531-13.875-1.97-1.688-4.407-3-6.938-3.656-2.625-.657-5.344-.47-7.875.656a13.685 13.685 0 00-6.094 6.094 26.075 26.075 0 00-2.531 8.343",fill:"#020204"}),w=r.createElement("path",{d:"M411.313 338.469c.187.844.468 1.687.937 2.344a10.342 10.342 0 003.188 3.187c1.218.844 2.437 1.594 3.656 2.344 6.469 4.406 12.187 9.844 16.781 16.219C441.5 371.375 448.531 379.25 456.5 386c6.094 4.219 13.219 6.75 20.625 7.406 8.625.656 17.344-.375 25.688-3 7.687-2.25 15.093-5.437 22.03-9.656 11.907-9.563 24.657-18 38.157-25.031 3.188-1.125 6.375-1.969 9.375-3.375 3.094-1.313 5.719-3.563 7.313-6.563 1.03-3 1.687-6.187 1.78-9.375.47-3.375 1.595-6.656 2.157-10.031.75-3.375.469-6.844-.75-10.125a13.816 13.816 0 00-5.906-5.906c-2.532-1.219-5.344-1.969-8.157-2.063-5.718.188-11.343.75-16.875 1.688-7.5.656-15-.281-22.5 0-9.28.281-18.562 2.344-27.937 2.719-10.688.562-21.281-1.125-31.969-1.594-4.594-.281-9.281-.094-13.875.656-4.594.656-9 2.344-12.844 4.969-3.562 2.812-6.843 5.812-10.03 9a27.829 27.829 0 01-5.532 3.844c-2.063 1.03-4.219 1.593-6.563 1.5a10.766 10.766 0 00-3.468 0c-.656.28-1.313.656-1.781 1.125l-1.407 1.687c-.937 1.406-1.781 2.906-2.437 4.406",fill:"#D99A03"}),x=r.createElement("path",{d:"M434.844 314.844c-3.75 2.25-7.406 4.687-11.063 7.219a14.568 14.568 0 00-4.781 4.78 10.16 10.16 0 00-.844 4.688 40.676 40.676 0 010 4.781c-.094 1.032-.469 2.157-.469 3.282 0 .562 0 1.125.188 1.594.188.562.375 1.03.75 1.406.469.469 1.125.844 1.875 1.031.656.188 1.406.281 2.156.469 3.281.937 6.281 2.719 8.719 5.062 2.531 2.25 4.781 4.875 7.5 7.031 7.5 5.625 16.594 8.532 25.875 8.438 9.281-.188 18.469-1.5 27.375-3.844 7.031-1.5 13.969-3.375 20.719-5.719 10.5-3.937 20.156-9.656 28.5-17.062a94.798 94.798 0 0111.625-9.656c3.75-2.344 8.156-3.938 11.906-6.188.375-.187.656-.469 1.031-.656.282-.281.563-.563.75-.938a2.626 2.626 0 000-2.062c-.187-.656-.468-1.219-.843-1.688a12.797 12.797 0 00-1.594-1.593 26.443 26.443 0 00-14.813-5.156c-5.437-.375-10.593 0-15.843-1.032-4.875-1.031-9.657-2.437-14.344-4.125a103.68 103.68 0 00-15.282-3.656c-12.187-1.969-24.562-1.688-36.656.938-11.344 2.53-22.312 6.843-32.437 12.656",fill:"#604405"}),T=r.createElement("path",{d:"M433.625 302.094c-5.438 3.656-10.313 8.156-14.531 13.219a31.347 31.347 0 00-5.719 9.656c-.844 2.812-1.406 5.719-1.875 8.625-.281 1.031-.469 2.156-.469 3.281 0 .563.094 1.125.281 1.594a3.53 3.53 0 00.844 1.406c.656.656 1.5 1.031 2.438 1.219.844.187 1.781.187 2.719.281 4.125.656 7.968 2.344 11.343 4.781 3.375 2.344 6.563 5.063 10.031 7.313 7.875 4.687 16.875 7.219 26.063 7.406 9.188.188 18.281-.75 27.188-2.719a118.662 118.662 0 0021-5.906 125.554 125.554 0 0028.5-17.063c4.03-3 7.968-6.187 11.625-9.656 1.218-1.219 2.437-2.437 3.75-3.562a13.827 13.827 0 014.406-2.531c2.531-.657 5.156-.75 7.781-.094 1.875.469 3.844.656 5.813.656 1.03 0 1.968-.188 2.906-.469.937-.375 1.781-.937 2.343-1.687.844-1.031 1.22-2.25 1.22-3.563s-.376-2.531-1.032-3.656c-1.406-2.156-3.563-3.844-5.906-4.781-3.282-1.313-6.657-2.344-10.125-3a142.883 142.883 0 01-30.657-11.156c-4.875-2.438-9.468-5.063-14.343-7.594-4.875-2.719-9.938-5.063-15.188-6.75-12.094-3.281-24.937-2.719-36.656 1.687-13.125 4.594-24.844 12.563-33.844 23.156",fill:"#F5BD0C"}),z=r.createElement("path",{d:"M494.656 287.188c.656 2.156 4.031 1.78 6 2.718 1.969.938 3.094 2.719 4.969 2.906 1.969.188 4.688-.656 4.969-2.437.375-2.438-3.188-3.938-5.438-4.781-3-1.406-6.375-1.5-9.375-.188-.656.281-1.312 1.125-1.125 1.781zm-32.25-1.125c-2.531-.844-6.656 3.562-5.437 5.906.375.656 1.5 1.406 2.25 1.031s2.156-2.906 3.375-3.75c.937-.75.75-2.906-.188-3.188zm0 0",fill:"#CD8907"}),C=r.createElement("path",{d:"M864.219 809.938c-1.875 4.875-4.594 9.375-7.969 13.406-7.875 8.437-17.438 15.187-27.938 19.875-17.812 8.25-35.156 17.437-52.03 27.468a215.954 215.954 0 00-30.657 24.75c-7.781 8.157-16.125 15.657-24.938 22.688-9.187 6.75-19.78 11.344-31.03 13.125-13.782 1.781-27.75-.375-40.407-6.094-9.094-3.468-16.969-9.562-22.5-17.625-4.688-8.625-6.844-18.281-6.375-28.031a293.704 293.704 0 016.188-51.094c2.437-14.062 4.875-28.125 6.375-42.281 2.625-25.875 2.906-51.844.937-77.719a60.554 60.554 0 010-13.031c.563-8.813 7.969-15.563 16.875-15.469 4.031-.093 8.063.282 12 1.032 9.375 1.125 18.75 2.718 27.938 4.875 5.718 1.5 11.437 3.562 17.156 5.156 9.562 2.812 19.687 3.656 29.625 2.718 10.406-2.437 21-4.03 31.687-4.968 4.407.187 8.813.937 12.938 2.25 4.312 1.218 8.343 3.375 11.625 6.468 2.343 2.532 4.218 5.438 5.437 8.625 1.782 4.782 2.907 9.75 3.282 14.813.187 4.5.562 9 1.125 13.5 1.593 7.219 5.062 13.969 9.937 19.594 4.969 5.437 10.313 10.5 16.125 15a173.108 173.108 0 0017.438 13.5c2.906 1.968 5.812 3.75 8.53 5.906 2.813 2.063 5.157 4.688 6.938 7.688 2.25 4.125 3 8.906 1.875 13.5",fill:"#F5BD0C"}),D=r.createElement("path",{d:"M864.219 809.938c-1.875 4.875-4.594 9.375-7.969 13.406-7.875 8.437-17.438 15.187-27.938 19.875-17.812 8.25-35.156 17.437-52.03 27.468a215.954 215.954 0 00-30.657 24.75c-7.781 8.157-16.125 15.657-24.938 22.688-9.187 6.75-19.78 11.344-31.03 13.125-13.782 1.781-27.75-.375-40.407-6.094-9.094-3.468-16.969-9.562-22.5-17.625-4.688-8.625-6.844-18.281-6.375-28.031a293.704 293.704 0 016.188-51.094c2.437-14.062 4.875-28.125 6.375-42.281 2.625-25.875 2.906-51.844.937-77.719a60.554 60.554 0 010-13.031c.563-8.813 7.969-15.563 16.875-15.469 4.031-.093 8.063.282 12 1.032 9.375 1.125 18.75 2.718 27.938 4.875 5.718 1.5 11.437 3.562 17.156 5.156 9.562 2.812 19.687 3.656 29.625 2.718 10.406-2.437 21-4.03 31.687-4.968 4.407.187 8.813.937 12.938 2.25 4.312 1.218 8.343 3.375 11.625 6.468 2.343 2.532 4.218 5.438 5.437 8.625 1.782 4.782 2.907 9.75 3.282 14.813.187 4.5.562 9 1.125 13.5 1.593 7.219 5.062 13.969 9.937 19.594 4.969 5.437 10.313 10.5 16.125 15a173.108 173.108 0 0017.438 13.5c2.906 1.968 5.812 3.75 8.53 5.906 2.813 2.063 5.157 4.688 6.938 7.688 2.25 4.125 3 8.906 1.875 13.5M275.188 666.03a26.145 26.145 0 0114.437-1.312 35.242 35.242 0 0113.5 5.718c7.781 5.907 14.531 13.22 19.875 21.375 13.219 18.188 25.875 36.75 37.406 56.063 9.375 15.656 17.906 31.781 28.688 46.5 7.031 9.563 15 18.469 22.125 28.031 7.406 9.375 13.031 20.063 16.5 31.407 4.125 15.093 2.437 31.125-4.594 45.093-5.063 9.75-12.656 17.907-21.938 23.532-9.375 5.625-20.156 8.437-31.125 8.156-17.25-2.344-33.937-7.594-49.312-15.563-32.719-13.031-68.25-17.156-102-27.281-10.406-3.094-20.531-6.844-31.031-9.656-4.688-1.125-9.281-2.532-13.781-4.407-4.407-1.875-8.25-5.062-10.782-9.093a20.743 20.743 0 01-2.719-10.782c.094-3.75.844-7.406 2.157-10.78 2.531-7.032 6.656-13.313 9.375-20.25a84.632 84.632 0 004.687-35.813c-.562-12.094-2.719-24.188-3.375-36.282a58.715 58.715 0 01.563-16.218c1.406-10.688 9.75-19.219 20.531-20.813 4.969-.843 9.938-1.218 14.906-.937 4.969.281 10.031.281 15 0 4.969-.282 9.938-1.688 14.344-4.032 4.031-2.437 7.594-5.812 10.313-9.75a124.125 124.125 0 007.406-12.187c2.25-4.219 4.781-8.156 7.781-11.906 2.813-3.844 6.656-6.75 11.063-8.813",fill:"#F5BD0C"}),I=r.createElement("path",{d:"M275.188 666.125a26.145 26.145 0 0114.437-1.313 35.242 35.242 0 0113.5 5.72c7.781 5.905 14.531 13.218 19.875 21.374 13.219 18.188 25.875 36.75 37.406 56.063 9.375 15.656 17.906 31.781 28.688 46.5 7.031 9.562 15 18.468 22.125 28.031 7.406 9.375 13.031 20.063 16.5 31.406 4.125 15.094 2.437 31.125-4.594 45.094-5.063 9.75-12.656 17.906-21.938 23.531-9.375 5.625-20.156 8.438-31.125 8.157-17.25-2.344-33.937-7.594-49.312-15.563-32.719-13.031-68.25-17.156-102-27.281-10.406-3.094-20.531-6.844-31.031-9.657-4.688-1.125-9.281-2.53-13.781-4.406-4.407-1.875-8.25-5.062-10.782-9.093a20.743 20.743 0 01-2.719-10.782c.094-3.75.844-7.406 2.157-10.781 2.531-7.031 6.656-13.313 9.375-20.25a84.632 84.632 0 004.687-35.813c-.562-12.093-2.719-24.093-3.375-36.28a58.715 58.715 0 01.563-16.22c1.406-10.687 9.75-19.218 20.531-20.812 4.969-.844 9.938-1.219 14.906-.938 4.969.282 10.031.282 15 0 4.969-.28 9.938-1.687 14.344-4.03 4.031-2.438 7.594-5.813 10.313-9.75a124.125 124.125 0 007.406-12.188c2.25-4.219 4.781-8.157 7.781-11.907 2.813-3.843 6.656-6.843 11.063-8.812",fill:"#F5BD0C"}),P=r.createElement("path",{d:"M282.406 674c4.125-1.594 8.719-1.875 13.031-.844s8.344 3 11.813 5.813c6.656 5.812 12.281 12.75 16.5 20.531 11.25 18.188 22.219 36.563 32.438 55.313a370.55 370.55 0 0024.937 41.437c6.375 8.625 13.688 16.5 20.25 24.938 6.844 8.343 12 17.812 15.188 28.03 3.75 13.407 2.156 27.75-4.22 40.22-4.687 8.812-11.718 16.218-20.343 21.187a51.593 51.593 0 01-28.5 7.031 163.06 163.06 0 01-45.188-13.968c-28.5-10.407-59.53-11.72-88.78-19.875-10.5-2.813-20.72-6.657-31.313-9.282-4.688-1.031-9.375-2.343-13.875-4.031-4.5-1.688-8.438-4.875-11.063-8.906-1.687-3.188-2.531-6.75-2.344-10.313a33.95 33.95 0 012.25-10.5c2.532-6.656 6.563-12.75 9.094-19.406 3.563-10.313 4.781-21.188 3.656-32.063-.75-10.78-2.718-21.468-3.28-32.343-.376-4.782-.188-9.657.655-14.438.844-4.781 3.094-9.187 6.47-12.75 3.937-3.562 8.812-5.906 14.062-6.562 5.25-.657 10.5-.657 15.656 0 5.25.656 10.5.843 15.75.75 10.313 0 19.688-6 24.094-15.375a98.75 98.75 0 005.531-13.032c1.594-4.5 3.75-8.718 6.281-12.75 2.625-4.03 6.375-7.218 10.781-9.093",fill:"#F5BD0C"});var S=function(e){var t=e.title,a=e.titleId,n=g(e,["title","titleId"]);return r.createElement("svg",y({className:"linux_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,v,E,b,k,N,O,j,w,x,T,z,C,D,I,P)};function M(){return(M=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var B=r.createElement("defs",null,r.createElement("style",null)),A=r.createElement("path",{d:"M878.3 721.7c-1.35 3.6-18.9 65.25-62.1 128.25-37.8 54.9-76.5 109.8-137.7 110.7-60.3.9-79.65-36-148.5-36s-90.45 35.1-147.6 36.9c-58.95 2.25-104.4-59.85-142.2-114.3C163.25 736.55 103.85 531.8 183.5 395c39.15-68.4 109.8-112.05 186.3-113.4 57.6-.9 112.95 39.15 148.05 39.15 36 0 102.6-48.6 172.8-41.4 29.25 1.35 111.6 12.15 164.25 89.1-4.05 2.7-98.1 58.5-97.2 171.45.9 136.35 119.25 181.35 120.6 181.8m-234-515.25c31.5-38.7 52.65-91.8 46.8-144.45-45 1.8-100.35 30.15-132.75 68.4-28.8 33.3-54.45 87.3-47.25 139.5 49.95 2.7 101.7-26.55 133.2-63.45",fill:"#fff"});var F=function(e){var t=e.title,a=e.titleId,n=_(e,["title","titleId"]);return r.createElement("svg",M({className:"macos_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,B,A)};function L(){return(L=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var V=r.createElement("defs",null,r.createElement("style",null)),H=r.createElement("path",{d:"M944.9 471.64a141.947 141.947 0 00-105.047-9.506 139.64 139.64 0 00-56.784-88.959l-11.25-8.86-9.535 10.688a117.675 117.675 0 00-22.218 84.656 108.59 108.59 0 0021.206 56.87 164.925 164.925 0 01-30.544 13.443 204.272 204.272 0 01-62.972 10.153H73.925l-1.266 13.303a248.428 248.428 0 0020.897 129.375l8.128 16.116.928 1.519c55.829 92.193 167.204 139.95 274.05 139.95 206.888 0 364.191-98.747 442.575-288.479 52.37 2.672 105.947-12.403 131.57-61.003l6.524-12.403-12.431-6.975zM246.978 711.689a46.434 46.434 0 1147.813-46.435 47.166 47.166 0 01-47.813 46.434z",fill:"#1296db"}),$=r.createElement("path",{d:"M246.978 640.7a24.44 24.44 0 1025.144 24.469 24.806 24.806 0 00-25.144-24.469M118.25 427.625h84.375V512H118.25zm112.5 0h84.375V512H230.75zm0-112.5h84.375V399.5H230.75zm112.5 0h84.375V399.5H343.25zm0 112.5h84.375V512H343.25zm112.5 0h84.375V512H455.75zm112.5 0h84.375V512H568.25zm-112.5-112.5h84.375V399.5H455.75zm0-112.5h84.375V287H455.75z",fill:"#1296db"});var U=function(e){var t=e.title,a=e.titleId,n=R(e,["title","titleId"]);return r.createElement("svg",L({className:"docker_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,V,H,$)};function G(){return(G=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var J=r.createElement("defs",null,r.createElement("style",null)),Q=r.createElement("path",{d:"M444.65 600.125l.262.375-37.462 90.487a193.912 193.912 0 01-77.813-97.387l96.676-16.388.15.188a16.5 16.5 0 0118.15 22.725zm-31.238-79.838a16.5 16.5 0 006.488-28.35l.075-.412-73.537-65.775a192.863 192.863 0 00-27.375 122.063l94.275-27.188.074-.338zm42.938-74.25a16.5 16.5 0 0026.213-12.637l.374-.188 5.625-98.25a192.9 192.9 0 00-112.874 54.076L456.2 446.15l.15-.075zm28.5 103.126l27.112 13.087 27.076-13.013 6.75-29.25-18.75-23.362h-30.15l-18.75 23.362 6.712 29.213zM541.1 433.1a16.5 16.5 0 0026.25 12.6l.3.112 80.025-56.737A194.55 194.55 0 00535.475 335l5.55 98.063.075.037zm407.85 223.875L732.462 926.263a60 60 0 01-46.8 22.275l-347.287.112a60 60 0 01-46.763-22.35l-216.6-269.25A59.362 59.362 0 0163.5 606.8l77.25-335.813c4.05-17.625 15.937-32.4 32.362-40.237L485.938 81.238a60.225 60.225 0 0151.937 0l312.937 149.437c16.425 7.838 28.313 22.65 32.363 40.238L960.5 606.725a59.041 59.041 0 01-11.55 50.25zm-123.338-77.138c-1.575-.375-3.862-.974-5.437-1.275-6.525-1.237-11.812-.937-17.963-1.425-13.124-1.387-23.924-2.512-33.562-5.55-3.937-1.5-6.75-6.187-8.1-8.1l-7.537-2.212a241.875 241.875 0 00-3.938-87.45 242.438 242.438 0 00-35.1-81.113c1.95-1.762 5.625-4.987 6.638-5.962.3-3.375.037-6.863 3.524-10.575 7.388-6.937 16.65-12.675 27.863-19.575 5.325-3.15 10.238-5.137 15.562-9.075 1.2-.9 2.85-2.325 4.126-3.337 9-7.163 11.062-19.5 4.612-27.6-6.45-8.1-18.975-8.85-27.937-1.688-1.276 1.013-3 2.325-4.163 3.3-5.025 4.35-8.138 8.625-12.375 13.125-9.225 9.375-16.875 17.175-25.238 22.838-3.637 2.1-8.962 1.387-11.362 1.237l-7.125 5.063a245.437 245.437 0 00-155.475-75.113l-.45-8.362c-2.437-2.325-5.362-4.313-6.112-9.376-.826-10.05.562-20.887 2.137-33.937.862-6.113 2.288-11.175 2.55-17.813.037-1.5-.038-3.712-.037-5.324 0-11.475-8.4-20.813-18.75-20.813-10.313 0-18.713 9.338-18.713 20.813l.037.525c0 1.537-.074 3.45 0 4.8.225 6.637 1.65 11.7 2.513 17.812 1.575 13.05 2.925 23.888 2.1 33.975a20.437 20.437 0 01-6.075 9.675l-.45 7.913A240.9 240.9 0 00335.15 360.35a313.988 313.988 0 01-6.75-4.8c-3.375.45-6.75 1.5-11.137-1.088-8.363-5.625-16.013-13.425-25.238-22.8-4.237-4.5-7.313-8.774-12.337-13.087a100.912 100.912 0 00-4.163-3.3 22.275 22.275 0 00-13.05-4.95 18.038 18.038 0 00-14.925 6.6c-6.45 8.1-4.387 20.475 4.613 27.637l.262.188 3.9 3.113c5.325 3.937 10.2 5.962 15.525 9.074 11.213 6.938 20.475 12.675 27.863 19.575 2.85 3.076 3.375 8.476 3.75 10.8l6 5.363a242.325 242.325 0 00-38.25 168.975l-7.8 2.25c-2.063 2.7-4.988 6.9-8.063 8.137-9.637 3.038-20.475 4.125-33.562 5.513-6.15.525-11.438.225-18 1.462-1.388.263-3.375.75-4.988 1.125l-.15.076-.262.075c-11.063 2.662-18.15 12.825-15.863 22.8 2.288 10.012 13.088 16.087 24.188 13.687l.262-.037.375-.113 4.838-1.087c6.374-1.725 11.025-4.238 16.8-6.45 12.375-4.426 22.65-8.138 32.625-9.6 4.2-.338 8.625 2.587 10.8 3.787l8.137-1.387a243.75 243.75 0 00108 134.85l-3.375 8.175c1.237 3.15 2.587 7.462 1.65 10.575-3.637 9.45-9.862 19.387-16.95 30.487-3.413 5.1-6.937 9.075-10.05 14.963-.75 1.387-1.687 3.562-2.4 5.025-4.8 10.312-1.275 22.162 7.988 26.624 9.3 4.5 20.85-.262 25.875-10.575v-.074c.75-1.463 1.725-3.375 2.324-4.763 2.626-6.075 3.526-11.288 5.4-17.175 4.95-12.45 7.688-25.5 14.513-33.637 1.875-2.25 4.875-3.076 8.063-3.938l4.237-7.688a241.988 241.988 0 00172.838.45l3.974 7.2c3.225 1.05 6.75 1.575 9.6 5.813 5.1 8.7 8.588 19.013 12.826 31.5 1.874 5.85 2.774 11.063 5.437 17.137.6 1.388 1.613 3.375 2.325 4.838 4.988 10.35 16.575 15.075 25.875 10.575 9.263-4.425 12.787-16.313 7.988-26.625-.75-1.462-1.688-3.6-2.438-5.025-3.112-5.85-6.637-9.787-10.05-14.925-7.125-11.1-12.975-20.288-16.612-29.737-1.5-4.875.262-7.875 1.425-11.025-.675-.825-2.213-5.4-3.113-7.575a243.713 243.713 0 00108-135.826c2.4.376 6.6 1.125 7.988 1.426 2.812-1.875 5.4-4.275 10.5-3.9 9.974 1.462 20.25 5.174 32.624 9.6 5.776 2.25 10.388 4.8 16.8 6.487 1.35.375 3.3.713 4.876 1.05l.337.113.262.037c11.138 2.4 21.9-3.675 24.188-13.688 2.25-9.974-4.8-20.137-15.863-22.8zM677 425.787l-73.125 65.475v.188a16.5 16.5 0 006.488 28.387l.112.376 94.725 27.3a194.963 194.963 0 00-4.05-62.776A195.3 195.3 0 00677 425.75zM526.512 625.475a16.387 16.387 0 00-15.15-8.7 16.5 16.5 0 00-13.95 8.738h-.075l-47.55 85.95a193.65 193.65 0 00124.725.112l-47.624-86.1h-.375zm70.8-48.488a16.5 16.5 0 00-10.124 1.35 16.5 16.5 0 00-8.025 21.45l-.113.15 37.875 91.426a193.125 193.125 0 0078.038-98.063l-97.5-16.5-.15.187z",fill:"#0092ff"});var q=function(e){var t=e.title,a=e.titleId,n=W(e,["title","titleId"]);return r.createElement("svg",G({className:"kubernetes_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,J,Q)},K=a(213),X=(a(175),a(176),a(193));function Y(){return l.a.createElement("div",{className:"furion-banner"},l.a.createElement("div",{className:"furion-banner-container"},l.a.createElement("div",{className:"furion-banner-item"},l.a.createElement("div",{className:"furion-banner-project"},"Furion"),l.a.createElement("div",{className:"furion-banner-description"},"\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002"),l.a.createElement("ul",{className:"furion-banner-spec"},l.a.createElement("li",null,"\u57fa\u4e8e .NET 5 \u5e73\u53f0\uff0c\u6ca1\u6709\u5386\u53f2\u5305\u88b1"),l.a.createElement("li",null,"\u6781\u5c11\u4f9d\u8d56\uff0c\u53ea\u4f9d\u8d56\u4e24\u4e2a\u7b2c\u4e09\u65b9\u5305"),l.a.createElement("li",null,"\u6781\u901f\u4e0a\u624b\uff0c\u4ee3\u7801\u65e0\u4fb5\u5165\u5f0f"),l.a.createElement("li",null,"\u53ea\u9700\u8981\u4e00\u4e2a Inject() \u5373\u53ef\u5b8c\u6210\u914d\u7f6e")),l.a.createElement("div",{className:"furion-support-platform"},"\u53d7\u652f\u6301\u5e73\u53f0\uff1a"),l.a.createElement("div",{className:"furion-support-icons"},l.a.createElement("span",null,l.a.createElement(h,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(S,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(F,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(U,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(q,{height:"39",width:"39"}))),l.a.createElement("div",{className:"furion-get-start-btn"},l.a.createElement(s.a,{className:"furion-get-start",to:Object(m.a)("docs/get-start")},"\u4e00\u5206\u949f\u4e0a\u624b"))),l.a.createElement("div",{className:"furion-banner-item"},l.a.createElement(ne,{style:{float:"right"}},l.a.createElement(ae,{language:"cs",source:'\npublic class AppService : IDynamicApiController\n{\n private readonly IRepository _userRepository;\n public AppService(IRepository userRepository)\n {\n _userRepository = userRepository;\n }\n\n [IfException(1000, "\u7528\u6237ID: {0} \u4e0d\u5b58\u5728")]\n public async Task GetUser([Range(1, int.MaxValue)] int userId)\n {\n var user = await _userRepository.FindOrDefaultAsync(userId);\n _ = user ?? throw Oops.Oh(1000, userId);\n return user.Adapt();\n }\n\n public async Task GetRemote(string id)\n {\n var data = await $"https://www.furion.pro/data?id={id}".GetAsAsync();\n return data;\n }\n}\n'})))))}function Z(){const{isDarkTheme:e,setLightTheme:t,setDarkTheme:a}=Object(o.a)();return l.a.createElement("div",{className:"furion-content"},l.a.createElement("p",{className:"furion-small-title"+(e?" dark":"")},"\u5b8c\u5168\u5f00\u6e90\u514d\u8d39"),l.a.createElement("h1",{className:"furion-big-title"+(e?" dark":"")},"\u4ee3\u7801\u6258\u7ba1\u5728\u5f00\u6e90\u4e2d\u56fd GITEE"),l.a.createElement("div",{className:"furion-gitee-log"},l.a.createElement("div",{className:"furion-log-item",style:{border:"6px solid #723cff"}},l.a.createElement("div",{className:"furion-log-jiao"+(e?" dark":"")}),l.a.createElement("div",{className:"furion-log-number"},l.a.createElement("div",{style:{color:"#723cff"}},"2380"),l.a.createElement("span",{className:e?" dark":""},"Stars"))),l.a.createElement("div",{className:"furion-log-item",style:{border:"6px solid #3fbbfe"}},l.a.createElement("div",{className:"furion-log-jiao"+(e?" dark":"")}),l.a.createElement("div",{className:"furion-log-number"},l.a.createElement("div",{style:{color:"#3fbbfe"}},"523"),l.a.createElement("span",{className:e?" dark":""},"Forks"))),l.a.createElement("div",{className:"furion-log-item",style:{border:"6px solid #1fd898"}},l.a.createElement("div",{className:"furion-log-jiao"+(e?" dark":"")}),l.a.createElement("div",{className:"furion-log-number"},l.a.createElement("div",{style:{color:"#1fd898"}},"627,666"),l.a.createElement("span",{className:e?" dark":""},"Downloads")))))}function ee(){const{isDarkTheme:e,setLightTheme:t,setDarkTheme:a}=Object(o.a)();return l.a.createElement("div",{className:"furion-content"},l.a.createElement("p",{className:"furion-small-title"+(e?" dark":"")},"\u5927\u91cf\u4f7f\u7528\u8005\u6d4b\u8bc4"),l.a.createElement("h1",{className:"furion-big-title"+(e?" dark":"")},"\u6765\u542c\u542c\u4ed6\u4eec\u662f\u600e\u4e48\u8bf4\u7684"),l.a.createElement("div",{className:"furion-remark"},l.a.createElement("div",{className:"furion-remark-item"},l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u7406\u60f3\u548c\u73b0\u5b9e"),l.a.createElement("p",{className:e?" dark":void 0},"\u4f5c\u8005\u7684\u6280\u672f\u662f\u6211\u63a5\u89e6.NET\u7a0b\u5e8f\u5458\u4e2d\u6700\u597d\u7684\u4e00\u4e2a\uff0c\u4ee3\u7801\u7684\u8d28\u91cf\uff0c\u6587\u6863\u7684\u8d28\u91cf\u90fd\u662f\u4e00\u7b49\u4e00\u7684\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"kesshei"),l.a.createElement("p",{className:e?" dark":void 0},"\u5f3a\u70c8\u652f\u6301\uff0c\u56e0\u4e3a\u6709\u4f60\u4eec\uff0c.net \u4f1a\u8d70\u7684\u66f4\u8fdc\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u9006\u5929\u7684\u8748\u8748"),l.a.createElement("p",{className:e?" dark":void 0},"\u975e\u5e38\u4f18\u79c0\u7684\u5f00\u6e90\u4f5c\u54c1\uff0c\u70b9\u8d5e\u652f\u6301"))),l.a.createElement("div",{className:"furion-remark-item"},l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u5f20\u82b8\u6eaa"),l.a.createElement("p",{className:e?" dark":void 0},"\u5927\u6982\u770b\u4e86\u4e00\u4e0b\uff0c\u89c9\u5f97\u9879\u76ee\u975e\u5e38\u68d2\u3002core\u751f\u6001\u4e00\u5b9a\u80fd\u706b")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u8d56\u76ae\u5c0f\u9cc4\u9c7c"),l.a.createElement("p",{className:e?" dark":void 0},"\u4f5c\u8005\u597d\u68d2\uff0c\u652f\u6301\u56fd\u5185.net\uff01")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"gudufy"),l.a.createElement("p",{className:e?" dark":void 0},"\u505a\u5f97\u975e\u5e38\u68d2\uff0c\u6253\u7b97\u57fa\u4e8e\u4f60\u7684\u6846\u67b6\u505a\u4e00\u4e2a\u57fa\u672c\u7684\u540e\u53f0\u7ba1\u7406\u51fa\u6765\uff0c\u4f9b\u5927\u5bb6\u5feb\u901f\u5f00\u53d1\u4e2d\u5c0f\u578b\u9879\u76ee\u3002"))),l.a.createElement("div",{className:"furion-remark-item"},l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"ThinkCoder"),l.a.createElement("p",{className:e?" dark":void 0},"\u6587\u6863\u5199\u7684\u771f\u4e0d\u9519\uff0c\u4ee3\u7801\u8d28\u91cf\u4e5f\u975e\u5e38\u9ad8\uff0c\u6ce8\u91ca\u975e\u5e38\u5b8c\u5584\uff0c\u8d5e\u4e00\u4e2a\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"liuina"),l.a.createElement("p",{className:e?" dark":void 0},"\u671f\u5f85\u6587\u6863\u5199\u5b8c\u7684\u90a3\u4e00\u5929\uff0c\u7edd\u5bf9\u60ca\u8273\u56db\u5ea7\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"weiyu.xiao"),l.a.createElement("p",{className:e?" dark":void 0},"\u5f88\u4e0d\u9519\u7684\u9879\u76ee\uff0c\u5bf9\u5feb\u901f\u642d\u5efa\u5065\u58ee\u7684\u6280\u672f\u67b6\u6784\uff0c\u5e2e\u52a9\u4e1a\u52a1\u6210\u529f\u5f88\u6709\u5e2e\u52a9\u3002")))))}function te(){return l.a.createElement("div",{className:"furion-whouse"},l.a.createElement("div",{className:"furion-who-custom"},l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom1.png"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom2.png"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom3.png"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom4.jpg"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("a",{href:"http://www.hezongsoft.net",target:"_blank"},l.a.createElement("img",{src:Object(m.a)("img/custom5.png"),height:"100"}))),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("a",{href:"http://www.dilon.vip/",target:"_blank"},l.a.createElement("img",{src:Object(m.a)("img/custom6.png"),height:"100"})))),l.a.createElement("div",{className:"furion-who-des"},l.a.createElement("div",{style:{maxWidth:350}},l.a.createElement("div",null),l.a.createElement("h1",null,"\u6211\u4eec\u7684\u5ba2\u6237"),l.a.createElement("p",null,"\u6211\u4eec\u7684\u8f6f\u4ef6\u5305\u5df2\u5728\u5168\u7403\u591a\u4e2a\u9879\u76ee\u4e2d\u4f7f\u7528\u3002\u4ece\u5c0f\u578b\u4f01\u4e1a\u5230\u4f01\u4e1a\u7684\u89e3\u51b3\u65b9\u6848\u53ca\u77e5\u540d\u4f01\u4e1a\u3002\u516c\u53f8\u5728\u7b80\u5355\u8f6f\u4ef6\u548c\u590d\u6742\u7ba1\u7406\u7cfb\u7edf\u7684\u5f00\u53d1\u65b9\u9762\u90fd\u4fe1\u4efb\u6211\u4eec\u3002"),l.a.createElement(s.a,{className:"furion-get-start",to:Object(m.a)("docs/get-start")},"\u7acb\u5373\u6dfb\u52a0\u60a8\u7684\u516c\u53f8"))))}function ae(e){let{language:t,replace:a,section:n,source:r}=e;if(r=r.replace(/\/\/ <.*?\n/g,""),a)for(const[l,c]of Object.entries(a))r=r.replace(new RegExp(l,"gs"),c);return r=r.trim(),r.includes("\n")||(r+="\n"),l.a.createElement(K.a.pre,null,l.a.createElement(K.a.code,{children:r,className:"language-"+t,mdxType:"code",originalType:"code",parentName:"pre"}))}function ne(e){const{children:t,className:a,...r}=e;return l.a.createElement("div",Object(n.a)({},r,{className:"system-window blue-accent preview-border "+a}),l.a.createElement("div",{className:"system-top-bar"},l.a.createElement("span",{className:"system-top-bar-circle",style:{backgroundColor:"#8759ff"}}),l.a.createElement("span",{className:"system-top-bar-circle",style:{backgroundColor:"#3fc4fe"}}),l.a.createElement("span",{className:"system-top-bar-circle",style:{backgroundColor:"#42ffac"}})),t)}t.default=function(){const e=Object(i.default)(),{siteConfig:t={}}=e;return l.a.createElement(c.a,{title:"\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002 "+t.title,description:"\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002"},l.a.createElement(Y,null),l.a.createElement(Z,null),l.a.createElement(ee,null),l.a.createElement(te,null),l.a.createElement(X.a,null))}},193:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),r=a.n(n),l=a(190);a(55);function c(){const[e,t]=Object(n.useState)(!1);return r.a.createElement("div",{className:"furion-join-group"},e&&r.a.createElement("img",{src:Object(l.a)("img/dotnetchina2.jpg")}),r.a.createElement("button",{onClick:()=>t(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},211:function(e,t,a){"use strict";const n=(e,{target:t=document.body}={})=>{const a=document.createElement("textarea"),n=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection();let l=!1;r.rangeCount>0&&(l=r.getRangeAt(0)),t.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch(s){}return a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),n&&n.focus(),c};e.exports=n,e.exports.default=n},212:function(e,t){function a(e){let t,a=[];for(let n of e.split(",").map(e=>e.trim()))if(/^-?\d+$/.test(n))a.push(parseInt(n,10));else if(t=n.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,n,r,l]=t;if(n&&l){n=parseInt(n),l=parseInt(l);const e=n0&&e[a-1]===t?e:e.concat(t)},h=function(e,t){var a=e.plain,n=Object.create(null),r=e.styles.reduce((function(e,a){var n=a.languages,r=a.style;return n&&!n.includes(t)||a.types.forEach((function(t){var a=u({},e[t],r);e[t]=a})),e}),n);return r.root=a,r.plain=u({},a,{backgroundColor:null}),r};function y(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(a[n]=e[n]);return a}var g=function(e){function t(){for(var t=this,a=[],n=arguments.length;n--;)a[n]=arguments[n];e.apply(this,a),m(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var a=e.theme?h(e.theme,e.language):void 0;return t.themeDict=a})),m(this,"getLineProps",(function(e){var a=e.key,n=e.className,r=e.style,l=u({},y(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),c=t.getThemeDict(t.props);return void 0!==c&&(l.style=c.plain),void 0!==r&&(l.style=void 0!==l.style?u({},l.style,r):r),void 0!==a&&(l.key=a),n&&(l.className+=" "+n),l})),m(this,"getStyleForToken",(function(e){var a=e.types,n=e.empty,r=a.length,l=t.getThemeDict(t.props);if(void 0!==l){if(1===r&&"plain"===a[0])return n?{display:"inline-block"}:void 0;if(1===r&&!n)return l[a[0]];var c=n?{display:"inline-block"}:{},s=a.map((function(e){return l[e]}));return Object.assign.apply(Object,[c].concat(s))}})),m(this,"getTokenProps",(function(e){var a=e.key,n=e.className,r=e.style,l=e.token,c=u({},y(e,["key","className","style","token"]),{className:"token "+l.types.join(" "),children:l.content,style:t.getStyleForToken(l),key:void 0});return void 0!==r&&(c.style=void 0!==c.style?u({},c.style,r):r),void 0!==a&&(c.key=a),n&&(c.className+=" "+n),c}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,a=e.language,n=e.code,r=e.children,l=this.getThemeDict(this.props),c=t.languages[a];return r({tokens:function(e){for(var t=[[]],a=[e],n=[0],r=[e.length],l=0,c=0,s=[],i=[s];c>-1;){for(;(l=n[c]++)0?m:["plain"],o=u):(m=f(m,u.type),u.alias&&(m=f(m,u.alias)),o=u.content),"string"==typeof o){var h=o.split(p),y=h.length;s.push({types:m,content:h[0]});for(var g=1;g{const{prism:e}=Object(j.useThemeConfig)(),{isDarkTheme:t}=Object(O.a)(),a=e.theme||N,n=e.darkTheme||a;return t?n:a},x=a(57),T=a.n(x);const z=/{([\d,-]+)}/,C=(e=["js","jsBlock","jsx","python","html"])=>{const t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},a=["highlight-next-line","highlight-start","highlight-end"].join("|"),n=e.map(e=>`(?:${t[e].start}\\s*(${a})\\s*${t[e].end})`).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)},D=/(?:title=")(.*)(?:")/;var I=({children:e,className:t,metastring:a})=>{const{prism:c}=Object(j.useThemeConfig)(),[i,m]=Object(r.useState)(!1),[u,p]=Object(r.useState)(!1);Object(r.useEffect)(()=>{p(!0)},[]);const d=Object(r.useRef)(null);let f=[],h="";const y=w(),v=Array.isArray(e)?e.join(""):e;if(a&&z.test(a)){const e=a.match(z)[1];f=k()(e).filter(e=>e>0)}a&&D.test(a)&&(h=a.match(D)[1]);let b=t&&t.replace(/language-/,"");!b&&c.defaultLanguage&&(b=c.defaultLanguage);let N=v.replace(/\n$/,"");if(0===f.length&&void 0!==b){let e="";const t=(e=>{switch(e){case"js":case"javascript":case"ts":case"typescript":return C(["js","jsBlock"]);case"jsx":case"tsx":return C(["js","jsBlock","jsx"]);case"html":return C(["js","jsBlock","html"]);case"python":case"py":return C(["python"]);default:return C()}})(b),a=v.replace(/\n$/,"").split("\n");let n;for(let r=0;re||t,void 0)){case"highlight-next-line":e+=l+",";break;case"highlight-start":n=l;break;case"highlight-end":e+=`${n}-${l-1},`}a.splice(r,1)}else r+=1}f=k()(e),N=a.join("\n")}const O=()=>{E()(N),m(!0),setTimeout(()=>m(!1),2e3)};return l.a.createElement(g,Object(n.a)({},o,{key:String(u),theme:y,code:N,language:b}),({className:e,style:t,tokens:a,getLineProps:r,getTokenProps:c})=>l.a.createElement(l.a.Fragment,null,h&&l.a.createElement("div",{style:t,className:T.a.codeBlockTitle},h),l.a.createElement("div",{className:T.a.codeBlockContent},l.a.createElement("div",{tabIndex:0,className:Object(s.a)(e,T.a.codeBlock,"thin-scrollbar",{[T.a.codeBlockWithTitle]:h})},l.a.createElement("div",{className:T.a.codeBlockLines,style:t},a.map((e,t)=>{1===e.length&&""===e[0].content&&(e[0].content="\n");const a=r({line:e,key:t});return f.includes(t+1)&&(a.className=a.className+" docusaurus-highlight-code-line"),l.a.createElement("div",Object(n.a)({key:t},a),e.map((e,t)=>l.a.createElement("span",Object(n.a)({key:t},c({token:e,key:t})))))}))),l.a.createElement("button",{ref:d,type:"button","aria-label":"Copy code to clipboard",className:Object(s.a)(T.a.copyButton),onClick:O},i?"Copied":"Copy"))))},P=(a(58),a(59)),S=a.n(P);var M=e=>function({id:t,...a}){const{navbar:{hideOnScroll:n}}=Object(j.useThemeConfig)();return t?l.a.createElement(e,a,l.a.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:Object(s.a)("anchor",{[S.a.enhancedAnchor]:!n}),id:t}),a.children,l.a.createElement("a",{className:"hash-link",href:"#"+t,title:"Direct link to heading"},"#")):l.a.createElement(e,a)},_=a(60),B=a.n(_);const A={code:e=>{const{children:t}=e;return"string"==typeof t?t.includes("\n")?l.a.createElement(I,e):l.a.createElement("code",e):t},a:e=>l.a.createElement(c.a,e),pre:e=>l.a.createElement("div",Object(n.a)({className:B.a.mdxCodeBlock},e)),h1:M("h1"),h2:M("h2"),h3:M("h3"),h4:M("h4"),h5:M("h5"),h6:M("h6")};t.a=A}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{188:function(e,t,a){"use strict";a.r(t);var n=a(3),r=a(0),l=a.n(r),c=a(207),s=a(202),i=a(21),o=a(209),m=a(194);function u(){return(u=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var d=r.createElement("defs",null,r.createElement("style",null)),f=r.createElement("path",{d:"M459.5 485.75V182.094l-314.906 67.5V485.75H459.5zm52.5 0h367.313V92.187L512 170.938V485.75zm-52.5 52.5H144.687v236.156l314.907 67.5V538.25zm52.5 0v314.906l367.313 78.75V538.25H512z",fill:"#00adef"});var h=function(e){var t=e.title,a=e.titleId,n=p(e,["title","titleId"]);return r.createElement("svg",u({className:"windows_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,d,f)};function y(){return(y=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var v=r.createElement("defs",null,r.createElement("style",null)),E=r.createElement("path",{d:"M524.375 217.906c-8.063 5.25-14.25 12.938-17.719 21.938-3.562 11.625-3 24 1.406 35.344A59.437 59.437 0 00528.875 305a37.347 37.347 0 0017.063 6.563c6.187.75 12.375-.282 17.906-3.094a35.218 35.218 0 0014.906-16.219c3-6.938 4.688-14.344 4.875-21.844a73.847 73.847 0 00-3.563-28.219c-3.28-9.937-9.656-18.468-18.28-24.28-4.407-2.813-9.282-4.688-14.438-5.438a30.339 30.339 0 00-15.282 1.687 41.666 41.666 0 00-7.78 4.219",fill:"#FFF"}),b=r.createElement("path",{d:"M791.563 600.594a395.632 395.632 0 00-22.313-77.438c-6.844-18.562-16.125-36.187-27.656-52.312-11.625-15.469-26.344-28.5-37.688-44.156-6-8.157-11.062-17.25-17.343-25.22-2.532-5.25-4.97-10.5-7.407-15.75-7.5-16.406-14.343-33.187-23.25-48.75-1.406-2.437-2.906-4.874-4.312-7.218-1.125-15-2.719-30-3.563-45a425.74 425.74 0 00-7.593-89.906c-3.938-14.156-9.938-27.75-17.813-40.125-9.188-14.625-21-27.375-34.875-37.594a134.301 134.301 0 00-77.25-24.75c-20.344-.469-40.5 4.125-58.594 13.5-19.031 10.406-34.406 26.438-44.062 45.844a153.998 153.998 0 00-14.063 62.344c-.75 21.187 1.219 42.187 2.063 63.375.844 21.937.375 43.968 2.156 65.906.563 7.031 1.406 14.062 1.406 21.187 0 3.563-.187 7.125-.281 10.594l-.281.75a450.215 450.215 0 01-31.688 46.781c-8.062 10.219-16.125 20.344-24.281 30.375-10.594 11.906-19.594 25.125-26.719 39.375-4.781 12.375-8.625 25.125-11.625 38.063l-.281 1.031a296.022 296.022 0 01-16.875 43.313 142.935 142.935 0 00-1.875 3.937c-4.031 8.344-8.25 16.688-12.656 24.844l-5.063 9.468a159.66 159.66 0 00-8.437 17.625c-1.406 3.657-2.531 7.407-3.188 11.25-1.219 8.157-.656 16.407 1.5 24.282.469 1.968 1.125 3.937 1.781 5.906 2.063 5.813 4.5 11.531 7.407 16.969 1.312 2.531 2.719 4.968 4.031 7.5l1.219 1.781a169.016 169.016 0 004.125 6.938l.187.28c1.594 2.626 3.375 5.157 5.063 7.688l.281.375c1.781 2.438 3.563 4.969 5.438 7.407 6.937 27.093 19.687 52.312 37.218 74.062-2.719 4.781-5.156 9.469-7.875 14.156A216.887 216.887 0 00293 853.72c-2.531 8.062-3.188 16.593-1.781 24.937 1.312 8.438 5.625 16.032 12.187 21.563 4.406 3.375 9.469 5.718 14.813 6.843 5.344 1.125 10.875 1.688 16.406 1.407 20.813-1.594 41.438-5.719 61.313-12.094 12-3.188 24-6 36.187-8.438 12.656-2.906 25.5-4.687 38.438-5.25 3.187.094 6.375-.093 9.468-.28 8.813.937 17.625 1.312 26.531.937l3.282-.188c2.25.282 4.594.375 6.937.563a480.306 480.306 0 0146.407 4.781c13.5 2.063 27 4.688 40.312 7.969 20.531 6.187 41.625 10.312 63.094 12.093 5.625.282 11.25-.187 16.875-1.312 5.531-1.125 10.781-3.563 15.281-6.938 6.563-5.437 10.875-13.03 12.281-21.468 1.407-8.344.75-16.875-1.781-24.938-6.188-15.656-14.156-30.562-23.906-44.343-3.375-5.72-6.563-11.625-9.938-17.344a307.557 307.557 0 0038.157-52.969c6.562.375 13.03-.375 19.312-2.438a81.136 81.136 0 0040.594-30.468c3-4.219 5.343-8.907 6.75-13.875a89.449 89.449 0 0012.937-33.094c3-19.5 2.532-39.469-1.406-58.781h-.188zm0 0",fill:"#020204"}),k=r.createElement("path",{d:"M431 335a32.58 32.58 0 00-6 12.75c-1.031 4.594-1.688 9.375-1.781 14.063.281 9.468-.469 18.937-2.344 28.218-3.281 9.656-8.25 18.563-14.625 26.531-10.969 13.782-19.594 29.25-25.5 45.75-3 10.22-4.031 20.907-2.906 31.594a337.236 337.236 0 00-29.344 53.156c-12.563 28.032-20.625 57.938-23.906 88.5-4.031 37.594 1.5 75.563 15.937 110.438a182.552 182.552 0 0047.156 65.719c10.5 9.093 22.032 16.781 34.407 22.875 43.781 21.375 95.062 20.906 138.375-1.313a267.942 267.942 0 0058.687-46.406c11.157-10.125 21.094-21.469 29.813-33.844 14.531-25.218 23.062-53.531 24.843-82.593 9-50.25 3.47-102-15.843-149.25-7.594-15.75-17.625-30.188-29.813-42.75a236.719 236.719 0 00-18.937-63.75c-6.75-14.532-14.907-28.407-21.188-43.313-2.531-6.094-4.781-12.281-7.593-18.188-2.72-6-6.47-11.53-11.063-16.218-4.969-4.594-10.875-8.063-17.344-10.031a71.82 71.82 0 00-19.875-3.375c-13.5-.657-27.093 1.03-40.406.562-10.781-.469-21.375-2.344-32.156-1.688-5.344.282-10.688 1.313-15.656 3.282A31.379 31.379 0 00431 335.094m4.313-117.281c-5.063.375-9.844 2.53-13.5 6-3.657 3.468-6.375 7.875-7.875 12.656-2.532 9.75-3.188 19.969-1.782 30 .188 9.094 1.781 18.187 4.781 26.812 1.688 4.219 4.125 8.156 7.313 11.438 3.188 3.281 7.219 5.719 11.625 6.844a23.2 23.2 0 0012.656-.47c4.031-1.312 7.781-3.562 10.781-6.562 4.407-4.5 7.594-10.031 9.188-16.031a64.942 64.942 0 002.156-18.563c0-7.78-1.219-15.562-3.562-23.062s-6.375-14.344-11.813-20.063c-2.625-2.718-5.625-5.062-9-6.75-3.469-1.593-7.219-2.437-10.969-2.25m89.063 0c-8.063 5.25-14.25 12.938-17.719 21.938-3.562 11.625-3 24 1.406 35.344a59.437 59.437 0 0020.813 29.812 37.347 37.347 0 0017.063 6.563c6.187.75 12.375-.281 17.906-3.094a35.218 35.218 0 0014.906-16.219c3-6.937 4.688-14.344 4.875-21.844a73.847 73.847 0 00-3.563-28.218c-3.28-9.938-9.656-18.469-18.28-24.281-4.407-2.813-9.282-4.688-14.438-5.438a30.339 30.339 0 00-15.282 1.688 41.666 41.666 0 00-7.78 4.218",fill:"#FFF"}),N=r.createElement("path",{d:"M542.469 241.625c-3 .188-5.813 1.125-8.344 2.719s-4.688 3.75-6.375 6.187a32.028 32.028 0 00-5.063 16.781c-.28 4.407.375 8.907 1.782 13.125s4.031 7.97 7.406 10.782a21.713 21.713 0 0012.469 4.875c4.593.187 9.093-1.031 12.843-3.656 3-2.157 5.438-4.875 7.125-8.157 1.688-3.187 2.72-6.75 3.188-10.312.938-6.375-.188-12.938-3-18.656-2.906-5.813-7.875-10.22-13.875-12.563-2.625-1.031-5.344-1.406-8.156-1.313",fill:"#020204"}),O=r.createElement("path",{d:"M435.313 217.906c-5.063.375-9.844 2.531-13.5 6-3.657 3.469-6.375 7.875-7.875 12.656-2.532 9.75-3.188 19.97-1.782 30 .188 9.094 1.781 18.188 4.781 26.813 1.688 4.313 4.125 8.156 7.313 11.438 3.188 3.28 7.219 5.718 11.625 6.843a23.2 23.2 0 0012.656-.469c4.031-1.312 7.781-3.562 10.781-6.562 4.407-4.5 7.594-10.031 9.188-16.031a64.942 64.942 0 002.156-18.563c0-7.781-1.219-15.562-3.562-23.062s-6.375-14.344-11.813-20.063c-2.625-2.719-5.625-5.062-9-6.75-3.469-1.594-7.219-2.437-10.969-2.25",fill:"#FFF"}),j=r.createElement("path",{d:"M423.219 259.625c-1.219 6.281-.938 12.844 1.031 18.938 1.5 4.03 3.75 7.687 6.75 10.78 1.875 2.063 4.031 3.844 6.563 5.063 2.53 1.313 5.343 1.688 8.156 1.031 2.531-.656 4.687-2.156 6.281-4.218 1.594-2.063 2.719-4.406 3.469-6.844 2.156-7.313 1.969-15.094-.375-22.406-1.5-5.344-4.406-10.219-8.531-13.875-1.97-1.688-4.407-3-6.938-3.656-2.625-.657-5.344-.47-7.875.656a13.685 13.685 0 00-6.094 6.094 26.075 26.075 0 00-2.531 8.343",fill:"#020204"}),w=r.createElement("path",{d:"M411.313 338.469c.187.844.468 1.687.937 2.344a10.342 10.342 0 003.188 3.187c1.218.844 2.437 1.594 3.656 2.344 6.469 4.406 12.187 9.844 16.781 16.219C441.5 371.375 448.531 379.25 456.5 386c6.094 4.219 13.219 6.75 20.625 7.406 8.625.656 17.344-.375 25.688-3 7.687-2.25 15.093-5.437 22.03-9.656 11.907-9.563 24.657-18 38.157-25.031 3.188-1.125 6.375-1.969 9.375-3.375 3.094-1.313 5.719-3.563 7.313-6.563 1.03-3 1.687-6.187 1.78-9.375.47-3.375 1.595-6.656 2.157-10.031.75-3.375.469-6.844-.75-10.125a13.816 13.816 0 00-5.906-5.906c-2.532-1.219-5.344-1.969-8.157-2.063-5.718.188-11.343.75-16.875 1.688-7.5.656-15-.281-22.5 0-9.28.281-18.562 2.344-27.937 2.719-10.688.562-21.281-1.125-31.969-1.594-4.594-.281-9.281-.094-13.875.656-4.594.656-9 2.344-12.844 4.969-3.562 2.812-6.843 5.812-10.03 9a27.829 27.829 0 01-5.532 3.844c-2.063 1.03-4.219 1.593-6.563 1.5a10.766 10.766 0 00-3.468 0c-.656.28-1.313.656-1.781 1.125l-1.407 1.687c-.937 1.406-1.781 2.906-2.437 4.406",fill:"#D99A03"}),x=r.createElement("path",{d:"M434.844 314.844c-3.75 2.25-7.406 4.687-11.063 7.219a14.568 14.568 0 00-4.781 4.78 10.16 10.16 0 00-.844 4.688 40.676 40.676 0 010 4.781c-.094 1.032-.469 2.157-.469 3.282 0 .562 0 1.125.188 1.594.188.562.375 1.03.75 1.406.469.469 1.125.844 1.875 1.031.656.188 1.406.281 2.156.469 3.281.937 6.281 2.719 8.719 5.062 2.531 2.25 4.781 4.875 7.5 7.031 7.5 5.625 16.594 8.532 25.875 8.438 9.281-.188 18.469-1.5 27.375-3.844 7.031-1.5 13.969-3.375 20.719-5.719 10.5-3.937 20.156-9.656 28.5-17.062a94.798 94.798 0 0111.625-9.656c3.75-2.344 8.156-3.938 11.906-6.188.375-.187.656-.469 1.031-.656.282-.281.563-.563.75-.938a2.626 2.626 0 000-2.062c-.187-.656-.468-1.219-.843-1.688a12.797 12.797 0 00-1.594-1.593 26.443 26.443 0 00-14.813-5.156c-5.437-.375-10.593 0-15.843-1.032-4.875-1.031-9.657-2.437-14.344-4.125a103.68 103.68 0 00-15.282-3.656c-12.187-1.969-24.562-1.688-36.656.938-11.344 2.53-22.312 6.843-32.437 12.656",fill:"#604405"}),T=r.createElement("path",{d:"M433.625 302.094c-5.438 3.656-10.313 8.156-14.531 13.219a31.347 31.347 0 00-5.719 9.656c-.844 2.812-1.406 5.719-1.875 8.625-.281 1.031-.469 2.156-.469 3.281 0 .563.094 1.125.281 1.594a3.53 3.53 0 00.844 1.406c.656.656 1.5 1.031 2.438 1.219.844.187 1.781.187 2.719.281 4.125.656 7.968 2.344 11.343 4.781 3.375 2.344 6.563 5.063 10.031 7.313 7.875 4.687 16.875 7.219 26.063 7.406 9.188.188 18.281-.75 27.188-2.719a118.662 118.662 0 0021-5.906 125.554 125.554 0 0028.5-17.063c4.03-3 7.968-6.187 11.625-9.656 1.218-1.219 2.437-2.437 3.75-3.562a13.827 13.827 0 014.406-2.531c2.531-.657 5.156-.75 7.781-.094 1.875.469 3.844.656 5.813.656 1.03 0 1.968-.188 2.906-.469.937-.375 1.781-.937 2.343-1.687.844-1.031 1.22-2.25 1.22-3.563s-.376-2.531-1.032-3.656c-1.406-2.156-3.563-3.844-5.906-4.781-3.282-1.313-6.657-2.344-10.125-3a142.883 142.883 0 01-30.657-11.156c-4.875-2.438-9.468-5.063-14.343-7.594-4.875-2.719-9.938-5.063-15.188-6.75-12.094-3.281-24.937-2.719-36.656 1.687-13.125 4.594-24.844 12.563-33.844 23.156",fill:"#F5BD0C"}),z=r.createElement("path",{d:"M494.656 287.188c.656 2.156 4.031 1.78 6 2.718 1.969.938 3.094 2.719 4.969 2.906 1.969.188 4.688-.656 4.969-2.437.375-2.438-3.188-3.938-5.438-4.781-3-1.406-6.375-1.5-9.375-.188-.656.281-1.312 1.125-1.125 1.781zm-32.25-1.125c-2.531-.844-6.656 3.562-5.437 5.906.375.656 1.5 1.406 2.25 1.031s2.156-2.906 3.375-3.75c.937-.75.75-2.906-.188-3.188zm0 0",fill:"#CD8907"}),C=r.createElement("path",{d:"M864.219 809.938c-1.875 4.875-4.594 9.375-7.969 13.406-7.875 8.437-17.438 15.187-27.938 19.875-17.812 8.25-35.156 17.437-52.03 27.468a215.954 215.954 0 00-30.657 24.75c-7.781 8.157-16.125 15.657-24.938 22.688-9.187 6.75-19.78 11.344-31.03 13.125-13.782 1.781-27.75-.375-40.407-6.094-9.094-3.468-16.969-9.562-22.5-17.625-4.688-8.625-6.844-18.281-6.375-28.031a293.704 293.704 0 016.188-51.094c2.437-14.062 4.875-28.125 6.375-42.281 2.625-25.875 2.906-51.844.937-77.719a60.554 60.554 0 010-13.031c.563-8.813 7.969-15.563 16.875-15.469 4.031-.093 8.063.282 12 1.032 9.375 1.125 18.75 2.718 27.938 4.875 5.718 1.5 11.437 3.562 17.156 5.156 9.562 2.812 19.687 3.656 29.625 2.718 10.406-2.437 21-4.03 31.687-4.968 4.407.187 8.813.937 12.938 2.25 4.312 1.218 8.343 3.375 11.625 6.468 2.343 2.532 4.218 5.438 5.437 8.625 1.782 4.782 2.907 9.75 3.282 14.813.187 4.5.562 9 1.125 13.5 1.593 7.219 5.062 13.969 9.937 19.594 4.969 5.437 10.313 10.5 16.125 15a173.108 173.108 0 0017.438 13.5c2.906 1.968 5.812 3.75 8.53 5.906 2.813 2.063 5.157 4.688 6.938 7.688 2.25 4.125 3 8.906 1.875 13.5",fill:"#F5BD0C"}),D=r.createElement("path",{d:"M864.219 809.938c-1.875 4.875-4.594 9.375-7.969 13.406-7.875 8.437-17.438 15.187-27.938 19.875-17.812 8.25-35.156 17.437-52.03 27.468a215.954 215.954 0 00-30.657 24.75c-7.781 8.157-16.125 15.657-24.938 22.688-9.187 6.75-19.78 11.344-31.03 13.125-13.782 1.781-27.75-.375-40.407-6.094-9.094-3.468-16.969-9.562-22.5-17.625-4.688-8.625-6.844-18.281-6.375-28.031a293.704 293.704 0 016.188-51.094c2.437-14.062 4.875-28.125 6.375-42.281 2.625-25.875 2.906-51.844.937-77.719a60.554 60.554 0 010-13.031c.563-8.813 7.969-15.563 16.875-15.469 4.031-.093 8.063.282 12 1.032 9.375 1.125 18.75 2.718 27.938 4.875 5.718 1.5 11.437 3.562 17.156 5.156 9.562 2.812 19.687 3.656 29.625 2.718 10.406-2.437 21-4.03 31.687-4.968 4.407.187 8.813.937 12.938 2.25 4.312 1.218 8.343 3.375 11.625 6.468 2.343 2.532 4.218 5.438 5.437 8.625 1.782 4.782 2.907 9.75 3.282 14.813.187 4.5.562 9 1.125 13.5 1.593 7.219 5.062 13.969 9.937 19.594 4.969 5.437 10.313 10.5 16.125 15a173.108 173.108 0 0017.438 13.5c2.906 1.968 5.812 3.75 8.53 5.906 2.813 2.063 5.157 4.688 6.938 7.688 2.25 4.125 3 8.906 1.875 13.5M275.188 666.03a26.145 26.145 0 0114.437-1.312 35.242 35.242 0 0113.5 5.718c7.781 5.907 14.531 13.22 19.875 21.375 13.219 18.188 25.875 36.75 37.406 56.063 9.375 15.656 17.906 31.781 28.688 46.5 7.031 9.563 15 18.469 22.125 28.031 7.406 9.375 13.031 20.063 16.5 31.407 4.125 15.093 2.437 31.125-4.594 45.093-5.063 9.75-12.656 17.907-21.938 23.532-9.375 5.625-20.156 8.437-31.125 8.156-17.25-2.344-33.937-7.594-49.312-15.563-32.719-13.031-68.25-17.156-102-27.281-10.406-3.094-20.531-6.844-31.031-9.656-4.688-1.125-9.281-2.532-13.781-4.407-4.407-1.875-8.25-5.062-10.782-9.093a20.743 20.743 0 01-2.719-10.782c.094-3.75.844-7.406 2.157-10.78 2.531-7.032 6.656-13.313 9.375-20.25a84.632 84.632 0 004.687-35.813c-.562-12.094-2.719-24.188-3.375-36.282a58.715 58.715 0 01.563-16.218c1.406-10.688 9.75-19.219 20.531-20.813 4.969-.843 9.938-1.218 14.906-.937 4.969.281 10.031.281 15 0 4.969-.282 9.938-1.688 14.344-4.032 4.031-2.437 7.594-5.812 10.313-9.75a124.125 124.125 0 007.406-12.187c2.25-4.219 4.781-8.156 7.781-11.906 2.813-3.844 6.656-6.75 11.063-8.813",fill:"#F5BD0C"}),I=r.createElement("path",{d:"M275.188 666.125a26.145 26.145 0 0114.437-1.313 35.242 35.242 0 0113.5 5.72c7.781 5.905 14.531 13.218 19.875 21.374 13.219 18.188 25.875 36.75 37.406 56.063 9.375 15.656 17.906 31.781 28.688 46.5 7.031 9.562 15 18.468 22.125 28.031 7.406 9.375 13.031 20.063 16.5 31.406 4.125 15.094 2.437 31.125-4.594 45.094-5.063 9.75-12.656 17.906-21.938 23.531-9.375 5.625-20.156 8.438-31.125 8.157-17.25-2.344-33.937-7.594-49.312-15.563-32.719-13.031-68.25-17.156-102-27.281-10.406-3.094-20.531-6.844-31.031-9.657-4.688-1.125-9.281-2.53-13.781-4.406-4.407-1.875-8.25-5.062-10.782-9.093a20.743 20.743 0 01-2.719-10.782c.094-3.75.844-7.406 2.157-10.781 2.531-7.031 6.656-13.313 9.375-20.25a84.632 84.632 0 004.687-35.813c-.562-12.093-2.719-24.093-3.375-36.28a58.715 58.715 0 01.563-16.22c1.406-10.687 9.75-19.218 20.531-20.812 4.969-.844 9.938-1.219 14.906-.938 4.969.282 10.031.282 15 0 4.969-.28 9.938-1.687 14.344-4.03 4.031-2.438 7.594-5.813 10.313-9.75a124.125 124.125 0 007.406-12.188c2.25-4.219 4.781-8.157 7.781-11.907 2.813-3.843 6.656-6.843 11.063-8.812",fill:"#F5BD0C"}),P=r.createElement("path",{d:"M282.406 674c4.125-1.594 8.719-1.875 13.031-.844s8.344 3 11.813 5.813c6.656 5.812 12.281 12.75 16.5 20.531 11.25 18.188 22.219 36.563 32.438 55.313a370.55 370.55 0 0024.937 41.437c6.375 8.625 13.688 16.5 20.25 24.938 6.844 8.343 12 17.812 15.188 28.03 3.75 13.407 2.156 27.75-4.22 40.22-4.687 8.812-11.718 16.218-20.343 21.187a51.593 51.593 0 01-28.5 7.031 163.06 163.06 0 01-45.188-13.968c-28.5-10.407-59.53-11.72-88.78-19.875-10.5-2.813-20.72-6.657-31.313-9.282-4.688-1.031-9.375-2.343-13.875-4.031-4.5-1.688-8.438-4.875-11.063-8.906-1.687-3.188-2.531-6.75-2.344-10.313a33.95 33.95 0 012.25-10.5c2.532-6.656 6.563-12.75 9.094-19.406 3.563-10.313 4.781-21.188 3.656-32.063-.75-10.78-2.718-21.468-3.28-32.343-.376-4.782-.188-9.657.655-14.438.844-4.781 3.094-9.187 6.47-12.75 3.937-3.562 8.812-5.906 14.062-6.562 5.25-.657 10.5-.657 15.656 0 5.25.656 10.5.843 15.75.75 10.313 0 19.688-6 24.094-15.375a98.75 98.75 0 005.531-13.032c1.594-4.5 3.75-8.718 6.281-12.75 2.625-4.03 6.375-7.218 10.781-9.093",fill:"#F5BD0C"});var S=function(e){var t=e.title,a=e.titleId,n=g(e,["title","titleId"]);return r.createElement("svg",y({className:"linux_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,v,E,b,k,N,O,j,w,x,T,z,C,D,I,P)};function M(){return(M=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var B=r.createElement("defs",null,r.createElement("style",null)),A=r.createElement("path",{d:"M878.3 721.7c-1.35 3.6-18.9 65.25-62.1 128.25-37.8 54.9-76.5 109.8-137.7 110.7-60.3.9-79.65-36-148.5-36s-90.45 35.1-147.6 36.9c-58.95 2.25-104.4-59.85-142.2-114.3C163.25 736.55 103.85 531.8 183.5 395c39.15-68.4 109.8-112.05 186.3-113.4 57.6-.9 112.95 39.15 148.05 39.15 36 0 102.6-48.6 172.8-41.4 29.25 1.35 111.6 12.15 164.25 89.1-4.05 2.7-98.1 58.5-97.2 171.45.9 136.35 119.25 181.35 120.6 181.8m-234-515.25c31.5-38.7 52.65-91.8 46.8-144.45-45 1.8-100.35 30.15-132.75 68.4-28.8 33.3-54.45 87.3-47.25 139.5 49.95 2.7 101.7-26.55 133.2-63.45",fill:"#fff"});var F=function(e){var t=e.title,a=e.titleId,n=_(e,["title","titleId"]);return r.createElement("svg",M({className:"macos_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,B,A)};function L(){return(L=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var V=r.createElement("defs",null,r.createElement("style",null)),H=r.createElement("path",{d:"M944.9 471.64a141.947 141.947 0 00-105.047-9.506 139.64 139.64 0 00-56.784-88.959l-11.25-8.86-9.535 10.688a117.675 117.675 0 00-22.218 84.656 108.59 108.59 0 0021.206 56.87 164.925 164.925 0 01-30.544 13.443 204.272 204.272 0 01-62.972 10.153H73.925l-1.266 13.303a248.428 248.428 0 0020.897 129.375l8.128 16.116.928 1.519c55.829 92.193 167.204 139.95 274.05 139.95 206.888 0 364.191-98.747 442.575-288.479 52.37 2.672 105.947-12.403 131.57-61.003l6.524-12.403-12.431-6.975zM246.978 711.689a46.434 46.434 0 1147.813-46.435 47.166 47.166 0 01-47.813 46.434z",fill:"#1296db"}),$=r.createElement("path",{d:"M246.978 640.7a24.44 24.44 0 1025.144 24.469 24.806 24.806 0 00-25.144-24.469M118.25 427.625h84.375V512H118.25zm112.5 0h84.375V512H230.75zm0-112.5h84.375V399.5H230.75zm112.5 0h84.375V399.5H343.25zm0 112.5h84.375V512H343.25zm112.5 0h84.375V512H455.75zm112.5 0h84.375V512H568.25zm-112.5-112.5h84.375V399.5H455.75zm0-112.5h84.375V287H455.75z",fill:"#1296db"});var U=function(e){var t=e.title,a=e.titleId,n=R(e,["title","titleId"]);return r.createElement("svg",L({className:"docker_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,V,H,$)};function G(){return(G=Object.assign||function(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var J=r.createElement("defs",null,r.createElement("style",null)),Q=r.createElement("path",{d:"M444.65 600.125l.262.375-37.462 90.487a193.912 193.912 0 01-77.813-97.387l96.676-16.388.15.188a16.5 16.5 0 0118.15 22.725zm-31.238-79.838a16.5 16.5 0 006.488-28.35l.075-.412-73.537-65.775a192.863 192.863 0 00-27.375 122.063l94.275-27.188.074-.338zm42.938-74.25a16.5 16.5 0 0026.213-12.637l.374-.188 5.625-98.25a192.9 192.9 0 00-112.874 54.076L456.2 446.15l.15-.075zm28.5 103.126l27.112 13.087 27.076-13.013 6.75-29.25-18.75-23.362h-30.15l-18.75 23.362 6.712 29.213zM541.1 433.1a16.5 16.5 0 0026.25 12.6l.3.112 80.025-56.737A194.55 194.55 0 00535.475 335l5.55 98.063.075.037zm407.85 223.875L732.462 926.263a60 60 0 01-46.8 22.275l-347.287.112a60 60 0 01-46.763-22.35l-216.6-269.25A59.362 59.362 0 0163.5 606.8l77.25-335.813c4.05-17.625 15.937-32.4 32.362-40.237L485.938 81.238a60.225 60.225 0 0151.937 0l312.937 149.437c16.425 7.838 28.313 22.65 32.363 40.238L960.5 606.725a59.041 59.041 0 01-11.55 50.25zm-123.338-77.138c-1.575-.375-3.862-.974-5.437-1.275-6.525-1.237-11.812-.937-17.963-1.425-13.124-1.387-23.924-2.512-33.562-5.55-3.937-1.5-6.75-6.187-8.1-8.1l-7.537-2.212a241.875 241.875 0 00-3.938-87.45 242.438 242.438 0 00-35.1-81.113c1.95-1.762 5.625-4.987 6.638-5.962.3-3.375.037-6.863 3.524-10.575 7.388-6.937 16.65-12.675 27.863-19.575 5.325-3.15 10.238-5.137 15.562-9.075 1.2-.9 2.85-2.325 4.126-3.337 9-7.163 11.062-19.5 4.612-27.6-6.45-8.1-18.975-8.85-27.937-1.688-1.276 1.013-3 2.325-4.163 3.3-5.025 4.35-8.138 8.625-12.375 13.125-9.225 9.375-16.875 17.175-25.238 22.838-3.637 2.1-8.962 1.387-11.362 1.237l-7.125 5.063a245.437 245.437 0 00-155.475-75.113l-.45-8.362c-2.437-2.325-5.362-4.313-6.112-9.376-.826-10.05.562-20.887 2.137-33.937.862-6.113 2.288-11.175 2.55-17.813.037-1.5-.038-3.712-.037-5.324 0-11.475-8.4-20.813-18.75-20.813-10.313 0-18.713 9.338-18.713 20.813l.037.525c0 1.537-.074 3.45 0 4.8.225 6.637 1.65 11.7 2.513 17.812 1.575 13.05 2.925 23.888 2.1 33.975a20.437 20.437 0 01-6.075 9.675l-.45 7.913A240.9 240.9 0 00335.15 360.35a313.988 313.988 0 01-6.75-4.8c-3.375.45-6.75 1.5-11.137-1.088-8.363-5.625-16.013-13.425-25.238-22.8-4.237-4.5-7.313-8.774-12.337-13.087a100.912 100.912 0 00-4.163-3.3 22.275 22.275 0 00-13.05-4.95 18.038 18.038 0 00-14.925 6.6c-6.45 8.1-4.387 20.475 4.613 27.637l.262.188 3.9 3.113c5.325 3.937 10.2 5.962 15.525 9.074 11.213 6.938 20.475 12.675 27.863 19.575 2.85 3.076 3.375 8.476 3.75 10.8l6 5.363a242.325 242.325 0 00-38.25 168.975l-7.8 2.25c-2.063 2.7-4.988 6.9-8.063 8.137-9.637 3.038-20.475 4.125-33.562 5.513-6.15.525-11.438.225-18 1.462-1.388.263-3.375.75-4.988 1.125l-.15.076-.262.075c-11.063 2.662-18.15 12.825-15.863 22.8 2.288 10.012 13.088 16.087 24.188 13.687l.262-.037.375-.113 4.838-1.087c6.374-1.725 11.025-4.238 16.8-6.45 12.375-4.426 22.65-8.138 32.625-9.6 4.2-.338 8.625 2.587 10.8 3.787l8.137-1.387a243.75 243.75 0 00108 134.85l-3.375 8.175c1.237 3.15 2.587 7.462 1.65 10.575-3.637 9.45-9.862 19.387-16.95 30.487-3.413 5.1-6.937 9.075-10.05 14.963-.75 1.387-1.687 3.562-2.4 5.025-4.8 10.312-1.275 22.162 7.988 26.624 9.3 4.5 20.85-.262 25.875-10.575v-.074c.75-1.463 1.725-3.375 2.324-4.763 2.626-6.075 3.526-11.288 5.4-17.175 4.95-12.45 7.688-25.5 14.513-33.637 1.875-2.25 4.875-3.076 8.063-3.938l4.237-7.688a241.988 241.988 0 00172.838.45l3.974 7.2c3.225 1.05 6.75 1.575 9.6 5.813 5.1 8.7 8.588 19.013 12.826 31.5 1.874 5.85 2.774 11.063 5.437 17.137.6 1.388 1.613 3.375 2.325 4.838 4.988 10.35 16.575 15.075 25.875 10.575 9.263-4.425 12.787-16.313 7.988-26.625-.75-1.462-1.688-3.6-2.438-5.025-3.112-5.85-6.637-9.787-10.05-14.925-7.125-11.1-12.975-20.288-16.612-29.737-1.5-4.875.262-7.875 1.425-11.025-.675-.825-2.213-5.4-3.113-7.575a243.713 243.713 0 00108-135.826c2.4.376 6.6 1.125 7.988 1.426 2.812-1.875 5.4-4.275 10.5-3.9 9.974 1.462 20.25 5.174 32.624 9.6 5.776 2.25 10.388 4.8 16.8 6.487 1.35.375 3.3.713 4.876 1.05l.337.113.262.037c11.138 2.4 21.9-3.675 24.188-13.688 2.25-9.974-4.8-20.137-15.863-22.8zM677 425.787l-73.125 65.475v.188a16.5 16.5 0 006.488 28.387l.112.376 94.725 27.3a194.963 194.963 0 00-4.05-62.776A195.3 195.3 0 00677 425.75zM526.512 625.475a16.387 16.387 0 00-15.15-8.7 16.5 16.5 0 00-13.95 8.738h-.075l-47.55 85.95a193.65 193.65 0 00124.725.112l-47.624-86.1h-.375zm70.8-48.488a16.5 16.5 0 00-10.124 1.35 16.5 16.5 0 00-8.025 21.45l-.113.15 37.875 91.426a193.125 193.125 0 0078.038-98.063l-97.5-16.5-.15.187z",fill:"#0092ff"});var q=function(e){var t=e.title,a=e.titleId,n=W(e,["title","titleId"]);return r.createElement("svg",G({className:"kubernetes_svg__icon",viewBox:"0 0 1024 1024",width:200,height:200,"aria-labelledby":a},n),t?r.createElement("title",{id:a},t):null,J,Q)},K=a(217),X=(a(179),a(180),a(197));function Y(){return l.a.createElement("div",{className:"furion-banner"},l.a.createElement("div",{className:"furion-banner-container"},l.a.createElement("div",{className:"furion-banner-item"},l.a.createElement("div",{className:"furion-banner-project"},"Furion"),l.a.createElement("div",{className:"furion-banner-description"},"\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002"),l.a.createElement("ul",{className:"furion-banner-spec"},l.a.createElement("li",null,"\u57fa\u4e8e .NET 5 \u5e73\u53f0\uff0c\u6ca1\u6709\u5386\u53f2\u5305\u88b1"),l.a.createElement("li",null,"\u6781\u5c11\u4f9d\u8d56\uff0c\u53ea\u4f9d\u8d56\u4e24\u4e2a\u7b2c\u4e09\u65b9\u5305"),l.a.createElement("li",null,"\u6781\u901f\u4e0a\u624b\uff0c\u4ee3\u7801\u65e0\u4fb5\u5165\u5f0f"),l.a.createElement("li",null,"\u53ea\u9700\u8981\u4e00\u4e2a Inject() \u5373\u53ef\u5b8c\u6210\u914d\u7f6e")),l.a.createElement("div",{className:"furion-support-platform"},"\u53d7\u652f\u6301\u5e73\u53f0\uff1a"),l.a.createElement("div",{className:"furion-support-icons"},l.a.createElement("span",null,l.a.createElement(h,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(S,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(F,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(U,{height:"39",width:"39"})),l.a.createElement("span",null,l.a.createElement(q,{height:"39",width:"39"}))),l.a.createElement("div",{className:"furion-get-start-btn"},l.a.createElement(s.a,{className:"furion-get-start",to:Object(m.a)("docs/get-start")},"\u4e00\u5206\u949f\u4e0a\u624b"))),l.a.createElement("div",{className:"furion-banner-item"},l.a.createElement(ne,{style:{float:"right"}},l.a.createElement(ae,{language:"cs",source:'\npublic class AppService : IDynamicApiController\n{\n private readonly IRepository _userRepository;\n public AppService(IRepository userRepository)\n {\n _userRepository = userRepository;\n }\n\n [IfException(1000, "\u7528\u6237ID: {0} \u4e0d\u5b58\u5728")]\n public async Task GetUser([Range(1, int.MaxValue)] int userId)\n {\n var user = await _userRepository.FindOrDefaultAsync(userId);\n _ = user ?? throw Oops.Oh(1000, userId);\n return user.Adapt();\n }\n\n public async Task GetRemote(string id)\n {\n var data = await $"https://www.furion.pro/data?id={id}".GetAsAsync();\n return data;\n }\n}\n'})))))}function Z(){const{isDarkTheme:e,setLightTheme:t,setDarkTheme:a}=Object(o.a)();return l.a.createElement("div",{className:"furion-content"},l.a.createElement("p",{className:"furion-small-title"+(e?" dark":"")},"\u5b8c\u5168\u5f00\u6e90\u514d\u8d39"),l.a.createElement("h1",{className:"furion-big-title"+(e?" dark":"")},"\u4ee3\u7801\u6258\u7ba1\u5728\u5f00\u6e90\u4e2d\u56fd GITEE"),l.a.createElement("div",{className:"furion-gitee-log"},l.a.createElement("div",{className:"furion-log-item",style:{border:"6px solid #723cff"}},l.a.createElement("div",{className:"furion-log-jiao"+(e?" dark":"")}),l.a.createElement("div",{className:"furion-log-number"},l.a.createElement("div",{style:{color:"#723cff"}},"2390"),l.a.createElement("span",{className:e?" dark":""},"Stars"))),l.a.createElement("div",{className:"furion-log-item",style:{border:"6px solid #3fbbfe"}},l.a.createElement("div",{className:"furion-log-jiao"+(e?" dark":"")}),l.a.createElement("div",{className:"furion-log-number"},l.a.createElement("div",{style:{color:"#3fbbfe"}},"530"),l.a.createElement("span",{className:e?" dark":""},"Forks"))),l.a.createElement("div",{className:"furion-log-item",style:{border:"6px solid #1fd898"}},l.a.createElement("div",{className:"furion-log-jiao"+(e?" dark":"")}),l.a.createElement("div",{className:"furion-log-number"},l.a.createElement("div",{style:{color:"#1fd898"}},"631,892"),l.a.createElement("span",{className:e?" dark":""},"Downloads")))))}function ee(){const{isDarkTheme:e,setLightTheme:t,setDarkTheme:a}=Object(o.a)();return l.a.createElement("div",{className:"furion-content"},l.a.createElement("p",{className:"furion-small-title"+(e?" dark":"")},"\u5927\u91cf\u4f7f\u7528\u8005\u6d4b\u8bc4"),l.a.createElement("h1",{className:"furion-big-title"+(e?" dark":"")},"\u6765\u542c\u542c\u4ed6\u4eec\u662f\u600e\u4e48\u8bf4\u7684"),l.a.createElement("div",{className:"furion-remark"},l.a.createElement("div",{className:"furion-remark-item"},l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u7406\u60f3\u548c\u73b0\u5b9e"),l.a.createElement("p",{className:e?" dark":void 0},"\u4f5c\u8005\u7684\u6280\u672f\u662f\u6211\u63a5\u89e6.NET\u7a0b\u5e8f\u5458\u4e2d\u6700\u597d\u7684\u4e00\u4e2a\uff0c\u4ee3\u7801\u7684\u8d28\u91cf\uff0c\u6587\u6863\u7684\u8d28\u91cf\u90fd\u662f\u4e00\u7b49\u4e00\u7684\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"kesshei"),l.a.createElement("p",{className:e?" dark":void 0},"\u5f3a\u70c8\u652f\u6301\uff0c\u56e0\u4e3a\u6709\u4f60\u4eec\uff0c.net \u4f1a\u8d70\u7684\u66f4\u8fdc\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u9006\u5929\u7684\u8748\u8748"),l.a.createElement("p",{className:e?" dark":void 0},"\u975e\u5e38\u4f18\u79c0\u7684\u5f00\u6e90\u4f5c\u54c1\uff0c\u70b9\u8d5e\u652f\u6301"))),l.a.createElement("div",{className:"furion-remark-item"},l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u5f20\u82b8\u6eaa"),l.a.createElement("p",{className:e?" dark":void 0},"\u5927\u6982\u770b\u4e86\u4e00\u4e0b\uff0c\u89c9\u5f97\u9879\u76ee\u975e\u5e38\u68d2\u3002core\u751f\u6001\u4e00\u5b9a\u80fd\u706b")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"\u8d56\u76ae\u5c0f\u9cc4\u9c7c"),l.a.createElement("p",{className:e?" dark":void 0},"\u4f5c\u8005\u597d\u68d2\uff0c\u652f\u6301\u56fd\u5185.net\uff01")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"gudufy"),l.a.createElement("p",{className:e?" dark":void 0},"\u505a\u5f97\u975e\u5e38\u68d2\uff0c\u6253\u7b97\u57fa\u4e8e\u4f60\u7684\u6846\u67b6\u505a\u4e00\u4e2a\u57fa\u672c\u7684\u540e\u53f0\u7ba1\u7406\u51fa\u6765\uff0c\u4f9b\u5927\u5bb6\u5feb\u901f\u5f00\u53d1\u4e2d\u5c0f\u578b\u9879\u76ee\u3002"))),l.a.createElement("div",{className:"furion-remark-item"},l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"ThinkCoder"),l.a.createElement("p",{className:e?" dark":void 0},"\u6587\u6863\u5199\u7684\u771f\u4e0d\u9519\uff0c\u4ee3\u7801\u8d28\u91cf\u4e5f\u975e\u5e38\u9ad8\uff0c\u6ce8\u91ca\u975e\u5e38\u5b8c\u5584\uff0c\u8d5e\u4e00\u4e2a\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"liuina"),l.a.createElement("p",{className:e?" dark":void 0},"\u671f\u5f85\u6587\u6863\u5199\u5b8c\u7684\u90a3\u4e00\u5929\uff0c\u7edd\u5bf9\u60ca\u8273\u56db\u5ea7\u3002")),l.a.createElement("div",{className:"furion-remark-p"},l.a.createElement("h1",null,"weiyu.xiao"),l.a.createElement("p",{className:e?" dark":void 0},"\u5f88\u4e0d\u9519\u7684\u9879\u76ee\uff0c\u5bf9\u5feb\u901f\u642d\u5efa\u5065\u58ee\u7684\u6280\u672f\u67b6\u6784\uff0c\u5e2e\u52a9\u4e1a\u52a1\u6210\u529f\u5f88\u6709\u5e2e\u52a9\u3002")))))}function te(){return l.a.createElement("div",{className:"furion-whouse"},l.a.createElement("div",{className:"furion-who-custom"},l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom1.png"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom2.png"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom3.png"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("img",{src:Object(m.a)("img/custom4.jpg"),height:"100"})),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("a",{href:"http://www.hezongsoft.net",target:"_blank"},l.a.createElement("img",{src:Object(m.a)("img/custom5.png"),height:"100"}))),l.a.createElement("div",{className:"furion-custom-img"},l.a.createElement("a",{href:"http://www.dilon.vip/",target:"_blank"},l.a.createElement("img",{src:Object(m.a)("img/custom6.png"),height:"100"})))),l.a.createElement("div",{className:"furion-who-des"},l.a.createElement("div",{style:{maxWidth:350}},l.a.createElement("div",null),l.a.createElement("h1",null,"\u6211\u4eec\u7684\u5ba2\u6237"),l.a.createElement("p",null,"\u6211\u4eec\u7684\u8f6f\u4ef6\u5305\u5df2\u5728\u5168\u7403\u591a\u4e2a\u9879\u76ee\u4e2d\u4f7f\u7528\u3002\u4ece\u5c0f\u578b\u4f01\u4e1a\u5230\u4f01\u4e1a\u7684\u89e3\u51b3\u65b9\u6848\u53ca\u77e5\u540d\u4f01\u4e1a\u3002\u516c\u53f8\u5728\u7b80\u5355\u8f6f\u4ef6\u548c\u590d\u6742\u7ba1\u7406\u7cfb\u7edf\u7684\u5f00\u53d1\u65b9\u9762\u90fd\u4fe1\u4efb\u6211\u4eec\u3002"),l.a.createElement(s.a,{className:"furion-get-start",to:Object(m.a)("docs/get-start")},"\u7acb\u5373\u6dfb\u52a0\u60a8\u7684\u516c\u53f8"))))}function ae(e){let{language:t,replace:a,section:n,source:r}=e;if(r=r.replace(/\/\/ <.*?\n/g,""),a)for(const[l,c]of Object.entries(a))r=r.replace(new RegExp(l,"gs"),c);return r=r.trim(),r.includes("\n")||(r+="\n"),l.a.createElement(K.a.pre,null,l.a.createElement(K.a.code,{children:r,className:"language-"+t,mdxType:"code",originalType:"code",parentName:"pre"}))}function ne(e){const{children:t,className:a,...r}=e;return l.a.createElement("div",Object(n.a)({},r,{className:"system-window blue-accent preview-border "+a}),l.a.createElement("div",{className:"system-top-bar"},l.a.createElement("span",{className:"system-top-bar-circle",style:{backgroundColor:"#8759ff"}}),l.a.createElement("span",{className:"system-top-bar-circle",style:{backgroundColor:"#3fc4fe"}}),l.a.createElement("span",{className:"system-top-bar-circle",style:{backgroundColor:"#42ffac"}})),t)}t.default=function(){const e=Object(i.default)(),{siteConfig:t={}}=e;return l.a.createElement(c.a,{title:"\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002 "+t.title,description:"\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002"},l.a.createElement(Y,null),l.a.createElement(Z,null),l.a.createElement(ee,null),l.a.createElement(te,null),l.a.createElement(X.a,null))}},197:function(e,t,a){"use strict";a.d(t,"a",(function(){return c}));var n=a(0),r=a.n(n),l=a(194);a(55);function c(){const[e,t]=Object(n.useState)(!1);return r.a.createElement("div",{className:"furion-join-group"},e&&r.a.createElement("img",{src:Object(l.a)("img/dotnetchina2.jpg")}),r.a.createElement("button",{onClick:()=>t(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}},215:function(e,t,a){"use strict";const n=(e,{target:t=document.body}={})=>{const a=document.createElement("textarea"),n=document.activeElement;a.value=e,a.setAttribute("readonly",""),a.style.contain="strict",a.style.position="absolute",a.style.left="-9999px",a.style.fontSize="12pt";const r=document.getSelection();let l=!1;r.rangeCount>0&&(l=r.getRangeAt(0)),t.append(a),a.select(),a.selectionStart=0,a.selectionEnd=e.length;let c=!1;try{c=document.execCommand("copy")}catch(s){}return a.remove(),l&&(r.removeAllRanges(),r.addRange(l)),n&&n.focus(),c};e.exports=n,e.exports.default=n},216:function(e,t){function a(e){let t,a=[];for(let n of e.split(",").map(e=>e.trim()))if(/^-?\d+$/.test(n))a.push(parseInt(n,10));else if(t=n.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[e,n,r,l]=t;if(n&&l){n=parseInt(n),l=parseInt(l);const e=n0&&e[a-1]===t?e:e.concat(t)},h=function(e,t){var a=e.plain,n=Object.create(null),r=e.styles.reduce((function(e,a){var n=a.languages,r=a.style;return n&&!n.includes(t)||a.types.forEach((function(t){var a=u({},e[t],r);e[t]=a})),e}),n);return r.root=a,r.plain=u({},a,{backgroundColor:null}),r};function y(e,t){var a={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&-1===t.indexOf(n)&&(a[n]=e[n]);return a}var g=function(e){function t(){for(var t=this,a=[],n=arguments.length;n--;)a[n]=arguments[n];e.apply(this,a),m(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var a=e.theme?h(e.theme,e.language):void 0;return t.themeDict=a})),m(this,"getLineProps",(function(e){var a=e.key,n=e.className,r=e.style,l=u({},y(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),c=t.getThemeDict(t.props);return void 0!==c&&(l.style=c.plain),void 0!==r&&(l.style=void 0!==l.style?u({},l.style,r):r),void 0!==a&&(l.key=a),n&&(l.className+=" "+n),l})),m(this,"getStyleForToken",(function(e){var a=e.types,n=e.empty,r=a.length,l=t.getThemeDict(t.props);if(void 0!==l){if(1===r&&"plain"===a[0])return n?{display:"inline-block"}:void 0;if(1===r&&!n)return l[a[0]];var c=n?{display:"inline-block"}:{},s=a.map((function(e){return l[e]}));return Object.assign.apply(Object,[c].concat(s))}})),m(this,"getTokenProps",(function(e){var a=e.key,n=e.className,r=e.style,l=e.token,c=u({},y(e,["key","className","style","token"]),{className:"token "+l.types.join(" "),children:l.content,style:t.getStyleForToken(l),key:void 0});return void 0!==r&&(c.style=void 0!==c.style?u({},c.style,r):r),void 0!==a&&(c.key=a),n&&(c.className+=" "+n),c}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,a=e.language,n=e.code,r=e.children,l=this.getThemeDict(this.props),c=t.languages[a];return r({tokens:function(e){for(var t=[[]],a=[e],n=[0],r=[e.length],l=0,c=0,s=[],i=[s];c>-1;){for(;(l=n[c]++)0?m:["plain"],o=u):(m=f(m,u.type),u.alias&&(m=f(m,u.alias)),o=u.content),"string"==typeof o){var h=o.split(p),y=h.length;s.push({types:m,content:h[0]});for(var g=1;g{const{prism:e}=Object(j.useThemeConfig)(),{isDarkTheme:t}=Object(O.a)(),a=e.theme||N,n=e.darkTheme||a;return t?n:a},x=a(57),T=a.n(x);const z=/{([\d,-]+)}/,C=(e=["js","jsBlock","jsx","python","html"])=>{const t={js:{start:"\\/\\/",end:""},jsBlock:{start:"\\/\\*",end:"\\*\\/"},jsx:{start:"\\{\\s*\\/\\*",end:"\\*\\/\\s*\\}"},python:{start:"#",end:""},html:{start:"\x3c!--",end:"--\x3e"}},a=["highlight-next-line","highlight-start","highlight-end"].join("|"),n=e.map(e=>`(?:${t[e].start}\\s*(${a})\\s*${t[e].end})`).join("|");return new RegExp(`^\\s*(?:${n})\\s*$`)},D=/(?:title=")(.*)(?:")/;var I=({children:e,className:t,metastring:a})=>{const{prism:c}=Object(j.useThemeConfig)(),[i,m]=Object(r.useState)(!1),[u,p]=Object(r.useState)(!1);Object(r.useEffect)(()=>{p(!0)},[]);const d=Object(r.useRef)(null);let f=[],h="";const y=w(),v=Array.isArray(e)?e.join(""):e;if(a&&z.test(a)){const e=a.match(z)[1];f=k()(e).filter(e=>e>0)}a&&D.test(a)&&(h=a.match(D)[1]);let b=t&&t.replace(/language-/,"");!b&&c.defaultLanguage&&(b=c.defaultLanguage);let N=v.replace(/\n$/,"");if(0===f.length&&void 0!==b){let e="";const t=(e=>{switch(e){case"js":case"javascript":case"ts":case"typescript":return C(["js","jsBlock"]);case"jsx":case"tsx":return C(["js","jsBlock","jsx"]);case"html":return C(["js","jsBlock","html"]);case"python":case"py":return C(["python"]);default:return C()}})(b),a=v.replace(/\n$/,"").split("\n");let n;for(let r=0;re||t,void 0)){case"highlight-next-line":e+=l+",";break;case"highlight-start":n=l;break;case"highlight-end":e+=`${n}-${l-1},`}a.splice(r,1)}else r+=1}f=k()(e),N=a.join("\n")}const O=()=>{E()(N),m(!0),setTimeout(()=>m(!1),2e3)};return l.a.createElement(g,Object(n.a)({},o,{key:String(u),theme:y,code:N,language:b}),({className:e,style:t,tokens:a,getLineProps:r,getTokenProps:c})=>l.a.createElement(l.a.Fragment,null,h&&l.a.createElement("div",{style:t,className:T.a.codeBlockTitle},h),l.a.createElement("div",{className:T.a.codeBlockContent},l.a.createElement("div",{tabIndex:0,className:Object(s.a)(e,T.a.codeBlock,"thin-scrollbar",{[T.a.codeBlockWithTitle]:h})},l.a.createElement("div",{className:T.a.codeBlockLines,style:t},a.map((e,t)=>{1===e.length&&""===e[0].content&&(e[0].content="\n");const a=r({line:e,key:t});return f.includes(t+1)&&(a.className=a.className+" docusaurus-highlight-code-line"),l.a.createElement("div",Object(n.a)({key:t},a),e.map((e,t)=>l.a.createElement("span",Object(n.a)({key:t},c({token:e,key:t})))))}))),l.a.createElement("button",{ref:d,type:"button","aria-label":"Copy code to clipboard",className:Object(s.a)(T.a.copyButton),onClick:O},i?"Copied":"Copy"))))},P=(a(58),a(59)),S=a.n(P);var M=e=>function({id:t,...a}){const{navbar:{hideOnScroll:n}}=Object(j.useThemeConfig)();return t?l.a.createElement(e,a,l.a.createElement("a",{"aria-hidden":"true",tabIndex:-1,className:Object(s.a)("anchor",{[S.a.enhancedAnchor]:!n}),id:t}),a.children,l.a.createElement("a",{className:"hash-link",href:"#"+t,title:"Direct link to heading"},"#")):l.a.createElement(e,a)},_=a(60),B=a.n(_);const A={code:e=>{const{children:t}=e;return"string"==typeof t?t.includes("\n")?l.a.createElement(I,e):l.a.createElement("code",e):t},a:e=>l.a.createElement(c.a,e),pre:e=>l.a.createElement("div",Object(n.a)({className:B.a.mdxCodeBlock},e)),h1:M("h1"),h2:M("h2"),h3:M("h3"),h4:M("h4"),h5:M("h5"),h6:M("h6")};t.a=A}}]); \ No newline at end of file diff --git a/docs/f809ed0c.0f4f5b8c.js b/docs/f809ed0c.0f4f5b8c.js new file mode 100644 index 00000000000..8c8636bc912 --- /dev/null +++ b/docs/f809ed0c.0f4f5b8c.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[106],{181:function(n){n.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"furion","name":"furion","count":3,"permalink":"/blog/tags/furion"}')}}]); \ No newline at end of file diff --git a/docs/f809ed0c.14c80bf3.js b/docs/f809ed0c.14c80bf3.js deleted file mode 100644 index 16419d39733..00000000000 --- a/docs/f809ed0c.14c80bf3.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[102],{177:function(n){n.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"furion","name":"furion","count":1,"permalink":"/blog/tags/furion"}')}}]); \ No newline at end of file diff --git a/docs/f9353588.2670abf8.js b/docs/f9353588.bd2265b3.js similarity index 96% rename from docs/f9353588.2670abf8.js rename to docs/f9353588.bd2265b3.js index cada23fc1e2..faa3927ab39 100644 --- a/docs/f9353588.2670abf8.js +++ b/docs/f9353588.bd2265b3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[103],{178:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return s})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return u}));var r=n(3),a=n(7),i=(n(0),n(192)),c=n(193),o=n(190),s={id:"get-start",title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",sidebar_label:"2.1 \u4e00\u5206\u949f\u4e0a\u624b"},b={unversionedId:"get-start",id:"get-start",isDocsHomePage:!1,title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",description:"Furion \u5b98\u65b9\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u811a\u624b\u67b6\uff0c\u53ef\u4ee5\u5feb\u901f\u7684\u521b\u5efa\u591a\u5c42\u67b6\u6784\u9879\u76ee\u3002",source:"@site/docs\\get-start.mdx",slug:"/get-start",permalink:"/docs/get-start",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/get-start.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",sidebar:"docs",previous:{title:"1.5 \u8d5e\u52a9 Furion",permalink:"/docs/donate"},next:{title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",permalink:"/docs/template"}},p=[{value:"2.1 \u521b\u5efa Web \u9879\u76ee",id:"21-\u521b\u5efa-web-\u9879\u76ee",children:[{value:"2.1.1 \u521b\u5efa ASP.NET Core Web \u5e94\u7528\u7a0b\u5e8f",id:"211-\u521b\u5efa-aspnet-core-web-\u5e94\u7528\u7a0b\u5e8f",children:[]}]},{value:"2.2 \u6dfb\u52a0 Furion \u4f9d\u8d56\u5305",id:"22-\u6dfb\u52a0-furion-\u4f9d\u8d56\u5305",children:[]},{value:"2.3 Furion \u57fa\u672c\u914d\u7f6e",id:"23-furion-\u57fa\u672c\u914d\u7f6e",children:[{value:"2.3.1 Program.cs \u6dfb\u52a0 Inject()",id:"231-programcs-\u6dfb\u52a0-inject",children:[]},{value:"2.3.2 \u5728 Startup.cs \u4e2d\u6dfb\u52a0\u4e24\u4e2a Inject()",id:"232-\u5728-startupcs-\u4e2d\u6dfb\u52a0\u4e24\u4e2a-inject",children:[]}]},{value:"2.4 \u542f\u52a8\u6d4f\u89c8\u5668",id:"24-\u542f\u52a8\u6d4f\u89c8\u5668",children:[]}],l={toc:p};function u(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u4f7f\u7528\u811a\u624b\u67b6")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5b98\u65b9\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u811a\u624b\u67b6\uff0c\u53ef\u4ee5\u5feb\u901f\u7684\u521b\u5efa\u591a\u5c42\u67b6\u6784\u9879\u76ee\u3002"),Object(i.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"/docs/template"}),"2.2 \u5b98\u65b9\u811a\u624b\u67b6"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002"))),Object(i.b)("h2",{id:"21-\u521b\u5efa-web-\u9879\u76ee"},"2.1 \u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"h2"},"Web")," \u9879\u76ee"),Object(i.b)("h3",{id:"211-\u521b\u5efa-aspnet-core-web-\u5e94\u7528\u7a0b\u5e8f"},"2.1.1 \u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"h3"},"ASP.NET Core Web \u5e94\u7528\u7a0b\u5e8f")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u6253\u5f00 ",Object(i.b)("inlineCode",{parentName:"li"},"Visual Studio 2019")," \u5e76\u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"li"},"Web")," \u9879\u76ee")),Object(i.b)("img",{src:Object(o.a)("img/rm1.png")}),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u914d\u7f6e\u9879\u76ee\u540d\u79f0")),Object(i.b)("img",{src:Object(o.a)("img/rm2.png")}),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u9009\u62e9 ",Object(i.b)("inlineCode",{parentName:"li"},"WebAPI")," \u9879\u76ee")),Object(i.b)("img",{src:Object(o.a)("img/rm3.png")}),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5df2\u7ecf\u5185\u7f6e\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Swagger")," \u89c4\u8303\u5316\u5e93\uff0c\u6240\u4ee5\u521b\u5efa\u65f6",Object(i.b)("strong",{parentName:"p"},"\u65e0\u9700\u52fe\u9009")," ",Object(i.b)("inlineCode",{parentName:"p"},"Enable OpenAPI support")," \u9009\u9879\u3002"))),Object(i.b)("h2",{id:"22-\u6dfb\u52a0-furion-\u4f9d\u8d56\u5305"},"2.2 \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h2"},"Furion")," \u4f9d\u8d56\u5305"),Object(i.b)("img",{src:Object(o.a)("img/rm4.png")}),Object(i.b)("h2",{id:"23-furion-\u57fa\u672c\u914d\u7f6e"},"2.3 ",Object(i.b)("inlineCode",{parentName:"h2"},"Furion")," \u57fa\u672c\u914d\u7f6e"),Object(i.b)("h3",{id:"231-programcs-\u6dfb\u52a0-inject"},"2.3.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"Program.cs")," \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h3"},"Inject()")),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{18}","{18}":!0}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace FurStart\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args) =>\n Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder\n .Inject() // \u6dfb\u52a0\u8fd9\u4e00\u884c\n .UseStartup();\n });\n }\n}\n")),Object(i.b)("h3",{id:"232-\u5728-startupcs-\u4e2d\u6dfb\u52a0\u4e24\u4e2a-inject"},"2.3.2 \u5728 ",Object(i.b)("inlineCode",{parentName:"h3"},"Startup.cs")," \u4e2d\u6dfb\u52a0\u4e24\u4e2a ",Object(i.b)("inlineCode",{parentName:"h3"},"Inject()")),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{20,37}","{20,37}":!0}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace FurStart\n{\n public class Startup\n {\n public Startup(IConfiguration configuration)\n {\n Configuration = configuration;\n }\n\n public IConfiguration Configuration { get; }\n\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers().AddInject(); // \u6dfb\u52a0 AddInject();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n app.UseHttpsRedirection();\n\n app.UseRouting();\n\n app.UseAuthorization();\n\n // \u6dfb\u52a0\u8fd9\u4e00\u884c\uff0c\u5982\u679c\u662f MVC\u548cAPI\u5171\u5b58\u9879\u76ee\uff0c\u65e0\u9700\u6dfb\u52a0 string.Empty\n app.UseInject(string.Empty);\n\n app.UseEndpoints(endpoints =>\n {\n endpoints.MapControllers();\n });\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5c0f\u63d0\u9192")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c ",Object(i.b)("inlineCode",{parentName:"p"},"app.UseInject()")," \u4e0d\u8f93\u5165\u53c2\u6570\uff0c\u5219\u9ed8\u8ba4\u5730\u5740\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"/api"),"\uff0c\u5982\u679c\u8f93\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"string.Empty")," \u5219\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"/")," \u76ee\u5f55\u3002\u5982\u679c\u8f93\u5165\u4efb\u610f\u5b57\u7b26\u4e32\uff0c\u5219\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"/\u4efb\u610f\u5b57\u7b26\u4e32")," \u76ee\u5f55\u3002"))),Object(i.b)("h2",{id:"24-\u542f\u52a8\u6d4f\u89c8\u5668"},"2.4 \u542f\u52a8\u6d4f\u89c8\u5668"),Object(i.b)("p",null,"\u542f\u52a8\u6d4f\u89c8\u5668\u67e5\u770b\u6548\u679c\u3002"),Object(i.b)("img",{src:Object(o.a)("img/rm5.png")}),Object(i.b)("p",null,"\u8bf4\u597d\u4e00\u5206\u949f\u4e0a\u624b\uff0c\u4f60\u4eec\u7528\u4e86\u591a\u957f\u65f6\u95f4\u3002\ud83d\ude01"))}u.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return c}));var r=n(21),a=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var b=a.a.createContext({}),p=function(e){var t=a.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},l=function(e){var t=p(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),l=p(n),d=r,m=l["".concat(c,".").concat(d)]||l[d]||u[d]||i;return n?a.a.createElement(m,o(o({ref:t},b),{},{components:n})):a.a.createElement(m,o({ref:t},b))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,c=new Array(i);c[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:r,c[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[107],{182:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return s})),n.d(t,"metadata",(function(){return b})),n.d(t,"toc",(function(){return p})),n.d(t,"default",(function(){return u}));var r=n(3),a=n(7),i=(n(0),n(196)),c=n(197),o=n(194),s={id:"get-start",title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",sidebar_label:"2.1 \u4e00\u5206\u949f\u4e0a\u624b"},b={unversionedId:"get-start",id:"get-start",isDocsHomePage:!1,title:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",description:"Furion \u5b98\u65b9\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u811a\u624b\u67b6\uff0c\u53ef\u4ee5\u5feb\u901f\u7684\u521b\u5efa\u591a\u5c42\u67b6\u6784\u9879\u76ee\u3002",source:"@site/docs\\get-start.mdx",slug:"/get-start",permalink:"/docs/get-start",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/get-start.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"2.1 \u4e00\u5206\u949f\u4e0a\u624b",sidebar:"docs",previous:{title:"1.5 \u8d5e\u52a9 Furion",permalink:"/docs/donate"},next:{title:"2.2 \u5b98\u65b9\u811a\u624b\u67b6",permalink:"/docs/template"}},p=[{value:"2.1 \u521b\u5efa Web \u9879\u76ee",id:"21-\u521b\u5efa-web-\u9879\u76ee",children:[{value:"2.1.1 \u521b\u5efa ASP.NET Core Web \u5e94\u7528\u7a0b\u5e8f",id:"211-\u521b\u5efa-aspnet-core-web-\u5e94\u7528\u7a0b\u5e8f",children:[]}]},{value:"2.2 \u6dfb\u52a0 Furion \u4f9d\u8d56\u5305",id:"22-\u6dfb\u52a0-furion-\u4f9d\u8d56\u5305",children:[]},{value:"2.3 Furion \u57fa\u672c\u914d\u7f6e",id:"23-furion-\u57fa\u672c\u914d\u7f6e",children:[{value:"2.3.1 Program.cs \u6dfb\u52a0 Inject()",id:"231-programcs-\u6dfb\u52a0-inject",children:[]},{value:"2.3.2 \u5728 Startup.cs \u4e2d\u6dfb\u52a0\u4e24\u4e2a Inject()",id:"232-\u5728-startupcs-\u4e2d\u6dfb\u52a0\u4e24\u4e2a-inject",children:[]}]},{value:"2.4 \u542f\u52a8\u6d4f\u89c8\u5668",id:"24-\u542f\u52a8\u6d4f\u89c8\u5668",children:[]}],l={toc:p};function u(e){var t=e.components,n=Object(a.a)(e,["components"]);return Object(i.b)("wrapper",Object(r.a)({},l,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(c.a,{mdxType:"JoinGroup"}),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23-.02.05-.02.11-.02.17H5c0-.06 0-.13-.02-.17-.2-1.17-.59-1.83-1.45-3.23-.2-.31-.42-.67-.67-1.11C2.44 6.78 2 5.65 2 5c0-2.2 2.02-4 4.5-4 1.22 0 2.36.42 3.22 1.19C10.55 2.94 11 3.94 11 5c0 .66-.44 1.78-.86 2.48zM4 14h5c-.23 1.14-1.3 2-2.5 2s-2.27-.86-2.5-2z"})))),"\u63a8\u8350\u4f7f\u7528\u811a\u624b\u67b6")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5b98\u65b9\u63d0\u4f9b\u4e86\u975e\u5e38\u7075\u6d3b\u65b9\u4fbf\u7684\u811a\u624b\u67b6\uff0c\u53ef\u4ee5\u5feb\u901f\u7684\u521b\u5efa\u591a\u5c42\u67b6\u6784\u9879\u76ee\u3002"),Object(i.b)("p",{parentName:"div"},"\u63a8\u8350\u4f7f\u7528 \u300a",Object(i.b)("a",Object(r.a)({parentName:"p"},{href:"/docs/template"}),"2.2 \u5b98\u65b9\u811a\u624b\u67b6"),"\u300b\u4ee3\u66ff\u672c\u7ae0\u8282\u529f\u80fd\u3002"))),Object(i.b)("h2",{id:"21-\u521b\u5efa-web-\u9879\u76ee"},"2.1 \u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"h2"},"Web")," \u9879\u76ee"),Object(i.b)("h3",{id:"211-\u521b\u5efa-aspnet-core-web-\u5e94\u7528\u7a0b\u5e8f"},"2.1.1 \u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"h3"},"ASP.NET Core Web \u5e94\u7528\u7a0b\u5e8f")),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u6253\u5f00 ",Object(i.b)("inlineCode",{parentName:"li"},"Visual Studio 2019")," \u5e76\u521b\u5efa ",Object(i.b)("inlineCode",{parentName:"li"},"Web")," \u9879\u76ee")),Object(i.b)("img",{src:Object(o.a)("img/rm1.png")}),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u914d\u7f6e\u9879\u76ee\u540d\u79f0")),Object(i.b)("img",{src:Object(o.a)("img/rm2.png")}),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u9009\u62e9 ",Object(i.b)("inlineCode",{parentName:"li"},"WebAPI")," \u9879\u76ee")),Object(i.b)("img",{src:Object(o.a)("img/rm3.png")}),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u7279\u522b\u6ce8\u610f")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u5df2\u7ecf\u5185\u7f6e\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"Swagger")," \u89c4\u8303\u5316\u5e93\uff0c\u6240\u4ee5\u521b\u5efa\u65f6",Object(i.b)("strong",{parentName:"p"},"\u65e0\u9700\u52fe\u9009")," ",Object(i.b)("inlineCode",{parentName:"p"},"Enable OpenAPI support")," \u9009\u9879\u3002"))),Object(i.b)("h2",{id:"22-\u6dfb\u52a0-furion-\u4f9d\u8d56\u5305"},"2.2 \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h2"},"Furion")," \u4f9d\u8d56\u5305"),Object(i.b)("img",{src:Object(o.a)("img/rm4.png")}),Object(i.b)("h2",{id:"23-furion-\u57fa\u672c\u914d\u7f6e"},"2.3 ",Object(i.b)("inlineCode",{parentName:"h2"},"Furion")," \u57fa\u672c\u914d\u7f6e"),Object(i.b)("h3",{id:"231-programcs-\u6dfb\u52a0-inject"},"2.3.1 ",Object(i.b)("inlineCode",{parentName:"h3"},"Program.cs")," \u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"h3"},"Inject()")),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{18}","{18}":!0}),"using Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Hosting;\n\nnamespace FurStart\n{\n public class Program\n {\n public static void Main(string[] args)\n {\n CreateHostBuilder(args).Build().Run();\n }\n\n public static IHostBuilder CreateHostBuilder(string[] args) =>\n Host.CreateDefaultBuilder(args)\n .ConfigureWebHostDefaults(webBuilder =>\n {\n webBuilder\n .Inject() // \u6dfb\u52a0\u8fd9\u4e00\u884c\n .UseStartup();\n });\n }\n}\n")),Object(i.b)("h3",{id:"232-\u5728-startupcs-\u4e2d\u6dfb\u52a0\u4e24\u4e2a-inject"},"2.3.2 \u5728 ",Object(i.b)("inlineCode",{parentName:"h3"},"Startup.cs")," \u4e2d\u6dfb\u52a0\u4e24\u4e2a ",Object(i.b)("inlineCode",{parentName:"h3"},"Inject()")),Object(i.b)("pre",null,Object(i.b)("code",Object(r.a)({parentName:"pre"},{className:"language-cs",metastring:"{20,37}","{20,37}":!0}),"using Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace FurStart\n{\n public class Startup\n {\n public Startup(IConfiguration configuration)\n {\n Configuration = configuration;\n }\n\n public IConfiguration Configuration { get; }\n\n public void ConfigureServices(IServiceCollection services)\n {\n services.AddControllers().AddInject(); // \u6dfb\u52a0 AddInject();\n }\n\n public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n {\n if (env.IsDevelopment())\n {\n app.UseDeveloperExceptionPage();\n }\n\n app.UseHttpsRedirection();\n\n app.UseRouting();\n\n app.UseAuthorization();\n\n // \u6dfb\u52a0\u8fd9\u4e00\u884c\uff0c\u5982\u679c\u662f MVC\u548cAPI\u5171\u5b58\u9879\u76ee\uff0c\u65e0\u9700\u6dfb\u52a0 string.Empty\n app.UseInject(string.Empty);\n\n app.UseEndpoints(endpoints =>\n {\n endpoints.MapControllers();\n });\n }\n }\n}\n")),Object(i.b)("div",{className:"admonition admonition-important alert alert--info"},Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(r.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(r.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(r.a)({parentName:"svg"},{fillRule:"evenodd",d:"M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"})))),"\u5c0f\u63d0\u9192")),Object(i.b)("div",Object(r.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u5982\u679c ",Object(i.b)("inlineCode",{parentName:"p"},"app.UseInject()")," \u4e0d\u8f93\u5165\u53c2\u6570\uff0c\u5219\u9ed8\u8ba4\u5730\u5740\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"/api"),"\uff0c\u5982\u679c\u8f93\u5165 ",Object(i.b)("inlineCode",{parentName:"p"},"string.Empty")," \u5219\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"/")," \u76ee\u5f55\u3002\u5982\u679c\u8f93\u5165\u4efb\u610f\u5b57\u7b26\u4e32\uff0c\u5219\u4e3a ",Object(i.b)("inlineCode",{parentName:"p"},"/\u4efb\u610f\u5b57\u7b26\u4e32")," \u76ee\u5f55\u3002"))),Object(i.b)("h2",{id:"24-\u542f\u52a8\u6d4f\u89c8\u5668"},"2.4 \u542f\u52a8\u6d4f\u89c8\u5668"),Object(i.b)("p",null,"\u542f\u52a8\u6d4f\u89c8\u5668\u67e5\u770b\u6548\u679c\u3002"),Object(i.b)("img",{src:Object(o.a)("img/rm5.png")}),Object(i.b)("p",null,"\u8bf4\u597d\u4e00\u5206\u949f\u4e0a\u624b\uff0c\u4f60\u4eec\u7528\u4e86\u591a\u957f\u65f6\u95f4\u3002\ud83d\ude01"))}u.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return c}));var r=n(21),a=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(a.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function a(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return a}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return m}));var r=n(0),a=n.n(r);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var b=a.a.createContext({}),p=function(e){var t=a.a.useContext(b),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},l=function(e){var t=p(e.components);return a.a.createElement(b.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return a.a.createElement(a.a.Fragment,{},t)}},d=a.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,i=e.originalType,c=e.parentName,b=s(e,["components","mdxType","originalType","parentName"]),l=p(n),d=r,m=l["".concat(c,".").concat(d)]||l[d]||u[d]||i;return n?a.a.createElement(m,o(o({ref:t},b),{},{components:n})):a.a.createElement(m,o({ref:t},b))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=n.length,c=new Array(i);c[0]=d;var o={};for(var s in t)hasOwnProperty.call(t,s)&&(o[s]=t[s]);o.originalType=e,o.mdxType="string"==typeof e?e:r,c[1]=o;for(var b=2;bt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/f976f453.a435f7d8.js b/docs/f976f453.304c9cf2.js similarity index 58% rename from docs/f976f453.a435f7d8.js rename to docs/f976f453.304c9cf2.js index 616ed1c5bda..ce6ee4a1269 100644 --- a/docs/f976f453.a435f7d8.js +++ b/docs/f976f453.304c9cf2.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[104],{179:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","isLast":true,"docsSidebars":{"docs":[{"collapsed":true,"type":"category","label":"1. \u5e8f\u8a00","items":[{"type":"link","label":"1.1 \u4ecb\u7ecd","href":"/docs/"},{"type":"link","label":"1.2 \u5173\u4e8e\u4f5c\u8005","href":"/docs/author"},{"type":"link","label":"1.3 \u6e90\u7801\u7ed3\u6784","href":"/docs/source"},{"type":"link","label":"1.4 \u9879\u76ee\u5408\u4f5c","href":"/docs/cooperate"},{"type":"link","label":"1.5 \u8d5e\u52a9 Furion","href":"/docs/donate"}]},{"collapsed":true,"type":"category","label":"2. \u4e00\u5206\u949f\u4e0a\u624b","items":[{"type":"link","label":"2.1 \u4e00\u5206\u949f\u4e0a\u624b","href":"/docs/get-start"},{"type":"link","label":"2.2 \u5b98\u65b9\u811a\u624b\u67b6","href":"/docs/template"},{"type":"link","label":"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528","href":"/docs/reference"}]},{"type":"link","label":"3. \u5e94\u7528\u542f\u52a8","href":"/docs/appstartup"},{"collapsed":true,"type":"category","label":"4. \u914d\u7f6e\u4e0e\u9009\u9879","items":[{"type":"link","label":"4.1 \u914d\u7f6e","href":"/docs/configuration"},{"type":"link","label":"4.2 \u9009\u9879","href":"/docs/options"}]},{"type":"link","label":"5. \u52a8\u6001 WebAPI","href":"/docs/dynamic-api-controller"},{"type":"link","label":"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863","href":"/docs/specification-document"},{"type":"link","label":"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406","href":"/docs/friendly-exception"},{"type":"link","label":"8. \u6570\u636e\u6821\u9a8c","href":"/docs/data-validation"},{"collapsed":true,"type":"category","label":"9. \u6570\u636e\u5e93\u64cd\u4f5c\u6307\u5357","items":[{"type":"link","label":"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587","href":"/docs/dbcontext"},{"type":"link","label":"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668","href":"/docs/dbcontext-locator"},{"type":"link","label":"9.3 \u6570\u636e\u5e93\u5b9e\u4f53","href":"/docs/entity"},{"type":"link","label":"9.4 \u4ed3\u50a8\u6a21\u5f0f","href":"/docs/dbcontext-repository"},{"type":"link","label":"9.5 \u65b0\u589e\u64cd\u4f5c","href":"/docs/dbcontext-add"},{"type":"link","label":"9.6 \u66f4\u65b0\u64cd\u4f5c","href":"/docs/dbcontext-update"},{"type":"link","label":"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c","href":"/docs/dbcontext-add-or-update"},{"type":"link","label":"9.8 \u5220\u9664\u64cd\u4f5c","href":"/docs/dbcontext-delete"},{"type":"link","label":"9.9 \u6279\u91cf\u64cd\u4f5c","href":"/docs/dbcontext-batch"},{"type":"link","label":"9.10 \u67e5\u8be2\u64cd\u4f5c","href":"/docs/dbcontext-query"},{"type":"link","label":"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c","href":"/docs/dbcontext-hight-query"},{"type":"link","label":"9.12 \u89c6\u56fe\u64cd\u4f5c","href":"/docs/dbcontext-view"},{"type":"link","label":"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c","href":"/docs/dbcontext-proc"},{"type":"link","label":"9.14 \u51fd\u6570\u64cd\u4f5c","href":"/docs/dbcontext-function"},{"type":"link","label":"9.15 Sql \u64cd\u4f5c","href":"/docs/dbcontext-sql"},{"type":"link","label":"9.16 Sql \u6a21\u677f","href":"/docs/dbcontext-sql-template"},{"type":"link","label":"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406","href":"/docs/dbcontext-sql-proxy"},{"type":"link","label":"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c","href":"/docs/dbcontext-multi-database"},{"type":"link","label":"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b","href":"/docs/dbcontext-db-first"},{"type":"link","label":"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93","href":"/docs/dbcontext-code-first"},{"type":"link","label":"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e","href":"/docs/dbcontext-seed-data"},{"type":"link","label":"9.22 \u5ba1\u8ba1\u65e5\u5fd7","href":"/docs/dbcontext-audit"},{"type":"link","label":"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668","href":"/docs/dbcontext-filter"},{"type":"link","label":"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668","href":"/docs/dbcontext-Interceptor"},{"type":"link","label":"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668","href":"/docs/dbcontext-entitytrigger"},{"type":"link","label":"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143","href":"/docs/tran"},{"type":"link","label":"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236","href":"/docs/dbcontext-read-write"},{"type":"link","label":"9.28 \u5206\u8868\u5206\u5e93","href":"/docs/split-db"}]},{"collapsed":true,"type":"category","label":"10. SqlSugar \u6216\u5176\u4ed6ORM","items":[{"type":"link","label":"10.1. SqlSugar \u96c6\u6210","href":"/docs/sqlsugar"},{"type":"link","label":"10.2. Dapper \u96c6\u6210","href":"/docs/dapper"}]},{"type":"link","label":"11. SaaS \u591a\u79df\u6237","href":"/docs/saas"},{"type":"link","label":"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c","href":"/docs/dependency-injection"},{"type":"link","label":"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04","href":"/docs/object-mapper"},{"type":"link","label":"14. \u5206\u5e03\u5f0f\u7f13\u5b58","href":"/docs/cache"},{"type":"link","label":"15. \u5b89\u5168\u9274\u6743","href":"/docs/auth-control"},{"type":"link","label":"16. CORS \u8de8\u57df","href":"/docs/cors"},{"type":"link","label":"17. \u89c6\u56fe\u5f15\u64ce","href":"/docs/view-engine"},{"type":"link","label":"18. \u65e5\u5fd7\u8bb0\u5f55","href":"/docs/logging"},{"type":"link","label":"19. \u8fdc\u7a0b\u8bf7\u6c42","href":"/docs/http"},{"type":"link","label":"20. \u6570\u636e\u52a0\u89e3\u5bc6","href":"/docs/encryption"},{"type":"link","label":"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09","href":"/docs/local-language"},{"type":"link","label":"22. \u4e8b\u4ef6\u603b\u7ebf","href":"/docs/event-bus"},{"type":"link","label":"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1","href":"/docs/process-service"},{"type":"link","label":"24. \u4efb\u52a1\u8c03\u5ea6","href":"/docs/job"},{"type":"link","label":"25. \u5373\u65f6\u901a\u8baf","href":"/docs/signalr"},{"type":"link","label":"26. Grpc \u670d\u52a1","href":"/docs/grpc"},{"collapsed":true,"type":"category","label":"27. \u6258\u7ba1\u90e8\u7f72","items":[{"type":"link","label":"27.1 \u5728 IIS \u90e8\u7f72","href":"/docs/deploy-iis"},{"type":"link","label":"27.2 \u5728 Docker \u90e8\u7f72","href":"/docs/deploy-docker"},{"type":"link","label":"27.3 \u5728 Nginx \u90e8\u7f72","href":"/docs/deploy-nginx"},{"type":"link","label":"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72","href":"/docs/virtual-deploy"}]},{"type":"link","label":"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210","href":"/docs/devops"},{"collapsed":true,"type":"category","label":"29. \u6d4b\u8bd5\u6307\u5357","items":[{"type":"link","label":"29.1 \u5355\u5143\u6d4b\u8bd5","href":"/docs/unittest"},{"type":"link","label":"29.2 \u6027\u80fd\u6d4b\u8bd5","href":"/docs/performance"},{"type":"link","label":"29.3 \u57fa\u51c6\u6d4b\u8bd5","href":"/docs/benchmark"}]},{"type":"link","label":"30. \u8d21\u732e\u6307\u5357","href":"/docs/contribute"},{"collapsed":true,"type":"category","label":"31. \u5e38\u89c1\u95ee\u9898","items":[{"type":"link","label":"31.1 \u5e38\u89c1\u95ee\u9898","href":"/docs/answer"},{"type":"link","label":"31.2 \u5e38\u89c1\u9519\u8bef","href":"/docs/errors"},{"type":"link","label":"31.3 \u6700\u4f73\u5b9e\u8df5","href":"/docs/gooduse"}]}],"settings":[{"type":"link","label":"1. \u5e94\u7528\u914d\u7f6e","href":"/docs/settings/appsettings"},{"type":"link","label":"2. \u8de8\u57df\u914d\u7f6e","href":"/docs/settings/corsaccessorsettings"},{"type":"link","label":"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e","href":"/docs/settings/validationTypemessagesettings"},{"type":"link","label":"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e","href":"/docs/settings/dependencyinjectionsettings"},{"type":"link","label":"5. \u52a8\u6001API\u914d\u7f6e","href":"/docs/settings/dynamicapicontrollersettings"},{"type":"link","label":"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e","href":"/docs/settings/friendlyexceptionsettings"},{"type":"link","label":"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e","href":"/docs/settings/specificationdocumentsettings"},{"type":"link","label":"8. \u591a\u8bed\u8a00\u914d\u7f6e","href":"/docs/settings/localizationsettings"}],"global":[{"type":"link","label":"1. App \u9759\u6001\u7c7b","href":"/docs/global/app"},{"type":"link","label":"2. Db \u9759\u6001\u7c7b","href":"/docs/global/db"},{"type":"link","label":"3. DataValidator \u9759\u6001\u7c7b","href":"/docs/global/datavalidator"},{"type":"link","label":"4. Oops \u9759\u6001\u7c7b","href":"/docs/global/oops"},{"type":"link","label":"5. LinqExpression \u9759\u6001\u7c7b","href":"/docs/global/linqexpression"},{"type":"link","label":"6. Http \u9759\u6001\u7c7b","href":"/docs/global/shttp"},{"type":"link","label":"7. JsonSerializerUtility \u9759\u6001\u7c7b","href":"/docs/global/jsonserializer"},{"type":"link","label":"8. L \u9759\u6001\u7c7b","href":"/docs/global/l"},{"type":"link","label":"9. MessageCenter \u9759\u6001\u7c7b","href":"/docs/global/messagecenter"}]},"permalinkToSidebar":{"/docs/answer":"docs","/docs/appstartup":"docs","/docs/auth-control":"docs","/docs/author":"docs","/docs/benchmark":"docs","/docs/cache":"docs","/docs/configuration":"docs","/docs/contribute":"docs","/docs/cooperate":"docs","/docs/cors":"docs","/docs/dapper":"docs","/docs/data-validation":"docs","/docs/dbcontext":"docs","/docs/dbcontext-add":"docs","/docs/dbcontext-add-or-update":"docs","/docs/dbcontext-audit":"docs","/docs/dbcontext-batch":"docs","/docs/dbcontext-code-first":"docs","/docs/dbcontext-db-first":"docs","/docs/dbcontext-delete":"docs","/docs/dbcontext-entitytrigger":"docs","/docs/dbcontext-filter":"docs","/docs/dbcontext-function":"docs","/docs/dbcontext-hight-query":"docs","/docs/dbcontext-Interceptor":"docs","/docs/dbcontext-locator":"docs","/docs/dbcontext-multi-database":"docs","/docs/dbcontext-proc":"docs","/docs/dbcontext-query":"docs","/docs/dbcontext-read-write":"docs","/docs/dbcontext-repository":"docs","/docs/dbcontext-seed-data":"docs","/docs/dbcontext-sql":"docs","/docs/dbcontext-sql-proxy":"docs","/docs/dbcontext-sql-template":"docs","/docs/dbcontext-update":"docs","/docs/dbcontext-view":"docs","/docs/dependency-injection":"docs","/docs/deploy-docker":"docs","/docs/deploy-iis":"docs","/docs/deploy-nginx":"docs","/docs/devops":"docs","/docs/donate":"docs","/docs/dynamic-api-controller":"docs","/docs/encryption":"docs","/docs/entity":"docs","/docs/errors":"docs","/docs/event-bus":"docs","/docs/friendly-exception":"docs","/docs/get-start":"docs","/docs/global/app":"global","/docs/global/datavalidator":"global","/docs/global/db":"global","/docs/global/jsonserializer":"global","/docs/global/l":"global","/docs/global/linqexpression":"global","/docs/global/messagecenter":"global","/docs/global/oops":"global","/docs/global/shttp":"global","/docs/gooduse":"docs","/docs/grpc":"docs","/docs/http":"docs","/docs/":"docs","/docs/job":"docs","/docs/local-language":"docs","/docs/logging":"docs","/docs/object-mapper":"docs","/docs/options":"docs","/docs/performance":"docs","/docs/process-service":"docs","/docs/reference":"docs","/docs/saas":"docs","/docs/settings/appsettings":"settings","/docs/settings/corsaccessorsettings":"settings","/docs/settings/dependencyinjectionsettings":"settings","/docs/settings/dynamicapicontrollersettings":"settings","/docs/settings/friendlyexceptionsettings":"settings","/docs/settings/localizationsettings":"settings","/docs/settings/specificationdocumentsettings":"settings","/docs/settings/validationTypemessagesettings":"settings","/docs/signalr":"docs","/docs/source":"docs","/docs/specification-document":"docs","/docs/split-db":"docs","/docs/sqlsugar":"docs","/docs/template":"docs","/docs/tran":"docs","/docs/unittest":"docs","/docs/view-engine":"docs","/docs/virtual-deploy":"docs"}}')}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[108],{183:function(e){e.exports=JSON.parse('{"pluginId":"default","version":"current","label":"Next","isLast":true,"docsSidebars":{"docs":[{"collapsed":true,"type":"category","label":"1. \u5e8f\u8a00","items":[{"type":"link","label":"1.1 \u4ecb\u7ecd","href":"/docs/"},{"type":"link","label":"1.2 \u5173\u4e8e\u4f5c\u8005","href":"/docs/author"},{"type":"link","label":"1.3 \u6e90\u7801\u7ed3\u6784","href":"/docs/source"},{"type":"link","label":"1.4 \u9879\u76ee\u5408\u4f5c","href":"/docs/cooperate"},{"type":"link","label":"1.5 \u8d5e\u52a9 Furion","href":"/docs/donate"}]},{"collapsed":true,"type":"category","label":"2. \u4e00\u5206\u949f\u4e0a\u624b","items":[{"type":"link","label":"2.1 \u4e00\u5206\u949f\u4e0a\u624b","href":"/docs/get-start"},{"type":"link","label":"2.2 \u5b98\u65b9\u811a\u624b\u67b6","href":"/docs/template"},{"type":"link","label":"2.3 \u6846\u67b6\u9879\u76ee\u5f15\u7528","href":"/docs/reference"}]},{"type":"link","label":"3. \u5e94\u7528\u542f\u52a8","href":"/docs/appstartup"},{"collapsed":true,"type":"category","label":"4. \u914d\u7f6e\u4e0e\u9009\u9879","items":[{"type":"link","label":"4.1 \u914d\u7f6e","href":"/docs/configuration"},{"type":"link","label":"4.2 \u9009\u9879","href":"/docs/options"}]},{"type":"link","label":"5. \u52a8\u6001 WebAPI","href":"/docs/dynamic-api-controller"},{"type":"link","label":"6. \u89c4\u8303\u5316\u63a5\u53e3\u6587\u6863","href":"/docs/specification-document"},{"type":"link","label":"7. \u53cb\u597d\u5f02\u5e38\u5904\u7406","href":"/docs/friendly-exception"},{"type":"link","label":"8. \u6570\u636e\u6821\u9a8c","href":"/docs/data-validation"},{"collapsed":true,"type":"category","label":"9. \u6570\u636e\u5e93\u64cd\u4f5c\u6307\u5357","items":[{"type":"link","label":"9.1 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587","href":"/docs/dbcontext"},{"type":"link","label":"9.2 \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668","href":"/docs/dbcontext-locator"},{"type":"link","label":"9.3 \u6570\u636e\u5e93\u5b9e\u4f53","href":"/docs/entity"},{"type":"link","label":"9.4 \u4ed3\u50a8\u6a21\u5f0f","href":"/docs/dbcontext-repository"},{"type":"link","label":"9.5 \u65b0\u589e\u64cd\u4f5c","href":"/docs/dbcontext-add"},{"type":"link","label":"9.6 \u66f4\u65b0\u64cd\u4f5c","href":"/docs/dbcontext-update"},{"type":"link","label":"9.7 \u65b0\u589e\u6216\u66f4\u65b0\u64cd\u4f5c","href":"/docs/dbcontext-add-or-update"},{"type":"link","label":"9.8 \u5220\u9664\u64cd\u4f5c","href":"/docs/dbcontext-delete"},{"type":"link","label":"9.9 \u6279\u91cf\u64cd\u4f5c","href":"/docs/dbcontext-batch"},{"type":"link","label":"9.10 \u67e5\u8be2\u64cd\u4f5c","href":"/docs/dbcontext-query"},{"type":"link","label":"9.11 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c","href":"/docs/dbcontext-hight-query"},{"type":"link","label":"9.12 \u89c6\u56fe\u64cd\u4f5c","href":"/docs/dbcontext-view"},{"type":"link","label":"9.13 \u5b58\u50a8\u8fc7\u7a0b\u64cd\u4f5c","href":"/docs/dbcontext-proc"},{"type":"link","label":"9.14 \u51fd\u6570\u64cd\u4f5c","href":"/docs/dbcontext-function"},{"type":"link","label":"9.15 Sql \u64cd\u4f5c","href":"/docs/dbcontext-sql"},{"type":"link","label":"9.16 Sql \u6a21\u677f","href":"/docs/dbcontext-sql-template"},{"type":"link","label":"9.17 Sql \u9ad8\u7ea7\u4ee3\u7406","href":"/docs/dbcontext-sql-proxy"},{"type":"link","label":"9.18 \u591a\u6570\u636e\u5e93\u64cd\u4f5c","href":"/docs/dbcontext-multi-database"},{"type":"link","label":"9.19 \u6570\u636e\u5e93\u751f\u6210\u6a21\u578b","href":"/docs/dbcontext-db-first"},{"type":"link","label":"9.20 \u6a21\u578b\u751f\u6210\u6570\u636e\u5e93","href":"/docs/dbcontext-code-first"},{"type":"link","label":"9.21 \u5b9e\u4f53\u79cd\u5b50\u6570\u636e","href":"/docs/dbcontext-seed-data"},{"type":"link","label":"9.22 \u5ba1\u8ba1\u65e5\u5fd7","href":"/docs/dbcontext-audit"},{"type":"link","label":"9.23 \u5b9e\u4f53/\u5168\u5c40\u67e5\u8be2\u7b5b\u9009\u5668","href":"/docs/dbcontext-filter"},{"type":"link","label":"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668","href":"/docs/dbcontext-Interceptor"},{"type":"link","label":"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668","href":"/docs/dbcontext-entitytrigger"},{"type":"link","label":"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143","href":"/docs/tran"},{"type":"link","label":"9.27 \u8bfb\u5199\u5206\u79bb/\u4e3b\u4ece\u590d\u5236","href":"/docs/dbcontext-read-write"},{"type":"link","label":"9.28 \u5206\u8868\u5206\u5e93","href":"/docs/split-db"}]},{"collapsed":true,"type":"category","label":"10. SqlSugar \u6216\u5176\u4ed6ORM","items":[{"type":"link","label":"10.1. SqlSugar \u96c6\u6210","href":"/docs/sqlsugar"},{"type":"link","label":"10.2. Dapper \u96c6\u6210","href":"/docs/dapper"}]},{"type":"link","label":"11. SaaS \u591a\u79df\u6237","href":"/docs/saas"},{"type":"link","label":"12. \u4f9d\u8d56\u6ce8\u5165/\u63a7\u5236\u53cd\u8f6c","href":"/docs/dependency-injection"},{"type":"link","label":"13. \u5bf9\u8c61\u6570\u636e\u6620\u5c04","href":"/docs/object-mapper"},{"type":"link","label":"14. \u5206\u5e03\u5f0f\u7f13\u5b58","href":"/docs/cache"},{"type":"link","label":"15. \u5b89\u5168\u9274\u6743","href":"/docs/auth-control"},{"type":"link","label":"16. CORS \u8de8\u57df","href":"/docs/cors"},{"type":"link","label":"17. \u89c6\u56fe\u5f15\u64ce","href":"/docs/view-engine"},{"type":"link","label":"18. \u65e5\u5fd7\u8bb0\u5f55","href":"/docs/logging"},{"type":"link","label":"19. \u8fdc\u7a0b\u8bf7\u6c42","href":"/docs/http"},{"type":"link","label":"20. \u6570\u636e\u52a0\u89e3\u5bc6","href":"/docs/encryption"},{"type":"link","label":"21. \u5168\u7403\u5316\u548c\u672c\u5730\u5316\uff08\u591a\u8bed\u8a00\uff09","href":"/docs/local-language"},{"type":"link","label":"22. \u4e8b\u4ef6\u603b\u7ebf","href":"/docs/event-bus"},{"type":"link","label":"23. \u8f85\u52a9\u89d2\u8272\u670d\u52a1","href":"/docs/process-service"},{"type":"link","label":"24. \u4efb\u52a1\u8c03\u5ea6","href":"/docs/job"},{"type":"link","label":"25. \u5373\u65f6\u901a\u8baf","href":"/docs/signalr"},{"type":"link","label":"26. Grpc \u670d\u52a1","href":"/docs/grpc"},{"collapsed":true,"type":"category","label":"27. \u6258\u7ba1\u90e8\u7f72","items":[{"type":"link","label":"27.1 \u5728 IIS \u90e8\u7f72","href":"/docs/deploy-iis"},{"type":"link","label":"27.2 \u5728 Docker \u90e8\u7f72","href":"/docs/deploy-docker"},{"type":"link","label":"27.3 \u5728 Nginx \u90e8\u7f72","href":"/docs/deploy-nginx"},{"type":"link","label":"27.4 \u4e8c\u7ea7\u865a\u62df\u76ee\u5f55\u90e8\u7f72","href":"/docs/virtual-deploy"}]},{"type":"link","label":"28. \u6301\u7eed\u90e8\u7f72\u96c6\u6210","href":"/docs/devops"},{"collapsed":true,"type":"category","label":"29. \u6d4b\u8bd5\u6307\u5357","items":[{"type":"link","label":"29.1 \u5355\u5143\u6d4b\u8bd5","href":"/docs/unittest"},{"type":"link","label":"29.2 \u6027\u80fd\u6d4b\u8bd5","href":"/docs/performance"},{"type":"link","label":"29.3 \u57fa\u51c6\u6d4b\u8bd5","href":"/docs/benchmark"}]},{"type":"link","label":"30. \u8d21\u732e\u6307\u5357","href":"/docs/contribute"}],"settings":[{"type":"link","label":"1. \u5e94\u7528\u914d\u7f6e","href":"/docs/settings/appsettings"},{"type":"link","label":"2. \u8de8\u57df\u914d\u7f6e","href":"/docs/settings/corsaccessorsettings"},{"type":"link","label":"3. \u9a8c\u8bc1\u6d88\u606f\u914d\u7f6e","href":"/docs/settings/validationTypemessagesettings"},{"type":"link","label":"4. \u4f9d\u8d56\u6ce8\u5165\u914d\u7f6e","href":"/docs/settings/dependencyinjectionsettings"},{"type":"link","label":"5. \u52a8\u6001API\u914d\u7f6e","href":"/docs/settings/dynamicapicontrollersettings"},{"type":"link","label":"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e","href":"/docs/settings/friendlyexceptionsettings"},{"type":"link","label":"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e","href":"/docs/settings/specificationdocumentsettings"},{"type":"link","label":"8. \u591a\u8bed\u8a00\u914d\u7f6e","href":"/docs/settings/localizationsettings"}],"global":[{"type":"link","label":"1. App \u9759\u6001\u7c7b","href":"/docs/global/app"},{"type":"link","label":"2. Db \u9759\u6001\u7c7b","href":"/docs/global/db"},{"type":"link","label":"3. DataValidator \u9759\u6001\u7c7b","href":"/docs/global/datavalidator"},{"type":"link","label":"4. Oops \u9759\u6001\u7c7b","href":"/docs/global/oops"},{"type":"link","label":"5. LinqExpression \u9759\u6001\u7c7b","href":"/docs/global/linqexpression"},{"type":"link","label":"6. Http \u9759\u6001\u7c7b","href":"/docs/global/shttp"},{"type":"link","label":"7. JsonSerializerUtility \u9759\u6001\u7c7b","href":"/docs/global/jsonserializer"},{"type":"link","label":"8. L \u9759\u6001\u7c7b","href":"/docs/global/l"},{"type":"link","label":"9. MessageCenter \u9759\u6001\u7c7b","href":"/docs/global/messagecenter"}]},"permalinkToSidebar":{"/docs/appstartup":"docs","/docs/auth-control":"docs","/docs/author":"docs","/docs/benchmark":"docs","/docs/cache":"docs","/docs/configuration":"docs","/docs/contribute":"docs","/docs/cooperate":"docs","/docs/cors":"docs","/docs/dapper":"docs","/docs/data-validation":"docs","/docs/dbcontext":"docs","/docs/dbcontext-add":"docs","/docs/dbcontext-add-or-update":"docs","/docs/dbcontext-audit":"docs","/docs/dbcontext-batch":"docs","/docs/dbcontext-code-first":"docs","/docs/dbcontext-db-first":"docs","/docs/dbcontext-delete":"docs","/docs/dbcontext-entitytrigger":"docs","/docs/dbcontext-filter":"docs","/docs/dbcontext-function":"docs","/docs/dbcontext-hight-query":"docs","/docs/dbcontext-Interceptor":"docs","/docs/dbcontext-locator":"docs","/docs/dbcontext-multi-database":"docs","/docs/dbcontext-proc":"docs","/docs/dbcontext-query":"docs","/docs/dbcontext-read-write":"docs","/docs/dbcontext-repository":"docs","/docs/dbcontext-seed-data":"docs","/docs/dbcontext-sql":"docs","/docs/dbcontext-sql-proxy":"docs","/docs/dbcontext-sql-template":"docs","/docs/dbcontext-update":"docs","/docs/dbcontext-view":"docs","/docs/dependency-injection":"docs","/docs/deploy-docker":"docs","/docs/deploy-iis":"docs","/docs/deploy-nginx":"docs","/docs/devops":"docs","/docs/donate":"docs","/docs/dynamic-api-controller":"docs","/docs/encryption":"docs","/docs/entity":"docs","/docs/event-bus":"docs","/docs/friendly-exception":"docs","/docs/get-start":"docs","/docs/global/app":"global","/docs/global/datavalidator":"global","/docs/global/db":"global","/docs/global/jsonserializer":"global","/docs/global/l":"global","/docs/global/linqexpression":"global","/docs/global/messagecenter":"global","/docs/global/oops":"global","/docs/global/shttp":"global","/docs/grpc":"docs","/docs/http":"docs","/docs/":"docs","/docs/job":"docs","/docs/local-language":"docs","/docs/logging":"docs","/docs/object-mapper":"docs","/docs/options":"docs","/docs/performance":"docs","/docs/process-service":"docs","/docs/reference":"docs","/docs/saas":"docs","/docs/settings/appsettings":"settings","/docs/settings/corsaccessorsettings":"settings","/docs/settings/dependencyinjectionsettings":"settings","/docs/settings/dynamicapicontrollersettings":"settings","/docs/settings/friendlyexceptionsettings":"settings","/docs/settings/localizationsettings":"settings","/docs/settings/specificationdocumentsettings":"settings","/docs/settings/validationTypemessagesettings":"settings","/docs/signalr":"docs","/docs/source":"docs","/docs/specification-document":"docs","/docs/split-db":"docs","/docs/sqlsugar":"docs","/docs/template":"docs","/docs/tran":"docs","/docs/unittest":"docs","/docs/view-engine":"docs","/docs/virtual-deploy":"docs"}}')}}]); \ No newline at end of file diff --git a/docs/fa37c62d.2b0f186f.js b/docs/fa37c62d.2b0f186f.js deleted file mode 100644 index b4bc2a7b113..00000000000 --- a/docs/fa37c62d.2b0f186f.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[105],{180:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(3),o=n(7),c=(n(0),n(192)),a=n(193),i={id:"cooperate",title:"1.4 \u9879\u76ee\u5408\u4f5c",sidebar_label:"1.4 \u9879\u76ee\u5408\u4f5c"},u={unversionedId:"cooperate",id:"cooperate",isDocsHomePage:!1,title:"1.4 \u9879\u76ee\u5408\u4f5c",description:"\u672c\u4eba\u63d0\u4f9b\u4ee5\u4e0b\u6280\u672f\u670d\u52a1\u9879\u76ee\uff1a",source:"@site/docs\\cooperate.mdx",slug:"/cooperate",permalink:"/docs/cooperate",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/cooperate.mdx",version:"current",sidebar_label:"1.4 \u9879\u76ee\u5408\u4f5c",sidebar:"docs",previous:{title:"1.3 \u6e90\u7801\u7ed3\u6784",permalink:"/docs/source"},next:{title:"1.5 \u8d5e\u52a9 Furion",permalink:"/docs/donate"}},l=[],p={toc:l};function s(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(c.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(c.b)(a.a,{mdxType:"JoinGroup"}),Object(c.b)("p",null,"\u672c\u4eba\u63d0\u4f9b\u4ee5\u4e0b\u6280\u672f\u670d\u52a1\u9879\u76ee\uff1a"),Object(c.b)("ul",null,Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u6280\u672f\u6307\u5bfc\u3001\u6280\u672f\u57f9\u8bad"),"\uff1a\uff08.NET\u3001Docker\u3001Devops\u3001K8S\u3001Nginx\uff09"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u9879\u76ee\u5916\u5305\u670d\u52a1\u5f00\u53d1"),"\uff1a\uff08\u7f51\u7ad9\u3001\u5c0f\u7a0b\u5e8f\u3001App\u3001\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3001\u7ba1\u7406\u7cfb\u7edf\uff09"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},"\u4ea7\u54c1\u5408\u4f5c\u670d\u52a1\u5f00\u53d1"),"\uff1a\uff08\u5171\u540c\u5f00\u53d1\uff0c\u6536\u76ca\u540e\u5206\u6210\uff09"),Object(c.b)("li",{parentName:"ul"},Object(c.b)("strong",{parentName:"li"},Object(c.b)("inlineCode",{parentName:"strong"},"Furion")," \u6587\u6863\u5e7f\u544a\u6295\u653e"),"\uff1a\uff08800 \u5143/\u6708\uff0c\u8986\u76d6\u6240\u6709\u6587\u6863\u9875\u9762\uff09")),Object(c.b)("p",null,"\u5982\u6709\u9879\u76ee\u5408\u4f5c\u610f\u613f\u53ef\u53d1\u9001\u90ae\u4ef6\u81f3\uff1a",Object(c.b)("inlineCode",{parentName:"p"},"monksoul@outlook.com")," \u7535\u5b50\u90ae\u7bb1\u3002"))}s.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return c})),n.d(t,"a",(function(){return a}));var r=n(21),o=n(191);function c(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:c=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const a=n.startsWith(t)?n:t+n.replace(/^\//,"");return c?e+a:a}(t,e,n,r)}}function a(e,t={}){const{withBaseUrl:n}=c();return n(e,t)}},191:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return m}));var r=n(0),o=n.n(r);function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),p=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=p(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,c=e.originalType,a=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=p(n),f=r,m=s["".concat(a,".").concat(f)]||s[f]||b[f]||c;return n?o.a.createElement(m,i(i({ref:t},l),{},{components:n})):o.a.createElement(m,i({ref:t},l))}));function m(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var c=n.length,a=new Array(c);a[0]=f;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,a[1]=i;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/fa37c62d.73802cc1.js b/docs/fa37c62d.73802cc1.js new file mode 100644 index 00000000000..5fcfe244b83 --- /dev/null +++ b/docs/fa37c62d.73802cc1.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[109],{184:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return i})),n.d(t,"metadata",(function(){return u})),n.d(t,"toc",(function(){return l})),n.d(t,"default",(function(){return s}));var r=n(3),o=n(7),a=(n(0),n(196)),c=n(197),i={id:"cooperate",title:"1.4 \u9879\u76ee\u5408\u4f5c",sidebar_label:"1.4 \u9879\u76ee\u5408\u4f5c"},u={unversionedId:"cooperate",id:"cooperate",isDocsHomePage:!1,title:"1.4 \u9879\u76ee\u5408\u4f5c",description:"\u672c\u4eba\u63d0\u4f9b\u4ee5\u4e0b\u6280\u672f\u670d\u52a1\u9879\u76ee\uff1a",source:"@site/docs\\cooperate.mdx",slug:"/cooperate",permalink:"/docs/cooperate",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/cooperate.mdx",version:"current",lastUpdatedBy:"Monk",lastUpdatedAt:1612156927,sidebar_label:"1.4 \u9879\u76ee\u5408\u4f5c",sidebar:"docs",previous:{title:"1.3 \u6e90\u7801\u7ed3\u6784",permalink:"/docs/source"},next:{title:"1.5 \u8d5e\u52a9 Furion",permalink:"/docs/donate"}},l=[],p={toc:l};function s(e){var t=e.components,n=Object(o.a)(e,["components"]);return Object(a.b)("wrapper",Object(r.a)({},p,n,{components:t,mdxType:"MDXLayout"}),Object(a.b)(c.a,{mdxType:"JoinGroup"}),Object(a.b)("p",null,"\u672c\u4eba\u63d0\u4f9b\u4ee5\u4e0b\u6280\u672f\u670d\u52a1\u9879\u76ee\uff1a"),Object(a.b)("ul",null,Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},"\u6280\u672f\u6307\u5bfc\u3001\u6280\u672f\u57f9\u8bad"),"\uff1a\uff08.NET\u3001Docker\u3001Devops\u3001K8S\u3001Nginx\uff09"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},"\u9879\u76ee\u5916\u5305\u670d\u52a1\u5f00\u53d1"),"\uff1a\uff08\u7f51\u7ad9\u3001\u5c0f\u7a0b\u5e8f\u3001App\u3001\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3001\u7ba1\u7406\u7cfb\u7edf\uff09"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},"\u4ea7\u54c1\u5408\u4f5c\u670d\u52a1\u5f00\u53d1"),"\uff1a\uff08\u5171\u540c\u5f00\u53d1\uff0c\u6536\u76ca\u540e\u5206\u6210\uff09"),Object(a.b)("li",{parentName:"ul"},Object(a.b)("strong",{parentName:"li"},Object(a.b)("inlineCode",{parentName:"strong"},"Furion")," \u6587\u6863\u5e7f\u544a\u6295\u653e"),"\uff1a\uff08800 \u5143/\u6708\uff0c\u8986\u76d6\u6240\u6709\u6587\u6863\u9875\u9762\uff09")),Object(a.b)("p",null,"\u5982\u6709\u9879\u76ee\u5408\u4f5c\u610f\u613f\u53ef\u53d1\u9001\u90ae\u4ef6\u81f3\uff1a",Object(a.b)("inlineCode",{parentName:"p"},"monksoul@outlook.com")," \u7535\u5b50\u90ae\u7bb1\u3002"))}s.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return c}));var r=n(21),o=n(195);function a(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(r.default)();return{withBaseUrl:(n,r)=>function(e,t,n,{forcePrependBaseUrl:r=!1,absolute:a=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(o.b)(n))return n;if(r)return t+n;const c=n.startsWith(t)?n:t+n.replace(/^\//,"");return a?e+c:c}(t,e,n,r)}}function c(e,t={}){const{withBaseUrl:n}=a();return n(e,t)}},195:function(e,t,n){"use strict";function r(e){return!0===/^(\w*:|\/\/)/.test(e)}function o(e){return void 0!==e&&!r(e)}n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return o}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return d}));var r=n(0),o=n.n(r);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function i(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var l=o.a.createContext({}),p=function(e){var t=o.a.useContext(l),n=t;return e&&(n="function"==typeof e?e(t):i(i({},t),e)),n},s=function(e){var t=p(e.components);return o.a.createElement(l.Provider,{value:t},e.children)},b={inlineCode:"code",wrapper:function(e){var t=e.children;return o.a.createElement(o.a.Fragment,{},t)}},f=o.a.forwardRef((function(e,t){var n=e.components,r=e.mdxType,a=e.originalType,c=e.parentName,l=u(e,["components","mdxType","originalType","parentName"]),s=p(n),f=r,d=s["".concat(c,".").concat(f)]||s[f]||b[f]||a;return n?o.a.createElement(d,i(i({ref:t},l),{},{components:n})):o.a.createElement(d,i({ref:t},l))}));function d(e,t){var n=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var a=n.length,c=new Array(a);c[0]=f;var i={};for(var u in t)hasOwnProperty.call(t,u)&&(i[u]=t[u]);i.originalType=e,i.mdxType="string"==typeof e?e:r,c[1]=i;for(var l=2;lt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/fa529204.61abd6b5.js b/docs/fa529204.f90db3a0.js similarity index 97% rename from docs/fa529204.61abd6b5.js rename to docs/fa529204.f90db3a0.js index 57dd49556d3..0bbfb9f24eb 100644 --- a/docs/fa529204.61abd6b5.js +++ b/docs/fa529204.f90db3a0.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[106],{181:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return o})),t.d(n,"default",(function(){return u}));var a=t(3),r=t(7),i=(t(0),t(192)),l=t(193),c={id:"view-engine",title:"17. \u89c6\u56fe\u5f15\u64ce",sidebar_label:"17. \u89c6\u56fe\u5f15\u64ce"},b={unversionedId:"view-engine",id:"view-engine",isDocsHomePage:!1,title:"17. \u89c6\u56fe\u5f15\u64ce",description:"17.1 \u5173\u4e8e\u89c6\u56fe\u5f15\u64ce",source:"@site/docs\\view-engine.mdx",slug:"/view-engine",permalink:"/docs/view-engine",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/view-engine.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"17. \u89c6\u56fe\u5f15\u64ce",sidebar:"docs",previous:{title:"16. CORS \u8de8\u57df",permalink:"/docs/cors"},next:{title:"18. \u65e5\u5fd7\u8bb0\u5f55",permalink:"/docs/logging"}},o=[{value:"17.1 \u5173\u4e8e\u89c6\u56fe\u5f15\u64ce",id:"171-\u5173\u4e8e\u89c6\u56fe\u5f15\u64ce",children:[]},{value:"17.2 \u89c6\u56fe\u5f15\u64ce\u4f5c\u7528",id:"172-\u89c6\u56fe\u5f15\u64ce\u4f5c\u7528",children:[]},{value:"17.3 \u57fa\u7840\u4f7f\u7528",id:"173-\u57fa\u7840\u4f7f\u7528",children:[{value:"17.3.1 \u6ce8\u518c\u670d\u52a1",id:"1731-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"17.3.2 \u4f7f\u7528\u65b9\u5f0f",id:"1732-\u4f7f\u7528\u65b9\u5f0f",children:[]},{value:"17.3.3 \u5f31\u7c7b\u578b\u6a21\u677f",id:"1733-\u5f31\u7c7b\u578b\u6a21\u677f",children:[]},{value:"17.3.4 \u5f3a\u7c7b\u578b\u6a21\u677f",id:"1734-\u5f3a\u7c7b\u578b\u6a21\u677f",children:[]},{value:"17.3.5 \u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58 \ud83e\udd47",id:"1735-\u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58-\ud83e\udd47",children:[]}]},{value:"17.4 \u9ad8\u7ea7\u7528\u6cd5",id:"174-\u9ad8\u7ea7\u7528\u6cd5",children:[{value:"17.4.1 \u6dfb\u52a0\u7a0b\u5e8f\u96c6",id:"1741-\u6dfb\u52a0\u7a0b\u5e8f\u96c6",children:[]},{value:"17.4.2 \u6dfb\u52a0\u547d\u540d\u7a7a\u95f4",id:"1742-\u6dfb\u52a0\u547d\u540d\u7a7a\u95f4",children:[]},{value:"17.4.3 \u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5",id:"1743-\u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5",children:[]},{value:"17.4.4 \u8c03\u7528\u7c7b\u65b9\u6cd5",id:"1744-\u8c03\u7528\u7c7b\u65b9\u6cd5",children:[]}]},{value:"17.5 IViewEngine \u63a5\u53e3",id:"175-iviewengine-\u63a5\u53e3",children:[]},{value:"17.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"176-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:o};function u(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(l.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"171-\u5173\u4e8e\u89c6\u56fe\u5f15\u64ce"},"17.1 \u5173\u4e8e\u89c6\u56fe\u5f15\u64ce"),Object(i.b)("p",null,"\u89c6\u56fe\u5f15\u64ce\u8d1f\u8d23\u6839\u636e\u89c6\u56fe\u6a21\u677f\u521b\u5efa HTML\u3002\u89c6\u56fe\u901a\u5e38\u662f HTML \u548c\u7f16\u7a0b\u8bed\u8a00\u7684\u67d0\u79cd\u6df7\u5408\u3002\u652f\u6301\u53d8\u91cf\u5b9a\u4e49\u3001\u65b9\u6cd5\u8c03\u7528\u53ca\u903b\u8f91\u7f16\u5199\u3002"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5e95\u5c42\u96c6\u6210\u4e86\u5fae\u8f6f\u63d0\u4f9b\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Razor")," \u89c6\u56fe\u5f15\u64ce\u7ec4\u4ef6\u5e76\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u65b9\u4fbf\u7684\u8bed\u6cd5\u7cd6\u3002"),Object(i.b)("h2",{id:"172-\u89c6\u56fe\u5f15\u64ce\u4f5c\u7528"},"17.2 \u89c6\u56fe\u5f15\u64ce\u4f5c\u7528"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"\u652f\u6301 ",Object(i.b)("inlineCode",{parentName:"strong"},"ASP.NET Core")," \u5b8c\u6574\u7684 ",Object(i.b)("inlineCode",{parentName:"strong"},"Razor")," \u8bed\u6cd5")),Object(i.b)("li",{parentName:"ul"},"\u6839\u636e\u4e0d\u540c\u7684\u6570\u636e\u7f16\u8bd1\u6a21\u677f\u4ea7\u751f\u4e0d\u540c\u7684\u8f93\u51fa"),Object(i.b)("li",{parentName:"ul"},"\u5b9e\u73b0\u5f3a\u5927\u7684\u63d2\u4ef6\u5316\u673a\u5236"),Object(i.b)("li",{parentName:"ul"},"\u5b9e\u73b0\u5168\u7ad9\u9875\u9762\u9759\u6001\u5316"),Object(i.b)("li",{parentName:"ul"},"\u53ef\u4ee5\u7528\u4f5c\u90ae\u4ef6\u6a21\u677f\u3001\u77ed\u4fe1\u6a21\u677f\u3001\u4f18\u60e0\u5238\u4fe1\u606f\u6a21\u677f\u7b49")),Object(i.b)("h2",{id:"173-\u57fa\u7840\u4f7f\u7528"},"17.3 \u57fa\u7840\u4f7f\u7528"),Object(i.b)("h3",{id:"1731-\u6ce8\u518c\u670d\u52a1"},"17.3.1 \u6ce8\u518c\u670d\u52a1"),Object(i.b)("p",null,"\u4f7f\u7528\u4e4b\u524d\u9700\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c ",Object(i.b)("inlineCode",{parentName:"p"},"\u89c6\u56fe\u5f15\u64ce\u670d\u52a1"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddViewEngine();\n}\n")),Object(i.b)("h3",{id:"1732-\u4f7f\u7528\u65b9\u5f0f"},"17.3.2 \u4f7f\u7528\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(i.b)("inlineCode",{parentName:"li"},"IViewEngine"))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,9,12}","{2,9,12}":!0}),'using Furion.DynamicApiController;\nusing Furion.ViewEngine;\n\nnamespace Furion.Application\n{\n public class ViewEngineService : IDynamicApiController\n {\n private readonly IViewEngine _viewEngine;\n public ViewEngineService(IViewEngine viewEngine)\n {\n _viewEngine = viewEngine;\n var result = _viewEngine.RunCompile("Hello @Model.Name", new { Name = "Furion" });\n }\n }\n}\n')),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5b57\u7b26\u4e32\u65b9\u5f0f")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = "Hello @Model.Name".RunCompile(new { Name = "Furion" });\n')),Object(i.b)("h3",{id:"1733-\u5f31\u7c7b\u578b\u6a21\u677f"},"17.3.3 \u5f31\u7c7b\u578b\u6a21\u677f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompile("Hello @Model.Name", new { Name = "Furion" });\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n")),Object(i.b)("p",null,"\u652f\u6301\u5f02\u6b65 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompileAsync")),Object(i.b)("h3",{id:"1734-\u5f3a\u7c7b\u578b\u6a21\u677f"},"17.3.4 \u5f3a\u7c7b\u578b\u6a21\u677f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompile(@"\nHello @Model.Name\n@foreach(var item in Model.Items)\n{\n

@item

\n}\n", new TestModel\n{\n Name = "Furion",\n Items = new[] { 3, 1, 2 }\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n

3

\n

1

\n

2

\n")),Object(i.b)("p",null,"\u652f\u6301\u5f02\u6b65 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompileAsync")),Object(i.b)("h3",{id:"1735-\u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58-\ud83e\udd47"},"17.3.5 \u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58 \ud83e\udd47"),Object(i.b)("p",null,"\u7531\u4e8e\u6a21\u677f\u7f16\u8bd1\u9700\u8981\u6d88\u8017\u5927\u91cf\u7684\u6027\u80fd\uff0c\u6240\u4ee5\u5efa\u8bae\u4f7f\u7528\u5e26 ",Object(i.b)("inlineCode",{parentName:"p"},"FromCached")," \u7ed3\u5c3e\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompileFromCached")," \u66ff\u4ee3\u3002\u8c03\u7528\u8be5\u65b9\u6cd5\u540e\u4f1a\u81ea\u52a8\u5c06\u6a21\u677f\u7f16\u8bd1\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},".dll")," \u4ee5\u4fbf\u4e0b\u6b21\u4f7f\u7528\u3002\u51cf\u5c11\u7b2c\u4e8c\u6b21\u4e4b\u540e\u4f7f\u7528\u6a21\u677f\u7684\u6027\u80fd\u635f\u8017\u3002"),Object(i.b)("p",null,"\u5982\uff0c\u5f3a\u7c7b\u578b\u6a21\u677f\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"\nHello @Model.Name\n@foreach(var item in Model.Items)\n{\n

@item

\n}\n", new TestModel\n{\n Name = "Furion",\n Items = new[] { 3, 1, 2 }\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n

3

\n

1

\n

2

\n")),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"strong"},"RunCompileFromCached")," \u65b9\u6cd5\u4e4b\u540e\u5c06\u4f1a\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"strong"},"MD5")," \u52a0\u5bc6\u6a21\u677f\u5e76\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"strong"},"MD5"),"\u5b57\u7b26\u4e32\u7684 ",Object(i.b)("inlineCode",{parentName:"strong"},".dll")," \u5b58\u653e\u5728\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u7684 ",Object(i.b)("inlineCode",{parentName:"strong"},"templates")," \u76ee\u5f55\u4e2d\u3002\u53ea\u8981\u6a21\u677f\u5185\u5bb9\u4e0d\u53d8\uff0c\u6570\u636e\u53d1\u751f\u6539\u53d8\u4e5f\u4e0d\u4f1a\u91cd\u65b0\u7f16\u8bd1\u6a21\u677f\u3002\u8fd9\u6837\u5927\u5927\u7684\u63d0\u9ad8\u4e86\u9996\u6b21\u4e4b\u540e\u7684\u6027\u80fd\u3002")),Object(i.b)("p",null,"\u5982\uff0c\u4f20\u5165\u65b0\u7684\u6570\u636e\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{10}","{10}":!0}),'var result = _viewEngine.RunCompileFromCached(@"\nHello @Model.Name\n@foreach(var item in Model.Items)\n{\n

@item

\n}\n", new TestModel\n{\n Name = "Furion",\n Items = new[] { 5,6,7,8 }\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n

5

\n

6

\n

7

\n

8

\n")),Object(i.b)("p",null,"\u6a21\u677f\u4e0d\u518d\u91cd\u65b0\u7f16\u8bd1\uff0c\u53ea\u662f\u91cd\u65b0\u66ff\u6362\u6570\u636e\u3002"),Object(i.b)("h2",{id:"174-\u9ad8\u7ea7\u7528\u6cd5"},"17.4 \u9ad8\u7ea7\u7528\u6cd5"),Object(i.b)("p",null,"\u9ad8\u7ea7\u7528\u6cd5\u652f\u6301\u5c06\u7279\u5b9a\u7a0b\u5e8f\u96c6\u3001\u7279\u5b9a\u547d\u540d\u7a7a\u95f4\u3001\u7279\u5b9a\u7c7b\u578b\u5f15\u5165\u5230\u6a21\u677f\u4e2d\u4f7f\u7528\u3002"),Object(i.b)("h3",{id:"1741-\u6dfb\u52a0\u7a0b\u5e8f\u96c6"},"17.4.1 \u6dfb\u52a0\u7a0b\u5e8f\u96c6"),Object(i.b)("p",null,"\u6bd4\u5982\u8fd9\u91cc\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"p"},"System.IO")," \u7a0b\u5e8f\u96c6\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"
@System.IO.Path.Combine(""Furion"", ""ViewEngine"")
", builderAction: builder =>\n {\n builder.AddAssemblyReferenceByName("System.IO");\n });\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"
Furion\\\\ViewEngine
\n")),Object(i.b)("p",null,"\u53e6\u5916\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u591a\u79cd\u65b9\u5f0f\u52a0\u8f7d\u7a0b\u5e8f\u96c6\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'builder.AddAssemblyReferenceByName("System.Security"); // \u901a\u8fc7\u540d\u79f0\nbuilder.AddAssemblyReference(typeof(System.IO.File)); // \u901a\u8fc7\u7c7b\u578b\nbuilder.AddAssemblyReference(Assembly.Load("source")); // \u901a\u8fc7\u5143\u6570\u636e\u5f15\u7528\n')),Object(i.b)("h3",{id:"1742-\u6dfb\u52a0\u547d\u540d\u7a7a\u95f4"},"17.4.2 \u6dfb\u52a0\u547d\u540d\u7a7a\u95f4"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"
@Path.Combine(""Furion"", ""ViewEngine"")
", builderAction: builder =>\n {\n builder.AddUsing("System.IO");\n builder.AddAssemblyReferenceByName("System.IO");\n });\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"
Furion\\\\ViewEngine
\n")),Object(i.b)("p",null,"\u4e5f\u652f\u6301\u52a0\u5165\u591a\u4e2a ",Object(i.b)("inlineCode",{parentName:"p"},"using"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),'builder.AddUsing("System.IO");\nbuilder.AddUsing("Furion");\n')),Object(i.b)("h3",{id:"1743-\u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5"},"17.4.3 \u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"\n\n @{ RecursionTest(3); }\n\n\n@{\n void RecursionTest(int level)\n {\n if (level <= 0)\n {\n return;\n }\n\n
LEVEL: @level
\n @{ RecursionTest(level - 1); }\n }\n}\n");\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"\n
LEVEL: 3
\n
LEVEL: 2
\n
LEVEL: 1
\n\n")),Object(i.b)("h3",{id:"1744-\u8c03\u7528\u7c7b\u65b9\u6cd5"},"17.4.4 \u8c03\u7528\u7c7b\u65b9\u6cd5"),Object(i.b)("p",null,"\u5b9a\u4e49 ",Object(i.b)("inlineCode",{parentName:"p"},"CustomModel")," \u7c7b\u5e76\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"ViewEngineModel")," \u57fa\u7c7b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),'public class CustomModel : ViewEngineModel\n{\n public int A { get; set; }\n public string B { get; set; }\n public string Decorator(object value)\n {\n return "-=" + value + "=-";\n }\n}\n')),Object(i.b)("p",null,"\u5728\u6a21\u677f\u4e2d\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"Decorator(value)")," \u65b9\u6cd5\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var content = @"Hello @A, @B, @Decorator(123)";\n\nvar template = _viewEngine.Compile(content);\n\nvar result = template.Run(instance =>\n{\n instance.A = 10;\n instance.B = "Alex";\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello 10, Alex, -=123=-\n")),Object(i.b)("h2",{id:"175-iviewengine-\u63a5\u53e3"},"17.5 ",Object(i.b)("inlineCode",{parentName:"h2"},"IViewEngine")," \u63a5\u53e3"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IViewEngine")," \u63d0\u4f9b\u4e86\u7b80\u5355\u65b9\u4fbf\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompile")," \u65b9\u6cd5\uff0c\u4e5f\u63d0\u4f9b\u4e86\u6700\u539f\u59cb\u5316\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Compile")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Run")," \u65b9\u6cd5\u3002"),Object(i.b)("p",null,"\u901a\u8fc7\u539f\u59cb\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Compile")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Run")," \u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u5f88\u591a\u590d\u6742\u7684\u903b\u8f91\u548c\u81ea\u5b9a\u4e49\u6307\u4ee4\u96c6\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \nIViewEngineTemplate Compile(string content, Action builderAction = null);\n/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \nTask CompileAsync(string content, Action builderAction = null);\n/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \n/// \nIViewEngineTemplate Compile(string content, Action builderAction = null)\n where T : IViewEngineModel;\n/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \n/// \nTask> CompileAsync(string content, Action builderAction = null)\n where T : IViewEngineModel;\n')),Object(i.b)("h2",{id:"176-\u53cd\u9988\u4e0e\u5efa\u8bae"},"17.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},190:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return l}));var a=t(21),r=t(191);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const l=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+l:l}(n,e,t,a)}}function l(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},191:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},192:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return d}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var o=r.a.createContext({}),p=function(e){var n=r.a.useContext(o),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},u=function(e){var n=p(e.components);return r.a.createElement(o.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},s=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,o=b(e,["components","mdxType","originalType","parentName"]),u=p(t),s=a,d=u["".concat(l,".").concat(s)]||u[s]||m[s]||i;return t?r.a.createElement(d,c(c({ref:n},o),{},{components:t})):r.a.createElement(d,c({ref:n},o))}));function d(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=s;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,l[1]=c;for(var o=2;on(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[110],{185:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return c})),t.d(n,"metadata",(function(){return b})),t.d(n,"toc",(function(){return o})),t.d(n,"default",(function(){return u}));var a=t(3),r=t(7),i=(t(0),t(196)),l=t(197),c={id:"view-engine",title:"17. \u89c6\u56fe\u5f15\u64ce",sidebar_label:"17. \u89c6\u56fe\u5f15\u64ce"},b={unversionedId:"view-engine",id:"view-engine",isDocsHomePage:!1,title:"17. \u89c6\u56fe\u5f15\u64ce",description:"17.1 \u5173\u4e8e\u89c6\u56fe\u5f15\u64ce",source:"@site/docs\\view-engine.mdx",slug:"/view-engine",permalink:"/docs/view-engine",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/view-engine.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"17. \u89c6\u56fe\u5f15\u64ce",sidebar:"docs",previous:{title:"16. CORS \u8de8\u57df",permalink:"/docs/cors"},next:{title:"18. \u65e5\u5fd7\u8bb0\u5f55",permalink:"/docs/logging"}},o=[{value:"17.1 \u5173\u4e8e\u89c6\u56fe\u5f15\u64ce",id:"171-\u5173\u4e8e\u89c6\u56fe\u5f15\u64ce",children:[]},{value:"17.2 \u89c6\u56fe\u5f15\u64ce\u4f5c\u7528",id:"172-\u89c6\u56fe\u5f15\u64ce\u4f5c\u7528",children:[]},{value:"17.3 \u57fa\u7840\u4f7f\u7528",id:"173-\u57fa\u7840\u4f7f\u7528",children:[{value:"17.3.1 \u6ce8\u518c\u670d\u52a1",id:"1731-\u6ce8\u518c\u670d\u52a1",children:[]},{value:"17.3.2 \u4f7f\u7528\u65b9\u5f0f",id:"1732-\u4f7f\u7528\u65b9\u5f0f",children:[]},{value:"17.3.3 \u5f31\u7c7b\u578b\u6a21\u677f",id:"1733-\u5f31\u7c7b\u578b\u6a21\u677f",children:[]},{value:"17.3.4 \u5f3a\u7c7b\u578b\u6a21\u677f",id:"1734-\u5f3a\u7c7b\u578b\u6a21\u677f",children:[]},{value:"17.3.5 \u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58 \ud83e\udd47",id:"1735-\u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58-\ud83e\udd47",children:[]}]},{value:"17.4 \u9ad8\u7ea7\u7528\u6cd5",id:"174-\u9ad8\u7ea7\u7528\u6cd5",children:[{value:"17.4.1 \u6dfb\u52a0\u7a0b\u5e8f\u96c6",id:"1741-\u6dfb\u52a0\u7a0b\u5e8f\u96c6",children:[]},{value:"17.4.2 \u6dfb\u52a0\u547d\u540d\u7a7a\u95f4",id:"1742-\u6dfb\u52a0\u547d\u540d\u7a7a\u95f4",children:[]},{value:"17.4.3 \u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5",id:"1743-\u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5",children:[]},{value:"17.4.4 \u8c03\u7528\u7c7b\u65b9\u6cd5",id:"1744-\u8c03\u7528\u7c7b\u65b9\u6cd5",children:[]}]},{value:"17.5 IViewEngine \u63a5\u53e3",id:"175-iviewengine-\u63a5\u53e3",children:[]},{value:"17.6 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"176-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],p={toc:o};function u(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},p,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)(l.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"171-\u5173\u4e8e\u89c6\u56fe\u5f15\u64ce"},"17.1 \u5173\u4e8e\u89c6\u56fe\u5f15\u64ce"),Object(i.b)("p",null,"\u89c6\u56fe\u5f15\u64ce\u8d1f\u8d23\u6839\u636e\u89c6\u56fe\u6a21\u677f\u521b\u5efa HTML\u3002\u89c6\u56fe\u901a\u5e38\u662f HTML \u548c\u7f16\u7a0b\u8bed\u8a00\u7684\u67d0\u79cd\u6df7\u5408\u3002\u652f\u6301\u53d8\u91cf\u5b9a\u4e49\u3001\u65b9\u6cd5\u8c03\u7528\u53ca\u903b\u8f91\u7f16\u5199\u3002"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u5e95\u5c42\u96c6\u6210\u4e86\u5fae\u8f6f\u63d0\u4f9b\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Razor")," \u89c6\u56fe\u5f15\u64ce\u7ec4\u4ef6\u5e76\u63d0\u4f9b\u66f4\u52a0\u7075\u6d3b\u65b9\u4fbf\u7684\u8bed\u6cd5\u7cd6\u3002"),Object(i.b)("h2",{id:"172-\u89c6\u56fe\u5f15\u64ce\u4f5c\u7528"},"17.2 \u89c6\u56fe\u5f15\u64ce\u4f5c\u7528"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("strong",{parentName:"li"},"\u652f\u6301 ",Object(i.b)("inlineCode",{parentName:"strong"},"ASP.NET Core")," \u5b8c\u6574\u7684 ",Object(i.b)("inlineCode",{parentName:"strong"},"Razor")," \u8bed\u6cd5")),Object(i.b)("li",{parentName:"ul"},"\u6839\u636e\u4e0d\u540c\u7684\u6570\u636e\u7f16\u8bd1\u6a21\u677f\u4ea7\u751f\u4e0d\u540c\u7684\u8f93\u51fa"),Object(i.b)("li",{parentName:"ul"},"\u5b9e\u73b0\u5f3a\u5927\u7684\u63d2\u4ef6\u5316\u673a\u5236"),Object(i.b)("li",{parentName:"ul"},"\u5b9e\u73b0\u5168\u7ad9\u9875\u9762\u9759\u6001\u5316"),Object(i.b)("li",{parentName:"ul"},"\u53ef\u4ee5\u7528\u4f5c\u90ae\u4ef6\u6a21\u677f\u3001\u77ed\u4fe1\u6a21\u677f\u3001\u4f18\u60e0\u5238\u4fe1\u606f\u6a21\u677f\u7b49")),Object(i.b)("h2",{id:"173-\u57fa\u7840\u4f7f\u7528"},"17.3 \u57fa\u7840\u4f7f\u7528"),Object(i.b)("h3",{id:"1731-\u6ce8\u518c\u670d\u52a1"},"17.3.1 \u6ce8\u518c\u670d\u52a1"),Object(i.b)("p",null,"\u4f7f\u7528\u4e4b\u524d\u9700\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Startup.cs")," \u4e2d\u6ce8\u518c ",Object(i.b)("inlineCode",{parentName:"p"},"\u89c6\u56fe\u5f15\u64ce\u670d\u52a1"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{3}","{3}":!0}),"public void ConfigureServices(IServiceCollection services)\n{\n services.AddViewEngine();\n}\n")),Object(i.b)("h3",{id:"1732-\u4f7f\u7528\u65b9\u5f0f"},"17.3.2 \u4f7f\u7528\u65b9\u5f0f"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u6784\u9020\u51fd\u6570\u6ce8\u5165 ",Object(i.b)("inlineCode",{parentName:"li"},"IViewEngine"))),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{2,9,12}","{2,9,12}":!0}),'using Furion.DynamicApiController;\nusing Furion.ViewEngine;\n\nnamespace Furion.Application\n{\n public class ViewEngineService : IDynamicApiController\n {\n private readonly IViewEngine _viewEngine;\n public ViewEngineService(IViewEngine viewEngine)\n {\n _viewEngine = viewEngine;\n var result = _viewEngine.RunCompile("Hello @Model.Name", new { Name = "Furion" });\n }\n }\n}\n')),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u5b57\u7b26\u4e32\u65b9\u5f0f")),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = "Hello @Model.Name".RunCompile(new { Name = "Furion" });\n')),Object(i.b)("h3",{id:"1733-\u5f31\u7c7b\u578b\u6a21\u677f"},"17.3.3 \u5f31\u7c7b\u578b\u6a21\u677f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompile("Hello @Model.Name", new { Name = "Furion" });\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n")),Object(i.b)("p",null,"\u652f\u6301\u5f02\u6b65 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompileAsync")),Object(i.b)("h3",{id:"1734-\u5f3a\u7c7b\u578b\u6a21\u677f"},"17.3.4 \u5f3a\u7c7b\u578b\u6a21\u677f"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompile(@"\nHello @Model.Name\n@foreach(var item in Model.Items)\n{\n

@item

\n}\n", new TestModel\n{\n Name = "Furion",\n Items = new[] { 3, 1, 2 }\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n

3

\n

1

\n

2

\n")),Object(i.b)("p",null,"\u652f\u6301\u5f02\u6b65 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompileAsync")),Object(i.b)("h3",{id:"1735-\u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58-\ud83e\udd47"},"17.3.5 \u9ad8\u6027\u80fd\u6a21\u677f\u7f13\u5b58 \ud83e\udd47"),Object(i.b)("p",null,"\u7531\u4e8e\u6a21\u677f\u7f16\u8bd1\u9700\u8981\u6d88\u8017\u5927\u91cf\u7684\u6027\u80fd\uff0c\u6240\u4ee5\u5efa\u8bae\u4f7f\u7528\u5e26 ",Object(i.b)("inlineCode",{parentName:"p"},"FromCached")," \u7ed3\u5c3e\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompileFromCached")," \u66ff\u4ee3\u3002\u8c03\u7528\u8be5\u65b9\u6cd5\u540e\u4f1a\u81ea\u52a8\u5c06\u6a21\u677f\u7f16\u8bd1\u6210 ",Object(i.b)("inlineCode",{parentName:"p"},".dll")," \u4ee5\u4fbf\u4e0b\u6b21\u4f7f\u7528\u3002\u51cf\u5c11\u7b2c\u4e8c\u6b21\u4e4b\u540e\u4f7f\u7528\u6a21\u677f\u7684\u6027\u80fd\u635f\u8017\u3002"),Object(i.b)("p",null,"\u5982\uff0c\u5f3a\u7c7b\u578b\u6a21\u677f\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"\nHello @Model.Name\n@foreach(var item in Model.Items)\n{\n

@item

\n}\n", new TestModel\n{\n Name = "Furion",\n Items = new[] { 3, 1, 2 }\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n

3

\n

1

\n

2

\n")),Object(i.b)("p",null,Object(i.b)("strong",{parentName:"p"},"\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"strong"},"RunCompileFromCached")," \u65b9\u6cd5\u4e4b\u540e\u5c06\u4f1a\u4f7f\u7528 ",Object(i.b)("inlineCode",{parentName:"strong"},"MD5")," \u52a0\u5bc6\u6a21\u677f\u5e76\u751f\u6210 ",Object(i.b)("inlineCode",{parentName:"strong"},"MD5"),"\u5b57\u7b26\u4e32\u7684 ",Object(i.b)("inlineCode",{parentName:"strong"},".dll")," \u5b58\u653e\u5728\u7f51\u7ad9\u6839\u76ee\u5f55\u4e0b\u7684 ",Object(i.b)("inlineCode",{parentName:"strong"},"templates")," \u76ee\u5f55\u4e2d\u3002\u53ea\u8981\u6a21\u677f\u5185\u5bb9\u4e0d\u53d8\uff0c\u6570\u636e\u53d1\u751f\u6539\u53d8\u4e5f\u4e0d\u4f1a\u91cd\u65b0\u7f16\u8bd1\u6a21\u677f\u3002\u8fd9\u6837\u5927\u5927\u7684\u63d0\u9ad8\u4e86\u9996\u6b21\u4e4b\u540e\u7684\u6027\u80fd\u3002")),Object(i.b)("p",null,"\u5982\uff0c\u4f20\u5165\u65b0\u7684\u6570\u636e\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{10}","{10}":!0}),'var result = _viewEngine.RunCompileFromCached(@"\nHello @Model.Name\n@foreach(var item in Model.Items)\n{\n

@item

\n}\n", new TestModel\n{\n Name = "Furion",\n Items = new[] { 5,6,7,8 }\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello Furion\n

5

\n

6

\n

7

\n

8

\n")),Object(i.b)("p",null,"\u6a21\u677f\u4e0d\u518d\u91cd\u65b0\u7f16\u8bd1\uff0c\u53ea\u662f\u91cd\u65b0\u66ff\u6362\u6570\u636e\u3002"),Object(i.b)("h2",{id:"174-\u9ad8\u7ea7\u7528\u6cd5"},"17.4 \u9ad8\u7ea7\u7528\u6cd5"),Object(i.b)("p",null,"\u9ad8\u7ea7\u7528\u6cd5\u652f\u6301\u5c06\u7279\u5b9a\u7a0b\u5e8f\u96c6\u3001\u7279\u5b9a\u547d\u540d\u7a7a\u95f4\u3001\u7279\u5b9a\u7c7b\u578b\u5f15\u5165\u5230\u6a21\u677f\u4e2d\u4f7f\u7528\u3002"),Object(i.b)("h3",{id:"1741-\u6dfb\u52a0\u7a0b\u5e8f\u96c6"},"17.4.1 \u6dfb\u52a0\u7a0b\u5e8f\u96c6"),Object(i.b)("p",null,"\u6bd4\u5982\u8fd9\u91cc\u6dfb\u52a0 ",Object(i.b)("inlineCode",{parentName:"p"},"System.IO")," \u7a0b\u5e8f\u96c6\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"
@System.IO.Path.Combine(""Furion"", ""ViewEngine"")
", builderAction: builder =>\n {\n builder.AddAssemblyReferenceByName("System.IO");\n });\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"
Furion\\\\ViewEngine
\n")),Object(i.b)("p",null,"\u53e6\u5916\uff0c",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u63d0\u4f9b\u591a\u79cd\u65b9\u5f0f\u52a0\u8f7d\u7a0b\u5e8f\u96c6\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'builder.AddAssemblyReferenceByName("System.Security"); // \u901a\u8fc7\u540d\u79f0\nbuilder.AddAssemblyReference(typeof(System.IO.File)); // \u901a\u8fc7\u7c7b\u578b\nbuilder.AddAssemblyReference(Assembly.Load("source")); // \u901a\u8fc7\u5143\u6570\u636e\u5f15\u7528\n')),Object(i.b)("h3",{id:"1742-\u6dfb\u52a0\u547d\u540d\u7a7a\u95f4"},"17.4.2 \u6dfb\u52a0\u547d\u540d\u7a7a\u95f4"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"
@Path.Combine(""Furion"", ""ViewEngine"")
", builderAction: builder =>\n {\n builder.AddUsing("System.IO");\n builder.AddAssemblyReferenceByName("System.IO");\n });\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"
Furion\\\\ViewEngine
\n")),Object(i.b)("p",null,"\u4e5f\u652f\u6301\u52a0\u5165\u591a\u4e2a ",Object(i.b)("inlineCode",{parentName:"p"},"using"),"\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{}),'builder.AddUsing("System.IO");\nbuilder.AddUsing("Furion");\n')),Object(i.b)("h3",{id:"1743-\u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5"},"17.4.3 \u5b9a\u4e49\u6a21\u677f\u65b9\u6cd5"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var result = _viewEngine.RunCompileFromCached(@"\n\n @{ RecursionTest(3); }\n\n\n@{\n void RecursionTest(int level)\n {\n if (level <= 0)\n {\n return;\n }\n\n
LEVEL: @level
\n @{ RecursionTest(level - 1); }\n }\n}\n");\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"\n
LEVEL: 3
\n
LEVEL: 2
\n
LEVEL: 1
\n\n")),Object(i.b)("h3",{id:"1744-\u8c03\u7528\u7c7b\u65b9\u6cd5"},"17.4.4 \u8c03\u7528\u7c7b\u65b9\u6cd5"),Object(i.b)("p",null,"\u5b9a\u4e49 ",Object(i.b)("inlineCode",{parentName:"p"},"CustomModel")," \u7c7b\u5e76\u7ee7\u627f ",Object(i.b)("inlineCode",{parentName:"p"},"ViewEngineModel")," \u57fa\u7c7b"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{1}","{1}":!0}),'public class CustomModel : ViewEngineModel\n{\n public int A { get; set; }\n public string B { get; set; }\n public string Decorator(object value)\n {\n return "-=" + value + "=-";\n }\n}\n')),Object(i.b)("p",null,"\u5728\u6a21\u677f\u4e2d\u8c03\u7528 ",Object(i.b)("inlineCode",{parentName:"p"},"Decorator(value)")," \u65b9\u6cd5\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'var content = @"Hello @A, @B, @Decorator(123)";\n\nvar template = _viewEngine.Compile(content);\n\nvar result = template.Run(instance =>\n{\n instance.A = 10;\n instance.B = "Alex";\n});\n')),Object(i.b)("p",null,"\u7ed3\u679c\uff1a"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-html"}),"Hello 10, Alex, -=123=-\n")),Object(i.b)("h2",{id:"175-iviewengine-\u63a5\u53e3"},"17.5 ",Object(i.b)("inlineCode",{parentName:"h2"},"IViewEngine")," \u63a5\u53e3"),Object(i.b)("p",null,Object(i.b)("inlineCode",{parentName:"p"},"IViewEngine")," \u63d0\u4f9b\u4e86\u7b80\u5355\u65b9\u4fbf\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"RunCompile")," \u65b9\u6cd5\uff0c\u4e5f\u63d0\u4f9b\u4e86\u6700\u539f\u59cb\u5316\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Compile")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Run")," \u65b9\u6cd5\u3002"),Object(i.b)("p",null,"\u901a\u8fc7\u539f\u59cb\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Compile")," \u548c ",Object(i.b)("inlineCode",{parentName:"p"},"Run")," \u65b9\u6cd5\u53ef\u4ee5\u5b9e\u73b0\u5f88\u591a\u590d\u6742\u7684\u903b\u8f91\u548c\u81ea\u5b9a\u4e49\u6307\u4ee4\u96c6\u3002"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \nIViewEngineTemplate Compile(string content, Action builderAction = null);\n/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \nTask CompileAsync(string content, Action builderAction = null);\n/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \n/// \nIViewEngineTemplate Compile(string content, Action builderAction = null)\n where T : IViewEngineModel;\n/// \n/// \u7f16\u8bd1\u6a21\u677f\n/// \n/// \n/// \n/// \n/// \nTask> CompileAsync(string content, Action builderAction = null)\n where T : IViewEngineModel;\n')),Object(i.b)("h2",{id:"176-\u53cd\u9988\u4e0e\u5efa\u8bae"},"17.6 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},194:function(e,n,t){"use strict";t.d(n,"b",(function(){return i})),t.d(n,"a",(function(){return l}));var a=t(21),r=t(195);function i(){const{siteConfig:{baseUrl:e="/",url:n}={}}=Object(a.default)();return{withBaseUrl:(t,a)=>function(e,n,t,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!t)return t;if(t.startsWith("#"))return t;if(Object(r.b)(t))return t;if(a)return n+t;const l=t.startsWith(n)?t:n+t.replace(/^\//,"");return i?e+l:l}(n,e,t,a)}}function l(e,n={}){const{withBaseUrl:t}=i();return t(e,n)}},195:function(e,n,t){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}t.d(n,"b",(function(){return a})),t.d(n,"a",(function(){return r}))},196:function(e,n,t){"use strict";t.d(n,"a",(function(){return u})),t.d(n,"b",(function(){return d}));var a=t(0),r=t.n(a);function i(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function l(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,a)}return t}function c(e){for(var n=1;n=0||(r[t]=e[t]);return r}(e,n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(r[t]=e[t])}return r}var o=r.a.createContext({}),p=function(e){var n=r.a.useContext(o),t=n;return e&&(t="function"==typeof e?e(n):c(c({},n),e)),t},u=function(e){var n=p(e.components);return r.a.createElement(o.Provider,{value:n},e.children)},m={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},s=r.a.forwardRef((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,o=b(e,["components","mdxType","originalType","parentName"]),u=p(t),s=a,d=u["".concat(l,".").concat(s)]||u[s]||m[s]||i;return t?r.a.createElement(d,c(c({ref:n},o),{},{components:t})):r.a.createElement(d,c({ref:n},o))}));function d(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,l=new Array(i);l[0]=s;var c={};for(var b in n)hasOwnProperty.call(n,b)&&(c[b]=n[b]);c.originalType=e,c.mdxType="string"==typeof e?e:a,l[1]=c;for(var o=2;on(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/fd89953c.f495ba9c.js b/docs/fd89953c.f9ebb3cf.js similarity index 95% rename from docs/fd89953c.f495ba9c.js rename to docs/fd89953c.f9ebb3cf.js index fa4ab56acad..9b2ebf8ac5b 100644 --- a/docs/fd89953c.f495ba9c.js +++ b/docs/fd89953c.f9ebb3cf.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[107],{182:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return m})),n.d(t,"default",(function(){return u}));var a=n(3),r=n(7),i=(n(0),n(192)),o=n(193),c={id:"dbcontext-entitytrigger",title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",sidebar_label:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668"},s={unversionedId:"dbcontext-entitytrigger",id:"dbcontext-entitytrigger",isDocsHomePage:!1,title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",description:"9.25.1 \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",source:"@site/docs\\dbcontext-entitytrigger.mdx",slug:"/dbcontext-entitytrigger",permalink:"/docs/dbcontext-entitytrigger",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-entitytrigger.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",sidebar:"docs",previous:{title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",permalink:"/docs/dbcontext-Interceptor"},next:{title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",permalink:"/docs/tran"}},m=[{value:"9.25.1 \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",id:"9251-\u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",children:[]},{value:"9.25.2 \u6709\u4f55\u4f5c\u7528",id:"9252-\u6709\u4f55\u4f5c\u7528",children:[]},{value:"9.25.3 \u5982\u4f55\u4f7f\u7528",id:"9253-\u5982\u4f55\u4f7f\u7528",children:[{value:"9.25.3.1 \u542f\u7528\u6570\u636e\u76d1\u542c",id:"92531-\u542f\u7528\u6570\u636e\u76d1\u542c",children:[]},{value:"9.25.3.2 \u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e",id:"92532-\u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e",children:[]}]},{value:"9.25.4 IEntityChangedListener \u5b9a\u4e49",id:"9254-ientitychangedlistener-\u5b9a\u4e49",children:[]},{value:"9.29.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9295-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:m};function u(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9251-\u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668"},"9.25.1 \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668"),Object(i.b)("p",null,"\u5728\u6700\u65b0\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"1.1.6+")," \u7248\u672c\u4e2d\uff0c\u65b0\u589e\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"IEntityChangedListener")," \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u63a5\u53e3\uff0c\u53ef\u4ee5\u76d1\u542c ",Object(i.b)("inlineCode",{parentName:"p"},"EFCore")," \u4efb\u4f55\u5b9e\u4f53\u8868 ",Object(i.b)("inlineCode",{parentName:"p"},"\u589e\u5220\u6539")," \u64cd\u4f5c\u3002"),Object(i.b)("h2",{id:"9252-\u6709\u4f55\u4f5c\u7528"},"9.25.2 \u6709\u4f55\u4f5c\u7528"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u7c7b\u4f3c\u6570\u636e\u5e93 ",Object(i.b)("inlineCode",{parentName:"li"},"\u89e6\u53d1\u5668")," \u529f\u80fd\uff0c\u53ef\u5b9e\u73b0 ",Object(i.b)("inlineCode",{parentName:"li"},"\u589e\u5220\u6539")," \u76d1\u542c"),Object(i.b)("li",{parentName:"ul"},"\u53ef\u4ee5\u5b9e\u73b0\u7279\u6b8a\u64cd\u4f5c\uff0c\u6bd4\u5982\u5237\u65b0\u7f13\u5b58\uff0c\u8bb0\u5f55\u65e5\u5fd7\u7b49")),Object(i.b)("h2",{id:"9253-\u5982\u4f55\u4f7f\u7528"},"9.25.3 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u4e0d\u542f\u7528\u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668\uff0c\u5982\u60f3\u542f\u7528\uff0c\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")," \u6784\u9020\u51fd\u6570\u4e2d\u542f\u7528\u5373\u53ef\uff1a"),Object(i.b)("h3",{id:"92531-\u542f\u7528\u6570\u636e\u76d1\u542c"},"9.25.3.1 \u542f\u7528\u6570\u636e\u76d1\u542c"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11}","{11}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class DefaultDbContext : AppDbContext\n {\n public DefaultDbContext(DbContextOptions options) : base(options)\n {\n EnabledEntityChangedListener = true;\n }\n }\n}\n')),Object(i.b)("h3",{id:"92532-\u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e"},"9.25.3.2 \u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9,30-41}","{9,30-41}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.Extensions.Caching.Memory;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Post : Entity, IEntityChangedListener\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Post()\n {\n CreatedTime = DateTimeOffset.UtcNow;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// Person \u96c6\u5408\n /// \n public ICollection Persons { get; set; }\n\n /// \n /// \u5b9e\u4f53\u66f4\u6539\u540e\u89e6\u53d1\n /// \n /// \u5b9e\u4f53\u6570\u636e\n /// \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n /// \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\n /// \u5b9e\u4f53\u72b6\u6001\n public void OnChanged(Post entity, DbContext dbContext, Type dbContextLocator, EntityState state)\n {\n // \u5237\u65b0\u7f13\u5b58\n App.GetService().Set("Key", "Value");\n }\n }\n}\n')),Object(i.b)("h2",{id:"9254-ientitychangedlistener-\u5b9a\u4e49"},"9.25.4 ",Object(i.b)("inlineCode",{parentName:"h2"},"IEntityChangedListener")," \u5b9a\u4e49"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'/// \n/// \u5b9e\u4f53\u6570\u636e\u6539\u53d8\u76d1\u542c\u4f9d\u8d56\u63a5\u53e3\n/// \n/// \npublic interface IEntityChangedListener\n where TEntity : class, IPrivateEntity, new()\n{\n /// \n /// \u76d1\u542c\u6570\u636e\u6539\u53d8\u4e4b\u524d\uff08\u4ec5\u652f\u6301EFCore\u64cd\u4f5c\uff09\n /// \n /// \n /// \n /// \n /// \n void OnChanging(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state) { }\n\n /// \n /// \u76d1\u542c\u6570\u636e\u6539\u53d8\u4e4b\u540e\uff08\u4ec5\u652f\u6301EFCore\u64cd\u4f5c\uff09\n /// \n /// \n /// \n /// \n /// \n void OnChanged(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state);\n\n /// \n /// \u76d1\u542c\u6570\u636e\u6539\u53d8\u5931\u8d25\uff08\u4ec5\u652f\u6301EFCore\u64cd\u4f5c\uff09\n /// \n /// \n /// \n /// \n /// \n void OnChangeFailed(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state) { }\n}\n')),Object(i.b)("h2",{id:"9295-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.29.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},190:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var a=n(21),r=n(191);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},191:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},192:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var m=r.a.createContext({}),b=function(e){var t=r.a.useContext(m),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=b(e.components);return r.a.createElement(m.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},l=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),u=b(n),l=a,d=u["".concat(o,".").concat(l)]||u[l]||p[l]||i;return n?r.a.createElement(d,c(c({ref:t},m),{},{components:n})):r.a.createElement(d,c({ref:t},m))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=l;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var m=2;mt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[111],{186:function(e,t,n){"use strict";n.r(t),n.d(t,"frontMatter",(function(){return c})),n.d(t,"metadata",(function(){return s})),n.d(t,"toc",(function(){return m})),n.d(t,"default",(function(){return u}));var a=n(3),r=n(7),i=(n(0),n(196)),o=n(197),c={id:"dbcontext-entitytrigger",title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",sidebar_label:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668"},s={unversionedId:"dbcontext-entitytrigger",id:"dbcontext-entitytrigger",isDocsHomePage:!1,title:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",description:"9.25.1 \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",source:"@site/docs\\dbcontext-entitytrigger.mdx",slug:"/dbcontext-entitytrigger",permalink:"/docs/dbcontext-entitytrigger",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/docs/dbcontext-entitytrigger.mdx",version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1612020493,sidebar_label:"9.25. \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",sidebar:"docs",previous:{title:"9.24 \u6570\u636e\u5e93\u64cd\u4f5c\u62e6\u622a\u5668",permalink:"/docs/dbcontext-Interceptor"},next:{title:"9.26 \u4e8b\u52a1\u548c\u5de5\u4f5c\u5355\u5143",permalink:"/docs/tran"}},m=[{value:"9.25.1 \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",id:"9251-\u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668",children:[]},{value:"9.25.2 \u6709\u4f55\u4f5c\u7528",id:"9252-\u6709\u4f55\u4f5c\u7528",children:[]},{value:"9.25.3 \u5982\u4f55\u4f7f\u7528",id:"9253-\u5982\u4f55\u4f7f\u7528",children:[{value:"9.25.3.1 \u542f\u7528\u6570\u636e\u76d1\u542c",id:"92531-\u542f\u7528\u6570\u636e\u76d1\u542c",children:[]},{value:"9.25.3.2 \u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e",id:"92532-\u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e",children:[]}]},{value:"9.25.4 IEntityChangedListener \u5b9a\u4e49",id:"9254-ientitychangedlistener-\u5b9a\u4e49",children:[]},{value:"9.29.5 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9295-\u53cd\u9988\u4e0e\u5efa\u8bae",children:[]}],b={toc:m};function u(e){var t=e.components,n=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(a.a)({},b,n,{components:t,mdxType:"MDXLayout"}),Object(i.b)(o.a,{mdxType:"JoinGroup"}),Object(i.b)("h2",{id:"9251-\u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668"},"9.25.1 \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668"),Object(i.b)("p",null,"\u5728\u6700\u65b0\u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u7684 ",Object(i.b)("inlineCode",{parentName:"p"},"1.1.6+")," \u7248\u672c\u4e2d\uff0c\u65b0\u589e\u4e86 ",Object(i.b)("inlineCode",{parentName:"p"},"IEntityChangedListener")," \u5b9e\u4f53\u6570\u636e\u76d1\u542c\u63a5\u53e3\uff0c\u53ef\u4ee5\u76d1\u542c ",Object(i.b)("inlineCode",{parentName:"p"},"EFCore")," \u4efb\u4f55\u5b9e\u4f53\u8868 ",Object(i.b)("inlineCode",{parentName:"p"},"\u589e\u5220\u6539")," \u64cd\u4f5c\u3002"),Object(i.b)("h2",{id:"9252-\u6709\u4f55\u4f5c\u7528"},"9.25.2 \u6709\u4f55\u4f5c\u7528"),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},"\u7c7b\u4f3c\u6570\u636e\u5e93 ",Object(i.b)("inlineCode",{parentName:"li"},"\u89e6\u53d1\u5668")," \u529f\u80fd\uff0c\u53ef\u5b9e\u73b0 ",Object(i.b)("inlineCode",{parentName:"li"},"\u589e\u5220\u6539")," \u76d1\u542c"),Object(i.b)("li",{parentName:"ul"},"\u53ef\u4ee5\u5b9e\u73b0\u7279\u6b8a\u64cd\u4f5c\uff0c\u6bd4\u5982\u5237\u65b0\u7f13\u5b58\uff0c\u8bb0\u5f55\u65e5\u5fd7\u7b49")),Object(i.b)("h2",{id:"9253-\u5982\u4f55\u4f7f\u7528"},"9.25.3 \u5982\u4f55\u4f7f\u7528"),Object(i.b)("p",null,"\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"Furion")," \u6846\u67b6\u4e2d\uff0c\u9ed8\u8ba4\u4e0d\u542f\u7528\u5b9e\u4f53\u6570\u636e\u76d1\u542c\u5668\uff0c\u5982\u60f3\u542f\u7528\uff0c\u53ea\u9700\u8981\u5728 ",Object(i.b)("inlineCode",{parentName:"p"},"\u6570\u636e\u5e93\u4e0a\u4e0b\u6587")," \u6784\u9020\u51fd\u6570\u4e2d\u542f\u7528\u5373\u53ef\uff1a"),Object(i.b)("h3",{id:"92531-\u542f\u7528\u6570\u636e\u76d1\u542c"},"9.25.3.1 \u542f\u7528\u6570\u636e\u76d1\u542c"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{11}","{11}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\n\nnamespace Furion.EntityFramework.Core\n{\n [AppDbContext("Sqlite3ConnectionString")]\n public class DefaultDbContext : AppDbContext\n {\n public DefaultDbContext(DbContextOptions options) : base(options)\n {\n EnabledEntityChangedListener = true;\n }\n }\n}\n')),Object(i.b)("h3",{id:"92532-\u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e"},"9.25.3.2 \u76d1\u542c\u7279\u5b9a\u5b9e\u4f53\u6570\u636e"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs",metastring:"{9,30-41}","{9,30-41}":!0}),'using Furion.DatabaseAccessor;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.Extensions.Caching.Memory;\nusing System;\nusing System.Collections.Generic;\n\nnamespace Furion.Core\n{\n public class Post : Entity, IEntityChangedListener\n {\n /// \n /// \u6784\u9020\u51fd\u6570\n /// \n public Post()\n {\n CreatedTime = DateTimeOffset.UtcNow;\n IsDeleted = false;\n }\n\n /// \n /// \u540d\u79f0\n /// \n public string Name { get; set; }\n\n /// \n /// Person \u96c6\u5408\n /// \n public ICollection Persons { get; set; }\n\n /// \n /// \u5b9e\u4f53\u66f4\u6539\u540e\u89e6\u53d1\n /// \n /// \u5b9e\u4f53\u6570\u636e\n /// \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\n /// \u6570\u636e\u5e93\u4e0a\u4e0b\u6587\u5b9a\u4f4d\u5668\n /// \u5b9e\u4f53\u72b6\u6001\n public void OnChanged(Post entity, DbContext dbContext, Type dbContextLocator, EntityState state)\n {\n // \u5237\u65b0\u7f13\u5b58\n App.GetService().Set("Key", "Value");\n }\n }\n}\n')),Object(i.b)("h2",{id:"9254-ientitychangedlistener-\u5b9a\u4e49"},"9.25.4 ",Object(i.b)("inlineCode",{parentName:"h2"},"IEntityChangedListener")," \u5b9a\u4e49"),Object(i.b)("pre",null,Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-cs"}),'/// \n/// \u5b9e\u4f53\u6570\u636e\u6539\u53d8\u76d1\u542c\u4f9d\u8d56\u63a5\u53e3\n/// \n/// \npublic interface IEntityChangedListener\n where TEntity : class, IPrivateEntity, new()\n{\n /// \n /// \u76d1\u542c\u6570\u636e\u6539\u53d8\u4e4b\u524d\uff08\u4ec5\u652f\u6301EFCore\u64cd\u4f5c\uff09\n /// \n /// \n /// \n /// \n /// \n void OnChanging(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state) { }\n\n /// \n /// \u76d1\u542c\u6570\u636e\u6539\u53d8\u4e4b\u540e\uff08\u4ec5\u652f\u6301EFCore\u64cd\u4f5c\uff09\n /// \n /// \n /// \n /// \n /// \n void OnChanged(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state);\n\n /// \n /// \u76d1\u542c\u6570\u636e\u6539\u53d8\u5931\u8d25\uff08\u4ec5\u652f\u6301EFCore\u64cd\u4f5c\uff09\n /// \n /// \n /// \n /// \n /// \n void OnChangeFailed(TEntity entity, DbContext dbContext, Type dbContextLocator, EntityState state) { }\n}\n')),Object(i.b)("h2",{id:"9295-\u53cd\u9988\u4e0e\u5efa\u8bae"},"9.29.5 \u53cd\u9988\u4e0e\u5efa\u8bae"),Object(i.b)("div",{className:"admonition admonition-note alert alert--secondary"},Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(a.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(a.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"16",viewBox:"0 0 14 16"}),Object(i.b)("path",Object(a.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.3 5.69a.942.942 0 0 1-.28-.7c0-.28.09-.52.28-.7.19-.18.42-.28.7-.28.28 0 .52.09.7.28.18.19.28.42.28.7 0 .28-.09.52-.28.7a1 1 0 0 1-.7.3c-.28 0-.52-.11-.7-.3zM8 7.99c-.02-.25-.11-.48-.31-.69-.2-.19-.42-.3-.69-.31H6c-.27.02-.48.13-.69.31-.2.2-.3.44-.31.69h1v3c.02.27.11.5.31.69.2.2.42.31.69.31h1c.27 0 .48-.11.69-.31.2-.19.3-.42.31-.69H8V7.98v.01zM7 2.3c-3.14 0-5.7 2.54-5.7 5.68 0 3.14 2.56 5.7 5.7 5.7s5.7-2.55 5.7-5.7c0-3.15-2.56-5.69-5.7-5.69v.01zM7 .98c3.86 0 7 3.14 7 7s-3.14 7-7 7-7-3.12-7-7 3.14-7 7-7z"})))),"\u4e0e\u6211\u4eec\u4ea4\u6d41")),Object(i.b)("div",Object(a.a)({parentName:"div"},{className:"admonition-content"}),Object(i.b)("p",{parentName:"div"},"\u7ed9 Furion \u63d0 ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://gitee.com/monksoul/Furion/issues/new?issue"}),"Issue"),"\u3002"))))}u.isMDXComponent=!0},194:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"a",(function(){return o}));var a=n(21),r=n(195);function i(){const{siteConfig:{baseUrl:e="/",url:t}={}}=Object(a.default)();return{withBaseUrl:(n,a)=>function(e,t,n,{forcePrependBaseUrl:a=!1,absolute:i=!1}={}){if(!n)return n;if(n.startsWith("#"))return n;if(Object(r.b)(n))return n;if(a)return t+n;const o=n.startsWith(t)?n:t+n.replace(/^\//,"");return i?e+o:o}(t,e,n,a)}}function o(e,t={}){const{withBaseUrl:n}=i();return n(e,t)}},195:function(e,t,n){"use strict";function a(e){return!0===/^(\w*:|\/\/)/.test(e)}function r(e){return void 0!==e&&!a(e)}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return r}))},196:function(e,t,n){"use strict";n.d(t,"a",(function(){return u})),n.d(t,"b",(function(){return d}));var a=n(0),r=n.n(a);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function c(e){for(var t=1;t=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var m=r.a.createContext({}),b=function(e){var t=r.a.useContext(m),n=t;return e&&(n="function"==typeof e?e(t):c(c({},t),e)),n},u=function(e){var t=b(e.components);return r.a.createElement(m.Provider,{value:t},e.children)},p={inlineCode:"code",wrapper:function(e){var t=e.children;return r.a.createElement(r.a.Fragment,{},t)}},l=r.a.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,o=e.parentName,m=s(e,["components","mdxType","originalType","parentName"]),u=b(n),l=a,d=u["".concat(o,".").concat(l)]||u[l]||p[l]||i;return n?r.a.createElement(d,c(c({ref:t},m),{},{components:n})):r.a.createElement(d,c({ref:t},m))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=l;var c={};for(var s in t)hasOwnProperty.call(t,s)&&(c[s]=t[s]);c.originalType=e,c.mdxType="string"==typeof e?e:a,o[1]=c;for(var m=2;mt(!e)},"\u52a0\u5165QQ\u4ea4\u6d41\u7fa4"))}}}]); \ No newline at end of file diff --git a/docs/fde1f028.0d7aa16a.js b/docs/fde1f028.0d7aa16a.js new file mode 100644 index 00000000000..826f053bafe --- /dev/null +++ b/docs/fde1f028.0d7aa16a.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[112],{187:function(n){n.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"net","name":".net","count":3,"permalink":"/blog/tags/net"}')}}]); \ No newline at end of file diff --git a/docs/fde1f028.2818919c.js b/docs/fde1f028.2818919c.js deleted file mode 100644 index e8133b4940f..00000000000 --- a/docs/fde1f028.2818919c.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[108],{183:function(n){n.exports=JSON.parse('{"allTagsPath":"/blog/tags","slug":"net","name":".net","count":1,"permalink":"/blog/tags/net"}')}}]); \ No newline at end of file diff --git a/docs/img/bm1.png b/docs/img/bm1.png new file mode 100644 index 00000000000..21ce36d9314 Binary files /dev/null and b/docs/img/bm1.png differ diff --git a/docs/img/un1.png b/docs/img/un1.png new file mode 100644 index 00000000000..2e43e2fa76c Binary files /dev/null and b/docs/img/un1.png differ diff --git a/docs/index.html b/docs/index.html index 95270418347..b906d390c1a 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,22 +6,22 @@ -让 .NET 开发更简单,更通用,更流行。 Furion | Furion - - - - - +让 .NET 开发更简单,更通用,更流行。 Furion | Furion + + + + +
-

Your Docusaurus site did not load properly.

A very common reason is a wrong site baseUrl configuration.

Current configured baseUrl = / (default value)

We suggest trying baseUrl =

Furion
让 .NET 开发更简单,更通用,更流行。
  • 基于 .NET 5 平台,没有历史包袱
  • 极少依赖,只依赖两个第三方包
  • 极速上手,代码无侵入式
  • 只需要一个 Inject() 即可完成配置
受支持平台:
public class AppService : IDynamicApiController
{
private readonly IRepository<User> _userRepository;
public AppService(IRepository<User> userRepository)
{
_userRepository = userRepository;
}
+

Your Docusaurus site did not load properly.

A very common reason is a wrong site baseUrl configuration.

Current configured baseUrl = / (default value)

We suggest trying baseUrl =

Furion
让 .NET 开发更简单,更通用,更流行。
  • 基于 .NET 5 平台,没有历史包袱
  • 极少依赖,只依赖两个第三方包
  • 极速上手,代码无侵入式
  • 只需要一个 Inject() 即可完成配置
受支持平台:
public class AppService : IDynamicApiController
{
private readonly IRepository<User> _userRepository;
public AppService(IRepository<User> userRepository)
{
_userRepository = userRepository;
}
[IfException(1000, "用户ID: {0} 不存在")]
public async Task<UserDto> GetUser([Range(1, int.MaxValue)] int userId)
{
var user = await _userRepository.FindOrDefaultAsync(userId);
_ = user ?? throw Oops.Oh(1000, userId);
return user.Adapt<UserDto>();
}
-
public async Task<RemoteData> GetRemote(string id)
{
var data = await $"https://www.furion.pro/data?id={id}".GetAsAsync<RemoteData>();
return data;
}
}

完全开源免费

代码托管在开源中国 GITEE

2380
Stars
523
Forks
627,666
Downloads

大量使用者测评

来听听他们是怎么说的

理想和现实

作者的技术是我接触.NET程序员中最好的一个,代码的质量,文档的质量都是一等一的。

kesshei

强烈支持,因为有你们,.net 会走的更远。

逆天的蝈蝈

非常优秀的开源作品,点赞支持

张芸溪

大概看了一下,觉得项目非常棒。core生态一定能火

赖皮小鳄鱼

作者好棒,支持国内.net!

gudufy

做得非常棒,打算基于你的框架做一个基本的后台管理出来,供大家快速开发中小型项目。

ThinkCoder

文档写的真不错,代码质量也非常高,注释非常完善,赞一个。

liuina

期待文档写完的那一天,绝对惊艳四座。

weiyu.xiao

很不错的项目,对快速搭建健壮的技术架构,帮助业务成功很有帮助。

我们的客户

我们的软件包已在全球多个项目中使用。从小型企业到企业的解决方案及知名企业。公司在简单软件和复杂管理系统的开发方面都信任我们。

立即添加您的公司
- - - - - +
public async Task<RemoteData> GetRemote(string id)
{
var data = await $"https://www.furion.pro/data?id={id}".GetAsAsync<RemoteData>();
return data;
}
}

完全开源免费

代码托管在开源中国 GITEE

2390
Stars
530
Forks
631,892
Downloads

大量使用者测评

来听听他们是怎么说的

理想和现实

作者的技术是我接触.NET程序员中最好的一个,代码的质量,文档的质量都是一等一的。

kesshei

强烈支持,因为有你们,.net 会走的更远。

逆天的蝈蝈

非常优秀的开源作品,点赞支持

张芸溪

大概看了一下,觉得项目非常棒。core生态一定能火

赖皮小鳄鱼

作者好棒,支持国内.net!

gudufy

做得非常棒,打算基于你的框架做一个基本的后台管理出来,供大家快速开发中小型项目。

ThinkCoder

文档写的真不错,代码质量也非常高,注释非常完善,赞一个。

liuina

期待文档写完的那一天,绝对惊艳四座。

weiyu.xiao

很不错的项目,对快速搭建健壮的技术架构,帮助业务成功很有帮助。

我们的客户

我们的软件包已在全球多个项目中使用。从小型企业到企业的解决方案及知名企业。公司在简单软件和复杂管理系统的开发方面都信任我们。

立即添加您的公司
+ + + + + \ No newline at end of file diff --git a/docs/main.53797ac1.js b/docs/main.53797ac1.js deleted file mode 100644 index f6f3d69c953..00000000000 --- a/docs/main.53797ac1.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! For license information please see main.53797ac1.js.LICENSE.txt */ -(window.webpackJsonp=window.webpackJsonp||[]).push([[109],[function(e,t,n){"use strict";e.exports=n(38)},function(e,t,n){e.exports=n(42)()},function(e,t,n){"use strict";n.d(t,"a",(function(){return y})),n.d(t,"b",(function(){return E})),n.d(t,"c",(function(){return k})),n.d(t,"d",(function(){return P})),n.d(t,"e",(function(){return b})),n.d(t,"f",(function(){return L})),n.d(t,"g",(function(){return F})),n.d(t,"h",(function(){return g})),n.d(t,"i",(function(){return T})),n.d(t,"j",(function(){return C})),n.d(t,"k",(function(){return M})),n.d(t,"l",(function(){return U})),n.d(t,"m",(function(){return B})),n.d(t,"n",(function(){return z})),n.d(t,"o",(function(){return D}));var r=n(4),o=n(0),a=n.n(o),i=(n(1),n(6)),l=n(19),s=n(5),c=n(3),u=n(20),d=n.n(u),f=(n(27),n(7)),p=n(32),m=n.n(p),h=function(e){var t=Object(l.a)();return t.displayName=e,t}("Router-History"),g=function(e){var t=Object(l.a)();return t.displayName=e,t}("Router"),b=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen((function(e){n._isMounted?n.setState({location:e}):n._pendingLocation=e}))),n}Object(r.a)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){this._isMounted=!0,this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&this.unlisten()},n.render=function(){return a.a.createElement(g.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},a.a.createElement(h.Provider,{children:this.props.children||null,value:this.props.history}))},t}(a.a.Component);var y=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o=0;f--){var p=i[f];"."===p?a(i,f):".."===p?(a(i,f),d++):d&&(a(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&o(i[0])||i.unshift("");var m=i.join("/");return n&&"/"!==m.substr(-1)&&(m+="/"),m};function l(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var s=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every((function(t,r){return e(t,n[r])}));if("object"==typeof t||"object"==typeof n){var r=l(t),o=l(n);return r!==t||o!==n?e(r,o):Object.keys(Object.assign({},t,n)).every((function(r){return e(t[r],n[r])}))}return!1},c=n(5);function u(e){return"/"===e.charAt(0)?e:"/"+e}function d(e){return"/"===e.charAt(0)?e.substr(1):e}function f(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function p(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function m(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o}function h(e,t,n,o){var a;"string"==typeof e?(a=function(e){var t=e||"/",n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substr(o),t=t.substr(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substr(a),t=t.substr(0,a)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}(e)).state=t:(void 0===(a=Object(r.a)({},e)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==t&&void 0===a.state&&(a.state=t));try{a.pathname=decodeURI(a.pathname)}catch(l){throw l instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):l}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=i(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a}function g(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&s(e.state,t.state)}function b(){var e=null;var t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,o){if(null!=e){var a="function"==typeof e?e(t,n):e;"string"==typeof a?"function"==typeof r?r(a,o):o(!0):o(!1!==a)}else o(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;rt?n.splice(t,n.length-t,o):n.push(o),d({action:r,location:o,index:t,entries:n})}}))},replace:function(e,t){var r="REPLACE",o=h(e,t,f(),E.location);u.confirmTransitionTo(o,r,n,(function(e){e&&(E.entries[E.index]=o,d({action:r,location:o}))}))},go:v,goBack:function(){v(-1)},goForward:function(){v(1)},canGo:function(e){var t=E.index+e;return t>=0&&t=0||(o[n]=e[n]);return o}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return s}));var r=n(2),o=n(3),a=n(0),i=n.n(a);function l(e,t,n){return void 0===n&&(n=[]),e.some((function(e){var o=e.path?Object(r.j)(t,e):n.length?n[n.length-1].match:r.e.computeRootMatch(t);return o&&(n.push({route:e,match:o}),e.routes&&l(e.routes,t,n)),o})),n}function s(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),e?i.a.createElement(r.g,n,e.map((function(e,n){return i.a.createElement(r.d,{key:e.key||n,path:e.path,exact:e.exact,strict:e.strict,render:function(n){return e.render?e.render(Object(o.a)({},n,{},t,{route:e})):i.a.createElement(e.component,Object(o.a)({},n,t,{route:e}))}})}))):null}},function(e,t,n){"use strict";n.r(t),t.default={title:"Furion",tagline:"\u8ba9 .NET \u5f00\u53d1\u66f4\u7b80\u5355\uff0c\u66f4\u901a\u7528\uff0c\u66f4\u6d41\u884c\u3002",url:"https://furion.pro",baseUrl:"/",onBrokenLinks:"throw",onBrokenMarkdownLinks:"warn",favicon:"img/favicon.ico",organizationName:"Baiqian Co.,Ltd.",projectName:"Furion",themeConfig:{prism:{additionalLanguages:["powershell","csharp","sql"]},algolia:{apiKey:"97723a21d903df7ca5ea618b160f03c6",indexName:"furion",contextualSearch:!0,appId:"BH4D9OD16A",searchParameters:{}},navbar:{title:"Furion",logo:{alt:"Furion Logo",src:"img/furionlogo.png"},hideOnScroll:!0,items:[{to:"docs",activeBasePath:"docs",label:"\u6587\u6863",position:"left"},{to:"docs/global/app",activeBasePath:"docs/global",label:"\u9759\u6001\u7c7b",position:"left"},{to:"docs/settings/appsettings",activeBasePath:"docs/settings",label:"\u914d\u7f6e",position:"left"},{to:"blog",label:"\u535a\u5ba2",position:"left"},{label:"\u6e90\u7801",position:"right",items:[{label:"Gitee",href:"https://gitee.com/monksoul/Furion"},{label:"GitHub",href:"https://github.com/MonkSoul/Furion"}]},{label:"\u793e\u533a",position:"right",href:"https://www.chinadot.net"},{label:"\u5408\u4f5c",position:"right",to:"docs/cooperate",activeBasePath:"docs/cooperate"},{label:"\ud83d\udcb0\u8d5e\u52a9",position:"right",to:"docs/donate",activeBasePath:"docs/donate"}]},footer:{style:"dark",links:[{title:"\u6587\u6863",items:[{label:"\u5165\u95e8",to:"docs/get-start"},{label:"\u6307\u5357",to:"docs"}]},{title:"\u793e\u533a",items:[{label:"\u8ba8\u8bba",href:"https://gitee.com/monksoul/Furion/issues"},{label:"\u770b\u677f",href:"https://gitee.com/monksoul/Furion/board"}]},{title:"\u66f4\u591a",items:[{label:"\u535a\u5ba2",to:"blog"},{label:"\u4ed3\u5e93",href:"https://gitee.com/monksoul/Furion"}]}],copyright:"Copyright \xa9 2020-2021 Furion, Baiqian Co.,Ltd."},colorMode:{defaultMode:"light",disableSwitch:!1,respectPrefersColorScheme:!1,switchConfig:{darkIcon:"\ud83c\udf1c",darkIconStyle:{},lightIcon:"\ud83c\udf1e",lightIconStyle:{}}},docs:{versionPersistence:"localStorage"},metadatas:[],hideableSidebar:!1},presets:[["@docusaurus/preset-classic",{docs:{sidebarPath:"D:\\MONK\\Furion\\handbook\\sidebars.js",editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/",showLastUpdateTime:!0,showLastUpdateAuthor:!0},blog:{showReadingTime:!0,editUrl:"https://gitee.com/monksoul/Furion/tree/master/handbook/"},theme:{customCss:"D:\\MONK\\Furion\\handbook\\src\\css\\custom.css"}}]],baseUrlIssueBanner:!0,i18n:{defaultLocale:"en",locales:["en"],localeConfigs:{}},onDuplicateRoutes:"warn",customFields:{},plugins:[],themes:[],titleDelimiter:"|",noIndex:!1}},function(e,t,n){"use strict";n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return f})),n.d(t,"c",(function(){return y})),n.d(t,"e",(function(){return w}));var r=n(2);n.d(t,"d",(function(){return r.a})),n.d(t,"f",(function(){return r.b})),n.d(t,"g",(function(){return r.c})),n.d(t,"h",(function(){return r.d})),n.d(t,"i",(function(){return r.e})),n.d(t,"j",(function(){return r.f})),n.d(t,"k",(function(){return r.g})),n.d(t,"l",(function(){return r.i})),n.d(t,"m",(function(){return r.j})),n.d(t,"n",(function(){return r.k})),n.d(t,"o",(function(){return r.l})),n.d(t,"p",(function(){return r.m})),n.d(t,"q",(function(){return r.n})),n.d(t,"r",(function(){return r.o}));var o=n(4),a=n(0),i=n.n(a),l=n(6),s=(n(1),n(3)),c=n(7),u=n(5),d=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),o=0;o
'};function o(e,t,n){return en?n:e}function a(e){return 100*(-1+e)}function i(e,t,n){var o;return(o="translate3d"===r.positionUsing?{transform:"translate3d("+a(e)+"%,0,0)"}:"translate"===r.positionUsing?{transform:"translate("+a(e)+"%,0)"}:{"margin-left":a(e)+"%"}).transition="all "+t+"ms "+n,o}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(r[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=o(e,r.minimum,1),n.status=1===e?null:e;var a=n.render(!t),c=a.querySelector(r.barSelector),u=r.speed,d=r.easing;return a.offsetWidth,l((function(t){""===r.positionUsing&&(r.positionUsing=n.getPositioningCSS()),s(c,i(e,u,d)),1===e?(s(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout((function(){s(a,{transition:"all "+u+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),u)}),u)):setTimeout(t,u)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),r.trickleSpeed)};return r.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*o(Math.random()*t,.1,.95)),t=o(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*r.trickleRate)},e=0,t=0,n.promise=function(r){return r&&"resolved"!==r.state()?(0===t&&n.start(),e++,t++,r.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");u(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=r.template;var o,i=t.querySelector(r.barSelector),l=e?"-100":a(n.status||0),c=document.querySelector(r.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),r.showSpinner||(o=t.querySelector(r.spinnerSelector))&&p(o),c!=document.body&&u(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){d(document.documentElement,"nprogress-busy"),d(document.querySelector(r.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()}))}function r(t){var n=document.body.style;if(t in n)return t;for(var r,o=e.length,a=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((r=e[o]+a)in n)return r;return t}function o(e){return e=n(e),t[e]||(t[e]=r(e))}function a(e,t,n){t=o(t),e.style[t]=n}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function c(e,t){return("string"==typeof e?e:f(e)).indexOf(" "+t+" ")>=0}function u(e,t){var n=f(e),r=n+t;c(n,t)||(e.className=r.substring(1))}function d(e,t){var n,r=f(e);c(e,t)&&(n=r.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function f(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n})?r.call(t,n,t,e):r)||(e.exports=o)},,,function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l=n(0),s=n(1),c=[],u=[];function d(e){var t=e(),n={loading:!0,loaded:null,error:null};return n.promise=t.then((function(e){return n.loading=!1,n.loaded=e,e})).catch((function(e){throw n.loading=!1,n.error=e,e})),n}function f(e){var t={loading:!1,loaded:{},error:null},n=[];try{Object.keys(e).forEach((function(r){var o=d(e[r]);o.loading?t.loading=!0:(t.loaded[r]=o.loaded,t.error=o.error),n.push(o.promise),o.promise.then((function(e){t.loaded[r]=e})).catch((function(e){t.error=e}))}))}catch(r){t.error=r}return t.promise=Promise.all(n).then((function(e){return t.loading=!1,e})).catch((function(e){throw t.loading=!1,e})),t}function p(e,t){return l.createElement((n=e)&&n.__esModule?n.default:n,t);var n}function m(e,t){var d,f;if(!t.loading)throw new Error("react-loadable requires a `loading` component");var m=Object.assign({loader:null,loading:null,delay:200,timeout:null,render:p,webpack:null,modules:null},t),h=null;function g(){return h||(h=e(m.loader)),h.promise}return c.push(g),"function"==typeof m.webpack&&u.push((function(){if(e=m.webpack,"object"===r(n.m)&&e().every((function(e){return void 0!==e&&void 0!==n.m[e]})))return g();var e})),f=d=function(t){function n(r){o(this,n);var i=a(this,t.call(this,r));return i.retry=function(){i.setState({error:null,loading:!0,timedOut:!1}),h=e(m.loader),i._loadModule()},g(),i.state={error:h.error,pastDelay:!1,timedOut:!1,loading:h.loading,loaded:h.loaded},i}return i(n,t),n.preload=function(){return g()},n.prototype.componentWillMount=function(){this._mounted=!0,this._loadModule()},n.prototype._loadModule=function(){var e=this;if(this.context.loadable&&Array.isArray(m.modules)&&m.modules.forEach((function(t){e.context.loadable.report(t)})),h.loading){"number"==typeof m.delay&&(0===m.delay?this.setState({pastDelay:!0}):this._delay=setTimeout((function(){e.setState({pastDelay:!0})}),m.delay)),"number"==typeof m.timeout&&(this._timeout=setTimeout((function(){e.setState({timedOut:!0})}),m.timeout));var t=function(){e._mounted&&(e.setState({error:h.error,loaded:h.loaded,loading:h.loading}),e._clearTimeouts())};h.promise.then((function(){t()})).catch((function(e){t()}))}},n.prototype.componentWillUnmount=function(){this._mounted=!1,this._clearTimeouts()},n.prototype._clearTimeouts=function(){clearTimeout(this._delay),clearTimeout(this._timeout)},n.prototype.render=function(){return this.state.loading||this.state.error?l.createElement(m.loading,{isLoading:this.state.loading,pastDelay:this.state.pastDelay,timedOut:this.state.timedOut,error:this.state.error,retry:this.retry}):this.state.loaded?m.render(this.state.loaded,this.props):null},n}(l.Component),d.contextTypes={loadable:s.shape({report:s.func.isRequired})},f}function h(e){return m(d,e)}h.Map=function(e){if("function"!=typeof e.render)throw new Error("LoadableMap requires a `render(loaded, props)` function");return m(f,e)};var g=function(e){function t(){return o(this,t),a(this,e.apply(this,arguments))}return i(t,e),t.prototype.getChildContext=function(){return{loadable:{report:this.props.report}}},t.prototype.render=function(){return l.Children.only(this.props.children)},t}(l.Component);function b(e){for(var t=[];e.length;){var n=e.pop();t.push(n())}return Promise.all(t).then((function(){if(e.length)return b(e)}))}g.propTypes={report:s.func.isRequired},g.childContextTypes={loadable:s.shape({report:s.func.isRequired}).isRequired},h.Capture=g,h.preloadAll=function(){return new Promise((function(e,t){b(c).then(e,t)}))},h.preloadReady=function(){return new Promise((function(e,t){b(u).then(e,e)}))},e.exports=h},function(e,t,n){"use strict";(function(e){var r=n(0),o=n.n(r),a=n(4),i=n(1),l=n.n(i),s=1073741823,c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e?e:{};function u(e){var t=[];return{on:function(e){t.push(e)},off:function(e){t=t.filter((function(t){return t!==e}))},get:function(){return e},set:function(n,r){e=n,t.forEach((function(t){return t(e,r)}))}}}var d=o.a.createContext||function(e,t){var n,o,i,d="__create-react-context-"+((c[i="__global_unique_id__"]=(c[i]||0)+1)+"__"),f=function(e){function n(){var t;return(t=e.apply(this,arguments)||this).emitter=u(t.props.value),t}Object(a.a)(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[d]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,o=e.value;((a=r)===(i=o)?0!==a||1/a==1/i:a!=a&&i!=i)?n=0:(n="function"==typeof t?t(r,o):s,0!==(n|=0)&&this.emitter.set(e.value,n))}var a,i},r.render=function(){return this.props.children},n}(r.Component);f.childContextTypes=((n={})[d]=l.a.object.isRequired,n);var p=function(t){function n(){var e;return(e=t.apply(this,arguments)||this).state={value:e.getValue()},e.onUpdate=function(t,n){0!=((0|e.observedBits)&n)&&e.setState({value:e.getValue()})},e}Object(a.a)(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?s:t},r.componentDidMount=function(){this.context[d]&&this.context[d].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?s:e},r.componentWillUnmount=function(){this.context[d]&&this.context[d].off(this.onUpdate)},r.getValue=function(){return this.context[d]?this.context[d].get():e},r.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(r.Component);return p.contextTypes=((o={})[d]=l.a.object,o),{Provider:f,Consumer:p}};t.a=d}).call(this,n(26))},function(e,t,n){var r=n(44);e.exports=p,e.exports.parse=a,e.exports.compile=function(e,t){return l(a(e,t),t)},e.exports.tokensToFunction=l,e.exports.tokensToRegExp=f;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function a(e,t){for(var n,r=[],a=0,i=0,l="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var d=n[0],f=n[1],p=n.index;if(l+=e.slice(i,p),i=p+d.length,f)l+=f[1];else{var m=e[i],h=n[2],g=n[3],b=n[4],y=n[5],v=n[6],E=n[7];l&&(r.push(l),l="");var w=null!=h&&null!=m&&m!==h,x="+"===v||"*"===v,T="?"===v||"*"===v,k=n[2]||u,S=b||y;r.push({name:g||a++,prefix:h||"",delimiter:k,optional:T,repeat:x,partial:w,asterisk:!!E,pattern:S?c(S):E?".*":"[^"+s(k)+"]+?"})}}return ie.length)return;if(!(w instanceof s)){if(h&&v!=t.length-1){if(f.lastIndex=E,!(C=f.exec(e)))break;for(var x=C.index+(m?C[1].length:0),T=C.index+C[0].length,k=v,S=E,O=t.length;k=(S+=t[k].length)&&(++v,E=S);if(t[v]instanceof s)continue;P=k-v,w=e.slice(E,S),C.index-=E}else{f.lastIndex=0;var C=f.exec(w),P=1}if(C){m&&(g=C[1]?C[1].length:0),T=(x=C.index+g)+(C=C[0].slice(g)).length;var A=w.slice(0,x),N=w.slice(T),R=[v,P];A&&(++v,E+=A.length,R.push(A));var I=new s(c,p?o.tokenize(C,p):C,b,C,h);if(R.push(I),N&&R.push(N),Array.prototype.splice.apply(t,R),1!=P&&o.matchGrammar(e,t,n,v,E,!0,c),i)break}else if(i)break}}}}},hooks:{add:function(){}},tokenize:function(e,t,n){var r=[e],a=t.rest;if(a){for(var i in a)t[i]=a[i];delete t.rest}return o.matchGrammar(e,r,t,0,0,!1),r}},(a=o.Token=function(e,t,n,r,o){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!o}).stringify=function(e,t,n){if("string"==typeof e)return e;if("Array"===o.util.type(e))return e.map((function(n){return a.stringify(n,t,e)})).join("");var r={type:e.type,content:a.stringify(e.content,t,n),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:n};if(e.alias){var i="Array"===o.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(r.classes,i)}var l=Object.keys(r.attributes).map((function(e){return e+'="'+(r.attributes[e]||"").replace(/"/g,""")+'"'})).join(" ");return"<"+r.tag+' class="'+r.classes.join(" ")+'"'+(l?" "+l:"")+">"+r.content+""},o);i.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype://i,cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.languages.markup.tag.inside["attr-value"].inside.entity=i.languages.markup.entity,i.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(i.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:i.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:i.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g,e),"i"),lookbehind:!0,greedy:!0,inside:r},i.languages.insertBefore("markup","cdata",o)}}),i.languages.xml=i.languages.extend("markup",{}),i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)\w+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b\w+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+?)\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:n},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s*(?:\r?\n|\r)(?:[\s\S])*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0},{pattern:/(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/,greedy:!0,inside:n}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:n.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|aptitude|apt-cache|apt-get|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:if|then|else|elif|fi|for|while|in|case|esac|function|select|do|done|until)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|break|cd|continue|eval|exec|exit|export|getopts|hash|pwd|readonly|return|shift|test|times|trap|umask|unset|alias|bind|builtin|caller|command|declare|echo|enable|help|let|local|logout|mapfile|printf|read|readarray|source|type|typeset|ulimit|unalias|set|shopt)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:true|false)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|==?|!=?|=~|<<[<-]?|[&\d]?>>|\d?[<>]&?|&[>&]?|\|[&|]?|<=?|>=?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}};for(var r=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=n.variable[1].inside,a=0;a=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.c=i.languages.extend("clike",{"class-name":{pattern:/(\b(?:enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete i.languages.c.boolean,i.languages.cpp=i.languages.extend("c",{"class-name":{pattern:/(\b(?:class|enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:true|false)\b/}),i.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),function(e){var t=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/@[\w-]+/}},url:{pattern:RegExp("url\\((?:"+t.source+"|[^\n\r()]*)\\)","i"),inside:{function:/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+t.source+")*?(?=\\s*\\{)"),string:{pattern:t,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,function:/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:n.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},n.tag))}(i),i.languages.css.selector={pattern:i.languages.css.selector,inside:{"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-:.\w]+/,id:/#[-:.\w]+/,attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1)*\]/,greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)[-*\w\xA0-\uFFFF]*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},attribute:{pattern:/^(\s*)[-\w\xA0-\uFFFF]+/,lookbehind:!0},value:[/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,{pattern:/(=\s*)[-\w\xA0-\uFFFF]+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],punctuation:/[()]/}},i.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*/i,lookbehind:!0}}),i.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:/#[\da-f]{3,8}/i,entity:/\\[\da-f]{1,8}/i,unit:{pattern:/(\d)(?:%|[a-z]+)/,lookbehind:!0},number:/-?[\d.]+/}),i.languages.javascript=i.languages.extend("clike",{"class-name":[i.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.])\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,function:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/-[-=]?|\+[+=]?|!=?=?|<>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/}),i.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,i.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=\s*($|[\r\n,.;})\]]))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:i.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:i.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:i.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:i.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),i.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.markup.tag.addInlined("script","javascript"),i.languages.js=i.languages.javascript,function(e){var t=e.util.clone(e.languages.javascript);e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=/<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}))*\s*\/?)?>/i,e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/i,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.insertBefore("inside","attr-name",{spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}/,inside:{punctuation:/\.{3}|[{}.]/,"attr-value":/\w+/}}},e.languages.jsx.tag),e.languages.insertBefore("inside","attr-value",{script:{pattern:/=(\{(?:\{(?:\{[^}]*\}|[^}])*\}|[^}])+\})/i,inside:{"script-punctuation":{pattern:/^=(?={)/,alias:"punctuation"},rest:e.languages.jsx},alias:"language-javascript"}},e.languages.jsx.tag);var n=function(e){return e?"string"==typeof e?e:"string"==typeof e.content?e.content:e.content.map(n).join(""):""},r=function(t){for(var o=[],a=0;a0&&o[o.length-1].tagName===n(i.content[0].content[1])&&o.pop():"/>"===i.content[i.content.length-1].content||o.push({tagName:n(i.content[0].content[1]),openedBraces:0}):o.length>0&&"punctuation"===i.type&&"{"===i.content?o[o.length-1].openedBraces++:o.length>0&&o[o.length-1].openedBraces>0&&"punctuation"===i.type&&"}"===i.content?o[o.length-1].openedBraces--:l=!0),(l||"string"==typeof i)&&o.length>0&&0===o[o.length-1].openedBraces){var s=n(i);a0&&("string"==typeof t[a-1]||"plain-text"===t[a-1].type)&&(s=n(t[a-1])+s,t.splice(a-1,1),a--),t[a]=new e.Token("plain-text",s,null,s)}i.content&&"string"!=typeof i.content&&r(i.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||r(e.tokens)}))}(i),function(e){var t=e.languages.javadoclike={parameter:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*@(?:param|arg|arguments)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^\s*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};Object.defineProperty(t,"addSupport",{value:function(t,n){"string"==typeof t&&(t=[t]),t.forEach((function(t){!function(t,n){var r="doc-comment",o=e.languages[t];if(o){var a=o[r];if(!a){var i={"doc-comment":{pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,alias:"comment"}};a=(o=e.languages.insertBefore(t,"comment",i))[r]}if(a instanceof RegExp&&(a=o[r]={pattern:a}),Array.isArray(a))for(var l=0,s=a.length;l>>?=?|->|([-+&|])\2|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),e.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(\.[a-z]\w*)+/,lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":n,keyword:t,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})}(i),function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"==typeof a&&!a(e))return e;for(var o,l=i.length;-1!==n.code.indexOf(o=t(r,l));)++l;return i[l]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=a.length);s++){var c=l[s];if("string"==typeof c||c.content&&"string"==typeof c.content){var u=a[o],d=n.tokenStack[u],f="string"==typeof c?c:c.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++o;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),b=f.substring(m+p.length),y=[];h&&y.push.apply(y,i([h])),y.push(g),b&&y.push.apply(y,i([b])),"string"==typeof c?l.splice.apply(l,[s,1].concat(y)):c.content=y}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(i),function(e){e.languages.php=e.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,boolean:{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),e.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),e.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),e.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,package:{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),e.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var t={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,lookbehind:!0,inside:{rest:e.languages.php}};e.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:t}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:t}}}),delete e.languages.php.string,e.hooks.add("before-tokenize",(function(t){if(/<\?/.test(t.code)){e.languages["markup-templating"].buildPlaceholders(t,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"php")}))}(i),function(e){var t=e.languages.javascript,n=/{(?:[^{}]|{(?:[^{}]|{[^{}]*})*})+}/.source,r="(@(?:param|arg|argument|property)\\s+(?:"+n+"\\s+)?)";e.languages.jsdoc=e.languages.extend("javadoclike",{parameter:{pattern:RegExp(r+/[$\w\xA0-\uFFFF.]+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(r+/\[[$\w\xA0-\uFFFF.]+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:t,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp("(@[a-z]+\\s+)"+n),lookbehind:!0,inside:{punctuation:/[.,:?=<>|{}()[\]]/}},{pattern:/(@(?:augments|extends|class|interface|memberof!?|this)\s+)[A-Z]\w*(?:\.[A-Z]\w*)*/,lookbehind:!0,inside:{punctuation:/\./}}],example:{pattern:/(@example\s+)[^@]+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^(\s*(?:\*\s*)?).+$/m,lookbehind:!0,inside:t,alias:"language-javascript"}}}}),e.languages.javadoclike.addSupport("javascript",e.languages.jsdoc)}(i),i.languages.actionscript=i.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|else|extends|finally|for|function|if|implements|import|in|instanceof|interface|internal|is|native|new|null|package|private|protected|public|return|super|switch|this|throw|try|typeof|use|var|void|while|with|dynamic|each|final|get|include|namespace|native|override|set|static)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<>?>?|[!=]=?)=?|[~?@]/}),i.languages.actionscript["class-name"].alias="function",i.languages.markup&&i.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:{rest:i.languages.markup}}}),function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},rest:e.languages.javascript}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(i),function(e){e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:(?:Uint|Int)(?:8|16|32)|Uint8Clamped|Float(?:32|64))?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|(?:Weak)?(?:Set|Map)|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:/(\.\s*)#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*/,lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|location|navigator|performance|(?:local|session)Storage|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var t=["function","function-variable","method","method-variable","property-access"],n=0;n))/i,delete e.languages.flow.parameter,e.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(e.languages.flow.keyword)||(e.languages.flow.keyword=[e.languages.flow.keyword]),e.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:type|opaque|declare|Class)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:await|Diff|Exact|Keys|ObjMap|PropertyType|Shape|Record|Supertype|Subtype|Enum)\b(?!\$)/,lookbehind:!0})}(i),i.languages.n4js=i.languages.extend("javascript",{keyword:/\b(?:any|Array|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),i.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),i.languages.n4jsd=i.languages.n4js,i.languages.typescript=i.languages.extend("javascript",{keyword:/\b(?:abstract|as|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|var|void|while|with|yield)\b/,builtin:/\b(?:string|Function|any|number|boolean|Array|symbol|console|Promise|unknown|never)\b/}),i.languages.ts=i.languages.typescript,function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],a=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var o={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(o.code,o.grammar),e.hooks.run("after-tokenize",o),o.tokens}function c(t){var n={};n["interpolation-punctuation"]=o;var a=e.tokenize(t,n);if(3===a.length){var i=[1,1];i.push.apply(i,s(a[1],e.languages.javascript,"javascript")),a.splice.apply(a,i)}return new e.Token("interpolation",a,r.alias,t)}function u(t,n,r){var o=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),i=0,u={},d=s(o.map((function(e){if("string"==typeof e)return e;for(var n,o=e.content;-1!==t.indexOf(n=l(i++,r)););return u[n]=o,n})).join(""),n,r),f=Object.keys(u);return i=0,function e(t){for(var n=0;n=f.length)return;var r=t[n];if("string"==typeof r||"string"==typeof r.content){var o=f[i],a="string"==typeof r?r:r.content,l=a.indexOf(o);if(-1!==l){++i;var s=a.substring(0,l),d=c(u[o]),p=a.substring(l+o.length),m=[];if(s&&m.push(s),m.push(d),p){var h=[p];e(h),m.push.apply(m,h)}"string"==typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(d),new e.Token(r,d,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:md|markdown)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"==typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,o=n.length;r/g,t),n&&(e=e+"|"+e.replace(/_/g,"\\*")),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``.+?``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\r?\n|\r)|$)/.source.replace(/__/g,r),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\r?\n|\r)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+a+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+a+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/(^[ \t]*(?:\r?\n|\r))(?: {4}|\t).+(?:(?:\r?\n|\r)(?: {4}|\t).+)*/m,lookbehind:!0,alias:"keyword"},{pattern:/``.+?``|`[^`\r\n]+`/,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\r?\n|\r))[\s\S]+?(?=(?:\r?\n|\r)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\r?\n|\r)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#+.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/__(?:(?!_)|_(?:(?!_))+_)+__/.source,!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/_(?:(?!_)|__(?:(?!_))+__)+_/.source,!0),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+?\2/.source,!1),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)| ?\[(?:(?!\]))+\])/.source,!1),lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(\[)[^\]]+(?=\]$)/,lookbehind:!0},content:{pattern:/(^!?\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},string:{pattern:/"(?:\\.|[^"\\])*"(?=\)$)/}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!=typeof t)for(var n=0,r=t.length;n",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(i),i.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/m,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/m}},coord:/^@@.*@@$/m,commit_sha1:/^commit \w{40}$/m},i.languages.go=i.languages.extend("clike",{keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,builtin:/\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/,boolean:/\b(?:_|iota|nil|true|false)\b/,operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,number:/(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i,string:{pattern:/(["'`])(\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0}}),delete i.languages.go["class-name"],function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/i,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:true|false)\b/,block:{pattern:/^(\s*~?\s*)[#\/]\S+?(?=\s*~?\s*$|\s)/i,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,.\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")}))}(i),i.languages.json={property:{pattern:/"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,greedy:!0},comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,number:/-?\d+\.?\d*(e[+-]?\d+)?/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},i.languages.less=i.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-]+?(?:\([^{}]+\)|[^(){};])*?(?=\s*\{)/i,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\([^{}]*\)|[^{};@])*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/i,operator:/[+\-*\/]/}),i.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-]+.*?(?=[(;])/,lookbehind:!0,alias:"function"}}),i.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},builtin:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,symbol:{pattern:/^[^:=\r\n]+(?=\s*:(?!=))/m,inside:{variable:/\$+(?:[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:[/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,{pattern:/(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,lookbehind:!0}],operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},i.languages.objectivec=i.languages.extend("c",{keyword:/\b(?:asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while|in|self|super)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,string:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|@"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,operator:/-[->]?|\+\+?|!=?|<>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete i.languages.objectivec["class-name"],i.languages.ocaml={comment:/\(\*[\s\S]*?\*\)/,string:[{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},{pattern:/(['`])(?:\\(?:\d+|x[\da-f]+|.)|(?!\1)[^\\\r\n])\1/i,greedy:!0}],number:/\b(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,type:{pattern:/\B['`]\w*/,alias:"variable"},directive:{pattern:/\B#\w+/,alias:"function"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|object|of|open|prefix|private|rec|then|sig|struct|to|try|type|val|value|virtual|where|while|with)\b/,boolean:/\b(?:false|true)\b/,operator:/:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lxor|lsl|lsr|mod|nor|or)\b/,punctuation:/[(){}\[\]|_.,:;]/},i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/i,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},i.languages.python["string-interpolation"].inside.interpolation.inside.rest=i.languages.python,i.languages.py=i.languages.python,i.languages.reason=i.languages.extend("clike",{comment:{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:mod|land|lor|lxor|lsl|lsr|asr)\b/}),i.languages.insertBefore("reason","class-name",{character:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,alias:"string"},constructor:{pattern:/\b[A-Z]\w*\b(?!\s*\.)/,alias:"variable"},label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete i.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t]+.+)*/m,lookbehind:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,inside:{atrule:/(?:@[\w-]+|[+=])/m}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|or|not)\b/,{pattern:/(\s+)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s]+.*)/m,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/([ \t]*)\S(?:,?[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,?[^,\r\n]+)*)*/,lookbehind:!0}})}(i),i.languages.scss=i.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()]|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}]+[:{][^}]+))/m,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[\w-]|\$[-\w]+|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),i.languages.insertBefore("scss","atrule",{keyword:[/@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i,{pattern:/( +)(?:from|through)(?= )/,lookbehind:!0}]}),i.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),i.languages.insertBefore("scss","function",{placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:true|false)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/,lookbehind:!0}}),i.languages.scss.atrule.inside.rest=i.languages.scss,i.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:TRUE|FALSE|NULL)\b/i,number:/\b0x[\da-f]+\b|\b\d+\.?\d*|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t={url:/url\((["']?).*?\1\)/i,string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:if|else|for|return|unless)(?=\s+|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,number:/\b\d+(?:\.\d+)?%?/,boolean:/\b(?:true|false)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.+|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],punctuation:/[{}()\[\];:,]/};t.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^{|}$/,alias:"punctuation"},rest:t}},t.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:t}},e.languages.stylus={comment:{pattern:/(^|[^\\])(\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},"atrule-declaration":{pattern:/(^\s*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:t}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:(?:\{[^}]*\}|.+)|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:t}},statement:{pattern:/(^[ \t]*)(?:if|else|for|return|unless)[ \t]+.+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:t}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)[^{\r\n]*(?:;|[^{\r\n,](?=$)(?!(\r?\n|\r)(?:\{|\2[ \t]+)))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:t.interpolation}},rest:t}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\))?|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t]+)))/m,lookbehind:!0,inside:{interpolation:t.interpolation,punctuation:/[{},]/}},func:t.func,string:t.string,interpolation:t.interpolation,punctuation:/[{}()\[\];:.]/}}(i);var l=i.util.clone(i.languages.typescript);i.languages.tsx=i.languages.extend("jsx",l),i.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^_`|~]+/i,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/},i.languages.yaml={scalar:{pattern:/([\-:]\s*(?:![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/,lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:/(\s*(?:^|[:\-,[{\r\n?])[ \t]*(?:![^\s]+)?[ \t]*)[^\r\n{[\]},#\s]+?(?=\s*:\s)/,lookbehind:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?)?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?)(?=[ \t]*(?:$|,|]|}))/m,lookbehind:!0,alias:"number"},boolean:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:true|false)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},null:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)(?:null|~)[ \t]*(?=$|,|]|})/im,lookbehind:!0,alias:"important"},string:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)("|')(?:(?!\2)[^\\\r\n]|\\.)*\2(?=[ \t]*(?:$|,|]|}|\s*#))/m,lookbehind:!0,greedy:!0},number:{pattern:/([:\-,[{]\s*(?:![^\s]+)?[ \t]*)[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im,lookbehind:!0},tag:/![^\s]+/,important:/[&*][\w]+/,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},i.languages.yml=i.languages.yaml,t.a=i},function(e,t,n){"use strict";var r=n(0),o=n.n(r),a=n(33);t.a=function(e){return o.a.createElement(a.a,Object.assign({},e))}},function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(39)},function(e,t,n){"use strict";var r=n(8);t.a=r.b},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";e.exports=n(45)},function(e){e.exports=JSON.parse('{"docusaurus-plugin-content-docs":{"default":{"path":"/docs","versions":[{"name":"current","label":"Next","isLast":true,"path":"/docs","mainDocId":"introduce","docs":[{"id":"answer","path":"/docs/answer","sidebar":"docs"},{"id":"appstartup","path":"/docs/appstartup","sidebar":"docs"},{"id":"auth-control","path":"/docs/auth-control","sidebar":"docs"},{"id":"author","path":"/docs/author","sidebar":"docs"},{"id":"benchmark","path":"/docs/benchmark","sidebar":"docs"},{"id":"cache","path":"/docs/cache","sidebar":"docs"},{"id":"configuration","path":"/docs/configuration","sidebar":"docs"},{"id":"contribute","path":"/docs/contribute","sidebar":"docs"},{"id":"cooperate","path":"/docs/cooperate","sidebar":"docs"},{"id":"cors","path":"/docs/cors","sidebar":"docs"},{"id":"dapper","path":"/docs/dapper","sidebar":"docs"},{"id":"data-validation","path":"/docs/data-validation","sidebar":"docs"},{"id":"dbcontext","path":"/docs/dbcontext","sidebar":"docs"},{"id":"dbcontext-add","path":"/docs/dbcontext-add","sidebar":"docs"},{"id":"dbcontext-add-or-update","path":"/docs/dbcontext-add-or-update","sidebar":"docs"},{"id":"dbcontext-audit","path":"/docs/dbcontext-audit","sidebar":"docs"},{"id":"dbcontext-batch","path":"/docs/dbcontext-batch","sidebar":"docs"},{"id":"dbcontext-code-first","path":"/docs/dbcontext-code-first","sidebar":"docs"},{"id":"dbcontext-db-first","path":"/docs/dbcontext-db-first","sidebar":"docs"},{"id":"dbcontext-delete","path":"/docs/dbcontext-delete","sidebar":"docs"},{"id":"dbcontext-entitytrigger","path":"/docs/dbcontext-entitytrigger","sidebar":"docs"},{"id":"dbcontext-filter","path":"/docs/dbcontext-filter","sidebar":"docs"},{"id":"dbcontext-function","path":"/docs/dbcontext-function","sidebar":"docs"},{"id":"dbcontext-hight-query","path":"/docs/dbcontext-hight-query","sidebar":"docs"},{"id":"dbcontext-Interceptor","path":"/docs/dbcontext-Interceptor","sidebar":"docs"},{"id":"dbcontext-locator","path":"/docs/dbcontext-locator","sidebar":"docs"},{"id":"dbcontext-multi-database","path":"/docs/dbcontext-multi-database","sidebar":"docs"},{"id":"dbcontext-proc","path":"/docs/dbcontext-proc","sidebar":"docs"},{"id":"dbcontext-query","path":"/docs/dbcontext-query","sidebar":"docs"},{"id":"dbcontext-read-write","path":"/docs/dbcontext-read-write","sidebar":"docs"},{"id":"dbcontext-repository","path":"/docs/dbcontext-repository","sidebar":"docs"},{"id":"dbcontext-seed-data","path":"/docs/dbcontext-seed-data","sidebar":"docs"},{"id":"dbcontext-sql","path":"/docs/dbcontext-sql","sidebar":"docs"},{"id":"dbcontext-sql-proxy","path":"/docs/dbcontext-sql-proxy","sidebar":"docs"},{"id":"dbcontext-sql-template","path":"/docs/dbcontext-sql-template","sidebar":"docs"},{"id":"dbcontext-update","path":"/docs/dbcontext-update","sidebar":"docs"},{"id":"dbcontext-view","path":"/docs/dbcontext-view","sidebar":"docs"},{"id":"dependency-injection","path":"/docs/dependency-injection","sidebar":"docs"},{"id":"deploy-docker","path":"/docs/deploy-docker","sidebar":"docs"},{"id":"deploy-iis","path":"/docs/deploy-iis","sidebar":"docs"},{"id":"deploy-nginx","path":"/docs/deploy-nginx","sidebar":"docs"},{"id":"devops","path":"/docs/devops","sidebar":"docs"},{"id":"donate","path":"/docs/donate","sidebar":"docs"},{"id":"dynamic-api-controller","path":"/docs/dynamic-api-controller","sidebar":"docs"},{"id":"encryption","path":"/docs/encryption","sidebar":"docs"},{"id":"entity","path":"/docs/entity","sidebar":"docs"},{"id":"errors","path":"/docs/errors","sidebar":"docs"},{"id":"event-bus","path":"/docs/event-bus","sidebar":"docs"},{"id":"friendly-exception","path":"/docs/friendly-exception","sidebar":"docs"},{"id":"get-start","path":"/docs/get-start","sidebar":"docs"},{"id":"global/app","path":"/docs/global/app","sidebar":"global"},{"id":"global/datavalidator","path":"/docs/global/datavalidator","sidebar":"global"},{"id":"global/db","path":"/docs/global/db","sidebar":"global"},{"id":"global/jsonserializer","path":"/docs/global/jsonserializer","sidebar":"global"},{"id":"global/l","path":"/docs/global/l","sidebar":"global"},{"id":"global/linqexpression","path":"/docs/global/linqexpression","sidebar":"global"},{"id":"global/messagecenter","path":"/docs/global/messagecenter","sidebar":"global"},{"id":"global/oops","path":"/docs/global/oops","sidebar":"global"},{"id":"global/shttp","path":"/docs/global/shttp","sidebar":"global"},{"id":"gooduse","path":"/docs/gooduse","sidebar":"docs"},{"id":"grpc","path":"/docs/grpc","sidebar":"docs"},{"id":"http","path":"/docs/http","sidebar":"docs"},{"id":"introduce","path":"/docs/","sidebar":"docs"},{"id":"job","path":"/docs/job","sidebar":"docs"},{"id":"local-language","path":"/docs/local-language","sidebar":"docs"},{"id":"logging","path":"/docs/logging","sidebar":"docs"},{"id":"object-mapper","path":"/docs/object-mapper","sidebar":"docs"},{"id":"options","path":"/docs/options","sidebar":"docs"},{"id":"performance","path":"/docs/performance","sidebar":"docs"},{"id":"process-service","path":"/docs/process-service","sidebar":"docs"},{"id":"reference","path":"/docs/reference","sidebar":"docs"},{"id":"saas","path":"/docs/saas","sidebar":"docs"},{"id":"settings/appsettings","path":"/docs/settings/appsettings","sidebar":"settings"},{"id":"settings/corsaccessorsettings","path":"/docs/settings/corsaccessorsettings","sidebar":"settings"},{"id":"settings/dependencyinjectionsettings","path":"/docs/settings/dependencyinjectionsettings","sidebar":"settings"},{"id":"settings/dynamicapicontrollersettings","path":"/docs/settings/dynamicapicontrollersettings","sidebar":"settings"},{"id":"settings/friendlyexceptionsettings","path":"/docs/settings/friendlyexceptionsettings","sidebar":"settings"},{"id":"settings/localizationsettings","path":"/docs/settings/localizationsettings","sidebar":"settings"},{"id":"settings/specificationdocumentsettings","path":"/docs/settings/specificationdocumentsettings","sidebar":"settings"},{"id":"settings/validationTypemessagesettings","path":"/docs/settings/validationTypemessagesettings","sidebar":"settings"},{"id":"signalr","path":"/docs/signalr","sidebar":"docs"},{"id":"source","path":"/docs/source","sidebar":"docs"},{"id":"specification-document","path":"/docs/specification-document","sidebar":"docs"},{"id":"split-db","path":"/docs/split-db","sidebar":"docs"},{"id":"sqlsugar","path":"/docs/sqlsugar","sidebar":"docs"},{"id":"template","path":"/docs/template","sidebar":"docs"},{"id":"tran","path":"/docs/tran","sidebar":"docs"},{"id":"unittest","path":"/docs/unittest","sidebar":"docs"},{"id":"view-engine","path":"/docs/view-engine","sidebar":"docs"},{"id":"virtual-deploy","path":"/docs/virtual-deploy","sidebar":"docs"}]}]}}}')},function(e){e.exports=JSON.parse('{"defaultLocale":"en","locales":["en"],"localeConfigs":{"en":{"label":"en"}},"currentLocale":"en"}')},function(e){e.exports=JSON.parse("{}")},function(e){e.exports=JSON.parse('{"docusaurusVersion":"2.0.0-alpha.70","siteVersion":"1.0.0","pluginVersions":{"docusaurus-plugin-content-docs":{"type":"package","name":"@docusaurus/plugin-content-docs","version":"2.0.0-alpha.70"},"docusaurus-plugin-content-blog":{"type":"package","name":"@docusaurus/plugin-content-blog","version":"2.0.0-alpha.70"},"docusaurus-plugin-content-pages":{"type":"package","name":"@docusaurus/plugin-content-pages","version":"2.0.0-alpha.70"},"docusaurus-plugin-sitemap":{"type":"package","name":"@docusaurus/plugin-sitemap","version":"2.0.0-alpha.70"},"docusaurus-theme-classic":{"type":"package","name":"@docusaurus/theme-classic","version":"2.0.0-alpha.70"},"docusaurus-theme-search-algolia":{"type":"package","name":"@docusaurus/theme-search-algolia","version":"2.0.0-alpha.70"}}}')},function(e,t,n){"use strict";var r=n(27),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=p(n);o&&o!==m&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n},G=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},V=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!1===t?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},K=function(e){var t=J(e,E.TITLE),n=J(e,j);if(n&&t)return n.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var r=J(e,_);return t||r||void 0},Y=function(e){return J(e,D)||function(){}},Q=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return W({},e,t)}),{})},X=function(e,t){return t.filter((function(e){return void 0!==e[E.BASE]})).map((function(e){return e[E.BASE]})).reverse().reduce((function(t,n){if(!t.length)for(var r=Object.keys(n),o=0;o=0;n--){var r=e[n];if(r.hasOwnProperty(t))return r[t]}return null},ee=(r=Date.now(),function(e){var t=Date.now();t-r>16?(r=t,e(t)):setTimeout((function(){ee(e)}),0)}),te=function(e){return clearTimeout(e)},ne="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||ee:e.requestAnimationFrame||ee,re="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||te:e.cancelAnimationFrame||te,oe=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},ae=null,ie=function(e,t){var n=e.baseTag,r=e.bodyAttributes,o=e.htmlAttributes,a=e.linkTags,i=e.metaTags,l=e.noscriptTags,s=e.onChangeClientState,c=e.scriptTags,u=e.styleTags,d=e.title,f=e.titleAttributes;ce(E.BODY,r),ce(E.HTML,o),se(d,f);var p={baseTag:ue(E.BASE,n),linkTags:ue(E.LINK,a),metaTags:ue(E.META,i),noscriptTags:ue(E.NOSCRIPT,l),scriptTags:ue(E.SCRIPT,c),styleTags:ue(E.STYLE,u)},m={},h={};Object.keys(p).forEach((function(e){var t=p[e],n=t.newTags,r=t.oldTags;n.length&&(m[e]=n),r.length&&(h[e]=p[e].oldTags)})),t&&t(),s(e,m,h)},le=function(e){return Array.isArray(e)?e.join(""):e},se=function(e,t){void 0!==e&&document.title!==e&&(document.title=le(e)),ce(E.TITLE,t)},ce=function(e,t){var n=document.getElementsByTagName(e)[0];if(n){for(var r=n.getAttribute(B),o=r?r.split(","):[],a=[].concat(o),i=Object.keys(t),l=0;l=0;d--)n.removeAttribute(a[d]);o.length===a.length?n.removeAttribute(B):n.getAttribute(B)!==i.join(",")&&n.setAttribute(B,i.join(","))}},ue=function(e,t){var n=document.head||document.querySelector(E.HEAD),r=n.querySelectorAll(e+"["+"data-react-helmet]"),o=Array.prototype.slice.call(r),a=[],i=void 0;return t&&t.length&&t.forEach((function(t){var n=document.createElement(e);for(var r in t)if(t.hasOwnProperty(r))if(r===S)n.innerHTML=t.innerHTML;else if(r===x)n.styleSheet?n.styleSheet.cssText=t.cssText:n.appendChild(document.createTextNode(t.cssText));else{var l=void 0===t[r]?"":t[r];n.setAttribute(r,l)}n.setAttribute(B,"true"),o.some((function(e,t){return i=t,n.isEqualNode(e)}))?o.splice(i,1):a.push(n)})),o.forEach((function(e){return e.parentNode.removeChild(e)})),a.forEach((function(e){return n.appendChild(e)})),{oldTags:o,newTags:a}},de=function(e){return Object.keys(e).reduce((function(t,n){var r=void 0!==e[n]?n+'="'+e[n]+'"':""+n;return t?t+" "+r:r}),"")},fe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[I[n]||n]=e[n],t}),t)},pe=function(e,t,n){switch(e){case E.TITLE:return{toComponent:function(){return e=t.title,n=t.titleAttributes,(r={key:e})[B]=!0,o=fe(n,r),[m.a.createElement(E.TITLE,o,e)];var e,n,r,o},toString:function(){return function(e,t,n,r){var o=de(n),a=le(t);return o?"<"+e+' data-react-helmet="true" '+o+">"+V(a,r)+"":"<"+e+' data-react-helmet="true">'+V(a,r)+""}(e,t.title,t.titleAttributes,n)}};case b:case y:return{toComponent:function(){return fe(t)},toString:function(){return de(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,n){var r,o=((r={key:n})[B]=!0,r);return Object.keys(t).forEach((function(e){var n=I[e]||e;if(n===S||n===x){var r=t.innerHTML||t.cssText;o.dangerouslySetInnerHTML={__html:r}}else o[n]=t[e]})),m.a.createElement(e,o)}))}(e,t)},toString:function(){return function(e,t,n){return t.reduce((function(t,r){var o=Object.keys(r).filter((function(e){return!(e===S||e===x)})).reduce((function(e,t){var o=void 0===r[t]?t:t+'="'+V(r[t],n)+'"';return e?e+" "+o:o}),""),a=r.innerHTML||r.cssText||"",i=-1===U.indexOf(e);return t+"<"+e+' data-react-helmet="true" '+o+(i?"/>":">"+a+"")}),"")}(e,t,n)}}}},me=function(e){var t=e.baseTag,n=e.bodyAttributes,r=e.encode,o=e.htmlAttributes,a=e.linkTags,i=e.metaTags,l=e.noscriptTags,s=e.scriptTags,c=e.styleTags,u=e.title,d=void 0===u?"":u,f=e.titleAttributes;return{base:pe(E.BASE,t,r),bodyAttributes:pe(b,n,r),htmlAttributes:pe(y,o,r),link:pe(E.LINK,a,r),meta:pe(E.META,i,r),noscript:pe(E.NOSCRIPT,l,r),script:pe(E.SCRIPT,s,r),style:pe(E.STYLE,c,r),title:pe(E.TITLE,{title:d,titleAttributes:f},r)}},he=u()((function(e){return{baseTag:X([T,R],e),bodyAttributes:Q(b,e),defer:J(e,L),encode:J(e,F),htmlAttributes:Q(y,e),linkTags:Z(E.LINK,[A,T],e),metaTags:Z(E.META,[C,w,k,P,O],e),noscriptTags:Z(E.NOSCRIPT,[S],e),onChangeClientState:Y(e),scriptTags:Z(E.SCRIPT,[N,S],e),styleTags:Z(E.STYLE,[x],e),title:K(e),titleAttributes:Q(v,e)}}),(function(e){ae&&re(ae),e.defer?ae=ne((function(){ie(e,(function(){ae=null}))})):(ie(e),ae=null)}),me)((function(){return null})),ge=(o=he,i=a=function(e){function t(){return $(this,t),G(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.shouldComponentUpdate=function(e){return!f()(this.props,e)},t.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case E.SCRIPT:case E.NOSCRIPT:return{innerHTML:t};case E.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,n=e.child,r=e.arrayTypeChildren,o=e.newChildProps,a=e.nestedChildren;return W({},r,((t={})[n.type]=[].concat(r[n.type]||[],[W({},o,this.mapNestedChildrenToProps(n,a))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,n,r=e.child,o=e.newProps,a=e.newChildProps,i=e.nestedChildren;switch(r.type){case E.TITLE:return W({},o,((t={})[r.type]=i,t.titleAttributes=W({},a),t));case E.BODY:return W({},o,{bodyAttributes:W({},a)});case E.HTML:return W({},o,{htmlAttributes:W({},a)})}return W({},o,((n={})[r.type]=W({},a),n))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var n=W({},t);return Object.keys(e).forEach((function(t){var r;n=W({},n,((r={})[t]=e[t],r))})),n},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var n=this,r={};return m.a.Children.forEach(e,(function(e){if(e&&e.props){var o=e.props,a=o.children,i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,n){return t[M[n]||n]=e[n],t}),t)}(q(o,["children"]));switch(n.warnOnInvalidChildren(e,a),e.type){case E.LINK:case E.META:case E.NOSCRIPT:case E.SCRIPT:case E.STYLE:r=n.flattenArrayTypeChildren({child:e,arrayTypeChildren:r,newChildProps:i,nestedChildren:a});break;default:t=n.mapObjectTypeChildren({child:e,newProps:t,newChildProps:i,nestedChildren:a})}}})),t=this.mapArrayTypeChildrenToProps(r,t)},t.prototype.render=function(){var e=this.props,t=e.children,n=q(e,["children"]),r=W({},n);return t&&(r=this.mapChildrenToProps(t,r)),m.a.createElement(o,r)},H(t,null,[{key:"canUseDOM",set:function(e){o.canUseDOM=e}}]),t}(m.a.Component),a.propTypes={base:s.a.object,bodyAttributes:s.a.object,children:s.a.oneOfType([s.a.arrayOf(s.a.node),s.a.node]),defaultTitle:s.a.string,defer:s.a.bool,encodeSpecialCharacters:s.a.bool,htmlAttributes:s.a.object,link:s.a.arrayOf(s.a.object),meta:s.a.arrayOf(s.a.object),noscript:s.a.arrayOf(s.a.object),onChangeClientState:s.a.func,script:s.a.arrayOf(s.a.object),style:s.a.arrayOf(s.a.object),title:s.a.string,titleAttributes:s.a.object,titleTemplate:s.a.string},a.defaultProps={defer:!0,encodeSpecialCharacters:!0},a.peek=o.peek,a.rewind=function(){var e=o.rewind();return e||(e=me({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},i);ge.renderStatic=ge.rewind}).call(this,n(26))},function(e,t,n){"use strict";var r,o=n(0),a=(r=o)&&"object"==typeof r&&"default"in r?r.default:r;function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,n){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==n&&"function"!=typeof n)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(r){if("function"!=typeof r)throw new Error("Expected WrappedComponent to be a React component.");var s,c=[];function u(){s=e(c.map((function(e){return e.props}))),d.canUseDOM?t(s):n&&(s=n(s))}var d=function(e){var t,n;function o(){return e.apply(this,arguments)||this}n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,o.peek=function(){return s},o.rewind=function(){if(o.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=s;return s=void 0,c=[],e};var i=o.prototype;return i.UNSAFE_componentWillMount=function(){c.push(this),u()},i.componentDidUpdate=function(){u()},i.componentWillUnmount=function(){var e=c.indexOf(this);c.splice(e,1),u()},i.render=function(){return a.createElement(r,this.props)},o}(o.PureComponent);return i(d,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(r)+")"),i(d,"canUseDOM",l),d}}},function(e,t){var n="undefined"!=typeof Element,r="function"==typeof Map,o="function"==typeof Set,a="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;var l,s,c,u;if(Array.isArray(e)){if((l=e.length)!=t.length)return!1;for(s=l;0!=s--;)if(!i(e[s],t[s]))return!1;return!0}if(r&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(u=e.entries();!(s=u.next()).done;)if(!t.has(s.value[0]))return!1;for(u=e.entries();!(s=u.next()).done;)if(!i(s.value[1],t.get(s.value[0])))return!1;return!0}if(o&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(u=e.entries();!(s=u.next()).done;)if(!t.has(s.value[0]))return!1;return!0}if(a&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if((l=e.length)!=t.length)return!1;for(s=l;0!=s--;)if(e[s]!==t[s])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();if((l=(c=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(s=l;0!=s--;)if(!Object.prototype.hasOwnProperty.call(t,c[s]))return!1;if(n&&e instanceof Element)return!1;for(s=l;0!=s--;)if(("_owner"!==c[s]&&"__v"!==c[s]&&"__o"!==c[s]||!e.$$typeof)&&!i(e[c[s]],t[c[s]]))return!1;return!0}return e!=e&&t!=t}e.exports=function(e,t){try{return i(e,t)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}}},,function(e,t,n){e.exports=n(53)},function(e,t,n){"use strict";var r=n(12),o="function"==typeof Symbol&&Symbol.for,a=o?Symbol.for("react.element"):60103,i=o?Symbol.for("react.portal"):60106,l=o?Symbol.for("react.fragment"):60107,s=o?Symbol.for("react.strict_mode"):60108,c=o?Symbol.for("react.profiler"):60114,u=o?Symbol.for("react.provider"):60109,d=o?Symbol.for("react.context"):60110,f=o?Symbol.for("react.forward_ref"):60112,p=o?Symbol.for("react.suspense"):60113,m=o?Symbol.for("react.memo"):60115,h=o?Symbol.for("react.lazy"):60116,g="function"==typeof Symbol&&Symbol.iterator;function b(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nN.length&&N.push(e)}function _(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l=!1;if(null===e)l=!0;else switch(o){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case a:case i:l=!0}}if(l)return n(r,e,""===t?"."+F(e,0):t),1;if(l=0,t=""===t?".":t+":",Array.isArray(e))for(var s=0;s