コード例 #1
0
        public async Task <ControlResponse> SaveAsync(Control control)
        {
            try
            {
                await _controlRepository.AddAsync(control);

                await _unitOfWork.CompleteAsync();

                return(new ControlResponse(control));
            }
            catch (Exception e)
            {
                return(new ControlResponse($"An error occurred when saving the control: {e.Message}"));
            }
        }