Пример #1
0
 /// <summary>
 /// Create model
 /// </summary>
 /// <param name="request"></param>
 public CertificateRequestRecordApiModel(CertificateRequestRecordModel request)
 {
     RequestId = request.RequestId;
     EntityId  = request.EntityId;
     Type      = request.Type;
     State     = request.State;
     GroupId   = request.GroupId;
     Submitted = request.Submitted == null ? null :
                 new VaultOperationContextApiModel(request.Submitted);
     Accepted = request.Accepted == null ? null :
                new VaultOperationContextApiModel(request.Accepted);
     Approved = request.Approved == null ? null :
                new VaultOperationContextApiModel(request.Approved);
     ErrorInfo = request.ErrorInfo;
 }
Пример #2
0
 /// <summary>
 /// Create model
 /// </summary>
 /// <param name="model"></param>
 public static CertificateRequestRecordApiModel ToApiModel(
     this CertificateRequestRecordModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new CertificateRequestRecordApiModel {
         RequestId = model.RequestId,
         EntityId = model.EntityId,
         Type = (IIoT.OpcUa.Api.Vault.Models.CertificateRequestType)model.Type,
         State = (IIoT.OpcUa.Api.Vault.Models.CertificateRequestState)model.State,
         GroupId = model.GroupId,
         Submitted = model.Submitted.ToApiModel(),
         Accepted = model.Accepted.ToApiModel(),
         Approved = model.Approved.ToApiModel(),
         ErrorInfo = model.ErrorInfo
     });
 }