Esempio n. 1
0
 public async Task Update(T entity, string updateSql)
 {
     using (IDbConnection conn = DataBaseConfig.Connection())
     {
         await conn.ExecuteAsync(updateSql, entity);
     }
 }
Esempio n. 2
0
 public async Task <List <T> > Select(string selectSql)
 {
     using (IDbConnection conn = DataBaseConfig.Connection())
     {
         return(await Task.Run(() => conn.Query <T>(selectSql).ToList()));
     }
 }
Esempio n. 3
0
 public async Task Insert(T entity, string insertSql)
 {
     using (IDbConnection conn = DataBaseConfig.Connection())
     {
         await conn.ExecuteAsync(insertSql, entity);
     }
 }
Esempio n. 4
0
 public async Task <T> Detail(Guid Id, string detailSql)
 {
     using (IDbConnection conn = DataBaseConfig.Connection())
     {
         return(await conn.QueryFirstOrDefault(detailSql, new { Id = Id }));
     }
 }
Esempio n. 5
0
 public async Task Delete(Guid Id, string deleteSql)
 {
     using (IDbConnection conn = DataBaseConfig.Connection())
     {
         await conn.ExecuteAsync(deleteSql, new { Id = Id });
     }
 }
Esempio n. 6
0
 public async Task <List <T> > ExecQuerySP(string SPName)
 {
     using (IDbConnection conn = DataBaseConfig.Connection()) {
         return(await Task.Run(() => conn.Query <T>(SPName, null, null, true, null, CommandType.StoredProcedure).ToList()));
     }
 }