Språk

CosmosDbContextOptionsBuilder.ContentResponseOnWriteEnabled(Boolean) Method

Definition

Caution

Enabling ContentResponseOnWrite currently has no benefit for EF Core.

Sets the boolean to only return the headers and status code in the Cosmos DB response for write item operation like Create, Upsert, Patch and Replace. Setting the option to false will cause the response to have a null resource. This reduces networking and CPU load by not sending the resource back over the network and serializing it on the client.

public virtual Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder ContentResponseOnWriteEnabled(bool enabled = true);
[System.Obsolete("Enabling ContentResponseOnWrite currently has no benefit for EF Core.")]
public virtual Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder ContentResponseOnWriteEnabled(bool enabled = true);
abstract member ContentResponseOnWriteEnabled : bool -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
override this.ContentResponseOnWriteEnabled : bool -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
[<System.Obsolete("Enabling ContentResponseOnWrite currently has no benefit for EF Core.")>]
abstract member ContentResponseOnWriteEnabled : bool -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
override this.ContentResponseOnWriteEnabled : bool -> Microsoft.EntityFrameworkCore.Infrastructure.CosmosDbContextOptionsBuilder
Public Overridable Function ContentResponseOnWriteEnabled (Optional enabled As Boolean = true) As CosmosDbContextOptionsBuilder

Parameters

enabled
Boolean

false to have null resource

Returns

Attributes

Remarks

The EntityFrameworkCore default is false since 11.0. See Using DbContextOptions, and Accessing Azure Cosmos DB with EF Core for more information and examples.

Applies to