From 325d9e68db6fd7eabd2c4c7a854058ec0f7b0e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BE=E5=B0=8F=E5=83=A7?= Date: Wed, 30 Sep 2020 10:56:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=A9=20fixed=20docker=20image.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 2 +- README.md | 2 +- docs/{3ab56fdf.4296d098.js => 3ab56fdf.37521fc4.js} | 2 +- docs/404.html | 4 ++-- docs/{4c30b939.03c1dd5e.js => 4c30b939.d13a14dd.js} | 2 +- docs/blog/index.html | 4 ++-- docs/blog/tags/fur/index.html | 4 ++-- docs/blog/tags/furos/index.html | 4 ++-- docs/blog/tags/index.html | 4 ++-- docs/blog/tags/net-5/index.html | 4 ++-- docs/blog/tags/net/index.html | 4 ++-- docs/blog/tags/netcore/index.html | 4 ++-- docs/blog/welcome/index.html | 10 +++++----- docs/docs/aop/index.html | 4 ++-- docs/docs/auth-control/index.html | 4 ++-- docs/docs/author/index.html | 4 ++-- docs/docs/cache/index.html | 4 ++-- docs/docs/configuration/index.html | 4 ++-- docs/docs/contribute/index.html | 4 ++-- docs/docs/cors/index.html | 4 ++-- docs/docs/data-validation/index.html | 4 ++-- docs/docs/dbcontext-Interceptor/index.html | 4 ++-- docs/docs/dbcontext-add-or-update/index.html | 4 ++-- docs/docs/dbcontext-add/index.html | 4 ++-- docs/docs/dbcontext-audit/index.html | 4 ++-- docs/docs/dbcontext-batch/index.html | 4 ++-- docs/docs/dbcontext-code-first/index.html | 4 ++-- docs/docs/dbcontext-db-first/index.html | 4 ++-- docs/docs/dbcontext-delete/index.html | 4 ++-- docs/docs/dbcontext-filter/index.html | 4 ++-- docs/docs/dbcontext-function/index.html | 4 ++-- docs/docs/dbcontext-hight-query/index.html | 4 ++-- docs/docs/dbcontext-locator/index.html | 4 ++-- docs/docs/dbcontext-multi-database/index.html | 4 ++-- docs/docs/dbcontext-proc/index.html | 4 ++-- docs/docs/dbcontext-query/index.html | 4 ++-- docs/docs/dbcontext-read-write/index.html | 4 ++-- docs/docs/dbcontext-repository/index.html | 4 ++-- docs/docs/dbcontext-seed-data/index.html | 4 ++-- docs/docs/dbcontext-sql-proxy/index.html | 4 ++-- docs/docs/dbcontext-sql/index.html | 4 ++-- docs/docs/dbcontext-update/index.html | 4 ++-- docs/docs/dbcontext-view/index.html | 4 ++-- docs/docs/dbcontext/index.html | 4 ++-- docs/docs/dependency-injection/index.html | 4 ++-- docs/docs/deploy/index.html | 4 ++-- docs/docs/devops/index.html | 4 ++-- docs/docs/dynamic-api-controller/index.html | 4 ++-- docs/docs/entity/index.html | 4 ++-- docs/docs/event-bus/index.html | 4 ++-- docs/docs/friendly-exception/index.html | 4 ++-- docs/docs/get-start/index.html | 4 ++-- docs/docs/index.html | 10 +++++----- docs/docs/job/index.html | 4 ++-- docs/docs/local-language/index.html | 4 ++-- docs/docs/logging/index.html | 4 ++-- docs/docs/object-mapper/index.html | 4 ++-- docs/docs/options/index.html | 4 ++-- docs/docs/performance/index.html | 4 ++-- docs/docs/process-service/index.html | 4 ++-- docs/docs/saas/index.html | 4 ++-- docs/docs/signalr/index.html | 4 ++-- docs/docs/source/index.html | 4 ++-- docs/docs/specification-document/index.html | 4 ++-- docs/docs/split-db/index.html | 4 ++-- docs/docs/tran/index.html | 4 ++-- docs/docs/unittest/index.html | 4 ++-- docs/docs/view-engine/index.html | 4 ++-- docs/index.html | 4 ++-- .../runtime~main.84a0866b.js | 2 +- handbook/blog/2020-08-19-welcome.mdx | 2 +- .../{3ab56fdf.4296d098.js => 3ab56fdf.37521fc4.js} | 2 +- handbook/build/404.html | 4 ++-- .../{4c30b939.03c1dd5e.js => 4c30b939.d13a14dd.js} | 2 +- handbook/build/blog/index.html | 4 ++-- handbook/build/blog/tags/fur/index.html | 4 ++-- handbook/build/blog/tags/furos/index.html | 4 ++-- handbook/build/blog/tags/index.html | 4 ++-- handbook/build/blog/tags/net-5/index.html | 4 ++-- handbook/build/blog/tags/net/index.html | 4 ++-- handbook/build/blog/tags/netcore/index.html | 4 ++-- handbook/build/blog/welcome/index.html | 10 +++++----- handbook/build/docs/aop/index.html | 4 ++-- handbook/build/docs/auth-control/index.html | 4 ++-- handbook/build/docs/author/index.html | 4 ++-- handbook/build/docs/cache/index.html | 4 ++-- handbook/build/docs/configuration/index.html | 4 ++-- handbook/build/docs/contribute/index.html | 4 ++-- handbook/build/docs/cors/index.html | 4 ++-- handbook/build/docs/data-validation/index.html | 4 ++-- handbook/build/docs/dbcontext-Interceptor/index.html | 4 ++-- handbook/build/docs/dbcontext-add-or-update/index.html | 4 ++-- handbook/build/docs/dbcontext-add/index.html | 4 ++-- handbook/build/docs/dbcontext-audit/index.html | 4 ++-- handbook/build/docs/dbcontext-batch/index.html | 4 ++-- handbook/build/docs/dbcontext-code-first/index.html | 4 ++-- handbook/build/docs/dbcontext-db-first/index.html | 4 ++-- handbook/build/docs/dbcontext-delete/index.html | 4 ++-- handbook/build/docs/dbcontext-filter/index.html | 4 ++-- handbook/build/docs/dbcontext-function/index.html | 4 ++-- handbook/build/docs/dbcontext-hight-query/index.html | 4 ++-- handbook/build/docs/dbcontext-locator/index.html | 4 ++-- .../build/docs/dbcontext-multi-database/index.html | 4 ++-- handbook/build/docs/dbcontext-proc/index.html | 4 ++-- handbook/build/docs/dbcontext-query/index.html | 4 ++-- handbook/build/docs/dbcontext-read-write/index.html | 4 ++-- handbook/build/docs/dbcontext-repository/index.html | 4 ++-- handbook/build/docs/dbcontext-seed-data/index.html | 4 ++-- handbook/build/docs/dbcontext-sql-proxy/index.html | 4 ++-- handbook/build/docs/dbcontext-sql/index.html | 4 ++-- handbook/build/docs/dbcontext-update/index.html | 4 ++-- handbook/build/docs/dbcontext-view/index.html | 4 ++-- handbook/build/docs/dbcontext/index.html | 4 ++-- handbook/build/docs/dependency-injection/index.html | 4 ++-- handbook/build/docs/deploy/index.html | 4 ++-- handbook/build/docs/devops/index.html | 4 ++-- handbook/build/docs/dynamic-api-controller/index.html | 4 ++-- handbook/build/docs/entity/index.html | 4 ++-- handbook/build/docs/event-bus/index.html | 4 ++-- handbook/build/docs/friendly-exception/index.html | 4 ++-- handbook/build/docs/get-start/index.html | 4 ++-- handbook/build/docs/index.html | 10 +++++----- handbook/build/docs/job/index.html | 4 ++-- handbook/build/docs/local-language/index.html | 4 ++-- handbook/build/docs/logging/index.html | 4 ++-- handbook/build/docs/object-mapper/index.html | 4 ++-- handbook/build/docs/options/index.html | 4 ++-- handbook/build/docs/performance/index.html | 4 ++-- handbook/build/docs/process-service/index.html | 4 ++-- handbook/build/docs/saas/index.html | 4 ++-- handbook/build/docs/signalr/index.html | 4 ++-- handbook/build/docs/source/index.html | 4 ++-- handbook/build/docs/specification-document/index.html | 4 ++-- handbook/build/docs/split-db/index.html | 4 ++-- handbook/build/docs/tran/index.html | 4 ++-- handbook/build/docs/unittest/index.html | 4 ++-- handbook/build/docs/view-engine/index.html | 4 ++-- handbook/build/index.html | 4 ++-- .../build/runtime~main.84a0866b.js | 2 +- handbook/docs/introduce.mdx | 2 +- 140 files changed, 282 insertions(+), 282 deletions(-) rename docs/{3ab56fdf.4296d098.js => 3ab56fdf.37521fc4.js} (99%) rename docs/{4c30b939.03c1dd5e.js => 4c30b939.d13a14dd.js} (99%) rename handbook/build/runtime~main.f7abd164.js => docs/runtime~main.84a0866b.js (97%) rename handbook/build/{3ab56fdf.4296d098.js => 3ab56fdf.37521fc4.js} (99%) rename handbook/build/{4c30b939.03c1dd5e.js => 4c30b939.d13a14dd.js} (99%) rename docs/runtime~main.f7abd164.js => handbook/build/runtime~main.84a0866b.js (97%) diff --git a/README.en.md b/README.en.md index ee41bd3502c..9b2f469c836 100644 --- a/README.en.md +++ b/README.en.md @@ -76,7 +76,7 @@ ## 🍿 Docker 镜像 ```shell -docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.09.30 +docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.10.01 ``` ## 🥞 架构设计 diff --git a/README.md b/README.md index ee41bd3502c..9b2f469c836 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ ## 🍿 Docker 镜像 ```shell -docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.09.30 +docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.10.01 ``` ## 🥞 架构设计 diff --git a/docs/3ab56fdf.4296d098.js b/docs/3ab56fdf.37521fc4.js similarity index 99% rename from docs/3ab56fdf.4296d098.js rename to docs/3ab56fdf.37521fc4.js index 334c6728ce8..c0c614e4938 100644 --- a/docs/3ab56fdf.4296d098.js +++ b/docs/3ab56fdf.37521fc4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{135:function(e,t,a){"use strict";a.d(t,"a",(function(){return u})),a.d(t,"b",(function(){return j}));var n=a(0),r=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 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 i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},O={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=o(a),m=n,j=u["".concat(c,".").concat(m)]||u[m]||O[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},76:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return u}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={slug:"welcome",title:"Fur \u4ecb\u7ecd",author:"dotnet\u4e2d\u56fd",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://chinadot.net",author_image_url:"https://img04.sogoucdn.com/app/a/100520146/AFA3DBD8507E7753D93A155720F37B25",tags:["fur","furos",".net",".netcore",".net5"]},l={permalink:"/blog/welcome",editUrl:"https://gitee.com/monksoul/Fur/tree/main/handbook/blog/2020-08-19-welcome.mdx",source:"@site/blog\\2020-08-19-welcome.mdx",description:"=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},O={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=o(a),m=n,j=u["".concat(c,".").concat(m)]||u[m]||O[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},76:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return u}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={slug:"welcome",title:"Fur \u4ecb\u7ecd",author:"dotnet\u4e2d\u56fd",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://chinadot.net",author_image_url:"https://img04.sogoucdn.com/app/a/100520146/AFA3DBD8507E7753D93A155720F37B25",tags:["fur","furos",".net",".netcore",".net5"]},l={permalink:"/blog/welcome",editUrl:"https://gitee.com/monksoul/Fur/tree/main/handbook/blog/2020-08-19-welcome.mdx",source:"@site/blog\\2020-08-19-welcome.mdx",description:" Page Not Found | Fur - +

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/4c30b939.03c1dd5e.js b/docs/4c30b939.d13a14dd.js similarity index 99% rename from docs/4c30b939.03c1dd5e.js rename to docs/4c30b939.d13a14dd.js index 281676779a8..2becc900b4d 100644 --- a/docs/4c30b939.03c1dd5e.js +++ b/docs/4c30b939.d13a14dd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{135:function(e,t,a){"use strict";a.d(t,"a",(function(){return O})),a.d(t,"b",(function(){return j}));var n=a(0),r=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 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 i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},O=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},u={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),O=o(a),m=n,j=O["".concat(c,".").concat(m)]||O[m]||u[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},81:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return O}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={id:"introduce",title:"1.1 \u4ecb\u7ecd",sidebar_label:"1.1 \u4ecb\u7ecd",slug:"/"},l={unversionedId:"introduce",id:"introduce",isDocsHomePage:!1,title:"1.1 \u4ecb\u7ecd",description:"=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},O=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},u={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),O=o(a),m=n,j=O["".concat(c,".").concat(m)]||O[m]||u[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},81:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return O}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={id:"introduce",title:"1.1 \u4ecb\u7ecd",sidebar_label:"1.1 \u4ecb\u7ecd",slug:"/"},l={unversionedId:"introduce",id:"introduce",isDocsHomePage:!1,title:"1.1 \u4ecb\u7ecd",description:" Blog | Fur - + @@ -25,7 +25,7 @@

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/docs/blog/tags/fur/index.html b/docs/blog/tags/fur/index.html index 3f3f338fed1..5acf200a6b6 100644 --- a/docs/blog/tags/fur/index.html +++ b/docs/blog/tags/fur/index.html @@ -6,7 +6,7 @@ Posts tagged "fur" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with "fur"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/docs/blog/tags/furos/index.html b/docs/blog/tags/furos/index.html index e27e2ab2574..db7516335c6 100644 --- a/docs/blog/tags/furos/index.html +++ b/docs/blog/tags/furos/index.html @@ -6,7 +6,7 @@ Posts tagged "furos" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with "furos"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/docs/blog/tags/index.html b/docs/blog/tags/index.html index cdabe454e6b..1e2f74bfb98 100644 --- a/docs/blog/tags/index.html +++ b/docs/blog/tags/index.html @@ -6,7 +6,7 @@ Tags | Fur - + @@ -23,7 +23,7 @@ - + diff --git a/docs/blog/tags/net-5/index.html b/docs/blog/tags/net-5/index.html index 0b1877479fd..4af5170f743 100644 --- a/docs/blog/tags/net-5/index.html +++ b/docs/blog/tags/net-5/index.html @@ -6,7 +6,7 @@ Posts tagged ".net5" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with ".net5"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/docs/blog/tags/net/index.html b/docs/blog/tags/net/index.html index 6ff27b8ad8b..47849c7d9d4 100644 --- a/docs/blog/tags/net/index.html +++ b/docs/blog/tags/net/index.html @@ -6,7 +6,7 @@ Posts tagged ".net" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with ".net"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/docs/blog/tags/netcore/index.html b/docs/blog/tags/netcore/index.html index 1409ead3886..0cb431d5f06 100644 --- a/docs/blog/tags/netcore/index.html +++ b/docs/blog/tags/netcore/index.html @@ -6,7 +6,7 @@ Posts tagged ".netcore" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with ".netcore"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/docs/blog/welcome/index.html b/docs/blog/welcome/index.html index bfd074de3a7..ca5ac3ba24a 100644 --- a/docs/blog/welcome/index.html +++ b/docs/blog/welcome/index.html @@ -6,7 +6,7 @@ Fur 介绍 | Fur - + @@ -18,13 +18,13 @@ - +
-

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.09.30

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

+

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.10.01

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

- + @@ -36,6 +36,6 @@ - + \ No newline at end of file diff --git a/docs/docs/aop/index.html b/docs/docs/aop/index.html index cfb7aaf5fb9..14cabffb6b0 100644 --- a/docs/docs/aop/index.html +++ b/docs/docs/aop/index.html @@ -6,7 +6,7 @@ 19. 拦截切面 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/auth-control/index.html b/docs/docs/auth-control/index.html index ead3a572eb9..821ca787380 100644 --- a/docs/docs/auth-control/index.html +++ b/docs/docs/auth-control/index.html @@ -6,7 +6,7 @@ 13. 安全鉴权 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/author/index.html b/docs/docs/author/index.html index ee1e064d5fc..e404324b57a 100644 --- a/docs/docs/author/index.html +++ b/docs/docs/author/index.html @@ -6,7 +6,7 @@ 1.3 关于作者 | Fur - + @@ -26,7 +26,7 @@

1.3 关于作者

互联网账号

  • 百小僧
  • Monk/MonkSoul

技术能力

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

同时在技术培训领域也多有涉足。

职业情况

目前经营一家自己创办的软件科技公司,主要销售自主研发的 ERP 产品。

吃不起饭的时候也会接外包项目。

兴趣爱好

是个吃货,喜欢看抖音,看动漫,看美剧,看博客园、看开源中国。

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

个人主页

https://gitee.com/monksoul

https://github.com/monksoul

- + diff --git a/docs/docs/cache/index.html b/docs/docs/cache/index.html index 9463d7c663b..d42c1a8cc1b 100644 --- a/docs/docs/cache/index.html +++ b/docs/docs/cache/index.html @@ -6,7 +6,7 @@ 12. 分布式缓存 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/configuration/index.html b/docs/docs/configuration/index.html index 902aa66f8ff..21c3e40da12 100644 --- a/docs/docs/configuration/index.html +++ b/docs/docs/configuration/index.html @@ -6,7 +6,7 @@ 3.1 配置 | Fur - + @@ -29,7 +29,7 @@
namespace Fur.Web.Entry
{
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
// 启动自动扫描配置文件并注入,无需手动添加配置
.UseSetting(WebHostDefaults.HostingStartupAssembliesKey, nameof(Fur))
.UseStartup<Startup>();
});
}
}

