示例#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)));
 }