Reputation: 2116
I have this class in C#
1.A private DataTable. This datatable is initialized by a database query.
2.get(string filter) method, this method do DataTable.select(filter) on the private DataTable. And throw exception if it found 0 or more than 1 rows. Otherwise, it return the only row that it found.
I couldn't think of a proper name for it. Any comment is appreciated.
Upvotes: 0
Views: 87
Reputation: 9027
getSingleRowByName
Replace "Name" with whatever the string parameter is representative of.
Upvotes: 1
Reputation: 6547
A UniqueRowSelector
or SingleRowSelector
? Because it can only return one row.
Upvotes: 1