public void Commit(Entities.IUnitOfWork uow)
 {
     if (trans.Requests != null && trans.Requests.Count > 0)
     {
         uow.Execute(trans);
         this.trans = new Microsoft.Xrm.Sdk.Messages.ExecuteTransactionRequest
         {
             Requests        = new Microsoft.Xrm.Sdk.OrganizationRequestCollection(),
             ReturnResponses = false
         };
     }
 }
Exemple #2
0
        private void AddSolutionComponent(Guid id, int componentType, bool addRequiredComponents)
        {
            var component = (from sc in uow.SolutionComponents.GetQuery()
                             where sc.SolutionId.Id == this.solution.SolutionId &&
                             sc.ObjectId.Value == id &&
                             sc.ComponentType.Value == componentType
                             select sc).SingleOrDefault();

            if (component == null)
            {
                var req = new Microsoft.Crm.Sdk.Messages.AddSolutionComponentRequest
                {
                    AddRequiredComponents = addRequiredComponents,
                    ComponentId           = id,
                    ComponentType         = componentType,
                    SolutionUniqueName    = this.solution.UniqueName
                };
                uow.Execute(req);
            }
        }