public async Task <IEnumerable <SpecializationGroup> > GetAsync() { using (var cn = new SqlConnection(opts.ConnectionString)) { await cn.OpenAsync(); var grid = await cn.QueryMultipleAsync( Sql.Get, commandType : CommandType.StoredProcedure, commandTimeout : opts.DefaultTimeout ); return(HydratedSpecializationGroupReader.Read(grid)); } }
public async Task <SpecializationGroup> CreateAsync(SpecializationGroup g) { using (var cn = new SqlConnection(opts.ConnectionString)) { await cn.OpenAsync(); var grid = await cn.QueryMultipleAsync( Sql.Create, new { sqlSetId = g.SqlSetId, uiDefaultText = g.UiDefaultText, specs = SpecializationTable.From(g), user = user.UUID }, commandType : CommandType.StoredProcedure, commandTimeout : opts.DefaultTimeout); return(HydratedSpecializationGroupReader.ReadSingle(grid)); } }