最近得空在本地做的测试

Apr 20, 2013 at 3:44 PM
Image
Apr 20, 2013 at 3:44 PM
public class KylinORMHelper
{

    public static readonly ISimpleMapper<TestTb> TestTbHelper = SimpleMapper.Inject<TestTb>();

}

public class TestTb
{
    public ISimpleMapper<TestTb> Mapper;
    public TestTb()
    {
        this.Mapper = SimpleMapper.Inject(this, null);
    }

    public Int32 Id { get; set; }

    public String Name { get; set; }

    public Boolean IsShow { get; set; }

    public DateTime AddDate { get; set; }
}

public class KylinORM : IAction
{
    private DateTime AddDateS = DateTime.Parse("2013-4-25");
    private DateTime AddDateE = DateTime.Parse("2013-5-30");

    public void Action()
    {
        var list = new List<TestTb>();
        list = KylinORMHelper.TestTbHelper.Select<TestTb>("select * from TestTb where adddate>@AddDateS and adddate<@AddDateE", AddDateS,
                                    AddDateE);
    }
}