change your defintions to be like so..
public interface IRepository<T> where T : class
{
void DeserializeJSON();
}
public class Repository<T> : IRepository<T> where T : class
{
private string data;
private List<T> entities;
public void DeserializeJSON()
{
// Cannot implicitly convert type
entities = JsonConvert.DeserializeObject<List<T>>(data);
}
}
When you template the class, you don't need to template the functions. If you do the compiler believes they are of different types even though you are using the same variable