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));
     }
 }
 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);
         }
     }
 }