public int FirstRecord
{
get
{
if (NumRecords < 1)
throw new Exception("No records available");
return PageNumber * PageSize;
}
}
In static code analysis it is showing the below warning.
FirstRecord.get() creates an exception of type 'Exception', an exception type that should not be raised in a property. If this exception instance might be raised, use a different exception type, convert this property into a method, or change this property's logic so that it no longer raises an exception.