public NavigationProperty(JNode jNode) { Name = jNode.Get <String>("name"); EntityTypeName = jNode.Get <String>("entityTypeName"); IsScalar = jNode.Get <bool>("isScalar", true); AssociationName = jNode.Get <String>("associationName"); _validators = new ValidatorCollection(jNode.GetJNodeArray("validators")); _foreignKeyNames.AddRange(jNode.GetArray <String>("foreignKeyNames")); _invForeignKeyNames.AddRange(jNode.GetArray <String>("invForeignKeyNames")); // custom }
public EntityType(JNode jNode) { ShortName = jNode.Get <String>("shortName"); Namespace = jNode.Get <String>("namespace"); BaseTypeName = jNode.Get <String>("baseTypeName"); IsAbstract = jNode.Get <bool>("isAbstract"); AutoGeneratedKeyType = jNode.GetEnum <AutoGeneratedKeyType>("autoGeneratedKeyType"); var drn = jNode.Get <String>("defaultResourceName"); if (drn != null) { MetadataStore.Instance.AddResourceName(drn, this, true); } jNode.GetJNodeArray("dataProperties").Select(jn => new DataProperty(jn)).ForEach(dp => AddDataProperty(dp)); jNode.GetJNodeArray("navigationProperties").Select(jn => new NavigationProperty(jn)).ForEach(np => AddNavigationProperty(np)); _validators = new ValidatorCollection(jNode.GetJNodeArray("validators")); // custom }
public DataProperty(JNode jNode) { Name = jNode.Get <String>("name"); ComplexTypeName = jNode.Get <String>("complexTypeName"); if (ComplexTypeName == null) { DataType = DataType.FromName(jNode.Get <String>("dataType")); } IsNullable = jNode.Get <bool>("isNullable", true); if (DataType != null) { DefaultValue = jNode.Get("defaultValue", DataType.ClrType); } IsPartOfKey = jNode.Get <bool>("isPartOfKey", false); IsUnmapped = jNode.Get <bool>("isUnmapped", false); IsAutoIncrementing = jNode.Get <bool>("isAutoIncrementing", false); ConcurrencyMode = (ConcurrencyMode)Enum.Parse(typeof(ConcurrencyMode), jNode.Get <String>("conncurrencyMode", ConcurrencyMode.None.ToString())); MaxLength = jNode.Get <int?>("maxLength"); EnumTypeName = jNode.Get <String>("enumType"); IsScalar = jNode.Get <bool>("isScalar", true); _validators = new ValidatorCollection(jNode.GetJNodeArray("validators")); }