public static EntityAttribute ToData(CdmEntityAttributeDefinition instance, ResolveOptions resOpt, CopyOptions options) { return(new EntityAttribute { Explanation = instance.Explanation, Name = instance.Name, IsPolymorphicSource = instance.IsPolymorphicSource, Entity = Utils.JsonForm(instance.Entity, resOpt, options), Purpose = Utils.JsonForm(instance.Purpose, resOpt, options), AppliedTraits = CopyDataUtils.ListCopyData(resOpt, instance.AppliedTraits?.Where(trait => !trait.IsFromProperty), options), ResolutionGuidance = Utils.JsonForm(instance.ResolutionGuidance, resOpt, options), DisplayName = instance.GetProperty("displayName"), Description = instance.GetProperty("description") }); }
public static EntityAttribute ToData(CdmEntityAttributeDefinition instance, ResolveOptions resOpt, CopyOptions options) { EntityAttribute obj = new EntityAttribute { Explanation = instance.Explanation, Name = instance.Name, IsPolymorphicSource = instance.IsPolymorphicSource, Entity = Utils.JsonForm(instance.Entity, resOpt, options), Purpose = Utils.JsonForm(instance.Purpose, resOpt, options), AppliedTraits = CopyDataUtils.ListCopyData(resOpt, instance.AppliedTraits? .Where(trait => trait is CdmTraitGroupReference || !(trait as CdmTraitReference).IsFromProperty), options), ResolutionGuidance = Utils.JsonForm(instance.ResolutionGuidance, resOpt, options), DisplayName = instance.GetProperty("displayName"), Description = instance.GetProperty("description"), Cardinality = Utils.CardinalitySettingsToData(instance.Cardinality) }; return(obj); }