Table of Contents

Class MethodCallCodeFragment

Namespace
Microsoft.EntityFrameworkCore.Design
Assembly
Microsoft.EntityFrameworkCore.dll

Represents a call to a method.

public class MethodCallCodeFragment : IMethodCallCodeFragment
Inheritance
MethodCallCodeFragment
Implements
Inherited Members

Remarks

See Implementation of database providers and extensions for more information and examples.

Constructors

MethodCallCodeFragment(MethodInfo, params object?[])

Initializes a new instance of the MethodCallCodeFragment class.

public MethodCallCodeFragment(MethodInfo methodInfo, params object?[] arguments)

Parameters

methodInfo MethodInfo

The method's MethodInfo.

arguments object[]

The method call's arguments. Can be NestedClosureCodeFragment.

MethodCallCodeFragment(string, params object?[])

Initializes a new instance of the MethodCallCodeFragment class.

public MethodCallCodeFragment(string method, params object?[] arguments)

Parameters

method string

The method's name.

arguments object[]

The method call's arguments. Can be a fragment like NestedClosureCodeFragment or PropertyAccessorCodeFragment.

Properties

Arguments

Gets the method call's arguments.

public virtual IReadOnlyList<object?> Arguments { get; }

Property Value

IReadOnlyList<object>

The method call's arguments.

ChainedCall

Gets the next method call to chain after this.

public virtual MethodCallCodeFragment? ChainedCall { get; }

Property Value

MethodCallCodeFragment

The next method call.

DeclaringType

Gets the name of the method's declaring type.

public virtual string? DeclaringType { get; }

Property Value

string

The declaring type's name.

Method

Gets the method's name.

public virtual string Method { get; }

Property Value

string

The method's name.

MethodInfo

Gets the MethodInfo for this method call.

public virtual MethodInfo? MethodInfo { get; }

Property Value

MethodInfo

The MethodInfo.

Namespace

Gets the namespace of the method's declaring type.

public virtual string? Namespace { get; }

Property Value

string

The declaring type's name.

Methods

Chain(MethodCallCodeFragment)

Creates a method chain from this method to another.

public virtual MethodCallCodeFragment Chain(MethodCallCodeFragment call)

Parameters

call MethodCallCodeFragment

The next method.

Returns

MethodCallCodeFragment

A new fragment representing the method chain.

Chain(MethodInfo, params object?[])

Creates a method chain from this method to another.

public virtual MethodCallCodeFragment Chain(MethodInfo methodInfo, params object?[] arguments)

Parameters

methodInfo MethodInfo

The method's MethodInfo.

arguments object[]

The next method call's arguments.

Returns

MethodCallCodeFragment

A new fragment representing the method chain.

Chain(string, params object?[])

Creates a method chain from this method to another.

public virtual MethodCallCodeFragment Chain(string method, params object?[] arguments)

Parameters

method string

The next method's name.

arguments object[]

The next method call's arguments.

Returns

MethodCallCodeFragment

A new fragment representing the method chain.