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
20 KiB
JavaScript
1 line
20 KiB
JavaScript
12 months ago
|
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[4821],{2679:(r,n,e)=>{e.r(n),e.d(n,{assets:()=>u,contentTitle:()=>a,default:()=>l,frontMatter:()=>t,metadata:()=>o,toc:()=>d});var s=e(5893),i=e(1151);const t={id:"dbcontext-query",title:"9.11 \u67e5\u8be2\u64cd\u4f5c",sidebar_label:"9.11 \u67e5\u8be2\u64cd\u4f5c"},a=void 0,o={id:"dbcontext-query",title:"9.11 \u67e5\u8be2\u64cd\u4f5c",description:"9.11.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",source:"@site/docs/dbcontext-query.mdx",sourceDirName:".",slug:"/dbcontext-query",permalink:"/docs/dbcontext-query",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/dbcontext-query.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1682389320,formattedLastUpdatedAt:"Apr 25, 2023",frontMatter:{id:"dbcontext-query",title:"9.11 \u67e5\u8be2\u64cd\u4f5c",sidebar_label:"9.11 \u67e5\u8be2\u64cd\u4f5c"},sidebar:"docs",previous:{title:"9.10 \u6279\u91cf\u64cd\u4f5c",permalink:"/docs/dbcontext-batch"},next:{title:"9.12 \u9ad8\u7ea7\u67e5\u8be2\u64cd\u4f5c",permalink:"/docs/dbcontext-hight-query"}},u={},d=[{value:"9.11.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",id:"9111-\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",level:2},{value:"9.11.2 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761",id:"9112-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u4e00\u6761",level:2},{value:"9.11.3 \u67e5\u8be2\u6240\u6709\u6570\u636e",id:"9113-\u67e5\u8be2\u6240\u6709\u6570\u636e",level:2},{value:"9.11.4 \u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e",id:"9114-\u6839\u636e\u6761\u4ef6\u67e5\u8be2\u6240\u6709\u6570\u636e",level:2},{value:"9.11.5 \u5206\u9875\u67e5\u8be2",id:"9115-\u5206\u9875\u67e5\u8be2",level:2},{value:"9.11.6 \u5176\u4ed6\u67e5\u8be2",id:"9116-\u5176\u4ed6\u67e5\u8be2",level:2},{value:"9.11.6.1 \u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728",id:"91161-\u67e5\u770b\u8bb0\u5f55\u662f\u5426\u5b58\u5728",level:3},{value:"9.11.6.2 \u67e5\u8be2\u8bb0\u5f55\u6570",id:"91162-\u67e5\u8be2\u8bb0\u5f55\u6570",level:3},{value:"9.11.6.3 \u67e5\u8be2\u6700\u5927\u503c",id:"91163-\u67e5\u8be2\u6700\u5927\u503c",level:3},{value:"9.11.6.4 \u67e5\u8be2\u6700\u5c0f\u503c",id:"91164-\u67e5\u8be2\u6700\u5c0f\u503c",level:3},{value:"9.11.6.5 \u6c42\u548c\u67e5\u8be2",id:"91165-\u6c42\u548c\u67e5\u8be2",level:3},{value:"9.11.6.6 \u6c42\u5e73\u5747\u503c\u67e5\u8be2",id:"91166-\u6c42\u5e73\u5747\u503c\u67e5\u8be2",level:3},{value:"9.11.6.7 \u65f6\u95f4\u67e5\u8be2",id:"91167-\u65f6\u95f4\u67e5\u8be2",level:3},{value:"9.11.6.8 \u6a21\u7cca\u67e5\u8be2",id:"91168-\u6a21\u7cca\u67e5\u8be2",level:3},{value:"9.11.6.9 <code>Case When</code>",id:"91169-case-when",level:3},{value:"9.11.7 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"9117-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function c(r){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",p:"p",pre:"pre",...(0,i.a)(),...r.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h2,{id:"9111-\u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761",children:"9.11.1 \u6839\u636e\u4e3b\u952e\u67e5\u8be2\u4e00\u6761"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-cs",metastring:"showLineNumbers",children:"// ==== \u540c\u6b65\u64cd\u4f5c ====\r\n\r\n// \u793a\u4f8b\u4e00\r\nvar person = repository.Find(1);\r\n\r\n// \u793a\u4f8b\u4e8c\r\nvar person = repository.FindOrDefault(1);\r\n\r\n// \u793a\u4f8b\u4e09\r\nvar person = repository.Entities.Find(1);\r\n\r\n// ==== \u5f02\u6b65\u64cd\u4f5c ====\r\n\r\n// \u793a\u4f8b\u4e00\r\nvar person = await repository.FindAsync(1);\r\n\r\n// \u793a\u4f8b\u4e8c\r\nvar person = await repository.FindOrDefaultAsync(1);\r\n\r\n// \u793a\u4f8b\u4e09\r\nvar person = await repository.Entities.FindAsync(1);\r\n\n"})}),"\n",(0,s.jsx)(n.admonition,{title:"\u5c0f\u63d0\u793a",type:"tip",children:(0,s.jsxs)(n.p,{children:["\u53ef\u4ee5\u652f\u6301\u591a\u4e2a\u952e\u67e5\u8be2\uff0c\u5982\u4e3b\u952e\u3001\u8054\u5408\u952e\u3002",(0,s.jsx)(n.code,{children:'repository.Find(1, "\u767e\u5c0f\u50e7")'}),";"]})})
|