Пример #1
0
 public static async Task <TResult> QuerySingleOrDefaultAsync <TResult, TIdentity, TUser>(
     this DapperCX <TIdentity, TUser> crudService,
     Query <TResult> query) where TUser : IUserBase
 {
     using (var cn = crudService.GetConnection())
     {
         return(await query.ExecuteSingleOrDefaultAsync(cn));
     }
 }
Пример #2
0
 public static async Task <SelectList> QuerySelectListAsync <TIdentity, TUser>(
     this DapperCX <TIdentity, TUser> crudService,
     Query <SelectListItem> query, object selectedValue = null) where TUser : IUserBase
 {
     using (var cn = crudService.GetConnection())
     {
         return(await SelectListQuery.ExecuteInternalAsync(query, cn, selectedValue));
     }
 }
Пример #3
0
 public static async Task CreateSeedDataAsync(this DapperCX <int, UserProfile> data)
 {
     using (var cn = data.GetConnection())
     {
         foreach (var row in Permission.SeedData)
         {
             await data.MergeAsync(row);
         }
         foreach (var row in RecurringTaskType.SeedData)
         {
             await data.MergeAsync(row);
         }
     }
 }