Общее предупреждение T имеет то же имя, что и тип из другого типа

Учитывая следующее

public class Service<T> : IService<T>
{
        Repository<T> _repository = new Repository<T>();
        public T Get<T>(int id)
        {
            return _repository.Get<T>(id);
        }
}
public interface IService<T>
{
        T Get<T>(int id);
}

, я получаю следующее предупреждение

Параметр типа 'T' имеет то же имя как параметр типа из внешнего типа 'Services.IService'

I am not sure what the issue is with this, why does it care if my return type is the same as the type I am telling the class to be. Am I missing something here?

16
задан SwDevMan81 10 September 2010 в 16:39
поделиться