private bool FieldsAreFilled(CardContent cardToCheck) { var type = cardToCheck.GetType(); var counter = 0; foreach (var property in type.GetProperties()) { if (property.GetValue(cardToCheck) == null) { counter++; } } if (counter == type.GetProperties().Length) { return(false); } return(true); }
private bool FieldsAreFilled(CardContent cardToCheck) { var type = cardToCheck.GetType(); var counter = 0; foreach (var property in type.GetProperties()) { if (string.IsNullOrWhiteSpace((string)property.GetValue(cardToCheck).ToString()) || string.IsNullOrEmpty((string)property.GetValue(cardToCheck).ToString())) { counter++; } } if (counter == type.GetProperties().Length) { return(false); } return(true); }