private IReturnable InternalReturns <TInternalValue>(TInternalValue value) { var hook = _hookBuilder.CreateReturnHook(value); var injectionService = _hookServiceFactory.CreateHookService(_originalMethodInfo); return(injectionService.Hook(hook)); }
public IReturnable CallbackAsync <TReturnValue>(Func <TReturnValue> callback) { if (callback == null) { throw new ArgumentNullException(nameof(callback)); } var hook = _hookBuilder.CreateReturnHook(Task.FromResult(callback())); return(Inject(hook)); }