public Association(Class thisClass, XElement xe) { this.thisClass = thisClass; Name = (String)xe.Attribute("Name"); Member = (String)xe.Attribute("Member"); typeName = (String)xe.Attribute("Type"); thisKeyName = (String)xe.Attribute("ThisKey"); storage = (String)xe.Attribute("Storage"); otherKeyName = (String)xe.Attribute("OtherKey"); IsForeignKey = (xe.Attribute("IsForeignKey") != null); DeleteRule = (String)xe.Attribute("DeleteRule"); DeleteOnNull = (Boolean?)xe.Attribute("DeleteOnNull") ?? false; }
public Column(Class class1, XElement xe) { Class = class1; Name = (String)xe.Attribute("Name") ?? ""; Member = (String)xe.Attribute("Member") ?? Name; typeName = xe.Attribute("Type").Value; DbType = (String)xe.Attribute("DbType") ?? ""; IsPrimaryKey = (Boolean?)xe.Attribute("IsPrimaryKey") ?? false; IsDbGenerated = (Boolean?)xe.Attribute("IsDbGenerated") ?? false; IsDiscriminator = (Boolean?)xe.Attribute("IsDiscriminator") ?? false; CanBeNull = (Boolean?)xe.Attribute("CanBeNull") ?? false; Storage = (String)xe.Attribute("Storage") ?? ""; AutoSync = (xe.Attribute("AutoSync") != null) ? (System.Data.Linq.Mapping.AutoSync)Enum.Parse(typeof(System.Data.Linq.Mapping.AutoSync), xe.Attribute("AutoSync").Value) : (IsDbGenerated) ? AutoSync.OnInsert : AutoSync.Default; UpdateCheck = (xe.Attribute("UpdateCheck") == null) ? UpdateCheck.Always : (System.Data.Linq.Mapping.UpdateCheck)Enum.Parse(typeof(UpdateCheck), xe.Attribute("UpdateCheck").Value); MemberAttributes = DecodeAccess((String)xe.Attribute("AccessModifier")) | DecodeModifier((String)xe.Attribute("Modifier")); }
public Table(Database database, XElement xe) { Database = database; Name = (String)xe.Attribute("Name"); Member = (String)xe.Attribute("Member"); Classes = (from c in xe.Descendants(Database.ns + "Type") select new Class(this, c)).ToList(); BaseClass = Classes[0]; }