ying-hui.the@windev.co.uk (47) [Avatar] Offline
#1
for unkown reason I get:
...Core\Services\CountersService.cs(16,16,16,31): error CS0051: Inconsistent accessibility: parameter type 'ICountersRepository' is less accessible than method 'CountersService.CountersService(ICountersRepository)'

typed this in twice in fiffrent projects, but same error!

public class CountersService : ICountersService
{
readonly ICountersRepository repository;

public CountersService(ICountersRepository repository) // line in error!
{
this.repository = repository;
}

public async Task<Counter> AddNewCounter(string name)
{
var counter = new Counter { Name = name };
await repository.Save(counter);
return counter;
}
public async Task<IEnumerable<Counter>> GetAllCounters()
{
return await repository.GetAll();
}
public async Task DeleteCounter(Counter counter)
{
await repository.Delete(counter);
}
public async Task IncrementCounter(Counter counter)
{
counter.Count += 1;
await repository.Save(counter);
}
}

Any ideas?
Jim Bennett (88) [Avatar] Offline
#2
What's the accessibility of ICountersRepository? Is it public?
ying-hui.the@windev.co.uk (47) [Avatar] Offline
#3
Poo, it was Right in front of my face!