public async Task <ICollection <Topic> > List() { return(await dbcontext.Topics .Select(t => DbMapper.MapDbTopic(t)) .ToListAsync()); }
public async Task <Topic> FindById(int id) { var dbTopic = await dbcontext.Topics.FirstAsync(t => t.Id == id); return(DbMapper.MapDbTopic(dbTopic)); }
public async Task <Topic> FindByName(string name) { var dbTopic = await dbcontext.Topics.FirstAsync(t => t.Name == name); return(DbMapper.MapDbTopic(dbTopic)); }
public async Task <Notification> GetById(int nId) { return(DbMapper.MapDbNotification(await dbcontext.Notifications.Include(n => n.User).FirstOrDefaultAsync(n => n.Id == nId))); }