Skip to content

Fully Deprecate DefaultEntityRepository Constructor #117

Closed
@jaredcnance

Description

@jaredcnance

Ref #116

Remove the obsolete constructor, note that this is still being actively called in all projects since the DI framework will call the constructor with the most available parameters.

public class DefaultEntityRepository<TEntity, TId> 
    : IEntityRepository<TEntity, TId> 
    where TEntity : class, IIdentifiable<TId>
{
    [Obsolete("DbContext is no longer directly injected into the ctor. Use JsonApiContext.GetDbContextResolver() instead")]
    public DefaultEntityRepository(
        DbContext context,
        ILoggerFactory loggerFactory,
        IJsonApiContext jsonApiContext)
    {
        _context = context;
        _dbSet = context.GetDbSet<TEntity>();
        _jsonApiContext = jsonApiContext;
        _logger = loggerFactory.CreateLogger<DefaultEntityRepository<TEntity, TId>>();
        _genericProcessorFactory = _jsonApiContext.GenericProcessorFactory;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions