Interface IMatterService
Represents the matter API service.
Namespace: Relativity.Testing.Framework.Api.Services
Assembly: Relativity.Testing.Framework.Api.dll
Syntax
public interface IMatterService
Examples
_matterService = relativityFacade.Resolve<IMatterService>();
Methods
| Improve this Doc View SourceCreate(Matter)
Creates the specified Matter.
Declaration
Matter Create(Matter entity)
Parameters
| Type | Name | Description |
|---|---|---|
| Matter | entity | The matter to create. |
Returns
| Type | Description |
|---|---|
| Matter | The created matter. |
Examples
Create any old matter.
Matter matter = _matterService.Create(Matter());
Create a matter with specified properties.
Client client = _clientService.Create(Client());
Matter matter = new Matter
{
Name = "Dark",
Number = 12345,
Status = "Active",
Client = client
Keywords = "SomeKeyword"
Notes = "Some note about the matter."
};
matter = _matterService.Create(matter);
|
Improve this Doc
View Source
Delete(Int32)
Deletes the Matter by ArtifactID.
Declaration
void Delete(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The ArtifactID of the matter. |
Examples
_matterService.Delete(matter.ArtifactID);
|
Improve this Doc
View Source
Get(Int32, Boolean)
Gets the Matter by the ArtifactID.
Declaration
Matter Get(int id, bool withExtendedMetadata = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | id | The ArtifactID of the matter. |
| System.Boolean | withExtendedMetadata | If set to true Meta field will be populated on get. Default is false. |
Returns
| Type | Description |
|---|---|
| Matter | The Matter if it exists, otherwise null. |
Examples
Matter matter = _matterService.Get(1234567);
|
Improve this Doc
View Source
Get(String, Int32)
Gets the Matter by the matter name, and Client ArtifactID.
Declaration
Matter Get(string name, int clientId)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name of the matter. |
| System.Int32 | clientId | The ArtifactID of the client. |
Returns
| Type | Description |
|---|---|
| Matter | The Matter if it exists, otherwise null. |
Examples
Matter matter = _matterService.Get("AnotherMatter", 2345678);
|
Improve this Doc
View Source
GetEligibleClients()
Gets all of available clients in a Relativity environment.
Declaration
ArtifactIdNamePair[] GetEligibleClients()
Returns
| Type | Description |
|---|---|
| ArtifactIdNamePair[] | The array with pairs of Names and Artifact IDs of available clients. |
Examples
ArtifactIdNamePair[] allClients = _matterService.GetEligibleClients();
|
Improve this Doc
View Source
GetEligibleStatuses()
Gets all of available matter statuses in a Relativity environment.
Declaration
ArtifactIdNamePair[] GetEligibleStatuses()
Returns
| Type | Description |
|---|---|
| ArtifactIdNamePair[] | The array with pairs of Names and Artifact IDs of available statuses. |
Examples
ArtifactIdNamePair[] allStatuses = _matterService.GetEligibleStatuses();
|
Improve this Doc
View Source
Require(Matter)
Requires the specified matter.
- If the [ArtifactID](https://relativitydev.github.io/relativity.testing.framework/api/Relativity.Testing.Framework.Models.Artifact.html#Relativity_Testing_Framework_Models_Artifact_ArtifactID) property of
entityhas a positive value, this gets the matter by ID and updates it. - Else if the [Name](https://relativitydev.github.io/relativity.testing.framework/api/Relativity.Testing.Framework.Models.NamedArtifact.html#Relativity_Testing_Framework_Models_NamedArtifact_Name) property of
entityhave a value, this gets the matter by name and client ID and updates it, if it exists. - Otherwise this creates a new matter using Relativity.Testing.Framework.Api.Strategies.ICreateWorkspaceEntityStrategy`1.
Declaration
Matter Require(Matter entity)
Parameters
| Type | Name | Description |
|---|---|---|
| Matter | entity | The matter to require. |
Returns
| Type | Description |
|---|---|
| Matter | The created or updated matter. |
Examples
This example will search for a matter with the ArtifactID "1234567".
If it is found, the model will be used to update the rest of the properties on the matter.
If not, it will be created.
Matter matter = new Matter
{
ArtifactID = 1234567,
Status = "Inactive"
};
matter = _matterService.Require(matter);
This example will search for a matter named "MyMatter".
If one is found, it will be updated and returned.
If not, it will be created.
Client client = new Client
{
Name = "MyClient"
};
Client client = _clientService.Require(client);
Matter matter = new Matter
{
Name = "MyMatter",
Client = client,
Status = "Inactive"
};
matter = _matterService.Require(matter);
| Improve this Doc View Source
Update(Matter, Boolean)
Updates the specified Matter.
Declaration
void Update(Matter entity, bool restrictedUpdate = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Matter | entity | The matter to update. |
| System.Boolean | restrictedUpdate | If set to true the LastModifiedOn date will be added to API request and its value must match the LastModifiedOn date for the matter stored in Relativity. Otherwise, you receive a 409 error, indicating that the object has been modified. Default set to false. |
Examples
Matter matter = _matterService.Get("AnotherMatter", 2345678);
matter.Name = "ADifferentMatter";
matter = _matterService.Update(matter);