Skip to content

Commit

Permalink
Make the setters protected rather than private.
Browse files Browse the repository at this point in the history
This affords maximum extensibility, while still encapsulating
the values within a property
  • Loading branch information
eldamir committed May 14, 2024
1 parent ef13433 commit e63126a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ namespace Ardalis.Specification.EntityFramework6;
/// <inheritdoc/>
public abstract class RepositoryBase<T> : IRepositoryBase<T> where T : class
{
protected DbContext DbContext { get; private set; }
protected ISpecificationEvaluator SpecificationEvaluator { get; private set; }
protected DbContext DbContext { get; set; }
protected ISpecificationEvaluator SpecificationEvaluator { get; set; }

public RepositoryBase(DbContext dbContext)
: this(dbContext, EntityFramework6.SpecificationEvaluator.Default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ namespace Ardalis.Specification.EntityFrameworkCore;
/// <inheritdoc/>
public abstract class RepositoryBase<T> : IRepositoryBase<T> where T : class
{
protected DbContext DbContext { get; private set; }
protected ISpecificationEvaluator SpecificationEvaluator { get; private set; }
protected DbContext DbContext { get; set; }
protected ISpecificationEvaluator SpecificationEvaluator { get; set; }

public RepositoryBase(DbContext dbContext)
: this(dbContext, EntityFrameworkCore.SpecificationEvaluator.Default)
Expand Down
2 changes: 1 addition & 1 deletion sample/Ardalis.Sample.App3/RepositoryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Ardalis.Sample.App3;

public abstract class RepositoryBase<T> : IReadRepository<T> where T : class
{
protected DbContext DbContext { get; private set; }
protected DbContext DbContext { get; set; }
protected readonly AutoMapper.IConfigurationProvider _configurationProvider;
protected ISpecificationEvaluator Evaluator { get; }

Expand Down

0 comments on commit e63126a

Please sign in to comment.