I have written the following method to return a list of Unserializable classes (LINQ classes) from a list of Serializable classes (POCOs):
List<UnSerializableEntity> ToListOfUnserializables(List<SerializableEntity> entityList)
{
var tempList = new List<UnSerializableEntity>();
entityList.ForEach(e =>
{
if (e != null)
{
tempList.Add(ConvertFromSerializableToUnserializable(e));
}
});
return tempList;
}
Now, Resharper has 'complained' about this line: if (e != null)
, and suggested to change it to this:
if (!Equals(e, default(SerializableEntity)))
My question is to what has this change actually improved or prevented from happening? and I know the default keyword in this context has to do something with generics, but I'm not sure what it represents exactly.
PS. UnSerializableEntity
and SerializableEntity
are class generics.