读取 emailsetting.json 配置

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

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

3.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 会在应用启动时自动加载不同环境的配置文件。

3.1.6 配置更改通知(热更新

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

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

3.1.7 配置的优缺点

优点

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

缺点

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

3.1.8 配置使用场景

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

3.1.9 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/docs/docs/contribute/index.html b/docs/docs/contribute/index.html index d04756da111..6d83407a3f3 100644 --- a/docs/docs/contribute/index.html +++ b/docs/docs/contribute/index.html @@ -6,7 +6,7 @@ 26. 贡献指南 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/cors/index.html b/docs/docs/cors/index.html index ddbad8f738c..37aee1aa513 100644 --- a/docs/docs/cors/index.html +++ b/docs/docs/cors/index.html @@ -6,7 +6,7 @@ 14. CORS 跨域 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/data-validation/index.html b/docs/docs/data-validation/index.html index b0eb184ddfc..2ab156785b5 100644 --- a/docs/docs/data-validation/index.html +++ b/docs/docs/data-validation/index.html @@ -6,7 +6,7 @@ 7. 数据校验 | Fur - + @@ -78,7 +78,7 @@
namespace Fur.Application
{
public class FurAppService : IDynamicApiController
{
[TypeFilter(typeof(DataValidationFilter))]
public TestDto Post(TestDto testDto)
{
return testDto;
}
}
}

7.9.4 [ApiController] 控制器范围验证

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

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

7.10 MiniProfiler 查看

如下图所示:

7.10 多语言支持

文档整理中...

7.11 验证模型提供器

文档整理中...

7.12 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-Interceptor/index.html b/docs/docs/dbcontext-Interceptor/index.html index 0a4d11fa0d0..4e0665a4f82 100644 --- a/docs/docs/dbcontext-Interceptor/index.html +++ b/docs/docs/dbcontext-Interceptor/index.html @@ -6,7 +6,7 @@ 8.23 数据库操作拦截器 | Fur - + @@ -59,7 +59,7 @@
// 提交数据库失败
public override void SaveChangesFailed(DbContextErrorEventData eventData)
{
base.SaveChangesFailed(eventData);
}
// 提交数据库失败(异步)
public override Task SaveChangesFailedAsync(DbContextErrorEventData eventData, CancellationToken cancellationToken = default)
{
return base.SaveChangesFailedAsync(eventData, cancellationToken);
}
}
}

8.23.3 注册自定义过滤器

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

services.AddSqlitePool<FurDbContext>(interceptors: new IInterceptor[] {
new SqlConnectionProfilerInterceptor(),
new DbContextSaveChangesInterceptor(),
new SqlCommandProfilerInterceptor()
});

8.23.4 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-add-or-update/index.html b/docs/docs/dbcontext-add-or-update/index.html index 82ee0616fa1..8abce4d60cf 100644 --- a/docs/docs/dbcontext-add-or-update/index.html +++ b/docs/docs/dbcontext-add-or-update/index.html @@ -6,7 +6,7 @@ 8.7 新增或更新操作 | Fur - + @@ -104,7 +104,7 @@
// 示例七
await user.InsertOrUpdateExcludeNowAsync(new[] { u=>u.Name, u=>u.Age});
// 示例八
await user.InsertOrUpdateExcludeNowAsync(new[] {"Age", "Name"});

8.5.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-add/index.html b/docs/docs/dbcontext-add/index.html index a821276045f..6a5c820afc1 100644 --- a/docs/docs/dbcontext-add/index.html +++ b/docs/docs/dbcontext-add/index.html @@ -6,7 +6,7 @@ 8.5 新增操作 | Fur - + @@ -55,7 +55,7 @@
// 示例二
await repository.InsertNowAsync(new List<User> { user, user2 });
// 示例三
await repository.InsertNowAsync(new[] {user, user2 });
小知识

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

8.5.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-audit/index.html b/docs/docs/dbcontext-audit/index.html index 6657a73ef4d..0607ee3e9b5 100644 --- a/docs/docs/dbcontext-audit/index.html +++ b/docs/docs/dbcontext-audit/index.html @@ -6,7 +6,7 @@ 8.21 审计日志 | Fur - + @@ -39,7 +39,7 @@
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(); // 操作方式:新增、更新、删除
}));

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

8.21.4 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-batch/index.html b/docs/docs/dbcontext-batch/index.html index 8c5f404ff4a..67795032fa5 100644 --- a/docs/docs/dbcontext-batch/index.html +++ b/docs/docs/dbcontext-batch/index.html @@ -6,7 +6,7 @@ 8.9 批量操作 | Fur - + @@ -34,7 +34,7 @@
// 根据条件批量更新
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);

8.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

8.9.4 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/docs/docs/dbcontext-code-first/index.html b/docs/docs/dbcontext-code-first/index.html index 4bb6d0e7fb5..7abf38f69e5 100644 --- a/docs/docs/dbcontext-code-first/index.html +++ b/docs/docs/dbcontext-code-first/index.html @@ -6,7 +6,7 @@ 8.19 模型生成数据库 | Fur - + @@ -30,7 +30,7 @@
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
/// <summary>
/// 住址
/// </summary>
public string Address { get; set; }
}
}
实体约定

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

8.19.2.2 打开 程序包管理控制台

8.19.2.3 切换默认项目

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

8.19.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=Fur.Database.Migrations
To undo this action, use Remove-Migration.
PM>

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

8.19.2.5 更新到数据库

Update-Database

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

小知识

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

Update-Database v0.0.3

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

8.19.3 更新模型

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

Add-Migration v1.0.1
Update-Database

8.19.4 导出 Sql

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

Script-Migration

8.19.5 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/docs/docs/dbcontext-db-first/index.html b/docs/docs/dbcontext-db-first/index.html index f4cc43244e5..05a52c13482 100644 --- a/docs/docs/dbcontext-db-first/index.html +++ b/docs/docs/dbcontext-db-first/index.html @@ -6,7 +6,7 @@ 8.18 数据库生成模型 | Fur - + @@ -56,7 +56,7 @@
}
}
Fur Tools v1.0.0 全部实体生成成功!
PM>

8.13.4 命令参数配置

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

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

支持参数如下:

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

8.13.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-delete/index.html b/docs/docs/dbcontext-delete/index.html index 82098f18e63..b74d0b004c9 100644 --- a/docs/docs/dbcontext-delete/index.html +++ b/docs/docs/dbcontext-delete/index.html @@ -6,7 +6,7 @@ 8.8 删除操作 | Fur - + @@ -71,7 +71,7 @@
// 示例五
await entity.FakeDeleteAsync();
// 示例六
await repository.UpdateIncludeAsync(user, u => u.IsDeleted);

8.8.9 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-filter/index.html b/docs/docs/dbcontext-filter/index.html index 1ab6e778a98..d7b51b4d03f 100644 --- a/docs/docs/dbcontext-filter/index.html +++ b/docs/docs/dbcontext-filter/index.html @@ -6,7 +6,7 @@ 8.22 实体/全局查询筛选器 | Fur - + @@ -38,7 +38,7 @@
// 创建表达式元素
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

8.22.3 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-function/index.html b/docs/docs/dbcontext-function/index.html index 6b407979239..fa791d12a26 100644 --- a/docs/docs/dbcontext-function/index.html +++ b/docs/docs/dbcontext-function/index.html @@ -6,7 +6,7 @@ 8.14 函数操作 | Fur - + @@ -50,7 +50,7 @@
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity(typeof(F_Person)).HasNoKey();
modelBuilder.HasDbFunction(() => GetPersons(default));
}
}
}

8.14.5.4 在 Linq 中使用

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

最终生成 Sql

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

8.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 标量函数

8.14.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-hight-query/index.html b/docs/docs/dbcontext-hight-query/index.html index bf6ece2b350..d3fc81ba9a3 100644 --- a/docs/docs/dbcontext-hight-query/index.html +++ b/docs/docs/dbcontext-hight-query/index.html @@ -6,7 +6,7 @@ 8.11 高级查询操作 | Fur - + @@ -57,7 +57,7 @@
namespace Fur.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();

8.11.12 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-locator/index.html b/docs/docs/dbcontext-locator/index.html index 4058b32b005..13c0711c767 100644 --- a/docs/docs/dbcontext-locator/index.html +++ b/docs/docs/dbcontext-locator/index.html @@ -6,7 +6,7 @@ 8.2 数据库上下文定位器 | Fur - + @@ -28,7 +28,7 @@
namespace Fur.Core
{
public sealed class FurDbContextLocator : IDbContextLocator
{
}
}

8.2.4 默认数据库上下文定位器

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

AppDbContext<TDbContext> 定义代码如下:

using Fur.DependencyInjection;
using Microsoft.EntityFrameworkCore;
namespace Fur.DatabaseAccessor
{
/// <summary>
/// 默认应用数据库上下文
/// </summary>
/// <typeparam name="TDbContext">数据库上下文</typeparam>
[NonBeScan]
public abstract class AppDbContext<TDbContext> : AppDbContext<TDbContext, DbContextLocator>
where TDbContext : DbContext
{
/// <summary>
/// 构造函数
/// </summary>
/// <param name="options"></param>
public AppDbContext(DbContextOptions<TDbContext> options) : base(options)
{
}
}
}

8.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[])]:查询函数

8.2.6 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-multi-database/index.html b/docs/docs/dbcontext-multi-database/index.html index 2224303f486..f59f202bc46 100644 --- a/docs/docs/dbcontext-multi-database/index.html +++ b/docs/docs/dbcontext-multi-database/index.html @@ -6,7 +6,7 @@ 8.17 多数据库操作 | Fur - + @@ -47,7 +47,7 @@
/// <summary>
/// 数据库 SqlServer
/// </summary>
/// <param name="connectionString">数据库连接字符串</param>
/// <param name="options">数据库上下文选项构建器</param>
private static void ConfigureSqlServer(string connectionString, DbContextOptionsBuilder options)
{
options.UseSqlServer(connectionString, options =>
{
// 配置全局切割 Sql,而不是生成单个复杂 sql
//options.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
// 配置 code first 程序集
options.MigrationsAssembly("Fur.Database.Migrations");
//options.EnableRetryOnFailure();
//options.MigrationsHistoryTable("__EFMigrationsHistory", "fur");
});
}
}
}

8.17.4 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-proc/index.html b/docs/docs/dbcontext-proc/index.html index 1869420327f..1ba3d01b73e 100644 --- a/docs/docs/dbcontext-proc/index.html +++ b/docs/docs/dbcontext-proc/index.html @@ -6,7 +6,7 @@ 8.13 存储过程操作 | Fur - + @@ -119,7 +119,7 @@
// 获取 RETURN 返回值
var reval = result.ReturnValue;
// 获取返回结果集
var (list1,list2) = result.Result;
关于异步

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

8.13.3 关于 [DbParameter]

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

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

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

8.13.4 关于 ProcedureOutputResult

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

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

8.13.5 存储过程参数

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

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

8.13.6 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-query/index.html b/docs/docs/dbcontext-query/index.html index 80fcb76a145..3fa68477c2a 100644 --- a/docs/docs/dbcontext-query/index.html +++ b/docs/docs/dbcontext-query/index.html @@ -6,7 +6,7 @@ 8.10 查询操作 | Fur - + @@ -138,7 +138,7 @@
// 示例二
_testRepository.Where(u => u.Name.EndWith("Fur"));
// 示例三
_testRepository.Where(u => u.Name.Contains("Fur"));

