以下是我最近学的一个案例,用的内容,我相请一个高用指点,最好是在上海,沟通方面。本人愿付学费!using System;
using cenetcom.util;
namespace cenetcom
{
/// <summary>
/// 数据库连接 的摘要说明。
/// </summary>
/// 
[StoreUnit(StoreUnitType.Xml|StoreUnitType.Define)]
public class 数据库连接
{
public 数据库连接()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
[Field]
public string 定义名称;
[Field]
public string 服务器;
[Field]
public string 用户名;
[Field]
public string 密码;
[Field]
public bool 集成登录;
public static 数据库连接 本地连接定义
{
get
{
数据库连接 lj=(数据库连接)FastObject.PickObject(typeof(数据库连接).FullName,"定义名称","数据库");
if (lj!=null) return lj;
else 
{
lj=new 数据库连接();
lj.定义名称="数据库";
return lj;
}
} }
}
}
-------------------------------namespace cenetcom
{
/// <summary>
/// 存储单元的定义,包含对象的存储映射方式
/// </summary>
/// 
[AttributeUsage(AttributeTargets.All)]
public class StoreUnit:System.Attribute
{
public StoreUnit()
{

}
private StoreUnitType type;
private string logicname="Default";
private string storename="Default"; public StoreUnit(StoreUnitType type)
{ this.type=type;
if (!In(StoreUnitType.Db)) this.type|=StoreUnitType.Xml;
if (!In(StoreUnitType.Define)) this.type|=StoreUnitType.Public;
}
public StoreUnit(StoreUnitType type,string maplogicname)
{ this.type=type;
if (!In(StoreUnitType.Db)) this.type|=StoreUnitType.Xml;
if (!In(StoreUnitType.Define)) this.type|=StoreUnitType.Public;
this.logicname=maplogicname;
}
public StoreUnitType Type
{
get
{
return type;
}
}
public bool In(StoreUnitType type)
{
int x=Convert.ToInt16((this.type&type));
return (x!=0);
}
public string StoreName
{
get
{
return storename;
}
}
public string LogicName
{
get
{
return logicname;
}
}
public static StoreUnit Default=new StoreUnit(StoreUnitType.Public|StoreUnitType.Xml);
}
}

解决方案 »

  1.   

    不好意思上面一个错字,是高手指点,联系方式:[email protected]
      

  2.   

    题目是反射,里面一堆东西太多,不明白是怎么回事,反射本身不是很简单的语句吗,接口反射
    Object o=Assymble.Load("类命名空间路径").CreateInStance("类名称");
    或者是反射某个类中的主法Methode.Invoke(
      

  3.   

    上面打错名字了 Assembly.Load(path).CreateInstance(className);
      

  4.   

    就是一个ORM
    数据库表到对象的翻译过程而已
      

  5.   

    有没有这方面的资料,数据库表是如何ORM到对象的
      

  6.   

    有谁愿意教我呢?
    [email protected]