public bool Filter(Classifier c) => c.Code == ClassifierCode && c.TypeCode == ClassifierTypeCode;
public bool TryGetClassifier(string classifierTypeCode, string classifierCode, out Classifier result) { using (var connection = new SqlConnection(connectionString)) { connection.Open(); using (var command = new SqlCommand("dbo.GetClassifier", connection)) { command.CommandType = CommandType.StoredProcedure; command.Parameters.AddWithValue("@ClassifierTypeCode", classifierTypeCode); command.Parameters.AddWithValue("@ClassifierCode", classifierCode); using (var reader = command.ExecuteReader()) { if (reader.HasRows) { reader.Read(); result = new Classifier(this, reader.GetString(0), reader.GetString(1)) { Name = reader.GetString(2), Description = reader.GetString(3), UpdatedBy = reader.GetString(4), UpdatedOn = reader.GetDateTime(5) }; return(true); } else { result = null; return(false); } } } } }