Beispiel #1
0
 /// <summary>
 /// Create from service model
 /// </summary>
 /// <param name="model"></param>
 public BrowsePathResponseApiModel(BrowsePathResultModel model)
 {
     if (model == null)
     {
         throw new ArgumentNullException(nameof(model));
     }
     ErrorInfo = model.ErrorInfo == null ? null :
                 new ServiceResultApiModel(model.ErrorInfo);
     Targets = model.Targets?
               .Select(r => r == null ? null : new NodePathTargetApiModel(r))
               .ToList();
 }
 /// <summary>
 /// Create from service model
 /// </summary>
 /// <param name="model"></param>
 public static BrowsePathResponseApiModel ToApiModel(
     this BrowsePathResultModel model)
 {
     if (model == null)
     {
         return(null);
     }
     return(new BrowsePathResponseApiModel {
         ErrorInfo = model.ErrorInfo.ToApiModel(),
         Targets = model.Targets?
                   .Select(r => r.ToApiModel())
                   .ToList()
     });
 }