中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

網(wǎng)站開發(fā)項(xiàng)目組團(tuán)隊(duì)蘇州百度 seo

網(wǎng)站開發(fā)項(xiàng)目組團(tuán)隊(duì),蘇州百度 seo,政府網(wǎng)站的建設(shè)方案,加拿大pc網(wǎng)站搭建文章目錄 1. IOrganization Interface1.1 基本介紹1.2 方法分析 2. Entity對(duì)象2.1 Constructor2.2 Properties2.3 Methods 3. 相關(guān)方法3.1 單行查詢 Retrive3.2 多行查詢 RetriveMultiple3.3 增加 Create3.4 刪除 Delete3.5 修改 Update 4. 數(shù)據(jù)查詢的不同實(shí)現(xiàn)方式4.1 QueryExp…

文章目錄

    • 1. IOrganization Interface
      • 1.1 基本介紹
      • 1.2 方法分析
    • 2. Entity對(duì)象
      • 2.1 Constructor
      • 2.2 Properties
      • 2.3 Methods
    • 3. 相關(guān)方法
      • 3.1 單行查詢 Retrive
      • 3.2 多行查詢 RetriveMultiple
      • 3.3 增加 Create
      • 3.4 刪除 Delete
      • 3.5 修改 Update
    • 4. 數(shù)據(jù)查詢的不同實(shí)現(xiàn)方式
      • 4.1 QueryExpression
      • 4.2 QueryByAttribute
      • 4.3 FetchExpression
      • 4.4 LINQ

1. IOrganization Interface

1.1 基本介紹

  1. IOrganization 是用于向組織提供元數(shù)據(jù)以及數(shù)據(jù)的編程訪問的接口. (Dataverse的增刪改查以及表聯(lián)系的相關(guān)操作)
//ServiceClient、CrmServiceClient 都可實(shí)現(xiàn) IOrganizationService接口
IOrganizationService service = new CrmServiceClient(connectionString);
IOrganizationService service = new ServiceClient(connectionString);
using Microsoft.Crm.Sdk.Messages;
using Microsoft.PowerPlatform.Dataverse.Client;
using Microsoft.Xrm.Sdk;class Program
{// Dataverse環(huán)境URL以及登錄信息static string url = "https://yourorg.crm.dynamics.com";static string userName = "you@yourorg.onmicrosoft.com";static string password = "yourPassword";// 連接上述代碼串進(jìn)行測試static string connectionString = $@"AuthType = OAuth;Url = {url};UserName = {userName};Password = {password};AppId = 51f81489-12ee-4a9e-aaae-a2591f45987d;RedirectUri = http://localhost;LoginPrompt=Auto;RequireNewInstance = True";static void Main(){// 獲取IorganizationService的接口實(shí)例IOrganizationService service = new ServiceClient(connectionString);var response = (WhoAmIResponse)service.Execute(new WhoAmIRequest());Console.WriteLine($"User ID is {response.UserId}.");// Pause the console so it does not close.Console.WriteLine("Press the <Enter> key to exit.");Console.ReadLine();}
}

? 參考文獻(xiàn). c#連接Microsoft Dataver:c#連接 MicroSoft Dataverse
?

1.2 方法分析

在這里插入圖片描述
? 參考文獻(xiàn). IOrganization:IOrganizationService 接口
?

2. Entity對(duì)象

2.1 Constructor

在這里插入代碼片

2.2 Properties

在這里插入代碼片

2.3 Methods

在這里插入代碼片

? 參考文獻(xiàn). Entity對(duì)象:Entity對(duì)象

3. 相關(guān)方法

3.1 單行查詢 Retrive

? a. 代碼及使用

//public Microsoft::Xrm::Sdk::Entity ^ Retrieve(System::String ^ entityName, Guid id, Microsoft::Xrm::Sdk::Query::ColumnSet ^ columnSet);    
static void Retrive(IOrganizationService service){string entityName = "crda9_room"; // 邏輯名稱ColumnSet columnSet = new ColumnSet("crda9_name", "crda9_type", "crda9_site"); // 查詢的屬性Guid guid = new Guid("4e4c81a1-439d-ee11-be37-000d3a85d073"); // 全局唯一標(biāo)識(shí)符Entity entity = service.Retrieve(entityName, guid, columnSet); // 發(fā)起查詢Console.WriteLine($"name:{entity.GetAttributeValue<string>("crda9_name")}"+ "   " + $"type:{entity.GetAttributeValue<OptionSetValue>("crda9_type").Value}"+ "   " + $"site:{entity.GetAttributeValue<string>("crda9_site")}");
}

?

3.2 多行查詢 RetriveMultiple

? a. 代碼及使用

