Exemplo n.º 1
0
 /// <summary>
 /// Method to retrieve a solution from Dynamics CRM.
 /// </summary>
 /// <param name="uniqueName">The unique name of the solution to retrieve.</param>
 /// <returns>A solution object containing the details of the retrieved solution.</returns>
 public Solution RetrieveSolution(string uniqueName)
 {
     try
     {
         Solution solution;
         using (XrmService service = new XrmService(XRMConnectionString))
         {
             QueryExpression querySampleSolution = new QueryExpression
             {
                 EntityName = Solution.EntityLogicalName,
                 ColumnSet  = new ColumnSet(true),
                 Criteria   = new FilterExpression()
             };
             querySampleSolution.Criteria.AddCondition("uniquename", ConditionOperator.Equal, uniqueName);
             solution = (Solution)service.RetrieveMultiple(querySampleSolution).Entities[0];
         }
         return(solution);
     }
     catch (FaultException <Microsoft.Xrm.Sdk.OrganizationServiceFault> )
     {
         throw;
     }
 }