AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.08.2010, 05:18   #1  
Blog bot is offline
Blog bot
Участник
 
25,640 / 848 (80) +++++++
Регистрация: 28.10.2006
CRMScape: MS CRM 4.0 LINQ Support in CRM SDK 4.0.12
Источник: http://crmscape.blogspot.com/2010/08...-sdk-4012.html
==============

So far I really like what I have seen in this new SDK release MS CRM SDK.

It solves real problems and will actually make life better for CRM developers.

The new LINQ support can be used by people customizing their own propriety CRM systems and for integrators and xRM developers with software to deploy across different CRM schemas.

How they got it right and made life easier!
  1. The attributes can be directly accessed as simple types!
    • bool?  instead of  CrmBoolean
    • Guid   instead of   Key
    • etc..
  2. The related entities are associated as a list of entities like you would expect with LINQ
    • IEnumerable  instead of a BusinessEntityCollection.
    • Many less queries need to be coded greatly simplifying code.
      • Even though the additional queries are generated internally, they are done on the SQL side rather then requiring multiple web service calls which should be faster.
    • The related entity list names are predictable!
      • ex.  acct.account_contacts
      • ex.  acct.new_account_contact
    • Note: This is a significant improvement from the LINQtoSQL model that would just name related entities  contacts, contacts1, contacts2 without any way to predict which related list is which and wouldn’t give you a permanent way to set naming behavior. Adding an additional relationship to an entity that was already related could ruin your existing LINQ, requiring manual editing of the model xml.
  3. There is now much less of a reason to need to use the much more primitive Fetch type syntax.  string xmlResults = crmService.Fetch(xmlQuery);
  4. Entity classes do NOT need to be identical to the CRM schema for Selects!
  5. Entity classes do NOT need to be identical to the CRM schema for Updates!
    • According to MS the Update operation sends only modified attributes back to the server so you don’t have to care about anything else that’s been added.
In a nutshell
Strong typing and compile time errors
No web reference required
Easily regenerated Entity classes

Simple Maintenance
From a command line all you have to do is use the new crmsvcutil.exe to generate and update the LINQ Entity class source files. More information here.  MSDN reference

C:\> crmsvcutil /server:http://crm/Contoso /out:MyLinqEntities

One of the reasons I really appreciate this is that I wrote a utility to read all of the MS CRM Metadata and generate (Data Transfer Objects) or DTO’s for RIA services about a year ago along with all of the associated attributes for validation.  Idea for MS: If we had a switch on this utility to dynamically generate validation criteria attributes from the MS CRM metadata so that we could bind a control to it, that would be great for MVVM Silverlight apps!  Or generate them by default and just comment them out.

Getting Started:

David Yack has an explanation of how to set up MS CRM LINQ on your system and use it in a hello world project. There is no point duplicating his effort.

Sample Solution:

The following is a very simple sample solution 7.5Mb that is little more than the sample in the explanation link above. However the SDK libraries are included in the solution as are the Entity class files generated from the stock MS CRM 4.0 Contoso VM with a couple additions to the Account entity.

Since it ONLY accesses a couple standard fields in the Account entity it should work out of the box on any CRM 4 box once the Server name is set in the app.config file.  Just change the line below to whatever your local server name/orgname is and it should work.

Server=<a href="http://crm/Contoso;"/"http://crm/Contoso;"//a>

This is good stuff and the sooner you start using this the more time it will save you!




Источник: http://crmscape.blogspot.com/2010/08...-sdk-4012.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
CRM DE LA CREME! Some more useful javascripts for MS CRM Blog bot Dynamics CRM: Blogs 0 04.05.2010 11:05
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
CRMScape: MS CRM 4.0, xRM and building blocks Blog bot Dynamics CRM: Blogs 0 13.08.2009 15:05
Microsoft Dynamics CRM Team Blog: List Web Part for Microsoft Dynamics CRM 4.0 Deployment Scenarios Blog bot Dynamics CRM: Blogs 0 30.01.2009 22:05
Microsoft Dynamics CRM Team Blog: 32-bit vs. 64-bit CRM SDK Assemblies Blog bot Dynamics CRM: Blogs 0 11.09.2008 20:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 16:07.