コード例 #1
0
        public User GetUser(Guid id)
        {
            var query = new UserByIdQuery(dbContext.Users);
            var user = query.Execute(id);

            if (user == null)
            {
                throw new EntityNotFoundException("User", id);
            }

            return user;
        }
コード例 #2
0
        public User GetUser(Guid userId)
        {
            var query = new UserByIdQuery(dbContext.Users);
            var user = query.Execute(userId);

            if (user == null)
            {
                throw new EntityNotFoundException("User", userId);
            }

            return new UserMapper().Map(query.Execute(userId));
        }