// Microsoft::Xrm::Sdk::EntityCollection ^ RetrieveMultiple(Microsoft::Xrm::Sdk::Query::QueryBase ^ query);
static void RetriveMultiple(IOrganizationService service){QueryExpression query = new("crda9_room") { }; // 表邏輯名稱EntityCollection results = service.RetrieveMultiple(query); // 查詢發(fā)送foreach (Entity entity in results.Entities){Console.WriteLine($"Id:{entity.Id}"); // 全局唯一標(biāo)識(shí)符(每行數(shù)據(jù)有一個(gè)Id)Console.WriteLine($"name:{entity.Attributes["crda9_name"]}");}
}

? b. QueryExpression 總結(jié)

public ref class QueryExpression sealed : Microsoft::Xrm::Sdk::Query::QueryBase
query.EntityName = "crda9_room"; // 1.EntityName --> 表邏輯名(可在構(gòu)造函數(shù)時(shí)直接構(gòu)造)
query.ColumnSet.AddColumns("crda9_name"); // 2.ColumnSet --> 負(fù)責(zé)查詢列數(shù)
query.Criteria.AddCondition("crda9_type", ConditionOperator.Equal, 0); // 3.Criteria --> 查詢限定條件
query.AddOrder("crda9_name", OrderType.Ascending); // 4. AddOrder --> 列排序
query.TopCount = 2; // 5. TopCount --> 控制顯示的行數(shù)(與PageInfo不能同時(shí)使用)
query.PageInfo = new PagingInfo() {  // 6. PageInfor --> 控制分頁PageNumber = 1, // 頁數(shù)Count = 2 // 每頁數(shù)量
};

?

3.3 增加 Create

? a. 代碼及使用

// Guid Create(Microsoft::Xrm::Sdk::Entity ^ entity);
static void CreateExpressionExample(IOrganizationService service)
{Entity entity = new Entity("crda9_student");entity["crda9_name"] = "新學(xué)生_張雪雪";entity["crda9_age"] = 17;Guid id = service.Create(entity); Console.WriteLine("新學(xué)生的唯一id為:" + id);
}

?

3.4 刪除 Delete

? a. 代碼及使用

//  void Delete(System::String ^ entityName, Guid id);
static void DeleteExpressionExample(IOrganizationService service)
{string entityName = "crda9_student"; // 邏輯名稱Guid guid = new Guid("e334ba87-4c9a-ee11-be37-000d3a85d073"); // 全局唯一標(biāo)識(shí)符service.Delete(entityName, guid); 
}

?

3.5 修改 Update

? a. 代碼及使用

// void Update(Microsoft::Xrm::Sdk::Entity ^ entity);static void UpdateExpressionExample(IOrganizationService service){Guid id = CreateExpressionExample(service); // 先調(diào)用函數(shù)創(chuàng)建一個(gè)新學(xué)生,返回其Id唯一標(biāo)識(shí)Entity entity = new Entity("crda9_student");entity.Id = id;entity["crda9_name"] = "更新后的學(xué)生";service.Update(entity);Console.WriteLine("successful update....");}

?

4. 數(shù)據(jù)查詢的不同實(shí)現(xiàn)方式

? QueryBase的實(shí)現(xiàn)類
在這里插入圖片描述
? 參考文獻(xiàn). QueryBase抽象類接口:QueryBase抽象類接口

4.1 QueryExpression

? QueryExpression類 – 屬性
在這里插入圖片描述

  1. QueryExpression 是較為常用的數(shù)據(jù)查詢類,支持列查詢、條件判斷、實(shí)體聯(lián)系、排序等操作,
  2. 示例代碼見相關(guān)方法當(dāng)中多行查詢

?

4.2 QueryByAttribute

? QueryByAttribute類 – 屬性
在這里插入圖片描述

  1. 感覺功能可以由QueryByExpression代替,感覺這個(gè)可能更加側(cè)重通過屬性來查找判斷,
	static void QueryByAttributeTest(IOrganizationService service){QueryByAttribute query = new QueryByAttribute("crda9_room") {ColumnSet = new ColumnSet("crda9_name", "crda9_site"),};query.AddAttributeValue("crda9_site", "武漢"); // 此行必須實(shí)現(xiàn)(查找滿足條件的數(shù)據(jù))EntityCollection results = service.RetrieveMultiple(query);foreach (Entity entity in results.Entities){Console.WriteLine($"name:{entity.Attributes["crda9_name"]}");Console.WriteLine($"site:{entity.Attributes["crda9_site"]}");}}

?

4.3 FetchExpression

? FetchExpression類
在這里插入圖片描述

  1. 通過使用Fetch Xml語句拼接完成屬性的查詢以及過濾判斷等相關(guān)操作.
  2. Dynamic 365 -> 高級(jí)查找 -> Fetch XML 使用
  3. 補(bǔ)充字符串使用
    a. @ 防止轉(zhuǎn)義字符串, 可以省略使用/轉(zhuǎn)義的操作, 單引號(hào)需要使用雙引號(hào)轉(zhuǎn)義. 可多行換行, 會(huì)將每行前面空格算入內(nèi)
    b. $ 插值字符串, 可使用{}插入數(shù)據(jù)值, 方法類似與代替string.format(“{0}”, 數(shù)據(jù)值). 不可多行換行
    c. “”“”“” 多行字符串. 可多行換行,其每行最前列以第二個(gè)"""的那一列作為標(biāo)準(zhǔn).
    ?
static void QueryByFetch(IOrganizationService service){string fetchXml = $@"<fetch version=""1.0"" output-format=""xml-platform"" mapping=""logical"" distinct=""false""><entity name=""crda9_room""><attribute name=""crda9_name"" /><attribute name=""crda9_type"" /><attribute name=""crda9_site"" /><attribute name=""crda9_detail"" /><filter type=""and""><condition attribute=""crda9_name"" operator=""like"" value=""%北京%"" /></filter></entity></fetch>";FetchExpression query = new FetchExpression(fetchXml);EntityCollection results = service.RetrieveMultiple(query);foreach (Entity entity in results.Entities){Console.WriteLine($"name:{entity.Attributes["crda9_name"]}");Console.WriteLine($"site:{entity.Attributes["crda9_site"]}");}
}
foreach (Entity entity in results.Entities){Console.WriteLine($""" name: {entity["crda9_name"]}type: {entity.GetAttributeValue<OptionSetValue>("crda9_type")?.Value} // 防止為Nullsite: {entity.GetAttributeValue<OptionSetValue>("crda9_site")?.Value} // 防止為Null""");
}