8.10.6.9 Case When

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

8.10.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-read-write/index.html b/docs/docs/dbcontext-read-write/index.html index 58b1b63da2c..db18365aa94 100644 --- a/docs/docs/dbcontext-read-write/index.html +++ b/docs/docs/dbcontext-read-write/index.html @@ -6,7 +6,7 @@ 8.25 读写分离/主从复制 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/dbcontext-repository/index.html b/docs/docs/dbcontext-repository/index.html index 1823b99ef88..24d6f276ef8 100644 --- a/docs/docs/dbcontext-repository/index.html +++ b/docs/docs/dbcontext-repository/index.html @@ -6,7 +6,7 @@ 8.4 关于仓储 | Fur - + @@ -33,7 +33,7 @@
// 其他更多数据库一样的操作

另外任何仓储或实体配置都支持多个数据库同时操作

仓储方式

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("不支持该数据库操作");

8.4.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-seed-data/index.html b/docs/docs/dbcontext-seed-data/index.html index 0e5068be879..6dc0167e8c0 100644 --- a/docs/docs/dbcontext-seed-data/index.html +++ b/docs/docs/dbcontext-seed-data/index.html @@ -6,7 +6,7 @@ 8.20 实体种子数据 | Fur - + @@ -32,7 +32,7 @@
namespace Fur.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 = "广东省珠海市" }
};
}
}
}

8.20.3 导航属性

通常我们的实体有 一对多多对多等外键关系,那么我们需要单独为每一个实体添加数据种子,而不是直接写在主表中。

8.20.4 多个数据库种子数据

Fur 提供泛型的方式支持多个数据库种子数据设定,如:

using Fur.DatabaseAccessor;
using System.Collections.Generic;
namespace Fur.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 创建种子数据。

8.20.5 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

想了解更多 数据种子 知识可查阅 EF Core - 数据种子设定 章节。

- + diff --git a/docs/docs/dbcontext-sql-proxy/index.html b/docs/docs/dbcontext-sql-proxy/index.html index 62c37f04158..84846cb5153 100644 --- a/docs/docs/dbcontext-sql-proxy/index.html +++ b/docs/docs/dbcontext-sql-proxy/index.html @@ -6,7 +6,7 @@ 8.16 Sql 高级代理 | Fur - + @@ -76,7 +76,7 @@
namespace Fur.Application
{
public class ISql : ISqlDispatchProxy
{
[SqlFunction("FN_Name")] // 标量函数
string GetValue(MyParam dto);
[SqlProcedure("FN_Name")] // 表值函数
List<Person> GetPersons(int id);
}
}
补充说明

Sql 代理会自动判断返回值然后自动执行特定函数类型。

8.16.6 为什么用它?

通过上面的例子大家就可以了解,这种方式操作 sql 非常简单,而且极易维护。大家不用去关系返回值,关心用哪个方法,所有东西会自动给你处理好。

所以,如果需要用 Sql 操作,推荐使用 Sql 高级代理。

8.16.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-sql/index.html b/docs/docs/dbcontext-sql/index.html index 9eee42fb861..ae76d7be67f 100644 --- a/docs/docs/dbcontext-sql/index.html +++ b/docs/docs/dbcontext-sql/index.html @@ -6,7 +6,7 @@ 8.15 Sql 操作 | Fur - + @@ -173,7 +173,7 @@
// 不再举例子。。。。。。
补充说明

不管是那种方式操作 Sql ,方法名参数都是一致的,如:

  • SqlQuery
  • SqlQueryAsync
  • SqlQueries
  • SqlQueriesAsync
  • SqlNonQuery
  • SqlNonQueryAsync
  • SqlScalar
  • SqlScalarAsync
  • SqlProcedureQuery
  • SqlProcedureQueryAsync
  • SqlProcedureQueries
  • SqlProcedureQueriesAsync
  • SqlProcedureScalar
  • SqlProcedureScalarAsync
  • SqlProcedureNonQuery
  • SqlProcedureNonQueryAsync
  • SqlProcedureOutput
  • SqlProcedureOutputAsync
  • SqlFunctionScalar
  • SqlFunctionScalarAsync
  • SqlFunctionQuery
  • SqlFunctionQuery

8.15.6 IRepository 操作

IRepository 也能操作 sql,调用方法也是和上面一致的,如:

var dataTable = repository.Sql().SqlQuery("select * from person");
特别说明

由于篇幅有限,不再列举所有例子。

8.15.7 IRepository<TEntity> 操作

IRepository<TEntity> 也能操作 sql,调用方法也是和上面一致的,如:

var dataTable = personRepository.SqlQuery("select * from person");
特别说明

由于篇幅有限,不再列举所有例子。

8.15.8 关于 Sql 参数

所有 sql存储过程函数 参数都支持四种方式:

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

建议除了复杂的存储过程(带 OUTPUT/RETURN)的以外,所有参数建议使用 new {} 匿名类型,如果需要动态参数,则可以使用 Dictionary<string,object> 类型。

8.15.9 多数据库 Sql 操作 💯 💛

Fur 框架拥有非常灵活的多数据库操作方式,只需通过多数据库上下文定位器即可动态切换数据库。

8.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> 方式即可动态切换数据库。

8.15.9.2 ISqlRepository 方式

只需要通过 ISqlRepository<TDbContextLocator> 注入或通过 sqlRepository.Change<TDbContextLocator>() 切换。

8.15.9.3 IRepository 方式

只需要通过 repository.Change<TDbContextLocator>() 获取即可。

8.15.9.4 IRepository<TEntity> 方式

只需要通过 IRepository<TEntity, TDbContextLocator> 注入或通过 personRepository.Change<TEntity, TDbContextLocator>() 切换。

8.15.10 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-update/index.html b/docs/docs/dbcontext-update/index.html index e25029afb19..fb3660d39b2 100644 --- a/docs/docs/dbcontext-update/index.html +++ b/docs/docs/dbcontext-update/index.html @@ -6,7 +6,7 @@ 8.6 更新操作 | Fur - + @@ -198,7 +198,7 @@
// 示例二
await repository.UpdateNowAsync(new List<User> { user, user2 });
// 示例三
await repository.UpdateNowAsync(new[] {user, user2 });
小知识

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

8.6.15 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext-view/index.html b/docs/docs/dbcontext-view/index.html index a0137af5c70..9a9082149f1 100644 --- a/docs/docs/dbcontext-view/index.html +++ b/docs/docs/dbcontext-view/index.html @@ -6,7 +6,7 @@ 8.12 视图操作 | Fur - + @@ -34,7 +34,7 @@
public FurService(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> 方法可以将仓储约束为特定仓储,如只读仓储,可读可写仓储,只新增仓储等。

8.12.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/dbcontext/index.html b/docs/docs/dbcontext/index.html index 321f641c2e0..64e513c1739 100644 --- a/docs/docs/dbcontext/index.html +++ b/docs/docs/dbcontext/index.html @@ -6,7 +6,7 @@ 8.1 数据库上下文 | Fur - + @@ -34,7 +34,7 @@
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseSqlServer("数据库连接字符串");
}
}
}

8.1.6 数据库上下文定义位置

特别注意

Fur 框架中,数据库上下文需定义在 Fur.EntityFramework.Core 中,且每一个数据库上下文都必须拥有唯一的 DbContextLocator 定位器

8.1.7 动态数据库上下文对象

Fur 框架中,数据库上下文是定义在 Fur.EntityFramework.Core 项目层,并且该层不被 Fur.ApplicationFur.Core 等层引用。

所以就不能直接在 Fur.Application 项目层直接使用 Fur.EntityFramework.Core 定义的数据库上下文。

Fur 为了解决这个问题,提供了两种方式处理:

  • respository.DbContext :当前数据库上下文对象,返回是 DbContext 抽象类型
  • respository.DynamicDbContext:当前数据库上下文对象,返回的是 dynamic 类型

如果你只是想使用 DbContext 的功能,直接使用 respository.DbContext 即可,如:

respository.DbContext.SaveChanges();

如果你想能够获取具体的数据库上下文类型,如 MyDbContext,那么使用 respository.DynamicDbContext 就可以获取到具体的 MyDbContext 类型。如:

var persons = respository.DynamicDbContext.Persons.Find(1);
var users = respository.DynamicDbContext.Users;

这样就可以直接操作 MyDbContext 定义的属性和方法了。

8.1.8 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

想了解更多 数据库上下文 知识可查阅 EF Core - 配置 DbContext 章节。

- + diff --git a/docs/docs/dependency-injection/index.html b/docs/docs/dependency-injection/index.html index a573fbc7b6b..6dff541d0c0 100644 --- a/docs/docs/dependency-injection/index.html +++ b/docs/docs/dependency-injection/index.html @@ -6,7 +6,7 @@ 10. 依赖注入/控制反转 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/deploy/index.html b/docs/docs/deploy/index.html index 3920a9cd231..c2b75733451 100644 --- a/docs/docs/deploy/index.html +++ b/docs/docs/deploy/index.html @@ -6,7 +6,7 @@ 23. 托管部署 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/devops/index.html b/docs/docs/devops/index.html index a60de9e0464..5a129faed05 100644 --- a/docs/docs/devops/index.html +++ b/docs/docs/devops/index.html @@ -6,7 +6,7 @@ 24. 持续部署集成 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/dynamic-api-controller/index.html b/docs/docs/dynamic-api-controller/index.html index a390a7c0b14..0580b2a4f3a 100644 --- a/docs/docs/dynamic-api-controller/index.html +++ b/docs/docs/dynamic-api-controller/index.html @@ -6,7 +6,7 @@ 4. 动态 WebAPI | Fur - + @@ -75,7 +75,7 @@
namespace Fur.Web.Entry.Controllers
{
public class MvcController : ControllerBase
{
public string Get()
{
return nameof(Fur);
}
}
}
注意事项

启用该配置后,如果 Mvc 控制器 没有任何 [Route] 特性,但是贴了 [ApiController] 特性将会报错。原因是 [ApiController] 特性内部做了路由特性检测。所以建议使用 [ApiDataValidation] 代替。

查看 ASP.NET Core - ApiBehaviorApplicationModelProvider 源码

4.11 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/entity/index.html b/docs/docs/entity/index.html index 025c9b842b1..817f24038f9 100644 --- a/docs/docs/entity/index.html +++ b/docs/docs/entity/index.html @@ -6,7 +6,7 @@ 8.3 数据库实体 | Fur - + @@ -39,7 +39,7 @@
// 配置数据库实体
public void Configure(EntityTypeBuilder<User> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasKey(u => u.Id);
entityBuilder.HasIndex(u => u.Name);
}
}
}

8.3.3.2 在任何实例类中配置

using Fur.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
namespace Fur.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 数据库实体。

8.3.4 数据库实体配置说明

Fur 框架会自动扫描所有继承 IEntity 接口的类进行 DbSet<TEntity> 注册,也就是实现自动配置 DbContextOnModelCreating

如果需要跳过自动注册,只需要贴 [NonAutomatic][NonBeScan] 特性即可。一旦贴了次特性,那么就需要手动配置 DbContextOnModelCreating

8.3.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/event-bus/index.html b/docs/docs/event-bus/index.html index e0721a04c5c..3c8c06235c0 100644 --- a/docs/docs/event-bus/index.html +++ b/docs/docs/event-bus/index.html @@ -6,7 +6,7 @@ 17. 事件总线 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/friendly-exception/index.html b/docs/docs/friendly-exception/index.html index bf78028af82..c9df62f512a 100644 --- a/docs/docs/friendly-exception/index.html +++ b/docs/docs/friendly-exception/index.html @@ -6,7 +6,7 @@ 6. 友好异常处理 | Fur - + @@ -59,7 +59,7 @@
namespace Fur.Application
{
public class FurAppService : IDynamicApiController
{
[IfException(ErrorCodes.z1000, ErrorMessage = "我覆盖了默认的:{0} 不能小于 {1}")]
[IfException(ErrorCodes.x1001, "格式化参数1", "格式化参数2", ErrorMessage = "我覆盖了默认的:{0} 不能小于 {1}")]
[IfException(ErrorCodes.x1000, "格式化参数1", "格式化参数2")]
[IfException(ErrorCodes.SERVER_ERROR, "格式化参数1", "格式化参数2")]
public int Get(int id)
{
if (id < 3)
{
throw Oops.Oh(ErrorCodes.z1000, id, 3);
}
return id;
}
}
}
格式化流程

如果消息内容中包含格式化占位符但未指定格式化参数,那么会查找异常所在方法是否贴有 [IfException] 特性且含有格式化参数,接着就会查找 Oops.Oh 中指定的 格式化参数

6.11 异常消息优先级

[ErrorCodeItemMetadata] -> appsettings.json -> [IfException](低 -> 高)

  • [IfException] 会覆盖 appsettings.json 定义的状态码消息。
  • appsettings.json 会覆盖 [ErrorCodeItemMetadata] 定义的消息。

6.12 多语言支持

文档整理中...

6.13 异常模型提供器

文档整理中...

6.14 Fur 内置异常

  • EFCoreErrorCodesEF Core 操作异常
    • DataNotFound:未找到数据
    • KeyNotSet:没有设置主键

6.15 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/get-start/index.html b/docs/docs/get-start/index.html index 0ec52851efb..e835865b78b 100644 --- a/docs/docs/get-start/index.html +++ b/docs/docs/get-start/index.html @@ -6,7 +6,7 @@ 2. 一分钟入门 | Fur - + @@ -45,7 +45,7 @@
/// <summary>
/// 姓名
/// </summary>
[StringLength(32, MinimumLength = 2)]
public string Name { get; set; }
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
}
}

说好一分钟入门,你们用了多长时间。😁

- + diff --git a/docs/docs/index.html b/docs/docs/index.html index 24107606b01..04af3cd3c61 100644 --- a/docs/docs/index.html +++ b/docs/docs/index.html @@ -6,7 +6,7 @@ 1.1 介绍 | Fur - + @@ -20,13 +20,13 @@ - +
-

1.1 介绍

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.09.30

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

+

1.1 介绍

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.10.01

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

