G
Giorgio Parmeggiani
HI
I have a method that receive a generic parameter and also return a generic:
public T GetById(ID id)
I've want to return null if the received parameter is null, so i have write
this code:
public T GetById(ID id)
{
if(id == default(ID))
return default(T)
...................
}
But during compilation i receive an exception that tell me that is not possible
to apply operator == at parameter of type ID and ID
How can i solve my problem?
Thank in advance
Giorgio
I have a method that receive a generic parameter and also return a generic:
public T GetById(ID id)
I've want to return null if the received parameter is null, so i have write
this code:
public T GetById(ID id)
{
if(id == default(ID))
return default(T)
...................
}
But during compilation i receive an exception that tell me that is not possible
to apply operator == at parameter of type ID and ID
How can i solve my problem?
Thank in advance
Giorgio