?

4.4 LINQ

  1. LINQ 最明顯的“語言集成”部分就是查詢表達(dá)式。 查詢表達(dá)式采用聲明性查詢語法編寫而成。 使用查詢語法,可以用最少的代碼對(duì)數(shù)據(jù)源執(zhí)行篩選、排序和分組操作。
http://www.risenshineclean.com/news/38553.html

相關(guān)文章:

  • wordpress帶用戶丁的老頭seo博客
  • 煙臺(tái)網(wǎng)站制作開發(fā)抖音關(guān)鍵詞排名查詢工具
  • 外貿(mào)工廠 網(wǎng)站建設(shè)國內(nèi)免費(fèi)域名注冊(cè)
  • 不同類型網(wǎng)站比較及網(wǎng)站域名設(shè)計(jì)新聞?lì)^條今日新聞
  • 怎么建設(shè)淘寶聯(lián)盟的網(wǎng)站百度搜索引擎的原理
  • 陜西省高速建設(shè)集團(tuán)公司網(wǎng)站全國免費(fèi)發(fā)布信息平臺(tái)
  • 動(dòng)態(tài)網(wǎng)站開發(fā) 機(jī)械5118
  • 南京網(wǎng)站設(shè)計(jì)我選柚米科技指數(shù)分布的期望和方差
  • 做營銷型網(wǎng)站多少錢百度關(guān)鍵詞優(yōu)化詞精靈
  • 專門做批發(fā)的網(wǎng)站seo網(wǎng)絡(luò)推廣經(jīng)理招聘
  • 企業(yè)網(wǎng)站建立制作個(gè)人免費(fèi)網(wǎng)站建設(shè)
  • php網(wǎng)站制作 青島外貿(mào)seo軟件
  • 配置 tomcat 做網(wǎng)站做搜索引擎優(yōu)化的企業(yè)
  • 12個(gè)優(yōu)秀平面設(shè)計(jì)素材網(wǎng)站南京seo整站優(yōu)化技術(shù)
  • 做網(wǎng)站廣告收入會(huì)員卡營銷策劃方案
  • 做視頻找空鏡頭那個(gè)網(wǎng)站比較全seo優(yōu)化有百度系和什么
  • 電子商務(wù)網(wǎng)站建設(shè)的技術(shù)綜述論文優(yōu)化排名 生客seo
  • 安卓開發(fā)培訓(xùn)北京百度推廣優(yōu)化
  • 做封面的地圖網(wǎng)站app推廣是什么意思
  • 微信知彼網(wǎng)絡(luò)網(wǎng)站建設(shè)電商網(wǎng)站開發(fā)平臺(tái)
  • 深圳市寶安區(qū)怎么樣seo網(wǎng)站推廣的主要目的是什么
  • 鄭州鞏義網(wǎng)站建設(shè)全國人大常委會(huì)委員長
  • 網(wǎng)站備案截圖網(wǎng)站收錄免費(fèi)咨詢
  • 克隆網(wǎng)站后怎么做查詢關(guān)鍵詞網(wǎng)站
  • 銀川app購物網(wǎng)站制作公司西安網(wǎng)站搭建公司
  • 專業(yè)網(wǎng)站設(shè)計(jì)公司哪家好百度投訴中心人工電話號(hào)碼
  • .net網(wǎng)站開發(fā)實(shí)例臨沂seo代理商
  • 做黃色網(wǎng)站被抓了怎么處理公司培訓(xùn)課程有哪些
  • 天龍八部私服怎么做網(wǎng)站百度風(fēng)云排行榜
  • 蘇州做網(wǎng)站推廣哪家好網(wǎng)絡(luò)營銷策劃書論文