Skip to content

Commit

Permalink
Updated CRM SDK Version
Browse files Browse the repository at this point in the history
  • Loading branch information
crisfervil committed Nov 25, 2016
1 parent 16c8ee1 commit 1c7d961
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 20 deletions.
25 changes: 11 additions & 14 deletions src/CRMBridge.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using Microsoft.Crm.Sdk.Messages;
using Microsoft.Xrm.Client;
using Microsoft.Xrm.Client.Services;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Messages;
using Microsoft.Xrm.Sdk.Metadata;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Tooling.Connector;
using System;
using System.Collections.Generic;
using System.Dynamic;
Expand Down Expand Up @@ -93,57 +92,55 @@ public async Task<object> Invoke(dynamic options)
public class CrmService : IOrganizationService
{
string _connectionString;
CrmConnection _connection;
OrganizationService _orgService;
CrmServiceClient _connection;

public CrmService(string connectionString)
{
WebRequest.DefaultWebProxy = WebRequest.GetSystemWebProxy();
WebRequest.DefaultWebProxy.Credentials = CredentialCache.DefaultNetworkCredentials;
_connectionString = connectionString;
// Establish a connection to the organization web service using CrmConnection.
_connection = Microsoft.Xrm.Client.CrmConnection.Parse(_connectionString);
_orgService = new OrganizationService(_connection);
_connection = new CrmServiceClient(_connectionString);
}

public OrganizationResponse Execute(OrganizationRequest request)
{
return _orgService.Execute(request);
return _connection.Execute(request);
}

public void Delete(string entityName, Guid id)
{
_orgService.Delete(entityName, id);
_connection.Delete(entityName, id);
}

public void Associate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)
{
_orgService.Associate(entityName, entityId, relationship, relatedEntities);
_connection.Associate(entityName, entityId, relationship, relatedEntities);
}

public Guid Create(Entity entity)
{
return _orgService.Create(entity);
return _connection.Create(entity);
}

public void Disassociate(string entityName, Guid entityId, Relationship relationship, EntityReferenceCollection relatedEntities)
{
_orgService.Disassociate(entityName, entityId, relationship, relatedEntities);
_connection.Disassociate(entityName, entityId, relationship, relatedEntities);
}

public Entity Retrieve(string entityName, Guid id, ColumnSet columnSet)
{
return _orgService.Retrieve(entityName, id, columnSet);
return _connection.Retrieve(entityName, id, columnSet);
}

public EntityCollection RetrieveMultiple(QueryBase query)
{
return _orgService.RetrieveMultiple(query);
return _connection.RetrieveMultiple(query);
}

public void Update(Entity entity)
{
_orgService.Update(entity);
_connection.Update(entity);
}
}

Expand Down
16 changes: 10 additions & 6 deletions src/CRMClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,19 @@ export class CRMClient {
private getBridge(fakeBridge: boolean) {

var source = path.join(__dirname, "CRMBridge.cs");
var ref1 = path.join(__dirname, "bin/Microsoft.Crm.Sdk.Proxy.dll");
var ref2 = path.join(__dirname, "bin/Microsoft.Xrm.Client.dll");
var ref3 = path.join(__dirname, "bin/Microsoft.Xrm.Sdk.dll");
var ref4 = path.join("System.Runtime.Serialization.dll");
var ref5 = path.join(__dirname, "bin/Newtonsoft.Json.dll");
var refs:Array<string> =
[ path.join(__dirname, "bin/Microsoft.Crm.Sdk.Proxy.dll")
,path.join(__dirname, "bin/Microsoft.Xrm.Tooling.Connector.dll")
,path.join(__dirname, "bin/Microsoft.Xrm.Sdk.dll")
,"System.Runtime.Serialization.dll"
,"System.ServiceModel.dll"
,path.join(__dirname,"bin/Microsoft.IdentityModel.Clients.ActiveDirectory.dll")
,path.join(__dirname, "bin/Newtonsoft.Json.dll")
];

var createBridge = edge.func({
source: source,
references: [ref1, ref2, ref3, ref4, ref5]
references: refs
});

var bridge = createBridge({ connectionString: this.connectionString, useFake: fakeBridge }, true);
Expand Down
Binary file modified src/bin/Microsoft.Crm.Sdk.Proxy.dll
Binary file not shown.
Binary file not shown.
Binary file removed src/bin/Microsoft.Xrm.Client.dll
Binary file not shown.
Binary file added src/bin/Microsoft.Xrm.Sdk.Deployment.dll
Binary file not shown.
Binary file modified src/bin/Microsoft.Xrm.Sdk.dll
Binary file not shown.
Binary file added src/bin/Microsoft.Xrm.Tooling.Connector.dll
Binary file not shown.

0 comments on commit 1c7d961

Please sign in to comment.