Exemple #1
0
 public static ModelDto MapFromModelData(ModelData model)
 {
     return(new ModelDto
     {
         Decommissioned = model.Decommissioned,
         Description = (model.Description == null || !model.Description.ContainsKey("en")) ? null : new ModelDescriptionDto {
             En = model.Description["en"]
         },
         DisplayName = (model.DisplayName == null || !model.DisplayName.ContainsKey("en")) ? null : new ModelDisplayNameDto {
             En = model.DisplayName["en"]
         },
         Id = model.Id,
         UploadTime = model.UploadTime,
         ModelDefinition = ModelDefinitionDto.MapFromModelData(model.Model)
     });
 }
Exemple #2
0
 public static ModelDto MapFromModelData(DigitalTwinsModelData model)
 {
     return(new ModelDto
     {
         Decommissioned = model.Decommissioned,
         Description = (model.LanguageDescriptions == null || !model.LanguageDescriptions.ContainsKey("en")) ? null : new ModelDescriptionDto {
             En = model.LanguageDescriptions["en"]
         },
         DisplayName = (model.LanguageDisplayNames == null || !model.LanguageDisplayNames.ContainsKey("en")) ? null : new ModelDisplayNameDto {
             En = model.LanguageDisplayNames["en"]
         },
         Id = model.Id,
         UploadTime = model.UploadedOn,
         ModelDefinition = ModelDefinitionDto.MapFromModelData(model.DtdlModel)
     });
 }