You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have it sense to have this import in Application project?
global using Microsoft.EntityFrameworkCore;
Have it sense to have this interface in Application project?
public interface IApplicationDbContext
{
DbSet TodoLists { get; }
DbSet TodoItems { get; }
Task SaveChangesAsync(CancellationToken cancellationToken);
}
This:
Give application layer full access to database. No restriction.
Expose DbSet objects, something that should belong only to infraestructure implementation.
Expose the whole db-context instead of use repositories to reduce coupling of command implementations only interested in some entities set.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Have it sense to have this import in Application project?
global using Microsoft.EntityFrameworkCore;
Have it sense to have this interface in Application project?
public interface IApplicationDbContext
{
DbSet TodoLists { get; }
DbSet TodoItems { get; }
Task SaveChangesAsync(CancellationToken cancellationToken);
}
This:
Beta Was this translation helpful? Give feedback.
All reactions