コード例 #1
0
 public ResponseBase Insert(MenuButtonModel menuButton)
 {
     ResponseBase response;
     using (var unitOfWork = _unitOfWorkFactory.Create())
     {
         try
         {
             if (menuButton != null)
             {
                 unitOfWork.MenuButtonRepository.Insert(menuButton.ToEntity());
             }
             unitOfWork.Save();
             response = new ResponseBase() { IsSucceed = true, Message = Modules.Resources.Logic.MenuButtonInsertSuccess };
         }
         catch (Exception e)
         {
             _logger.LogToFile(_logger.CreateErrorMessage(e));
             response = new ResponseBase() { IsSucceed = false, Message = Modules.Resources.Logic.MenuButtonInsertFailed };
         }
         return response;
     }
 }