- + @@ -40,6 +40,6 @@ - + \ No newline at end of file diff --git a/docs/docs/job/index.html b/docs/docs/job/index.html index 49f62742225..cd111ad6a49 100644 --- a/docs/docs/job/index.html +++ b/docs/docs/job/index.html @@ -6,7 +6,7 @@ 21. 任务调度 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/local-language/index.html b/docs/docs/local-language/index.html index ef5839436e4..bf70965a398 100644 --- a/docs/docs/local-language/index.html +++ b/docs/docs/local-language/index.html @@ -6,7 +6,7 @@ 15. 多语言处理 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/logging/index.html b/docs/docs/logging/index.html index 40b991e63ff..7a2f6421c33 100644 --- a/docs/docs/logging/index.html +++ b/docs/docs/logging/index.html @@ -6,7 +6,7 @@ 18. 日志记录 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/object-mapper/index.html b/docs/docs/object-mapper/index.html index 6970060ff27..2760f7e8221 100644 --- a/docs/docs/object-mapper/index.html +++ b/docs/docs/object-mapper/index.html @@ -6,7 +6,7 @@ 11. 对象数据映射 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/options/index.html b/docs/docs/options/index.html index f0088c42e1c..51a9cc0b387 100644 --- a/docs/docs/options/index.html +++ b/docs/docs/options/index.html @@ -6,7 +6,7 @@ 3.2 选项 | Fur - + @@ -41,7 +41,7 @@
public void OnListener(AppInfoOptions options, IConfiguration configuration)
{
var name = options.Name; // 实时的最新值
var version = options.Version; // 实时的最新值
}
public void PostConfigure(AppInfoOptions options, IConfiguration configuration)
{
}
}
特别说明

IConfigurableOptionsListener<TOptions> 继承自 IConfigurableOptions<TOptions>

3.3.9 选项的优缺点

优点

  • 强类型配置
  • 提供多种读取方式
  • 支持热加载
  • 支持设置默认值/后期配置
  • 支持在运行环境中动态配置
  • 支持验证配置有效性
  • 支持更改通知
  • 支持命名选项

缺点

  • 需要定义对应类型
  • 需要在启动时注册

3.3.10 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/docs/docs/performance/index.html b/docs/docs/performance/index.html index 266a76bf2c3..4b15c2941c1 100644 --- a/docs/docs/performance/index.html +++ b/docs/docs/performance/index.html @@ -6,7 +6,7 @@ 25.2 性能测试 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/process-service/index.html b/docs/docs/process-service/index.html index 4c8492bf8ee..2a10d14fdc2 100644 --- a/docs/docs/process-service/index.html +++ b/docs/docs/process-service/index.html @@ -6,7 +6,7 @@ 20. 进程服务 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/saas/index.html b/docs/docs/saas/index.html index c237830ed86..67b31ddc559 100644 --- a/docs/docs/saas/index.html +++ b/docs/docs/saas/index.html @@ -6,7 +6,7 @@ 9. SaaS 多租户 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/signalr/index.html b/docs/docs/signalr/index.html index 4a418d51287..9a17dad28c0 100644 --- a/docs/docs/signalr/index.html +++ b/docs/docs/signalr/index.html @@ -6,7 +6,7 @@ 22. 即时通讯 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/source/index.html b/docs/docs/source/index.html index 3ba389d1087..3daf66dab60 100644 --- a/docs/docs/source/index.html +++ b/docs/docs/source/index.html @@ -6,7 +6,7 @@ 1.2 源码结构 | Fur - + @@ -58,7 +58,7 @@
#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 平台下极易入门、极速开发的 Web 应用框架。\nCopyright © 2020 Fur, Baiqian Co.,Ltd.\n\n框架名称:Fur\n框架作者:百小僧\n框架版本:1.0.0\n源码地址:Gitee:https://gitee.com/monksoul/Fur \n Github:https://github.com/monksoul/Fur \n开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)\n-----------------------------------------------------------------------------

1.2.4 Fur 核心层

Fur 核心层是 Fur 框架的中心,也是 Fur 能够支撑起来的必备层。

源码结构:

Fur
├─Fur.csproj
├─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
| ├─Helpers
| | └Helpers.cs
| ├─Extensions
| | ├─MapsterExtensions.cs
| | └ObjectMapperServiceCollectionExtensions.cs
| ├─Dependencies
| | └IObjectMapper.cs
├─LinqBuilder
| ├─Visitors
| | └ParameterReplaceExpressionVisitor.cs
| ├─Extensions
| | ├─EFCoreLinqExtensions.cs
| | ├─LinqExpressionExtensions.cs
| | └LinqExtensions.cs
| ├─Builders
| | ├─EFCoreLinqBuilder.cs
| | └LinqBuilder.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
| ├─AppStartup.cs
| ├─Extensions
| | └DependencyInjectionServiceCollectionExtensions.cs
| ├─Enums
| | ├─InjectionOptions.cs
| | ├─InjectionScopeOptions.cs
| | └RegisterType.cs
| ├─Dependencies
| | ├─IDependency.cs
| | ├─IDispatchProxy.cs
| | ├─IScopedDependency.cs
| | ├─ISingletonDependency.cs
| | └ITransientDependency.cs
| ├─Attributes
| | ├─InjectionAttribute.cs
| | ├─NonBeScanAttribute.cs
| | └StartupOrderAttribute.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
├─DatabaseAccessor
| ├─UnitOfWork
| | ├─Filters
| | | └UnitOfWorkFilter.cs
| | ├─Attributes
| | | ├─NonTransactAttribute.cs
| | | └UnitOfWorkAttribute.cs
| ├─Repositories
| | ├─EFCoreRepository.cs
| | ├─IRepository.cs
| | ├─ISqlRepository.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
| ├─Options
| | └DatabaseAccessorSettingsOptions.cs
| ├─MultiTenants
| | ├─Providers
| | | └IMultiTenantProvider.cs
| | ├─Locators
| | | └MultiTenantDbContextLocator.cs
| | ├─Enums
| | | └MultiTenantOptions.cs
| | ├─Entities
| | | └Tenant.cs
| ├─Models
| | ├─DatabaseProvider.cs
| | ├─PagedList.cs
| | ├─ProcedureOutputResult.cs
| | └ProcedureOutputValue.cs
| ├─Locators
| | ├─DbContextLocator.cs
| | └IDbContextLocator.cs
| ├─Interceptors
| | ├─DbContextSaveChangesInterceptor.cs
| | ├─SqlCommandProfilerInterceptor.cs
| | └SqlConnectionProfilerInterceptor.cs
| ├─Helpers
| | └DbHelpers.cs
| ├─Extensions
| | ├─DatabaseAccessorServiceCollectionExtensions.cs
| | ├─PagedQueryableExtensions.cs
| | ├─Repositories
| | | ├─IEntityDbContextLocatorExtensions.cs
| | | ├─IEntityExtensions.cs
| | | └SqlExtensions.cs
| | ├─DatabaseProvider
| | | ├─Penetrates.cs
| | | ├─SqliteServiceCollectionExtensions.cs
| | | └SqlServerServiceCollectionExtensions.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
| | | ├─IModelBuilderDependency.cs
| | | └IModelBuilderFilter.cs
| | ├─Attributes
| | | ├─FakeDeleteAttribute.cs
| | | ├─NonAutomaticAttribute.cs
| | | └QueryableFunctionAttribute.cs
| ├─Contexts
| | ├─AppDbContext.cs
| | ├─Builders
| | | ├─AppDbContextBuilder.cs
| | | ├─Models
| | | | └DbContextCorrelationType.cs
| | ├─Attributes
| | | └DbContextAttribute.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
├─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
| ├─Options
| | └AppSettingsOptions.cs
| ├─Extensions
| | ├─AppApplicationBuilderExtensions.cs
| | ├─AppServiceCollectionExtensions.cs
| | └ObjectExtensions.cs
| ├─Enums
| | └ProjectType.cs

1.2.5 Fur.Application 业务应用层

Fur.Application 业务应用层是最常用的层,几乎所有的业务代码都在这个层中编写。

源码结构:

Fur.Application
├─Fur.Application.Core.csproj
├─Fur.Application.Core.xml
└FurApplicationStartup.cs

1.2.6 Fur.Core 仓储实体层

Fur.Core 主要是存储自定义仓储和定义实体的层。

源码结构:

Fur.Core
├─Fur.Core.csproj
└FurCoreStartup.cs

1.2.7 Fur.Database.Migrations 数据库架构维护层

Fur.Database.Migrations 主要是用来存放 Database FirstCode First 生成的维护文件。

源码结构:

Fur.Database.Migrations
└Fur.Database.Migrations.csproj

1.2.8 Fur.EntityFramework.Core 数据库上下文配置层

Fur.EntityFramework.Core 主要是用来配置数据库上下文和其他数据库相关配置信息的。

源码结构:

Fur.EntityFramework.Core
└Fur.EntityFramework.Core.csproj

1.2.9 Fur.Web.Core 应用核心层

Fur.Web.Core 主要是用来配置 Web 入口一些代码,如 FilterMiddlewares 等。

源码结构:

Fur.Web.Core
├─Fur.Web.Core.xml
└FurWebCoreStartup.cs

1.2.10 Fur.Web.Entry 应用入口层

Fur.Web.Entry 是我们的应用层,也就是我们的 Web 项目层,发布层。

源码结构:

Fur.Web.Entry
├─appsettings.Development.json
├─appsettings.json
├─Fur.Web.Entry.csproj
├─Fur.Web.Entry.csproj.user
├─Fur.Web.Entry.xml
├─Program.cs
├─Startup.cs
├─wwwroot
| └README.md
├─Properties
| └launchSettings.json
├─Controllers
- + diff --git a/docs/docs/specification-document/index.html b/docs/docs/specification-document/index.html index 18c74766cd0..904e4d75625 100644 --- a/docs/docs/specification-document/index.html +++ b/docs/docs/specification-document/index.html @@ -6,7 +6,7 @@ 5. 规范化接口文档 | Fur - + @@ -51,7 +51,7 @@
"Requirement": {
"Scheme": {
"Reference": {
"Id": "Bearer",
"Type": "SecurityScheme"
},
"Accesses": null
}
}
}
]
}
}
}

5.5.12 在线测试

如下图所示:

5.5.13 性能监视 MiniProfiler

规范化文档默认集成了 MiniProfiler 第三方性能组件,通过该组件可以方便查看请求性能、异常堆栈、数据库操作等信息。默认在 Swagger 首页左上角显示。

如下图所示:

小提示

也可以通过 appsetting.jsonAppSettings:InjectMiniProfiler 设为 false 关闭。

5.5.14 定义接口输出类型

using Fur.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
namespace Fur.Application
{
public class FurAppService : IDynamicApiController
{
[ProducesResponseType(201, Type = typeof(TestDto))]
[ProducesResponseType(400)]
public string Get()
{
return nameof(Fur);
}
}
}

如下图所示:

5.6 SpecificationDocumentSettings 配置

除了上述例子外,Fur 提供了一些配置选项,如:

  • DocumentTitle:文档标题,string,默认 Specification Api Document
  • DefaultGroupName:默认分组名,string,默认 Default
  • EnableAuthorized:是否启用权限控制,bool,默认 true
  • FormatAsV2:采用 Swagger 2.0 版本,bool,默认 false
  • RoutePrefix:规范化文档地址,string,默认 string
  • DocExpansionState:文档显示方式,DocExpansion,默认 List,取值:
    • List:列表式(展开子类),默认值
    • Full:完全展开
    • None:列表式(不展开子类)
  • XmlComments:程序集注释描述文件名(可带 .xmlstring,默认 Fur.Application, Fur.Web.Entry, Fur.Web.Core
  • GroupOpenApiInfos:分组信息配置,SpecificationOpenApiInfo[],默认 { 'Group': 'Default'}
  • SecurityDefinitions:安全策略定义配置,SpecificationOpenApiSecurityScheme[],默认 []

5.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/docs/docs/split-db/index.html b/docs/docs/split-db/index.html index 322cb731aa4..93532b92acf 100644 --- a/docs/docs/split-db/index.html +++ b/docs/docs/split-db/index.html @@ -6,7 +6,7 @@ 8.26 分表分库 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/tran/index.html b/docs/docs/tran/index.html index b361286ecab..24d689aff54 100644 --- a/docs/docs/tran/index.html +++ b/docs/docs/tran/index.html @@ -6,7 +6,7 @@ 8.24 事务和工作单元 | Fur - + @@ -29,7 +29,7 @@
var blogs = _testRepository.Entity
.OrderBy(b => b.Url)
.ToList();
// 提交事务
transaction.Commit();
}
catch (Exception)
{
// 回滚事务
transaction.RollBack();
}
}

8.24.4 工作单元特性说明

8.24.4.1 [UnitOfWork]

[UnitOfWork] 特性用来标记事务信息,如作用范围,隔离级别等。

  • Enabled:是否启动工作单元,默认 true
  • ScopeOption:定义事务范围行为,默认 TransactionScopeOption.Required
  • IsolationLevel:设置事务隔离级别,默认 IsolationLevel.ReadCommitted;
  • AsyncFlowOption:允许跨线程连续任务的事务流,如有异步操作需开启该选项,默认开启
特别注意

一旦方法贴了 [UnitOfWork(false)] 特性后,那么该方法不再启用工作单元模式,也就是不包含事务,也不会自动提交数据库。慎用!

8.24.4.2 [NonTransact]

一定方法或类贴了 [NonTransact] 特性,那么将关闭事务操作,但是还是会自动保存数据库到数据。

8.24.5 常见错误

  • A TransactionScope must be disposed on the same thread that it was created.

只需要在当前操作方法上贴 [NonTransact] 特性即可。

8.24.6 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

想了解更多 事务 知识可查阅 EF Core - 使用事务 章节。

- + diff --git a/docs/docs/unittest/index.html b/docs/docs/unittest/index.html index 85c77467540..1c570d01556 100644 --- a/docs/docs/unittest/index.html +++ b/docs/docs/unittest/index.html @@ -6,7 +6,7 @@ 25.1 单元测试 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/docs/view-engine/index.html b/docs/docs/view-engine/index.html index 1c34ba2af64..fc29fae141e 100644 --- a/docs/docs/view-engine/index.html +++ b/docs/docs/view-engine/index.html @@ -6,7 +6,7 @@ 16. 视图引擎 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/docs/index.html b/docs/index.html index a2a63d85611..8feabefd82b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@ Fur 是 .NET 5 平台下极易入门、极速开发的 Web 应用框架。 Fur | Fur - + @@ -22,7 +22,7 @@

Fur 是 .NET 5 平台下极易入门、极速开发的 Web 应用框架。

[object Object]

.NET 5 新起点

.NET 5 是 .NET 的重要且令人兴奋的新方向。你会看到 .NET 变得更加简单,但也有更广泛的功能和实用程序。所有新的开发和功能都将是 .NET 5 的一部分,包括新的 C# 版本

[object Object]

