Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class UserDao
- {
- private NpgsqlDataSource dataSource;
- private UserDao(NpgsqlDataSource dataSource)
- {
- this.dataSource = dataSource;
- }
- public User findById(int id)
- {
- var command = newDataSource().CreateCommand("SELECT * FROM TABLE WHERE ID = {id}");
- // execute command etc.
- }
- public User findByFirstName(string firstName)
- {
- var command = newDataSource().CreateCommand("SELECT * FROM TABLE WHERE ID = {firstName}");
- // execute command etc.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement