There is no point in converting the Id field from int to string - it will default to 0 if you don't set it. Therefore you should just check that it is within a valid range (e.g. greater than 0).
You need to check that the
par
object is not null before attempted to access the numbers property. Otherwise you will get a Null Reference Exception when the object is null.
Also if the count of
numbers
is 0 then it will not find any phone numbers.
if (par.Id <= 0)
{
Console.WriteLine("1");
}
if (string.IsNullOrWhiteSpace(par.name))
{
Console.WriteLine("2");
}
if (par.number == null ||
par.number.Count == 0 ||
par.number.Any(x => x.number1 != null || x.number2 != null)
)
{
Console.WriteLine("3");
}