Пример #1
0
        public DeleteDashResponse Handle(DeleteDashRequest request)
        {
            var response = new DeleteDashResponse {
                Errors = Validate(request)
            };


            if (response.HasErrors)
            {
                return(response);
            }
            try
            {
                int userId = _usersRepository.Get(request.UserId).Id;

                _dashRepository.DeleteDashboard(userId, request.DashboardId);
            }
            catch (Exception ex)
            {
                response.Errors.Add(new ErrorStatus("BAD_REQUEST"));
            }

            return(response);
        }