Example #1
0
 /// <summary>
 /// Creates a Client object with a random number and active status
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public int Create(string name)
 {
     using (IClientManager proxy = _helper.GetServicesManager().CreateProxy <IClientManager>(API.ExecutionIdentity.System))
     {
         List <ChoiceRef> choiceRefs = proxy.GetStatusChoicesForClientAsync().Result;
         ChoiceRef        statusRef  = choiceRefs.Find(x => x.Name == "Active");
         var newClient = new Relativity.Services.Client.Client
         {
             Name     = name,
             Number   = new Random().Next(1000).ToString(),
             Status   = statusRef,
             Keywords = "Integration Test Client"
         };
         int clientArtifactId = proxy.CreateSingleAsync(newClient).Result;
         return(clientArtifactId);
     }
 }
Example #2
0
        public static int Create_Client(IRSAPIClient client, Relativity.Services.ServiceProxy.ServiceFactory serviceFactory, string name)
        {
            var workspaceId = client.APIOptions.WorkspaceID;

            client.APIOptions.WorkspaceID = -1;

            using (IClientManager proxy = serviceFactory.CreateProxy <IClientManager>())
            {
                List <ChoiceRef> choiceRefs = proxy.GetStatusChoicesForClientAsync().Result;
                ChoiceRef        statusRef  = choiceRefs.Find(x => x.Name == "Active");
                var newClient = new Relativity.Services.Client.Client {
                    Name = name, Number = Guid.NewGuid().ToString(), Status = statusRef, Keywords = "Temp Client", Notes = "Used in the Disable Inactve User Integration Test."
                };
                int clientArtifactId = proxy.CreateSingleAsync(newClient).Result;
                client.APIOptions.WorkspaceID = workspaceId;
                return(clientArtifactId);
            }
        }