예제 #1
0
 public async Task <ICollection <Topic> > List()
 {
     return(await dbcontext.Topics
            .Select(t => DbMapper.MapDbTopic(t))
            .ToListAsync());
 }
예제 #2
0
        public async Task <Topic> FindById(int id)
        {
            var dbTopic = await dbcontext.Topics.FirstAsync(t => t.Id == id);

            return(DbMapper.MapDbTopic(dbTopic));
        }
예제 #3
0
        public async Task <Topic> FindByName(string name)
        {
            var dbTopic = await dbcontext.Topics.FirstAsync(t => t.Name == name);

            return(DbMapper.MapDbTopic(dbTopic));
        }
예제 #4
0
 public async Task <Notification> GetById(int nId)
 {
     return(DbMapper.MapDbNotification(await dbcontext.Notifications.Include(n => n.User).FirstOrDefaultAsync(n => n.Id == nId)));
 }