Esempio n. 1
0
        protected ActionReponse <TActionEntity> PerformAction <TAction, TActionEntity>(TAction action)
            where TAction : SystemAction <TActionEntity>
            where TActionEntity : class, IEntity
        {
            ActionReponse <TActionEntity> result = _actionHandlerOverlord.HandleAction <TAction, TActionEntity>(action);

            return(result);
        }
        public IHttpActionResult Do()
        {
            var modelActionResponse = new ActionReponse <TModel>(_modelConvert(_actionResponse.ActionResult),
                                                                 _actionResponse.ValidationResult);

            var response = modelActionResponse.ValidationResult.IsValid
                ? GetSucessfulResult(modelActionResponse)
                : Controller.BadRequestWithContent(modelActionResponse);

            return(response);
        }
 protected override IHttpActionResult GetSucessfulResult(ActionReponse <TModel> content)
 {
     return(Controller.OkWithContent(content));
 }
 public ActionResultToOkHttpActionResult(ActionReponse <T> actionResponse, Func <T, TModel> modelConvert, ApiController controller)
     : base(actionResponse, modelConvert, controller)
 {
 }
 protected abstract IHttpActionResult GetSucessfulResult(ActionReponse <TModel> content);
 protected ActionResultToHttpActionResult(ActionReponse <T> actionResponse, Func <T, TModel> modelConvert, ApiController controller)
 {
     _actionResponse = actionResponse;
     _modelConvert   = modelConvert;
     Controller      = controller;
 }