DatabaseExtensionsGetMethodInfo Method
Get the method information for the calling method in the given data context type for use in a
stored procedure method call.
Namespace: EWSoftware.EntityFrameworkAssembly: EWSoftware.EntityFramework (in EWSoftware.EntityFramework.dll) Version: 2025.11.12.0
public static MethodInfo GetMethodInfo(
this DbContext dataContext
)
<ExtensionAttribute>
Public Shared Function GetMethodInfo (
dataContext As DbContext
) As MethodInfo
public:
[ExtensionAttribute]
static MethodInfo^ GetMethodInfo(
DbContext^ dataContext
)
[<ExtensionAttribute>]
static member GetMethodInfo :
dataContext : DbContext -> MethodInfo
- dataContext DbContext
- The data context
MethodInfoThe method information for the calling method in the given data contextIn Visual Basic and C#, you can call this method as an instance method on any object of type
DbContext. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
When a stored procedure method is called asynchronously, the method information must be
obtained from a stack trace as the call may be inside the compiler generated state machine. This
extension method can be used to obtain the necessary method information whether the stored procedure
method is called synchronously or asynchronously.
[MethodStoredProcedure("spStateCodeAddUpdate")]
public int AddOrUpdateStateCode(string? oldState, string? state, string? stateDesc)
{
return this.ExecuteMethodNonQuery(this.GetMethodInfo(), oldState, state, stateDesc).ReturnValue;
}