public static bool DeleteData() { using (var provider = ProvidersHelper.Resolve <ITestProvider>()) { var rsDao = provider.DeleteData(1); return(rsDao); } }
public static List <TestModelDto> GetListByPage(int pageIndex, int pageSize) { using (var provider = ProvidersHelper.Resolve <ITestProvider>()) { var rsDao = provider.GetList(pageIndex, pageSize); var rsDto = MapperHelper.AutoMapTo <List <TestModelDto> >(rsDao); return(rsDto); } }
public static List <TestModelDto> GetList() { using (var provider = ProvidersHelper.Resolve <ITestProvider>()) { var rsDao = provider.GetList(1, 10); var rsDto = MapperHelper.AutoMapTo <List <TestModelDto> >(rsDao); return(rsDto); } }
public static TestModelDto GetData() { using (var provider = ProvidersHelper.Resolve <ITestProvider>()) { var rsDao = provider.GetData(1); var rsDto = MapperHelper.AutoMapTo <TestModelDto>(rsDao); return(rsDto); } }
public static TestModelDto AddDataByModel(TestModelDto model) { using (var provider = ProvidersHelper.Resolve <ITestProvider>()) { var daoModel = MapperHelper.AutoMapTo <DaoTestModel>(model); var rsDao = provider.AddData(daoModel); var rsDto = MapperHelper.AutoMapTo <TestModelDto>(rsDao); return(rsDto); } }
public static bool UpdateData() { using (var provider = ProvidersHelper.Resolve <ITestProvider>()) { var rs = provider.UpdateData(new DaoTestModel() { Id = 2, Name = "UpdateAccount", Psw = "666666" }); return(rs); } }
public static TestModelDto AddData() { using (var provider = ProvidersHelper.Resolve <ITestProvider>()) { var rsDao = provider.AddData(new DaoTestModel() { Name = "AccountName", Psw = "888888" }); var rsDto = MapperHelper.AutoMapTo <TestModelDto>(rsDao); return(rsDto); } }