Example #1
0
        public async Task <List <CategoryDto> > GetCategoriesByRound(int roundId)
        {
            try
            {
                var SelectedCats = await _context.Set <GetValidCategoriesByRoundResult>().FromSqlRaw($"GetValidCategoriesByRound {roundId}").ToListAsync();

                return(_mapper.Map <List <CategoryDto> >(SelectedCats));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #2
0
 /******************************************************************
  * Sets the Entity Framework database context and table references
  * ***************************************************************/
 public BaseRepo(JeopardyContext context)
 {
     _db    = context;
     _table = _db.Set <T>();
 }