“六级” 架构

Fur 在设计之初就秉承着 “六极” :极易入门、极速开发、极少依赖、极少配置、极其灵活、极易维护 的设计思想,在架构设计上做了大量的优化,支持各个能力阶层技术员极速上手。

[object Object]

冲一杯咖啡的时间

Fur 除了独具创新的设计理念和灵活的架构设计以外,同时还结合了主流的敏捷开发模式打造的一款极速开发框架。只需冲制一杯咖啡的时间便可完成工作

- + diff --git a/handbook/build/runtime~main.f7abd164.js b/docs/runtime~main.84a0866b.js similarity index 97% rename from handbook/build/runtime~main.f7abd164.js rename to docs/runtime~main.84a0866b.js index 049dbb0602d..e3332e0e01a 100644 --- a/handbook/build/runtime~main.f7abd164.js +++ b/docs/runtime~main.84a0866b.js @@ -1 +1 @@ -!function(e){function a(a){for(var c,r,t=a[0],n=a[1],o=a[2],u=0,l=[];u=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},O={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=o(a),m=n,j=u["".concat(c,".").concat(m)]||u[m]||O[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},76:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return u}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={slug:"welcome",title:"Fur \u4ecb\u7ecd",author:"dotnet\u4e2d\u56fd",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://chinadot.net",author_image_url:"https://img04.sogoucdn.com/app/a/100520146/AFA3DBD8507E7753D93A155720F37B25",tags:["fur","furos",".net",".netcore",".net5"]},l={permalink:"/blog/welcome",editUrl:"https://gitee.com/monksoul/Fur/tree/main/handbook/blog/2020-08-19-welcome.mdx",source:"@site/blog\\2020-08-19-welcome.mdx",description:"=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},u=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},O={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),u=o(a),m=n,j=u["".concat(c,".").concat(m)]||u[m]||O[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},76:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return u}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={slug:"welcome",title:"Fur \u4ecb\u7ecd",author:"dotnet\u4e2d\u56fd",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://chinadot.net",author_image_url:"https://img04.sogoucdn.com/app/a/100520146/AFA3DBD8507E7753D93A155720F37B25",tags:["fur","furos",".net",".netcore",".net5"]},l={permalink:"/blog/welcome",editUrl:"https://gitee.com/monksoul/Fur/tree/main/handbook/blog/2020-08-19-welcome.mdx",source:"@site/blog\\2020-08-19-welcome.mdx",description:" Page Not Found | Fur - +

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/handbook/build/4c30b939.03c1dd5e.js b/handbook/build/4c30b939.d13a14dd.js similarity index 99% rename from handbook/build/4c30b939.03c1dd5e.js rename to handbook/build/4c30b939.d13a14dd.js index 281676779a8..2becc900b4d 100644 --- a/handbook/build/4c30b939.03c1dd5e.js +++ b/handbook/build/4c30b939.d13a14dd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[26],{135:function(e,t,a){"use strict";a.d(t,"a",(function(){return O})),a.d(t,"b",(function(){return j}));var n=a(0),r=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 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 i(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},O=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},u={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),O=o(a),m=n,j=O["".concat(c,".").concat(m)]||O[m]||u[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},81:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return O}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={id:"introduce",title:"1.1 \u4ecb\u7ecd",sidebar_label:"1.1 \u4ecb\u7ecd",slug:"/"},l={unversionedId:"introduce",id:"introduce",isDocsHomePage:!1,title:"1.1 \u4ecb\u7ecd",description:"=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var p=r.a.createContext({}),o=function(e){var t=r.a.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):i(i({},t),e)),a},O=function(e){var t=o(e.components);return r.a.createElement(p.Provider,{value:t},e.children)},u={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 a=e.components,n=e.mdxType,b=e.originalType,c=e.parentName,p=l(e,["components","mdxType","originalType","parentName"]),O=o(a),m=n,j=O["".concat(c,".").concat(m)]||O[m]||u[m]||b;return a?r.a.createElement(j,i(i({ref:t},p),{},{components:a})):r.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,c=new Array(b);c[0]=m;var i={};for(var l in t)hasOwnProperty.call(t,l)&&(i[l]=t[l]);i.originalType=e,i.mdxType="string"==typeof e?e:n,c[1]=i;for(var p=2;pfunction(e,t,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 t+a;const c=a.startsWith(t)?a:t+a.replace(/^\//,"");return b?e+c:c}(t,e,a,n)}}function c(e,t={}){const{withBaseUrl:a}=b();return a(e,t)}},138: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}))},81:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return i})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return p})),a.d(t,"default",(function(){return O}));var n=a(2),r=a(6),b=(a(0),a(135)),c=a(137),i={id:"introduce",title:"1.1 \u4ecb\u7ecd",sidebar_label:"1.1 \u4ecb\u7ecd",slug:"/"},l={unversionedId:"introduce",id:"introduce",isDocsHomePage:!1,title:"1.1 \u4ecb\u7ecd",description:" Blog | Fur - + @@ -25,7 +25,7 @@

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/handbook/build/blog/tags/fur/index.html b/handbook/build/blog/tags/fur/index.html index 3f3f338fed1..5acf200a6b6 100644 --- a/handbook/build/blog/tags/fur/index.html +++ b/handbook/build/blog/tags/fur/index.html @@ -6,7 +6,7 @@ Posts tagged "fur" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with "fur"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/handbook/build/blog/tags/furos/index.html b/handbook/build/blog/tags/furos/index.html index e27e2ab2574..db7516335c6 100644 --- a/handbook/build/blog/tags/furos/index.html +++ b/handbook/build/blog/tags/furos/index.html @@ -6,7 +6,7 @@ Posts tagged "furos" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with "furos"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/handbook/build/blog/tags/index.html b/handbook/build/blog/tags/index.html index cdabe454e6b..1e2f74bfb98 100644 --- a/handbook/build/blog/tags/index.html +++ b/handbook/build/blog/tags/index.html @@ -6,7 +6,7 @@ Tags | Fur - + @@ -23,7 +23,7 @@ - + diff --git a/handbook/build/blog/tags/net-5/index.html b/handbook/build/blog/tags/net-5/index.html index 0b1877479fd..4af5170f743 100644 --- a/handbook/build/blog/tags/net-5/index.html +++ b/handbook/build/blog/tags/net-5/index.html @@ -6,7 +6,7 @@ Posts tagged ".net5" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with ".net5"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/handbook/build/blog/tags/net/index.html b/handbook/build/blog/tags/net/index.html index 6ff27b8ad8b..47849c7d9d4 100644 --- a/handbook/build/blog/tags/net/index.html +++ b/handbook/build/blog/tags/net/index.html @@ -6,7 +6,7 @@ Posts tagged ".net" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with ".net"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/handbook/build/blog/tags/netcore/index.html b/handbook/build/blog/tags/netcore/index.html index 1409ead3886..0cb431d5f06 100644 --- a/handbook/build/blog/tags/netcore/index.html +++ b/handbook/build/blog/tags/netcore/index.html @@ -6,7 +6,7 @@ Posts tagged ".netcore" | Fur - + @@ -25,7 +25,7 @@

1 post tagged with ".netcore"

View All Tags

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

- + diff --git a/handbook/build/blog/welcome/index.html b/handbook/build/blog/welcome/index.html index bfd074de3a7..ca5ac3ba24a 100644 --- a/handbook/build/blog/welcome/index.html +++ b/handbook/build/blog/welcome/index.html @@ -6,7 +6,7 @@ Fur 介绍 | Fur - + @@ -18,13 +18,13 @@ - +
-

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.09.30

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

+

Fur 介绍

dotnet中国

dotnet中国

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

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.10.01

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

- + @@ -36,6 +36,6 @@ - + \ No newline at end of file diff --git a/handbook/build/docs/aop/index.html b/handbook/build/docs/aop/index.html index cfb7aaf5fb9..14cabffb6b0 100644 --- a/handbook/build/docs/aop/index.html +++ b/handbook/build/docs/aop/index.html @@ -6,7 +6,7 @@ 19. 拦截切面 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/auth-control/index.html b/handbook/build/docs/auth-control/index.html index ead3a572eb9..821ca787380 100644 --- a/handbook/build/docs/auth-control/index.html +++ b/handbook/build/docs/auth-control/index.html @@ -6,7 +6,7 @@ 13. 安全鉴权 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/author/index.html b/handbook/build/docs/author/index.html index ee1e064d5fc..e404324b57a 100644 --- a/handbook/build/docs/author/index.html +++ b/handbook/build/docs/author/index.html @@ -6,7 +6,7 @@ 1.3 关于作者 | Fur - + @@ -26,7 +26,7 @@

1.3 关于作者

互联网账号

  • 百小僧
  • Monk/MonkSoul

技术能力

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

同时在技术培训领域也多有涉足。

职业情况

目前经营一家自己创办的软件科技公司,主要销售自主研发的 ERP 产品。

吃不起饭的时候也会接外包项目。

兴趣爱好

是个吃货,喜欢看抖音,看动漫,看美剧,看博客园、看开源中国。

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

个人主页

https://gitee.com/monksoul

https://github.com/monksoul

- + diff --git a/handbook/build/docs/cache/index.html b/handbook/build/docs/cache/index.html index 9463d7c663b..d42c1a8cc1b 100644 --- a/handbook/build/docs/cache/index.html +++ b/handbook/build/docs/cache/index.html @@ -6,7 +6,7 @@ 12. 分布式缓存 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/configuration/index.html b/handbook/build/docs/configuration/index.html index 902aa66f8ff..21c3e40da12 100644 --- a/handbook/build/docs/configuration/index.html +++ b/handbook/build/docs/configuration/index.html @@ -6,7 +6,7 @@ 3.1 配置 | Fur - + @@ -29,7 +29,7 @@
namespace Fur.Web.Entry
{
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
// 启动自动扫描配置文件并注入,无需手动添加配置
.UseSetting(WebHostDefaults.HostingStartupAssembliesKey, nameof(Fur))
.UseStartup<Startup>();
});
}
}

读取 emailsetting.json 配置

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

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

3.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 会在应用启动时自动加载不同环境的配置文件。

3.1.6 配置更改通知(热更新

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

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

3.1.7 配置的优缺点

优点

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

缺点

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

3.1.8 配置使用场景

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

3.1.9 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/handbook/build/docs/contribute/index.html b/handbook/build/docs/contribute/index.html index d04756da111..6d83407a3f3 100644 --- a/handbook/build/docs/contribute/index.html +++ b/handbook/build/docs/contribute/index.html @@ -6,7 +6,7 @@ 26. 贡献指南 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/cors/index.html b/handbook/build/docs/cors/index.html index ddbad8f738c..37aee1aa513 100644 --- a/handbook/build/docs/cors/index.html +++ b/handbook/build/docs/cors/index.html @@ -6,7 +6,7 @@ 14. CORS 跨域 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/data-validation/index.html b/handbook/build/docs/data-validation/index.html index b0eb184ddfc..2ab156785b5 100644 --- a/handbook/build/docs/data-validation/index.html +++ b/handbook/build/docs/data-validation/index.html @@ -6,7 +6,7 @@ 7. 数据校验 | Fur - + @@ -78,7 +78,7 @@
namespace Fur.Application
{
public class FurAppService : IDynamicApiController
{
[TypeFilter(typeof(DataValidationFilter))]
public TestDto Post(TestDto testDto)
{
return testDto;
}
}
}

7.9.4 [ApiController] 控制器范围验证

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

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

7.10 MiniProfiler 查看

如下图所示:

7.10 多语言支持

文档整理中...

7.11 验证模型提供器

文档整理中...

7.12 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-Interceptor/index.html b/handbook/build/docs/dbcontext-Interceptor/index.html index 0a4d11fa0d0..4e0665a4f82 100644 --- a/handbook/build/docs/dbcontext-Interceptor/index.html +++ b/handbook/build/docs/dbcontext-Interceptor/index.html @@ -6,7 +6,7 @@ 8.23 数据库操作拦截器 | Fur - + @@ -59,7 +59,7 @@
// 提交数据库失败
public override void SaveChangesFailed(DbContextErrorEventData eventData)
{
base.SaveChangesFailed(eventData);
}
// 提交数据库失败(异步)
public override Task SaveChangesFailedAsync(DbContextErrorEventData eventData, CancellationToken cancellationToken = default)
{
return base.SaveChangesFailedAsync(eventData, cancellationToken);
}
}
}

8.23.3 注册自定义过滤器

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

services.AddSqlitePool<FurDbContext>(interceptors: new IInterceptor[] {
new SqlConnectionProfilerInterceptor(),
new DbContextSaveChangesInterceptor(),
new SqlCommandProfilerInterceptor()
});

8.23.4 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-add-or-update/index.html b/handbook/build/docs/dbcontext-add-or-update/index.html index 82ee0616fa1..8abce4d60cf 100644 --- a/handbook/build/docs/dbcontext-add-or-update/index.html +++ b/handbook/build/docs/dbcontext-add-or-update/index.html @@ -6,7 +6,7 @@ 8.7 新增或更新操作 | Fur - + @@ -104,7 +104,7 @@
// 示例七
await user.InsertOrUpdateExcludeNowAsync(new[] { u=>u.Name, u=>u.Age});
// 示例八
await user.InsertOrUpdateExcludeNowAsync(new[] {"Age", "Name"});

8.5.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-add/index.html b/handbook/build/docs/dbcontext-add/index.html index a821276045f..6a5c820afc1 100644 --- a/handbook/build/docs/dbcontext-add/index.html +++ b/handbook/build/docs/dbcontext-add/index.html @@ -6,7 +6,7 @@ 8.5 新增操作 | Fur - + @@ -55,7 +55,7 @@
// 示例二
await repository.InsertNowAsync(new List<User> { user, user2 });
// 示例三
await repository.InsertNowAsync(new[] {user, user2 });
小知识

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

8.5.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-audit/index.html b/handbook/build/docs/dbcontext-audit/index.html index 6657a73ef4d..0607ee3e9b5 100644 --- a/handbook/build/docs/dbcontext-audit/index.html +++ b/handbook/build/docs/dbcontext-audit/index.html @@ -6,7 +6,7 @@ 8.21 审计日志 | Fur - + @@ -39,7 +39,7 @@
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(); // 操作方式:新增、更新、删除
}));

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

8.21.4 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-batch/index.html b/handbook/build/docs/dbcontext-batch/index.html index 8c5f404ff4a..67795032fa5 100644 --- a/handbook/build/docs/dbcontext-batch/index.html +++ b/handbook/build/docs/dbcontext-batch/index.html @@ -6,7 +6,7 @@ 8.9 批量操作 | Fur - + @@ -34,7 +34,7 @@
// 根据条件批量更新
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);

