/
Adding business-line specific metadata to a service request
Adding business-line specific metadata to a service request
In the following example, you'll see how to store business-line specific metadata with a service request, so it can be retrieved on the application dashboard.
Example 1 - Storing metadata
// Provide some metadata that helps to describe this particular service request.
var metadata = new BusinessLineMetadata() {
VesselManufacturer = "Princecraft",
MIC = "CA-QJT",
VesselYear = "2019"
};
// Create the service request artifact documents
await _documentManager.Create(document, metadata, document.DisplayNameEn, document.DisplayNameFr, MyDocumentVersion, serviceRequestId, CurrentUser.Id);
Example 2- Retrieving metadata on the dashboard
ICollection<ServiceRequest> serviceRequests = await _serviceRequestManager.Get<DTO.BusinessLineMetadata>(CurrentUser.Id, page, pageSize);
var dashboardViewModel = new MyRequestsViewModel
{
Requests = serviceRequests.Select(x =>
{
var serviceMetadata = (DTO.BusinessLineMetadata)x.Metadata;
return new ServiceRequestViewModel()
{
VesselManufacturer= serviceMetadata.VesselManufacturer,
MIC = serviceMetadata.MIC,
VesselYear = serviceMetadata.VesselYear
};
}).ToList()
};
return PartialView("MyRequests", dashboardViewModel);
, multiple selections available,
Related content
ArtifactManager
ArtifactManager
More like this
Collecting submitted form data, and storing it in MTOA
Collecting submitted form data, and storing it in MTOA
Read with this
Create, Read, Update, Submit of Service Requests Using NUGET Packages
Create, Read, Update, Submit of Service Requests Using NUGET Packages
More like this
Create, Read, Update, Submit of Service Requests Using API
Create, Read, Update, Submit of Service Requests Using API
Read with this
Service Applications
Service Applications
More like this
myTC Account Admin Console Create/Invite New User
myTC Account Admin Console Create/Invite New User
Read with this