December 2019
Intermediate to advanced
510 pages
11h 33m
English
DbContext is one of the abstractions between our application and the database. It enables us to interact with, and perform operations over, data. A DbContext implementation is also the representation of a session between our application and the database, and it can be used to query and save the instances of the application entities into our data source. Let's take a quick look at the DbContext implementation in the Catalog.Infrastructure project:
using System.Threading;using System.Threading.Tasks;using Catalog.Domain.Entities;using Catalog.Domain.Repositories;using Microsoft.EntityFrameworkCore;namespace Catalog.Infrastructure{ public class CatalogContext : DbContext, IUnitOfWork { public const string DEFAULT_SCHEMA ...
Read now
Unlock full access