Пример #1
0
 public async Task <T> GetEntityAsync(string keyValue, string connectionString = null)
 {
     using (SystemContext context = DataBaseConfig.CreateContext(connectionString))
     {
         return(await context.FindAsync <T>(keyValue));
     }
 }
Пример #2
0
 public async Task <bool> DeleteAsync(string[] keyValues, string connectionString = null)
 {
     using (SystemContext context = DataBaseConfig.CreateContext(connectionString))
     {
         List <T> entitys = new List <T>();
         entitys.ForEach(async u =>
         {
             entitys.Add(await context.FindAsync <T>(u));
         });
         return(await DeleteAsync(entitys));
     }
 }