IMiddleTierClient<TDbContext> Interface
Declares the API for a Middle Tier client.
Namespace: DevExpress.ExpressApp.ApplicationBuilder
Assembly: DevExpress.EntityFrameworkCore.Security.v25.1.dll
NuGet Package: DevExpress.ExpressApp.EFCore
Declaration
Type Parameters
Name | Description |
---|---|
TDbContext | The type of |
Remarks
To create a Middle Tier client, configure its settings with the MiddleTierClientBuilder<TDbContext> and call the Build() method. Once created, the client is immutable.
// Configures client `DbContext` type, server, and authentication settings
var builder = new MiddleTierClientBuilder<MainDemoDbContext>()
.UseServer("http://localhost:5000/")
.UsePasswordAuthentication("user", "password");
// Creates a Middle Tier client instance
IMiddleTierClient<MainDemoDbContext> client = builder.Build();
// Creates DbContext and operates data
using(var ctx = client.CreateDbContext()) {
var data = ctx.Users.ToList();
// ...
}
// Disposes the client
// Note that it is necessary to manually dispose the client when its instance is no longer needed
client.Dispose();
See Also