How to simplify the null check
public class MyEmployee
{
public string FirstName;
public string LastName;
public string Age;
public string Phone;
public string Gender;
}
I have implemented the following null condition check
public async Task<bool> ValidateClient(MyEmployee Client)
{
**if(Client.FirstName == null ||Client.LastName==null ||Client.Age== null ||Client.Gender ==null||Client.Phone==null)**
{
throw new Argumentexception("Employee details to be provided")
}
}
I am validating all the properties of Employee class with a null check condition , can this be simplified in C#.