实战 .Net 数据访问层 - 4

代码 3 :我的 Data Entity – 1 ,应用程序中的 Data Entity

// MyCustomer :包含基本字段的 Customer ,支持数据列表,从 MyDef 继承 ** **

[ ** Serializable ** ()]

public class ** MyCustomer ** : ** MyDef **

{

public string Id;

public string Name;

public string Phone;

public ** MyCustomer ** () { }

public ** MyCustomer ** ( ** ArrayList ** al) : base (al) { }

}

// MyDef :提供当前应用程序所需的 Data Entity 支持,

// 包括 O/R Mapping , XML ,从 DefBase 继承

[ ** Serializable ** ()]

public class ** MyDef ** : ** DefBase ** , ** IList ** , ** IEnumerable **

{

// O/R Mapping fields

[ ** NonSerialized ** ()]

protected internal ** ObjectSet ** _ostOrm = null ;

...

// XML fields

[ ** NonSerialized ** ()]

protected internal ** XmlNode ** _xmlNode = null ;

...

public ** MyDef ** () { }

public ** MyDef ** ( ** ArrayList ** al) : base (al) { }

public ** MyDef ** ( ** ObjectSet ** ostOrm)

{

this ._ostOrm = ostOrm;

this ._typeEntity =

** MyEntityType ** .ORM_OBJECTSPACES_OBJECTSET;

}

public ** MyDef ** ( ** XmlNode ** xmlNode)

{

this ._xmlNode = xmlNode;

this ._typeEntity = ** MyEntityType ** .XML_NODE;

}

...

}


下一段: http://www.csdn.net/develop/Read_Article.asp?id=27547

Published At
Categories with Web编程
Tagged with
comments powered by Disqus