Пример #1
0
        public async Task <UserDTO.Response> GetById(UserDTO.Request request)
        {
            UserDTO.Response response = new UserDTO.Response();
            response.Data = new List <UserDTO.Response.User>();
            UserDTO.Response.User user = await(from c in _context.HilarioMarket_User
                                               where c.UserName == request.UserName &&
                                               c.Password == request.Password
                                               select new UserDTO.Response.User
            {
                IdUser   = c.IdUser,
                Name     = c.Name,
                LastName = c.LastName,
                UserName = c.UserName,
                Password = c.Password
            }).FirstOrDefaultAsync();
            if (user != null)
            {
                response.success = true;

                response.Data.Add(user);
            }
            else
            {
                response.success = false;
            }

            return(response);
        }
Пример #2
0
 public Task <UserDTO.Response> Get([FromBody] UserDTO.Request request)
 {
     return(_repository.GetById(request));
 }