Exemple #1
0
        public static Response Create(UserViewModel model)
        {
            var response = ResponseFactory.Success(ResponseCode.SuccessEntityCreated);

            if (model == null)
            {
                return(ResponseFactory.Error(ResponseCode.ErrorInvalidInput));
            }

            var user        = model.CopyTo();
            var createdUser = Create(user);

            if (createdUser == null)
            {
                response = ResponseFactory.Error(ResponseCode.ErrorCreatingEntity);
            }
            return(response);
        }