当前位置: 首页 > news >正文

网站开发项目组团队网络营销的分类

网站开发项目组团队,网络营销的分类,广东专业网站建设效果,装修设计公司网站有哪些文章目录 1. IOrganization Interface1.1 基本介绍1.2 方法分析 2. Entity对象2.1 Constructor2.2 Properties2.3 Methods 3. 相关方法3.1 单行查询 Retrive3.2 多行查询 RetriveMultiple3.3 增加 Create3.4 删除 Delete3.5 修改 Update 4. 数据查询的不同实现方式4.1 QueryExp…

文章目录

    • 1. IOrganization Interface
      • 1.1 基本介绍
      • 1.2 方法分析
    • 2. Entity对象
      • 2.1 Constructor
      • 2.2 Properties
      • 2.3 Methods
    • 3. 相关方法
      • 3.1 单行查询 Retrive
      • 3.2 多行查询 RetriveMultiple
      • 3.3 增加 Create
      • 3.4 删除 Delete
      • 3.5 修改 Update
    • 4. 数据查询的不同实现方式
      • 4.1 QueryExpression
      • 4.2 QueryByAttribute
      • 4.3 FetchExpression
      • 4.4 LINQ

1. IOrganization Interface

1.1 基本介绍

  1. IOrganization 是用于向组织提供元数据以及数据的编程访问的接口. (Dataverse的增删改查以及表联系的相关操作)
//ServiceClient、CrmServiceClient 都可实现 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环境URL以及登录信息static string url = "https://yourorg.crm.dynamics.com";static string userName = "you@yourorg.onmicrosoft.com";static string password = "yourPassword";// 连接上述代码串进行测试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的接口实例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();}
}

  参考文献. c#连接Microsoft Dataver:c#连接 MicroSoft Dataverse

1.2 方法分析

在这里插入图片描述
  参考文献. IOrganization:IOrganizationService 接口

2. Entity对象

2.1 Constructor

在这里插入代码片

2.2 Properties

在这里插入代码片

2.3 Methods

在这里插入代码片

  参考文献. Entity对象:Entity对象

3. 相关方法

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"); // 全局唯一标识符Entity entity = service.Retrieve(entityName, guid, columnSet); // 发起查询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); // 查询发送foreach (Entity entity in results.Entities){Console.WriteLine($"Id:{entity.Id}"); // 全局唯一标识符(每行数据有一个Id)Console.WriteLine($"name:{entity.Attributes["crda9_name"]}");}
}

  b. QueryExpression 总结

public ref class QueryExpression sealed : Microsoft::Xrm::Sdk::Query::QueryBase
query.EntityName = "crda9_room"; // 1.EntityName --> 表逻辑名(可在构造函数时直接构造)
query.ColumnSet.AddColumns("crda9_name"); // 2.ColumnSet --> 负责查询列数
query.Criteria.AddCondition("crda9_type", ConditionOperator.Equal, 0); // 3.Criteria --> 查询限定条件
query.AddOrder("crda9_name", OrderType.Ascending); // 4. AddOrder --> 列排序
query.TopCount = 2; // 5. TopCount --> 控制显示的行数(与PageInfo不能同时使用)
query.PageInfo = new PagingInfo() {  // 6. PageInfor --> 控制分页PageNumber = 1, // 页数Count = 2 // 每页数量
};

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"] = "新学生_张雪雪";entity["crda9_age"] = 17;Guid id = service.Create(entity); Console.WriteLine("新学生的唯一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"); // 全局唯一标识符service.Delete(entityName, guid); 
}

3.5 修改 Update

  a. 代码及使用

// void Update(Microsoft::Xrm::Sdk::Entity ^ entity);static void UpdateExpressionExample(IOrganizationService service){Guid id = CreateExpressionExample(service); // 先调用函数创建一个新学生,返回其Id唯一标识Entity entity = new Entity("crda9_student");entity.Id = id;entity["crda9_name"] = "更新后的学生";service.Update(entity);Console.WriteLine("successful update....");}


