public IHeyResponse Create(HeyRememberDto heyRemember, bool update = false) { try { FindMethodService findService = new FindMethodService(heyRemember, new ResolveMethodByFireMeAttribute(_exceptionHandler)); return(update ? findService.UpdateResponse(_repository.MakeASchedulePrototype(heyRemember)) : findService.CreateNewResponse(_repository.MakeASchedulePrototype(heyRemember))); } catch (Exception ex) { if (_exceptionHandler != null) { _exceptionHandler.Handle(ex); return(new ErrorHeyResponse(ex, heyRemember)); } else { throw; } } }
public MethodExecutionResultEnum Invoke(IBoundMethodConsumer consumer) { try { object obj = Activator.CreateInstance(_fireMeMethod.DeclaringType); object[] myParams = JsonConvert.DeserializeObject <object[]>(_heyRemember.DomainSpecificData); return(consumer.Use(_fireMeMethod, obj, myParams)); } catch (Exception e) { if (_exceptionHandler != null) { _exceptionHandler.Handle(e); return(MethodExecutionResultEnum.Fail); } throw; } }