예제 #1
0
파일: User.cs 프로젝트: Yaakoi/YakoiChat
        public User GetUserById(int UserId)
        {
            var user = (from u in _ctx.User where u.Id == UserId select MapperUser.Map(u)).FirstOrDefault();
            var role = (from r in _ctx.AppRole join u in _ctx.User on r.Id equals u.IdRole where u.Id == UserId select MapperRole.Map(r)).FirstOrDefault();

            user.Role = role;
            return(user);
        }
예제 #2
0
파일: Group.cs 프로젝트: Yaakoi/YakoiChat
 public List <User> GetListUser(int GroupId)
 {
     return((from ug in _ctx.UserGroup where ug.IdGroup == GroupId select MapperUser.Map(ug.User)).ToList());
 }