Exemplo n.º 1
0
        public ServiceResponseModel Register(RegisterRequest request)
        {
            var isUserExist = IsUserExist(request.Email);

            if (isUserExist)
            {
                return(new ServiceResponseModel("User is already exist", false));
            }
            var user = request.MapToUser();

            _dbContext.Users.Add(user);
            _dbContext.SaveChanges();
            return(new ServiceResponseModel("User registered successfully", true));
        }