IMaterializationInterceptor.CreatingInstance 메서드

정의

EF가 엔터티의 instance 만들기 직전에 호출됩니다. 즉, 생성자가 호출되기 전입니다.

public virtual Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> CreatingInstance (Microsoft.EntityFrameworkCore.Diagnostics.MaterializationInterceptionData materializationData, Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<object> result);
abstract member CreatingInstance : Microsoft.EntityFrameworkCore.Diagnostics.MaterializationInterceptionData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>
override this.CreatingInstance : Microsoft.EntityFrameworkCore.Diagnostics.MaterializationInterceptionData * Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj> -> Microsoft.EntityFrameworkCore.Diagnostics.InterceptionResult<obj>
Public Overridable Function CreatingInstance (materializationData As MaterializationInterceptionData, result As InterceptionResult(Of Object)) As InterceptionResult(Of Object)

매개 변수

materializationData
MaterializationInterceptionData

구체화에 대한 컨텍스트 정보입니다.

result
InterceptionResult<Object>

있는 경우 현재 결과를 나타냅니다. 이전의 일부 인터셉터에서 를 호출SuppressWithResult(TResult)하여 true 실행을 억제한 경우 이 값은 로 설정됩니다HasResult. 이 값은 일반적으로이 메서드의 구현에 대 한 반환 값으로 사용 합니다.

반환

가 이falseHasResult EF는 정상적으로 계속됩니다. 이 이trueHasResult EF는 엔터티 instance 만들지 않고 대신 를 사용합니다Result. 결과를 변경하려고 하지 않는 모든 인터셉터에 대해 이 메서드를 구현하면 전달된 값이 result 반환됩니다.

적용 대상