コード例 #1
0
        public LimitationResponse Create(LimitationViewModel limitation)
        {
            LimitationResponse response = new LimitationResponse();

            try
            {
                Limitation addedLimitation = unitOfWork.GetLimitationRepository().Create(limitation.ConvertToLimitation());
                unitOfWork.Save();

                response.Limitation = addedLimitation.ConvertToLimitationViewModel();
                response.Success    = true;
            }
            catch (Exception ex)
            {
                response.Limitation = new LimitationViewModel();
                response.Success    = false;
                response.Message    = ex.Message;
            }

            return(response);
        }