コード例 #1
0
 public ControllerAction Update(ControllerAction controllerAction)
 {
     try
     {
         _actionRepository.Update(controllerAction);
         return controllerAction;
     }
     catch (Exception e)
     {
         _log.Error(e,"更新Action失败");
         return null;
     }
 }
コード例 #2
0
 public ControllerAction Create(ControllerAction controllerAction)
 {
     try
     {
         _actionRepository.Insert(controllerAction);
         return controllerAction;
     }
     catch (Exception e)
     {
         _log.Error(e,"创建Action失败");
         return null;
     }
 }
コード例 #3
0
 public ControllerAction ExistOrCreate(string controllerName, string actionName)
 {
     try
     {
         var action = _actionRepository.Get(c => c.ActionName == actionName && c.ControllerName == controllerName);
         if (action != null)
             return action;
         var newAction = new ControllerAction
         {
             ActionName = actionName,
             ControllerName = controllerName
         };
         _actionRepository.Insert(newAction);
         return newAction;
     }
     catch (Exception e)
     {
         _log.Error(e,"");
         return null;
     }
 }
コード例 #4
0
 public bool Delet(ControllerAction controllerAction)
 {
     try
     {
         _actionRepository.Delete(controllerAction);
         return true;
     }
     catch (Exception e)
     {
         _log.Error(e,"删除Action失败");
         return false;
     }
 }