当前位置: 首页 > 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 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 QueryExpression4.2 QueryByAttribute4.3 FetchExpression4.4 LINQ 1. IOrganization Interface 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 youyourorg.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;LoginPromptAuto;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 Dataverc#连接 MicroSoft Dataverse   1.2 方法分析 参考文献. IOrganizationIOrganizationService 接口   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.GetAttributeValuestring(crda9_name)} $type:{entity.GetAttributeValueOptionSetValue(crda9_type).Value} $site:{entity.GetAttributeValuestring(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类 – 属性 QueryExpression 是较为常用的数据查询类支持列查询、条件判断、实体联系、排序等操作,示例代码见相关方法当中多行查询 4.2 QueryByAttribute QueryByAttribute类 – 属性 感觉功能可以由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类 通过使用Fetch Xml语句拼接完成属性的查询以及过滤判断等相关操作.Dynamic 365 - 高级查找 - Fetch XML 使用补充字符串使用 a. 防止转义字符串, 可以省略使用/转义的操作, 单引号需要使用双引号转义. 可多行换行, 会将每行前面空格算入内 b. $ 插值字符串, 可使用{}插入数据值, 方法类似与代替string.format(“{0}”, 数据值). 不可多行换行 c. “”“”“” 多行字符串. 可多行换行其每行最前列以第二个的那一列作为标准.   static void QueryByFetch(IOrganizationService service){string fetchXml $fetch version1.0 output-formatxml-platform mappinglogical distinctfalseentity namecrda9_roomattribute namecrda9_name /attribute namecrda9_type /attribute namecrda9_site /attribute namecrda9_detail /filter typeandcondition attributecrda9_name operatorlike 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.GetAttributeValueOptionSetValue(crda9_type)?.Value} // 防止为Nullsite: {entity.GetAttributeValueOptionSetValue(crda9_site)?.Value} // 防止为Null); }4.4 LINQ LINQ 最明显的“语言集成”部分就是查询表达式。 查询表达式采用声明性查询语法编写而成。 使用查询语法可以用最少的代码对数据源执行筛选、排序和分组操作。
http://www.hkea.cn/news/14559638/

相关文章:

  • 农村pc网站开发wordpress页面内容调用
  • 建筑设计自学网站黑白网站设计
  • 网站主机空间用哪个好论坛网站备案
  • 商贸信息网站企业网站建设三网合一
  • 微信用大型网站站做跳板dw网页制作模板教程
  • 韩版做哪个网站好做视频网站要多大的带宽
  • 建设网站有哪些好处和坏处espresso wordpress函数
  • 详情页在线设计网站推荐学做网站看书会了吗
  • 南京网站建设 小程序网站制作公司哪里好
  • 全球首个完全响应式网站自助建设平台在中国诞生英文网站建设600
  • 松江区网站建设公司网站综合营销方案
  • dede cms 网站模板做网站 没内容
  • 医院网站建设趋势免费公司网址怎么注册
  • 网站建设与网页设计是什么意思广州招聘网
  • 搬家公司网站制作网站设计 电子购物网站设计
  • 南京学做网站公司设计网站需要包含什么资料
  • 网站收录下降一小时学做网站
  • 机票网站建设公司好成都网站建设顶呱呱
  • 网站建设价格差异好大网站失败后怎么重新建设
  • 弹幕网站开发阿里巴巴怎样做网站
  • 成立网站百姓网招聘信息最新招聘
  • 网站建设公司选择意见书wordpress自带的会员中心
  • 做火影网站背景图在线制作免费生成图片logo
  • 网站建设是什么专业啊软件公司排名100强
  • 网站服务器租用价格 贴吧江门网站建设推广策划
  • 郓城菏泽网站建设免费服务器主机
  • 在线做logo印章网站dw代码写完之后怎么运行网页
  • 给公司做的东西放到私人网站上宁夏百度推广代理商
  • wordpress能做手机站吗北京装修设计公司有哪些
  • 福建省龙岩市建设培训中心网站ps网页模板