8.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

8.9.4 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/handbook/build/docs/dbcontext-code-first/index.html b/handbook/build/docs/dbcontext-code-first/index.html index 4bb6d0e7fb5..7abf38f69e5 100644 --- a/handbook/build/docs/dbcontext-code-first/index.html +++ b/handbook/build/docs/dbcontext-code-first/index.html @@ -6,7 +6,7 @@ 8.19 模型生成数据库 | Fur - + @@ -30,7 +30,7 @@
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
/// <summary>
/// 住址
/// </summary>
public string Address { get; set; }
}
}
实体约定

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

8.19.2.2 打开 程序包管理控制台

8.19.2.3 切换默认项目

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

8.19.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=Fur.Database.Migrations
To undo this action, use Remove-Migration.
PM>

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

8.19.2.5 更新到数据库

Update-Database

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

小知识

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

Update-Database v0.0.3

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

8.19.3 更新模型

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

Add-Migration v1.0.1
Update-Database

8.19.4 导出 Sql

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

Script-Migration

8.19.5 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/handbook/build/docs/dbcontext-db-first/index.html b/handbook/build/docs/dbcontext-db-first/index.html index f4cc43244e5..05a52c13482 100644 --- a/handbook/build/docs/dbcontext-db-first/index.html +++ b/handbook/build/docs/dbcontext-db-first/index.html @@ -6,7 +6,7 @@ 8.18 数据库生成模型 | Fur - + @@ -56,7 +56,7 @@
}
}
Fur Tools v1.0.0 全部实体生成成功!
PM>

8.13.4 命令参数配置

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

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

支持参数如下:

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

8.13.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-delete/index.html b/handbook/build/docs/dbcontext-delete/index.html index 82098f18e63..b74d0b004c9 100644 --- a/handbook/build/docs/dbcontext-delete/index.html +++ b/handbook/build/docs/dbcontext-delete/index.html @@ -6,7 +6,7 @@ 8.8 删除操作 | Fur - + @@ -71,7 +71,7 @@
// 示例五
await entity.FakeDeleteAsync();
// 示例六
await repository.UpdateIncludeAsync(user, u => u.IsDeleted);

8.8.9 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-filter/index.html b/handbook/build/docs/dbcontext-filter/index.html index 1ab6e778a98..d7b51b4d03f 100644 --- a/handbook/build/docs/dbcontext-filter/index.html +++ b/handbook/build/docs/dbcontext-filter/index.html @@ -6,7 +6,7 @@ 8.22 实体/全局查询筛选器 | Fur - + @@ -38,7 +38,7 @@
// 创建表达式元素
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

8.22.3 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-function/index.html b/handbook/build/docs/dbcontext-function/index.html index 6b407979239..fa791d12a26 100644 --- a/handbook/build/docs/dbcontext-function/index.html +++ b/handbook/build/docs/dbcontext-function/index.html @@ -6,7 +6,7 @@ 8.14 函数操作 | Fur - + @@ -50,7 +50,7 @@
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity(typeof(F_Person)).HasNoKey();
modelBuilder.HasDbFunction(() => GetPersons(default));
}
}
}

8.14.5.4 在 Linq 中使用

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

最终生成 Sql

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

8.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 标量函数

8.14.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-hight-query/index.html b/handbook/build/docs/dbcontext-hight-query/index.html index bf6ece2b350..d3fc81ba9a3 100644 --- a/handbook/build/docs/dbcontext-hight-query/index.html +++ b/handbook/build/docs/dbcontext-hight-query/index.html @@ -6,7 +6,7 @@ 8.11 高级查询操作 | Fur - + @@ -57,7 +57,7 @@
namespace Fur.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();

8.11.12 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-locator/index.html b/handbook/build/docs/dbcontext-locator/index.html index 4058b32b005..13c0711c767 100644 --- a/handbook/build/docs/dbcontext-locator/index.html +++ b/handbook/build/docs/dbcontext-locator/index.html @@ -6,7 +6,7 @@ 8.2 数据库上下文定位器 | Fur - + @@ -28,7 +28,7 @@
namespace Fur.Core
{
public sealed class FurDbContextLocator : IDbContextLocator
{
}
}

8.2.4 默认数据库上下文定位器

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

AppDbContext<TDbContext> 定义代码如下:

using Fur.DependencyInjection;
using Microsoft.EntityFrameworkCore;
namespace Fur.DatabaseAccessor
{
/// <summary>
/// 默认应用数据库上下文
/// </summary>
/// <typeparam name="TDbContext">数据库上下文</typeparam>
[NonBeScan]
public abstract class AppDbContext<TDbContext> : AppDbContext<TDbContext, DbContextLocator>
where TDbContext : DbContext
{
/// <summary>
/// 构造函数
/// </summary>
/// <param name="options"></param>
public AppDbContext(DbContextOptions<TDbContext> options) : base(options)
{
}
}
}

8.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[])]:查询函数

8.2.6 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-multi-database/index.html b/handbook/build/docs/dbcontext-multi-database/index.html index 2224303f486..f59f202bc46 100644 --- a/handbook/build/docs/dbcontext-multi-database/index.html +++ b/handbook/build/docs/dbcontext-multi-database/index.html @@ -6,7 +6,7 @@ 8.17 多数据库操作 | Fur - + @@ -47,7 +47,7 @@
/// <summary>
/// 数据库 SqlServer
/// </summary>
/// <param name="connectionString">数据库连接字符串</param>
/// <param name="options">数据库上下文选项构建器</param>
private static void ConfigureSqlServer(string connectionString, DbContextOptionsBuilder options)
{
options.UseSqlServer(connectionString, options =>
{
// 配置全局切割 Sql,而不是生成单个复杂 sql
//options.UseQuerySplittingBehavior(QuerySplittingBehavior.SplitQuery);
// 配置 code first 程序集
options.MigrationsAssembly("Fur.Database.Migrations");
//options.EnableRetryOnFailure();
//options.MigrationsHistoryTable("__EFMigrationsHistory", "fur");
});
}
}
}

8.17.4 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-proc/index.html b/handbook/build/docs/dbcontext-proc/index.html index 1869420327f..1ba3d01b73e 100644 --- a/handbook/build/docs/dbcontext-proc/index.html +++ b/handbook/build/docs/dbcontext-proc/index.html @@ -6,7 +6,7 @@ 8.13 存储过程操作 | Fur - + @@ -119,7 +119,7 @@
// 获取 RETURN 返回值
var reval = result.ReturnValue;
// 获取返回结果集
var (list1,list2) = result.Result;
关于异步

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

8.13.3 关于 [DbParameter]

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

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

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

8.13.4 关于 ProcedureOutputResult

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

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

8.13.5 存储过程参数

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

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

8.13.6 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-query/index.html b/handbook/build/docs/dbcontext-query/index.html index 80fcb76a145..3fa68477c2a 100644 --- a/handbook/build/docs/dbcontext-query/index.html +++ b/handbook/build/docs/dbcontext-query/index.html @@ -6,7 +6,7 @@ 8.10 查询操作 | Fur - + @@ -138,7 +138,7 @@
// 示例二
_testRepository.Where(u => u.Name.EndWith("Fur"));
// 示例三
_testRepository.Where(u => u.Name.Contains("Fur"));

8.10.6.9 Case When

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

8.10.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-read-write/index.html b/handbook/build/docs/dbcontext-read-write/index.html index 58b1b63da2c..db18365aa94 100644 --- a/handbook/build/docs/dbcontext-read-write/index.html +++ b/handbook/build/docs/dbcontext-read-write/index.html @@ -6,7 +6,7 @@ 8.25 读写分离/主从复制 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/dbcontext-repository/index.html b/handbook/build/docs/dbcontext-repository/index.html index 1823b99ef88..24d6f276ef8 100644 --- a/handbook/build/docs/dbcontext-repository/index.html +++ b/handbook/build/docs/dbcontext-repository/index.html @@ -6,7 +6,7 @@ 8.4 关于仓储 | Fur - + @@ -33,7 +33,7 @@
// 其他更多数据库一样的操作

另外任何仓储或实体配置都支持多个数据库同时操作

仓储方式

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("不支持该数据库操作");

8.4.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-seed-data/index.html b/handbook/build/docs/dbcontext-seed-data/index.html index 0e5068be879..6dc0167e8c0 100644 --- a/handbook/build/docs/dbcontext-seed-data/index.html +++ b/handbook/build/docs/dbcontext-seed-data/index.html @@ -6,7 +6,7 @@ 8.20 实体种子数据 | Fur - + @@ -32,7 +32,7 @@
namespace Fur.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 = "广东省珠海市" }
};
}
}
}

8.20.3 导航属性

通常我们的实体有 一对多多对多等外键关系,那么我们需要单独为每一个实体添加数据种子,而不是直接写在主表中。

8.20.4 多个数据库种子数据

Fur 提供泛型的方式支持多个数据库种子数据设定,如:

using Fur.DatabaseAccessor;
using System.Collections.Generic;
namespace Fur.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 创建种子数据。

8.20.5 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

想了解更多 数据种子 知识可查阅 EF Core - 数据种子设定 章节。

- + diff --git a/handbook/build/docs/dbcontext-sql-proxy/index.html b/handbook/build/docs/dbcontext-sql-proxy/index.html index 62c37f04158..84846cb5153 100644 --- a/handbook/build/docs/dbcontext-sql-proxy/index.html +++ b/handbook/build/docs/dbcontext-sql-proxy/index.html @@ -6,7 +6,7 @@ 8.16 Sql 高级代理 | Fur - + @@ -76,7 +76,7 @@
namespace Fur.Application
{
public class ISql : ISqlDispatchProxy
{
[SqlFunction("FN_Name")] // 标量函数
string GetValue(MyParam dto);
[SqlProcedure("FN_Name")] // 表值函数
List<Person> GetPersons(int id);
}
}
补充说明

Sql 代理会自动判断返回值然后自动执行特定函数类型。

8.16.6 为什么用它?

通过上面的例子大家就可以了解,这种方式操作 sql 非常简单,而且极易维护。大家不用去关系返回值,关心用哪个方法,所有东西会自动给你处理好。

所以,如果需要用 Sql 操作,推荐使用 Sql 高级代理。

8.16.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-sql/index.html b/handbook/build/docs/dbcontext-sql/index.html index 9eee42fb861..ae76d7be67f 100644 --- a/handbook/build/docs/dbcontext-sql/index.html +++ b/handbook/build/docs/dbcontext-sql/index.html @@ -6,7 +6,7 @@ 8.15 Sql 操作 | Fur - + @@ -173,7 +173,7 @@
// 不再举例子。。。。。。
补充说明

不管是那种方式操作 Sql ,方法名参数都是一致的,如:

  • SqlQuery
  • SqlQueryAsync
  • SqlQueries
  • SqlQueriesAsync
  • SqlNonQuery
  • SqlNonQueryAsync
  • SqlScalar
  • SqlScalarAsync
  • SqlProcedureQuery
  • SqlProcedureQueryAsync
  • SqlProcedureQueries
  • SqlProcedureQueriesAsync
  • SqlProcedureScalar
  • SqlProcedureScalarAsync
  • SqlProcedureNonQuery
  • SqlProcedureNonQueryAsync
  • SqlProcedureOutput
  • SqlProcedureOutputAsync
  • SqlFunctionScalar
  • SqlFunctionScalarAsync
  • SqlFunctionQuery
  • SqlFunctionQuery

8.15.6 IRepository 操作

IRepository 也能操作 sql,调用方法也是和上面一致的,如:

var dataTable = repository.Sql().SqlQuery("select * from person");
特别说明

由于篇幅有限,不再列举所有例子。

8.15.7 IRepository<TEntity> 操作

IRepository<TEntity> 也能操作 sql,调用方法也是和上面一致的,如:

var dataTable = personRepository.SqlQuery("select * from person");
特别说明

由于篇幅有限,不再列举所有例子。

8.15.8 关于 Sql 参数

所有 sql存储过程函数 参数都支持四种方式:

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

建议除了复杂的存储过程(带 OUTPUT/RETURN)的以外,所有参数建议使用 new {} 匿名类型,如果需要动态参数,则可以使用 Dictionary<string,object> 类型。

8.15.9 多数据库 Sql 操作 💯 💛

Fur 框架拥有非常灵活的多数据库操作方式,只需通过多数据库上下文定位器即可动态切换数据库。

8.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> 方式即可动态切换数据库。

8.15.9.2 ISqlRepository 方式

只需要通过 ISqlRepository<TDbContextLocator> 注入或通过 sqlRepository.Change<TDbContextLocator>() 切换。

8.15.9.3 IRepository 方式

只需要通过 repository.Change<TDbContextLocator>() 获取即可。

8.15.9.4 IRepository<TEntity> 方式

只需要通过 IRepository<TEntity, TDbContextLocator> 注入或通过 personRepository.Change<TEntity, TDbContextLocator>() 切换。

8.15.10 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-update/index.html b/handbook/build/docs/dbcontext-update/index.html index e25029afb19..fb3660d39b2 100644 --- a/handbook/build/docs/dbcontext-update/index.html +++ b/handbook/build/docs/dbcontext-update/index.html @@ -6,7 +6,7 @@ 8.6 更新操作 | Fur - + @@ -198,7 +198,7 @@
// 示例二
await repository.UpdateNowAsync(new List<User> { user, user2 });
// 示例三
await repository.UpdateNowAsync(new[] {user, user2 });
小知识

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

8.6.15 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext-view/index.html b/handbook/build/docs/dbcontext-view/index.html index a0137af5c70..9a9082149f1 100644 --- a/handbook/build/docs/dbcontext-view/index.html +++ b/handbook/build/docs/dbcontext-view/index.html @@ -6,7 +6,7 @@ 8.12 视图操作 | Fur - + @@ -34,7 +34,7 @@
public FurService(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> 方法可以将仓储约束为特定仓储,如只读仓储,可读可写仓储,只新增仓储等。

8.12.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/dbcontext/index.html b/handbook/build/docs/dbcontext/index.html index 321f641c2e0..64e513c1739 100644 --- a/handbook/build/docs/dbcontext/index.html +++ b/handbook/build/docs/dbcontext/index.html @@ -6,7 +6,7 @@ 8.1 数据库上下文 | Fur - + @@ -34,7 +34,7 @@
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
base.OnConfiguring(optionsBuilder);
optionsBuilder.UseSqlServer("数据库连接字符串");
}
}
}

