Cast object to Decimal nullable

  • Thread starter Thread starter Luigi
  • Start date Start date
L

Luigi

Hi all
how can I write a method that returns me true if is possible to cast an
object to decimal nullable and false if not?
Like

public bool CanConvert(object obj)
{

return true if obj is possible to cast to decimal nullable
return false if not

}

Thanks a lot.
 
how can I write a method that returns me true if is possible to cast an
object to decimal nullable and false if not?
Like

public bool CanConvert(object obj)
{
return true if obj is possible to cast to decimal nullable
return false if not
}

public bool CanConvert(object obj)
{
return obj is decimal || obj == null;
}
 
Back
Top