Which of the below is a preferred coding style (in c# .net)
public void DoWork(Employee employee)
{
if(employee == null)
return;
if(!string.IsNullOrEmpty(employee.Name))
return;
// Do Work
}
or
public void DoWork(Employee employee)
{
if(employee != null && !string.IsNullOrEmpty(employee.Name))
{
// Do Work
}
}