8.1.6 数据库上下文定义位置

特别注意

Fur 框架中,数据库上下文需定义在 Fur.EntityFramework.Core 中,且每一个数据库上下文都必须拥有唯一的 DbContextLocator 定位器

8.1.7 动态数据库上下文对象

Fur 框架中,数据库上下文是定义在 Fur.EntityFramework.Core 项目层,并且该层不被 Fur.ApplicationFur.Core 等层引用。

所以就不能直接在 Fur.Application 项目层直接使用 Fur.EntityFramework.Core 定义的数据库上下文。

Fur 为了解决这个问题,提供了两种方式处理:

  • respository.DbContext :当前数据库上下文对象,返回是 DbContext 抽象类型
  • respository.DynamicDbContext:当前数据库上下文对象,返回的是 dynamic 类型

如果你只是想使用 DbContext 的功能,直接使用 respository.DbContext 即可,如:

respository.DbContext.SaveChanges();

如果你想能够获取具体的数据库上下文类型,如 MyDbContext,那么使用 respository.DynamicDbContext 就可以获取到具体的 MyDbContext 类型。如:

var persons = respository.DynamicDbContext.Persons.Find(1);
var users = respository.DynamicDbContext.Users;

这样就可以直接操作 MyDbContext 定义的属性和方法了。

8.1.8 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

想了解更多 数据库上下文 知识可查阅 EF Core - 配置 DbContext 章节。

- + diff --git a/handbook/build/docs/dependency-injection/index.html b/handbook/build/docs/dependency-injection/index.html index a573fbc7b6b..6dff541d0c0 100644 --- a/handbook/build/docs/dependency-injection/index.html +++ b/handbook/build/docs/dependency-injection/index.html @@ -6,7 +6,7 @@ 10. 依赖注入/控制反转 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/deploy/index.html b/handbook/build/docs/deploy/index.html index 3920a9cd231..c2b75733451 100644 --- a/handbook/build/docs/deploy/index.html +++ b/handbook/build/docs/deploy/index.html @@ -6,7 +6,7 @@ 23. 托管部署 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/devops/index.html b/handbook/build/docs/devops/index.html index a60de9e0464..5a129faed05 100644 --- a/handbook/build/docs/devops/index.html +++ b/handbook/build/docs/devops/index.html @@ -6,7 +6,7 @@ 24. 持续部署集成 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/dynamic-api-controller/index.html b/handbook/build/docs/dynamic-api-controller/index.html index a390a7c0b14..0580b2a4f3a 100644 --- a/handbook/build/docs/dynamic-api-controller/index.html +++ b/handbook/build/docs/dynamic-api-controller/index.html @@ -6,7 +6,7 @@ 4. 动态 WebAPI | Fur - + @@ -75,7 +75,7 @@
namespace Fur.Web.Entry.Controllers
{
public class MvcController : ControllerBase
{
public string Get()
{
return nameof(Fur);
}
}
}
注意事项

启用该配置后,如果 Mvc 控制器 没有任何 [Route] 特性,但是贴了 [ApiController] 特性将会报错。原因是 [ApiController] 特性内部做了路由特性检测。所以建议使用 [ApiDataValidation] 代替。

查看 ASP.NET Core - ApiBehaviorApplicationModelProvider 源码

4.11 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/entity/index.html b/handbook/build/docs/entity/index.html index 025c9b842b1..817f24038f9 100644 --- a/handbook/build/docs/entity/index.html +++ b/handbook/build/docs/entity/index.html @@ -6,7 +6,7 @@ 8.3 数据库实体 | Fur - + @@ -39,7 +39,7 @@
// 配置数据库实体
public void Configure(EntityTypeBuilder<User> entityBuilder, DbContext dbContext, Type dbContextLocator)
{
entityBuilder.HasKey(u => u.Id);
entityBuilder.HasIndex(u => u.Name);
}
}
}

8.3.3.2 在任何实例类中配置

using Fur.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
namespace Fur.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 数据库实体。

8.3.4 数据库实体配置说明

Fur 框架会自动扫描所有继承 IEntity 接口的类进行 DbSet<TEntity> 注册,也就是实现自动配置 DbContextOnModelCreating

如果需要跳过自动注册,只需要贴 [NonAutomatic][NonBeScan] 特性即可。一旦贴了次特性,那么就需要手动配置 DbContextOnModelCreating

8.3.5 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/event-bus/index.html b/handbook/build/docs/event-bus/index.html index e0721a04c5c..3c8c06235c0 100644 --- a/handbook/build/docs/event-bus/index.html +++ b/handbook/build/docs/event-bus/index.html @@ -6,7 +6,7 @@ 17. 事件总线 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/friendly-exception/index.html b/handbook/build/docs/friendly-exception/index.html index bf78028af82..c9df62f512a 100644 --- a/handbook/build/docs/friendly-exception/index.html +++ b/handbook/build/docs/friendly-exception/index.html @@ -6,7 +6,7 @@ 6. 友好异常处理 | Fur - + @@ -59,7 +59,7 @@
namespace Fur.Application
{
public class FurAppService : IDynamicApiController
{
[IfException(ErrorCodes.z1000, ErrorMessage = "我覆盖了默认的:{0} 不能小于 {1}")]
[IfException(ErrorCodes.x1001, "格式化参数1", "格式化参数2", ErrorMessage = "我覆盖了默认的:{0} 不能小于 {1}")]
[IfException(ErrorCodes.x1000, "格式化参数1", "格式化参数2")]
[IfException(ErrorCodes.SERVER_ERROR, "格式化参数1", "格式化参数2")]
public int Get(int id)
{
if (id < 3)
{
throw Oops.Oh(ErrorCodes.z1000, id, 3);
}
return id;
}
}
}
格式化流程

如果消息内容中包含格式化占位符但未指定格式化参数,那么会查找异常所在方法是否贴有 [IfException] 特性且含有格式化参数,接着就会查找 Oops.Oh 中指定的 格式化参数

6.11 异常消息优先级

[ErrorCodeItemMetadata] -> appsettings.json -> [IfException](低 -> 高)

  • [IfException] 会覆盖 appsettings.json 定义的状态码消息。
  • appsettings.json 会覆盖 [ErrorCodeItemMetadata] 定义的消息。

6.12 多语言支持

文档整理中...

6.13 异常模型提供器

文档整理中...

6.14 Fur 内置异常

  • EFCoreErrorCodesEF Core 操作异常
    • DataNotFound:未找到数据
    • KeyNotSet:没有设置主键

6.15 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/get-start/index.html b/handbook/build/docs/get-start/index.html index 0ec52851efb..e835865b78b 100644 --- a/handbook/build/docs/get-start/index.html +++ b/handbook/build/docs/get-start/index.html @@ -6,7 +6,7 @@ 2. 一分钟入门 | Fur - + @@ -45,7 +45,7 @@
/// <summary>
/// 姓名
/// </summary>
[StringLength(32, MinimumLength = 2)]
public string Name { get; set; }
/// <summary>
/// 年龄
/// </summary>
public int Age { get; set; }
}
}

说好一分钟入门,你们用了多长时间。😁

- + diff --git a/handbook/build/docs/index.html b/handbook/build/docs/index.html index 24107606b01..04af3cd3c61 100644 --- a/handbook/build/docs/index.html +++ b/handbook/build/docs/index.html @@ -6,7 +6,7 @@ 1.1 介绍 | Fur - + @@ -20,13 +20,13 @@ - +
-

1.1 介绍

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.09.30

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

+

1.1 介绍

star fork GitHub stars GitHub forks GitHub license QQ群-592844340

Fur.NET 5 平台下极易入门、极速开发的 Web 应用框架。

🍕 名字的由来

故事是这样子的:

起初,想开发一个极易入门、极易维护的框架,开发理念为:一切从简,只为了更懒

所以自然而然想到了:Lazier,也就是 更懒 的意思。但是 更懒更烂 读音相近且中文名没有特色,对此换名问题我苦恼了好几天。

刚好有一次我在博客园中帮一个博友解答问题,解决后博友赞扬我对 .NET Core 颇有了解,我就顺嘴回答了一句:“略懂皮毛”

就这时,脑瓜子灵机一动,干脆起名为:“皮毛”?英文单词 Fur [fɜː(r)]”,单词又短而且中文读音既俗气又顺口。😄😎

所以,Fur 就诞生了。

之后就有了 “小僧不才,略懂皮毛(Fur)。” 广告语 和 chinadot.net 域名。

🍔 关于 LOGO

Fur LOGO 设计由 F U R 三个单词组成:

我相信很多人看到 Fur 的 LOGO 时都会问:“为什么选择奶牛?”,因为 那些年吹过的牛逼都实现了 🐮

之所以选择 奶牛 是因为 具有脚踏实地,任劳任怨的做事风格,同时 奶牛 意味着丰富的营养价值,正如 Fur 所能带给你的。

🍟 文档地址

https://chinadot.net

🌭 开源地址

🍿 Docker 镜像

docker run --name fur -p 5000:80 monksoul/fur:v1.0.0-2020.10.01

🥞 架构设计

正在整理中...

🥝 功能模块

🥐 框架依赖

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

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

🥗 环境要求

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

🥪 支持平台

  • 运行环境
    • Windows
    • Linux
    • MacOS
    • Docker/K8S/K3S/Rancher
  • 数据库
    • SqlServer
    • Sqlite
    • Azure Cosmos
    • MySql
    • PostgreSQL
    • InMemory
    • Oracle

🍖 关于性能

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

🥟 问答 FAQ

🥇 1. 不是有一个 Abp 框架了吗?

Abp 确实是非常棒的框架,曾经本人也受益于它,Fur 并不是想要替代 Abp,而是想给 .NET 开发者多一个选择。

同时 Fur 框架是本人这 12 年的 .NET 开发经验的浓缩版。

🥈 2. 和 Abp 框架的区别?

FurAbp 有几大区别:

  • Fur 追求的是极少依赖和极速开发,和 Abp 大而包容不同
  • Fur 遵循宽松自由的 Apache-2.0 开源协议,这一点和 Abp 采用商用 LGPL-3.0 协议有着很大差别
  • Fur 符合中国国情开发,深知中国开发者最需要什么,框架内部提供了大量开发者需要的语法糖,而不仅仅是基础操作
  • FurAbp 在实现相同功能上,Fur 做的更加灵活和简单
  • Fur 是基于最新的 .NET 5 开发,抛开历史包袱,乘上 .NET 彻底跨平台的大船
  • Fur 是作为中国开发者推出,仅此而已

🥉 3. 为什么想要开发这样的一个框架?

开发这样的框架目的是为了能够提高自己的开发效率,也是为了验证自己对 .NET 新技术的掌握程度,同时也希望通过开源能够帮到更多的 .NET 开发者,也能从中受益。


🍚 关于作者

一个拥有 12 年开发经验 .NETer。喜欢分享,喜欢新技术,在互联网多个技术领域皆有涉猎。

🍤 项目成员

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

🍝 谁在使用

  • 百签科技(广东)有限公司
  • 码为科技(广州)有限公司
  • 广州启顺国际货运代理有限公司
  • 森丰供应链服务(广州)有限公司
  • 中山赢友网络科技有限公司
  • 中山模思软件科技有限公司
  • 珠海市恒泰新软件有限责任公司
  • 珠海思诺锐创软件有限公司
  • 深圳市易胜科技有限公司
  • 重庆虫儿飞科技有限公司
  • 重庆林木森科技有限公司

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

🍻 贡献代码

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

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

🍍 捐赠列表

注:排序按捐赠顺序书写

捐赠人昵称捐赠金额(元)附语
🤴 爱吃油麦菜100感谢您的开源项目!
👳‍♂️ 麦壳饼200感谢您的开源项目!
👨 Sun100感谢您的开源项目!
👶 d61761720感谢您的开源项目!
👦 Diqiguoji00816.66见贤思齐
👲 nodyang100感谢您的开源项目!
👳‍♀️ mictxd100吹过的牛都实现。
🧓 欧流全10希望将来超越 Spring
👨‍⚕️ lionkon10...看了框架感觉拿来学习是很不错的...

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

🥔 QQ 交流群

🧆 友情链接

👉 Fur 👉 SqlSugar 👉 Layx 👉 t-io

- + @@ -40,6 +40,6 @@ - + \ No newline at end of file diff --git a/handbook/build/docs/job/index.html b/handbook/build/docs/job/index.html index 49f62742225..cd111ad6a49 100644 --- a/handbook/build/docs/job/index.html +++ b/handbook/build/docs/job/index.html @@ -6,7 +6,7 @@ 21. 任务调度 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/local-language/index.html b/handbook/build/docs/local-language/index.html index ef5839436e4..bf70965a398 100644 --- a/handbook/build/docs/local-language/index.html +++ b/handbook/build/docs/local-language/index.html @@ -6,7 +6,7 @@ 15. 多语言处理 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/logging/index.html b/handbook/build/docs/logging/index.html index 40b991e63ff..7a2f6421c33 100644 --- a/handbook/build/docs/logging/index.html +++ b/handbook/build/docs/logging/index.html @@ -6,7 +6,7 @@ 18. 日志记录 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/object-mapper/index.html b/handbook/build/docs/object-mapper/index.html index 6970060ff27..2760f7e8221 100644 --- a/handbook/build/docs/object-mapper/index.html +++ b/handbook/build/docs/object-mapper/index.html @@ -6,7 +6,7 @@ 11. 对象数据映射 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/options/index.html b/handbook/build/docs/options/index.html index f0088c42e1c..51a9cc0b387 100644 --- a/handbook/build/docs/options/index.html +++ b/handbook/build/docs/options/index.html @@ -6,7 +6,7 @@ 3.2 选项 | Fur - + @@ -41,7 +41,7 @@
public void OnListener(AppInfoOptions options, IConfiguration configuration)
{
var name = options.Name; // 实时的最新值
var version = options.Version; // 实时的最新值
}
public void PostConfigure(AppInfoOptions options, IConfiguration configuration)
{
}
}
特别说明

IConfigurableOptionsListener<TOptions> 继承自 IConfigurableOptions<TOptions>

3.3.9 选项的优缺点

优点

  • 强类型配置
  • 提供多种读取方式
  • 支持热加载
  • 支持设置默认值/后期配置
  • 支持在运行环境中动态配置
  • 支持验证配置有效性
  • 支持更改通知
  • 支持命名选项

缺点

  • 需要定义对应类型
  • 需要在启动时注册

3.3.10 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

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

