I have a simple Interface which I would like to implement with different Accessors
public interface IValidatorByState : IValidator
{
AuthorizedDbContext Context { get; set; }
}
I'm trying to implement this on a class with an Public, Or Protected Get and an Internal Set;
Edit This class is is exposed to the user, they should only be able to retrieve the Context.
public class ValidatorByState<TEntity> : AbstractValidator<TEntity>, IValidatorByState
{
public AuthorizedDbContext Context { get; internal set;}
}
No matter which way Implement this I've been given an error
Attempts:
public AuthorizedDbContext Context { get; internal set;}
ValidatorByState.Context is not public
protected AuthorizedDbContext Context { get; internal set;}
ValidatorByState.Context.set Accessor must be more restrictive than property,
AuthorizedDbContext _context;
public AuthorizedDbContext IValidatorByState.Context => this._context;
public AuthorizedDbContext IValidatorByState.Context {
set { this._context = value; }
}
For this I get an error on both stating
Explicit implementation missing Accessor
How can I have a public get method with a internal set?