December 2019
Intermediate to advanced
510 pages
11h 33m
English
Before we start, we need to define some interfaces in the Catalog.Domain project. Let's proceed by setting a generic interface to determine the unit of work of our repository:
using System;using System.Threading;using System.Threading.Tasks;namespace Catalog.Domain.Repositories{ public interface IUnitOfWork : IDisposable { Task<int> SaveChangesAsync(CancellationToken cancellationToken = default(CancellationToken)); Task<bool> SaveEntitiesAsync(CancellationToken cancellationToken = default(CancellationToken)); }}
IUnitOfWork defines two methods: SaveChangesAsync and SaveEntitiesAsync. These two methods are used to save changes in our collection to the database effectively. These methods are ...
Read now
Unlock full access