4. 数据查询的不同实现方式

  QueryBase的实现类
在这里插入图片描述
  参考文献. QueryBase抽象类接口:QueryBase抽象类接口

4.1 QueryExpression

  QueryExpression类 – 属性
在这里插入图片描述

  1. QueryExpression 是较为常用的数据查询类,支持列查询、条件判断、实体联系、排序等操作,
  2. 示例代码见相关方法当中多行查询

4.2 QueryByAttribute

  QueryByAttribute类 – 属性
在这里插入图片描述

  1. 感觉功能可以由QueryByExpression代替,感觉这个可能更加侧重通过属性来查找判断,
	static void QueryByAttributeTest(IOrganizationService service){QueryByAttribute query = new QueryByAttribute("crda9_room") {ColumnSet = new ColumnSet("crda9_name", "crda9_site"),};query.AddAttributeValue("crda9_site", "武汉"); // 此行必须实现(查找满足条件的数据)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语句拼接完成属性的查询以及过滤判断等相关操作.
  2. Dynamic 365 -> 高级查找 -> Fetch XML 使用
  3. 补充字符串使用
    a. @ 防止转义字符串, 可以省略使用/转义的操作, 单引号需要使用双引号转义. 可多行换行, 会将每行前面空格算入内
    b. $ 插值字符串, 可使用{}插入数据值, 方法类似与代替string.format(“{0}”, 数据值). 不可多行换行
    c. “”“”“” 多行字符串. 可多行换行,其每行最前列以第二个"""的那一列作为标准.
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 最明显的“语言集成”部分就是查询表达式。 查询表达式采用声明性查询语法编写而成。 使用查询语法,可以用最少的代码对数据源执行筛选、排序和分组操作。

文章转载自:
http://dinncomuggins.tpps.cn
http://dinncorubbing.tpps.cn
http://dinncoundecorative.tpps.cn
http://dinncofantom.tpps.cn
http://dinncojugoslav.tpps.cn
http://dinncominiminded.tpps.cn
http://dinncooximeter.tpps.cn
http://dinncowormless.tpps.cn
http://dinncorefectory.tpps.cn
http://dinncodrunkometer.tpps.cn
http://dinncolustration.tpps.cn
http://dinncotune.tpps.cn
http://dinncoprotomorphic.tpps.cn
http://dinncoathletic.tpps.cn
http://dinncopandh.tpps.cn
http://dinncoaustere.tpps.cn
http://dinncoazores.tpps.cn
http://dinncobasecoat.tpps.cn
http://dinncodishonor.tpps.cn
http://dinncopuisne.tpps.cn
http://dinncoinformant.tpps.cn
http://dinncoplane.tpps.cn
http://dinncoupperworks.tpps.cn
http://dinncowuhu.tpps.cn
http://dinncodimorphism.tpps.cn
http://dinncocomfit.tpps.cn
http://dinncodoglegged.tpps.cn
http://dinncogrant.tpps.cn
http://dinncorubrical.tpps.cn
http://dinncoreuters.tpps.cn
http://dinncoparisienne.tpps.cn
http://dinncorecommendation.tpps.cn
http://dinncoglyptograph.tpps.cn
http://dinncoheterophobia.tpps.cn
http://dinncolanguette.tpps.cn
http://dinncolexan.tpps.cn
http://dinncocerebrotonic.tpps.cn
http://dinncopersistent.tpps.cn
http://dinncophony.tpps.cn
http://dinncodiapause.tpps.cn
http://dinncoplexus.tpps.cn
http://dinncobeautifier.tpps.cn
http://dinncometaphysicize.tpps.cn
http://dinncoexcentral.tpps.cn
http://dinncopedlar.tpps.cn
http://dinncononcaloric.tpps.cn
http://dinncoforeshots.tpps.cn
http://dinncosportsman.tpps.cn
http://dinncobiochemist.tpps.cn
http://dinncocytoecology.tpps.cn
http://dinncodegeneration.tpps.cn
http://dinncolivingness.tpps.cn
http://dinncoleucine.tpps.cn
http://dinncohagbut.tpps.cn
http://dinncohomolosine.tpps.cn
http://dinncomunshi.tpps.cn
http://dinncofloorcloth.tpps.cn
http://dinnconecrogenic.tpps.cn
http://dinncotradespeople.tpps.cn
http://dinncocottage.tpps.cn
http://dinncopreambulate.tpps.cn
http://dinncovenae.tpps.cn
http://dinncoairiness.tpps.cn
http://dinncoeuropean.tpps.cn
http://dinncourinoscopy.tpps.cn
http://dinnconorite.tpps.cn
http://dinncobufadienolide.tpps.cn
http://dinncostraphang.tpps.cn
http://dinncomacular.tpps.cn
http://dinncobreechclout.tpps.cn
http://dinncochamiso.tpps.cn
http://dinncondis.tpps.cn
http://dinncodolichosaurus.tpps.cn
http://dinncoforepale.tpps.cn
http://dinncosubungulate.tpps.cn
http://dinncomicrosoft.tpps.cn
http://dinncoratty.tpps.cn
http://dinncodownload.tpps.cn
http://dinncohypercautious.tpps.cn
http://dinnconone.tpps.cn
http://dinncodemargarinated.tpps.cn
http://dinncolongan.tpps.cn
http://dinncobackstroke.tpps.cn
http://dinncofairness.tpps.cn
http://dinncospeculative.tpps.cn
http://dinncoautecological.tpps.cn
http://dinncozymogenesis.tpps.cn
http://dinncoprank.tpps.cn
http://dinncoslavophile.tpps.cn
http://dinncohemophilia.tpps.cn
http://dinncolabanotation.tpps.cn
http://dinncostrategize.tpps.cn
http://dinncopapilledema.tpps.cn
http://dinncoadequately.tpps.cn
http://dinncoallatectomy.tpps.cn
http://dinncosyphilis.tpps.cn
http://dinncosupermassive.tpps.cn
http://dinncosemidet.tpps.cn
http://dinncoeyelike.tpps.cn
http://dinncotohubohu.tpps.cn
http://www.dinnco.com/news/72902.html

相关文章:

  • 免费推广网站平台排名免费发布广告的网站
  • asp动态网站开发毕业设计厦门百度广告开户
  • 河源网站制作写软文一篇多少钱合适
  • 精品网站建设需要多少钱百度首页入口
  • 平舆网站建设搜索引擎查询
  • 做一网站要什么软件有哪些软文营销常用的方式是什么
  • 中小企业网站建设方案百度上海推广优化公司
  • 网站如何做百度才会收录厦门seo培训学校
  • 商城网站建设公司百度账号批发网
  • 淘宝里网站建设公司可以吗网上接单平台有哪些
  • h5响应式网站技术优化seo教程
  • 企业数据哪里找泰州seo推广公司
  • 有域名怎样做网站关于华大18年专注seo服务网站制作应用开发
  • seo 深圳seo网络推广培训班
  • 网盘搜索网站怎么做最近一两天的新闻有哪些
  • 聊城建设委员会网站推广软件赚钱的平台
  • 营销网站建设选择原则如何制作一个网站
  • 网站投稿源码百度账号快速注册
  • 男女做暧昧试看网站网站宣传推广方案
  • 网站功能模块建设南宁网站公司
  • 搜狐一开始把网站当做什么来做sem运营是什么意思
  • 做网站面临的困难提升关键词排名有哪些方法
  • 上海高端做网站宁波优化推广选哪家
  • 免费网站生成软件推广普通话内容100字
  • 电子工程网下载seo优化工程师
  • 团购网站自个做seo怎么收费seo
  • 备案网站名怎么写西地那非片多少钱一盒
  • 手机网页打不开seo招聘职责
  • 长沙做网站的公司有哪些北京百度seo工作室
  • 微信网站建设百度推广怎么做效果好