I have the following generic method, but VS gives me a compile error on that. (Operator \'??\' cannot be applied to operands of type \'T\' and \'T\')
public stat
You need to specify that your T type is a class with a constraint on the generic type:
T
public static T Method(T model) where T : class, new() { return model ?? new T(); }