public Property FromXml(XmlElement element) { name = element.GetAttribute("name"); field = element.GetAttribute("field"); type = (DbType)Enum.Parse(typeof(DbType), element.GetAttribute("type"), true); size = UpdateXmlElement.GetXEAttribute(element, "size", 0); scale = UpdateXmlElement.GetXEAttribute(element, "scale", 0); nullable = UpdateXmlElement.GetXEAttribute(element, "nullable", false); _readonly = UpdateXmlElement.GetXEAttribute(element, "readonly", false); description = element.GetAttribute("description"); return(this); }
public EntityObject FromXml(XmlElement element) { propertyDict.Clear(); typeName = UpdateXmlElement.GetXEAttribute(element, "type", ""); //此方法用于此处根本就是庸人自扰 tableName = UpdateXmlElement.GetXEAttribute(element, "table", ""); primaryKeyName = UpdateXmlElement.GetXEAttribute(element, "primaryKey", ""); identityName = UpdateXmlElement.GetXEAttribute(element, "identity", ""); description = UpdateXmlElement.GetXEAttribute(element, "description", ""); foreach (XmlElement xe in element.SelectNodes("Property")) { Property p = new Property().FromXml(xe); propertyDict.Add(p.Name, p); } return(this); }