You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
12 months ago
|
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[657],{1995:(e,n,c)=>{c.r(n),c.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>a,frontMatter:()=>s,metadata:()=>t,toc:()=>l});var i=c(5893),r=c(1151);c(4996);const s={id:"inject",title:"2.8 \u795e\u5947\u7684 Inject",sidebar_label:"2.8 \u795e\u5947\u7684 Inject",description:"\u4e00\u53e5\u8bdd\u96c6\u6210 Furion"},d=void 0,t={id:"inject",title:"2.8 \u795e\u5947\u7684 Inject",description:"\u4e00\u53e5\u8bdd\u96c6\u6210 Furion",source:"@site/docs/inject.mdx",sourceDirName:".",slug:"/inject",permalink:"/docs/inject",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/inject.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1682387971,formattedLastUpdatedAt:"Apr 25, 2023",frontMatter:{id:"inject",title:"2.8 \u795e\u5947\u7684 Inject",sidebar_label:"2.8 \u795e\u5947\u7684 Inject",description:"\u4e00\u53e5\u8bdd\u96c6\u6210 Furion"},sidebar:"docs",previous:{title:"2.7 \u624b\u52a8\u642d\u5efa\u5206\u5c42",permalink:"/docs/reference"},next:{title:"2.9 .NET5 \u5347\u7ea7 .NET6",permalink:"/docs/net5-to-net6"}},o={},l=[{value:"2.8.1 <code>Inject</code> \u8bbe\u8ba1",id:"281-inject-\u8bbe\u8ba1",level:2},{value:"2.8.2 <code>Inject</code> \u65b9\u6cd5\u6709\u54ea\u4e9b",id:"282-inject-\u65b9\u6cd5\u6709\u54ea\u4e9b",level:2},{value:"2.8.3 \u5728 <code>Program.cs</code> \u4e2d\u4f7f\u7528",id:"283-\u5728-programcs-\u4e2d\u4f7f\u7528",level:2},{value:"2.8.3.1 <code>Inject()</code> \u65b9\u6cd5",id:"2831-inject-\u65b9\u6cd5",level:3},{value:"2.8.4 <code>Startup.ConfigureServices</code> \u4f7f\u7528",id:"284-startupconfigureservices-\u4f7f\u7528",level:2},{value:"2.8.4.1 <code>AddInject()</code> \u65b9\u6cd5",id:"2841-addinject-\u65b9\u6cd5",level:3},{value:"2.8.4.2 <code>AddInjectBase()</code> \u65b9\u6cd5",id:"2842-addinjectbase-\u65b9\u6cd5",level:3},{value:"2.8.4.3 <code>AddInjectMini()</code> \u65b9\u6cd5",id:"2843-addinjectmini-\u65b9\u6cd5",level:3},{value:"2.8.4.4 <code>AddInjectWithUnifyResult()</code> \u65b9\u6cd5",id:"2844-addinjectwithunifyresult-\u65b9\u6cd5",level:3},{value:"2.8.5 <code>Startup.Configure</code> \u4f7f\u7528",id:"285-startupconfigure-\u4f7f\u7528",level:2},{value:"2.8.5.1 <code>UseInject()</code> \u65b9\u6cd5",id:"2851-useinject-\u65b9\u6cd5",level:3},{value:"2.8.5.2 <code>UseInjectBase()</code> \u65b9\u6cd5",id:"2852-useinjectbase-\u65b9\u6cd5",level:3},{value:"2.8.6 \u914d\u7f6e <code>Inject()</code> \u9ed8\u8ba4\u6ce8\u518c\u670d\u52a1",id:"286-\u914d\u7f6e-inject-\u9ed8\u8ba4\u6ce8\u518c\u670d\u52a1",level:2},{value:"2.8.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"287-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function j(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",ul:"ul",...(0,r.a)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.admonition,{title:"\u7279\u522b\u6ce8\u610f",type:"warning",children:(0,i.jsxs)(n.p,{children:["\u6240\u6709 ",(0,i.jsx)(n.code,{children:".AddInject****()"})," \u65b9\u6cd5\u4e0d\u80fd\u540c\u65f6\u6ce8\u518c\uff0c\u53ea\u80fd\u53d6\u5176\u4e00\u3002"]})}),"\n",(0,i.jsxs)(n.h2,{id:"281-inject-\u8bbe\u8ba1",children:["2.8.1 ",(0,i.jsx)(n.code,{children:"Inject"})," \u8bbe\u8ba1"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Inject [\u026an\u02c8d\u0292ekt]"})," \u610f\u601d\u662f ",(0,i.jsx)(n.code,{children:"\u6ce8\u5165\uff0c\u6ce8\u5c04"})," \u7684\u610f\u601d\uff0c\u5728\u8fd9\u91cc\u610f\u4e3a\u4f7f\u7528\u6700\u5c0f\u7684\u4fb5\u5165\u5f0f\u5bf9\u5e94\u7528\u8fdb\u884c\u673a\u80fd\u6539\u9020\u3002"]}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Inject()"})," \u65b9\u6cd5\u662f ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u7684\u6700\u5c0f\u4fb5\u5165\u5f0f\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u8ba9\u4efb\u4f55 ",(0,i.jsx)(n.code,{children:"ASP.NET Core"})," Web \u540e\u7aef\u9879\u76ee\u77ac\u95f4\u652f\u6301\u6240\u6709 ",(0,i.jsx)(n.code,{children:"Furion"})," \u6846\u67b6\u7279\u6027\u3002"]}),"\n",(0,i.jsxs)(n.h2,{id:"282
|