static void Main(string[] args) { try { DapperConfiguration.Initialize(); ConnectionProvider provider = new ConnectionProvider(); UserAccountDapper dapper = new UserAccountDapper(); // UserAccountBroker userDataBroker = new UserAccountBroker(provider); //UserAccount user = userDataBroker.GetUserAccount("florian", "pwd"); UserAccount user = null; IEnumerable <UserAccount> accounts = dapper.GetAllContact(provider.GetConnection(), 1); user = dapper.GetUserAccount(provider.GetConnection(), "florian", "pwd"); if (user != null) { Console.WriteLine(user.Firstname); Console.WriteLine(user.Lastname); } else { Console.WriteLine("Not found"); } } catch (Exception e) { Console.WriteLine(e.Message.ToString()); } Console.Read(); }
public UserService() { _cp = new ConnectionProvider(); _dbConnection = _cp.GetConnection(); _userAccountDapper = new UserAccountDapper(); }