- + diff --git a/handbook/build/docs/performance/index.html b/handbook/build/docs/performance/index.html index 266a76bf2c3..4b15c2941c1 100644 --- a/handbook/build/docs/performance/index.html +++ b/handbook/build/docs/performance/index.html @@ -6,7 +6,7 @@ 25.2 性能测试 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/process-service/index.html b/handbook/build/docs/process-service/index.html index 4c8492bf8ee..2a10d14fdc2 100644 --- a/handbook/build/docs/process-service/index.html +++ b/handbook/build/docs/process-service/index.html @@ -6,7 +6,7 @@ 20. 进程服务 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/saas/index.html b/handbook/build/docs/saas/index.html index c237830ed86..67b31ddc559 100644 --- a/handbook/build/docs/saas/index.html +++ b/handbook/build/docs/saas/index.html @@ -6,7 +6,7 @@ 9. SaaS 多租户 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/signalr/index.html b/handbook/build/docs/signalr/index.html index 4a418d51287..9a17dad28c0 100644 --- a/handbook/build/docs/signalr/index.html +++ b/handbook/build/docs/signalr/index.html @@ -6,7 +6,7 @@ 22. 即时通讯 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/source/index.html b/handbook/build/docs/source/index.html index 3ba389d1087..3daf66dab60 100644 --- a/handbook/build/docs/source/index.html +++ b/handbook/build/docs/source/index.html @@ -6,7 +6,7 @@ 1.2 源码结构 | Fur - + @@ -58,7 +58,7 @@
#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 平台下极易入门、极速开发的 Web 应用框架。\nCopyright © 2020 Fur, Baiqian Co.,Ltd.\n\n框架名称:Fur\n框架作者:百小僧\n框架版本:1.0.0\n源码地址:Gitee:https://gitee.com/monksoul/Fur \n Github:https://github.com/monksoul/Fur \n开源协议:Apache-2.0(http://www.apache.org/licenses/LICENSE-2.0)\n-----------------------------------------------------------------------------

1.2.4 Fur 核心层

Fur 核心层是 Fur 框架的中心,也是 Fur 能够支撑起来的必备层。

源码结构:

Fur
├─Fur.csproj
├─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
| ├─Helpers
| | └Helpers.cs
| ├─Extensions
| | ├─MapsterExtensions.cs
| | └ObjectMapperServiceCollectionExtensions.cs
| ├─Dependencies
| | └IObjectMapper.cs
├─LinqBuilder
| ├─Visitors
| | └ParameterReplaceExpressionVisitor.cs
| ├─Extensions
| | ├─EFCoreLinqExtensions.cs
| | ├─LinqExpressionExtensions.cs
| | └LinqExtensions.cs
| ├─Builders
| | ├─EFCoreLinqBuilder.cs
| | └LinqBuilder.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
| ├─AppStartup.cs
| ├─Extensions
| | └DependencyInjectionServiceCollectionExtensions.cs
| ├─Enums
| | ├─InjectionOptions.cs
| | ├─InjectionScopeOptions.cs
| | └RegisterType.cs
| ├─Dependencies
| | ├─IDependency.cs
| | ├─IDispatchProxy.cs
| | ├─IScopedDependency.cs
| | ├─ISingletonDependency.cs
| | └ITransientDependency.cs
| ├─Attributes
| | ├─InjectionAttribute.cs
| | ├─NonBeScanAttribute.cs
| | └StartupOrderAttribute.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
├─DatabaseAccessor
| ├─UnitOfWork
| | ├─Filters
| | | └UnitOfWorkFilter.cs
| | ├─Attributes
| | | ├─NonTransactAttribute.cs
| | | └UnitOfWorkAttribute.cs
| ├─Repositories
| | ├─EFCoreRepository.cs
| | ├─IRepository.cs
| | ├─ISqlRepository.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
| ├─Options
| | └DatabaseAccessorSettingsOptions.cs
| ├─MultiTenants
| | ├─Providers
| | | └IMultiTenantProvider.cs
| | ├─Locators
| | | └MultiTenantDbContextLocator.cs
| | ├─Enums
| | | └MultiTenantOptions.cs
| | ├─Entities
| | | └Tenant.cs
| ├─Models
| | ├─DatabaseProvider.cs
| | ├─PagedList.cs
| | ├─ProcedureOutputResult.cs
| | └ProcedureOutputValue.cs
| ├─Locators
| | ├─DbContextLocator.cs
| | └IDbContextLocator.cs
| ├─Interceptors
| | ├─DbContextSaveChangesInterceptor.cs
| | ├─SqlCommandProfilerInterceptor.cs
| | └SqlConnectionProfilerInterceptor.cs
| ├─Helpers
| | └DbHelpers.cs
| ├─Extensions
| | ├─DatabaseAccessorServiceCollectionExtensions.cs
| | ├─PagedQueryableExtensions.cs
| | ├─Repositories
| | | ├─IEntityDbContextLocatorExtensions.cs
| | | ├─IEntityExtensions.cs
| | | └SqlExtensions.cs
| | ├─DatabaseProvider
| | | ├─Penetrates.cs
| | | ├─SqliteServiceCollectionExtensions.cs
| | | └SqlServerServiceCollectionExtensions.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
| | | ├─IModelBuilderDependency.cs
| | | └IModelBuilderFilter.cs
| | ├─Attributes
| | | ├─FakeDeleteAttribute.cs
| | | ├─NonAutomaticAttribute.cs
| | | └QueryableFunctionAttribute.cs
| ├─Contexts
| | ├─AppDbContext.cs
| | ├─Builders
| | | ├─AppDbContextBuilder.cs
| | | ├─Models
| | | | └DbContextCorrelationType.cs
| | ├─Attributes
| | | └DbContextAttribute.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
├─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
| ├─Options
| | └AppSettingsOptions.cs
| ├─Extensions
| | ├─AppApplicationBuilderExtensions.cs
| | ├─AppServiceCollectionExtensions.cs
| | └ObjectExtensions.cs
| ├─Enums
| | └ProjectType.cs

1.2.5 Fur.Application 业务应用层

Fur.Application 业务应用层是最常用的层,几乎所有的业务代码都在这个层中编写。

源码结构:

Fur.Application
├─Fur.Application.Core.csproj
├─Fur.Application.Core.xml
└FurApplicationStartup.cs

1.2.6 Fur.Core 仓储实体层

Fur.Core 主要是存储自定义仓储和定义实体的层。

源码结构:

Fur.Core
├─Fur.Core.csproj
└FurCoreStartup.cs

1.2.7 Fur.Database.Migrations 数据库架构维护层

Fur.Database.Migrations 主要是用来存放 Database FirstCode First 生成的维护文件。

源码结构:

Fur.Database.Migrations
└Fur.Database.Migrations.csproj

1.2.8 Fur.EntityFramework.Core 数据库上下文配置层

Fur.EntityFramework.Core 主要是用来配置数据库上下文和其他数据库相关配置信息的。

源码结构:

Fur.EntityFramework.Core
└Fur.EntityFramework.Core.csproj

1.2.9 Fur.Web.Core 应用核心层

Fur.Web.Core 主要是用来配置 Web 入口一些代码,如 FilterMiddlewares 等。

源码结构:

Fur.Web.Core
├─Fur.Web.Core.xml
└FurWebCoreStartup.cs

1.2.10 Fur.Web.Entry 应用入口层

Fur.Web.Entry 是我们的应用层,也就是我们的 Web 项目层,发布层。

源码结构:

Fur.Web.Entry
├─appsettings.Development.json
├─appsettings.json
├─Fur.Web.Entry.csproj
├─Fur.Web.Entry.csproj.user
├─Fur.Web.Entry.xml
├─Program.cs
├─Startup.cs
├─wwwroot
| └README.md
├─Properties
| └launchSettings.json
├─Controllers
- + diff --git a/handbook/build/docs/specification-document/index.html b/handbook/build/docs/specification-document/index.html index 18c74766cd0..904e4d75625 100644 --- a/handbook/build/docs/specification-document/index.html +++ b/handbook/build/docs/specification-document/index.html @@ -6,7 +6,7 @@ 5. 规范化接口文档 | Fur - + @@ -51,7 +51,7 @@
"Requirement": {
"Scheme": {
"Reference": {
"Id": "Bearer",
"Type": "SecurityScheme"
},
"Accesses": null
}
}
}
]
}
}
}

5.5.12 在线测试

如下图所示:

5.5.13 性能监视 MiniProfiler

规范化文档默认集成了 MiniProfiler 第三方性能组件,通过该组件可以方便查看请求性能、异常堆栈、数据库操作等信息。默认在 Swagger 首页左上角显示。

如下图所示:

小提示

也可以通过 appsetting.jsonAppSettings:InjectMiniProfiler 设为 false 关闭。

5.5.14 定义接口输出类型

using Fur.DynamicApiController;
using Microsoft.AspNetCore.Mvc;
namespace Fur.Application
{
public class FurAppService : IDynamicApiController
{
[ProducesResponseType(201, Type = typeof(TestDto))]
[ProducesResponseType(400)]
public string Get()
{
return nameof(Fur);
}
}
}

如下图所示:

5.6 SpecificationDocumentSettings 配置

除了上述例子外,Fur 提供了一些配置选项,如:

  • DocumentTitle:文档标题,string,默认 Specification Api Document
  • DefaultGroupName:默认分组名,string,默认 Default
  • EnableAuthorized:是否启用权限控制,bool,默认 true
  • FormatAsV2:采用 Swagger 2.0 版本,bool,默认 false
  • RoutePrefix:规范化文档地址,string,默认 string
  • DocExpansionState:文档显示方式,DocExpansion,默认 List,取值:
    • List:列表式(展开子类),默认值
    • Full:完全展开
    • None:列表式(不展开子类)
  • XmlComments:程序集注释描述文件名(可带 .xmlstring,默认 Fur.Application, Fur.Web.Entry, Fur.Web.Core
  • GroupOpenApiInfos:分组信息配置,SpecificationOpenApiInfo[],默认 { 'Group': 'Default'}
  • SecurityDefinitions:安全策略定义配置,SpecificationOpenApiSecurityScheme[],默认 []

5.7 反馈与建议

与我们交流

给 Fur 提 Issue

- + diff --git a/handbook/build/docs/split-db/index.html b/handbook/build/docs/split-db/index.html index 322cb731aa4..93532b92acf 100644 --- a/handbook/build/docs/split-db/index.html +++ b/handbook/build/docs/split-db/index.html @@ -6,7 +6,7 @@ 8.26 分表分库 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/tran/index.html b/handbook/build/docs/tran/index.html index b361286ecab..24d689aff54 100644 --- a/handbook/build/docs/tran/index.html +++ b/handbook/build/docs/tran/index.html @@ -6,7 +6,7 @@ 8.24 事务和工作单元 | Fur - + @@ -29,7 +29,7 @@
var blogs = _testRepository.Entity
.OrderBy(b => b.Url)
.ToList();
// 提交事务
transaction.Commit();
}
catch (Exception)
{
// 回滚事务
transaction.RollBack();
}
}

8.24.4 工作单元特性说明

8.24.4.1 [UnitOfWork]

[UnitOfWork] 特性用来标记事务信息,如作用范围,隔离级别等。

  • Enabled:是否启动工作单元,默认 true
  • ScopeOption:定义事务范围行为,默认 TransactionScopeOption.Required
  • IsolationLevel:设置事务隔离级别,默认 IsolationLevel.ReadCommitted;
  • AsyncFlowOption:允许跨线程连续任务的事务流,如有异步操作需开启该选项,默认开启
特别注意

一旦方法贴了 [UnitOfWork(false)] 特性后,那么该方法不再启用工作单元模式,也就是不包含事务,也不会自动提交数据库。慎用!

8.24.4.2 [NonTransact]

一定方法或类贴了 [NonTransact] 特性,那么将关闭事务操作,但是还是会自动保存数据库到数据。

8.24.5 常见错误

  • A TransactionScope must be disposed on the same thread that it was created.

只需要在当前操作方法上贴 [NonTransact] 特性即可。

8.24.6 反馈与建议

与我们交流

给 Fur 提 Issue


了解更多

想了解更多 事务 知识可查阅 EF Core - 使用事务 章节。

- + diff --git a/handbook/build/docs/unittest/index.html b/handbook/build/docs/unittest/index.html index 85c77467540..1c570d01556 100644 --- a/handbook/build/docs/unittest/index.html +++ b/handbook/build/docs/unittest/index.html @@ -6,7 +6,7 @@ 25.1 单元测试 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/docs/view-engine/index.html b/handbook/build/docs/view-engine/index.html index 1c34ba2af64..fc29fae141e 100644 --- a/handbook/build/docs/view-engine/index.html +++ b/handbook/build/docs/view-engine/index.html @@ -6,7 +6,7 @@ 16. 视图引擎 | Fur - + @@ -26,7 +26,7 @@ - + diff --git a/handbook/build/index.html b/handbook/build/index.html index a2a63d85611..8feabefd82b 100644 --- a/handbook/build/index.html +++ b/handbook/build/index.html @@ -6,7 +6,7 @@ Fur 是 .NET 5 平台下极易入门、极速开发的 Web 应用框架。 Fur | Fur - + @@ -22,7 +22,7 @@

Fur 是 .NET 5 平台下极易入门、极速开发的 Web 应用框架。

[object Object]

.NET 5 新起点

.NET 5 是 .NET 的重要且令人兴奋的新方向。你会看到 .NET 变得更加简单,但也有更广泛的功能和实用程序。所有新的开发和功能都将是 .NET 5 的一部分,包括新的 C# 版本

[object Object]

“六级” 架构

Fur 在设计之初就秉承着 “六极” :极易入门、极速开发、极少依赖、极少配置、极其灵活、极易维护 的设计思想,在架构设计上做了大量的优化,支持各个能力阶层技术员极速上手。

[object Object]

冲一杯咖啡的时间

Fur 除了独具创新的设计理念和灵活的架构设计以外,同时还结合了主流的敏捷开发模式打造的一款极速开发框架。只需冲制一杯咖啡的时间便可完成工作

- + diff --git a/docs/runtime~main.f7abd164.js b/handbook/build/runtime~main.84a0866b.js similarity index 97% rename from docs/runtime~main.f7abd164.js rename to handbook/build/runtime~main.84a0866b.js index 049dbb0602d..e3332e0e01a 100644 --- a/docs/runtime~main.f7abd164.js +++ b/handbook/build/runtime~main.84a0866b.js @@ -1 +1 @@ -!function(e){function a(a){for(var c,r,t=a[0],n=a[1],o=a[2],u=0,l=[];u