...
Example 1 - Storing metadata
Code Block | ||
---|---|---|
| ||
// 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
Code Block | ||
---|---|---|
| ||
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); |
...