public virtual async Task <TResult> ExecuteAsync <TEntity, TResult>(MemberInfo memberInfo, string rowKeyRef, string partitionKeyRef, TEntity value, IDictionary <string, EntityProperty> dictionary, AzureTableDriverDynamic repository, Func <Func <Task>, TResult> onSuccessWithRollback, Func <TResult> onFailure) { var propertyValueType = memberInfo.GetMemberType(); var rowKeyValue = memberInfo.GetValue(value); var referencedEntityType = ReferenceType.IsDefaultOrNull() ? propertyValueType.GetGenericArguments().First() : ReferenceType; if (!propertyValueType.IsSubClassOfGeneric(typeof(IRef <>))) { throw new Exception($"`{propertyValueType.FullName}` is instance of IRef<>"); } Task <TResult> result = (Task <TResult>) this.GetType() .GetMethod("ExecuteTypedAsync", BindingFlags.Public | BindingFlags.Instance) .MakeGenericMethod(typeof(TEntity), referencedEntityType, typeof(TResult)) .Invoke(this, new object[] { rowKeyValue, memberInfo, rowKeyRef, partitionKeyRef, value, dictionary, repository, onSuccessWithRollback, onFailure }); return(await result); }