I have this Generic Method that always returns a nullReferenceException. I've taken all the unnecessary code out, and it still give me the exception.
public T RetrieveInformationFromApi<T>(int Id) where T : IMovie
{
T result = default(T);
result.Title = "test";
}
The method can be called with three different classes that all have the attribute Title and the all implement the interface IMovie but the method still give me an exception. What am i doing wrong?