コード例 #1
0
 /// <summary>
 /// Convert to service model
 /// </summary>
 /// <typeparam name="S"></typeparam>
 /// <typeparam name="T"></typeparam>
 /// <param name="model"></param>
 /// <param name="convert"></param>
 /// <returns></returns>
 public static HistoryUpdateRequestModel <S> ToServiceModel <S, T>(
     this HistoryUpdateRequestApiModel <T> model, Func <T, S> convert)
 {
     if (model == null)
     {
         return(null);
     }
     return(new HistoryUpdateRequestModel <S> {
         Details = convert(model.Details),
         NodeId = model.NodeId,
         BrowsePath = model.BrowsePath,
         Header = model.Header.ToServiceModel()
     });
 }
コード例 #2
0
 /// <summary>
 /// Convert back to service model
 /// </summary>
 /// <returns></returns>
 public static HistoryUpdateRequestModel <VariantValue> ToServiceModel(
     this HistoryUpdateRequestApiModel <VariantValue> model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new HistoryUpdateRequestModel <VariantValue> {
         Details = model.Details,
         NodeId = model.NodeId,
         BrowsePath = model.BrowsePath,
         Header = model.Header.ToServiceModel()
     });
 }