public BO.User GetUser(string username) { BO.User user = null; using (KapitalDataContext context = new KapitalDataContext(ConnectionString)) { RepositoryAdapter<BO.User, User, UserCopyExtensions> adapter = new RepositoryAdapter<BO.User, User, UserCopyExtensions>(this); user = adapter.Get(context.Users.Where(u => String.Compare(u.Username, username, true) == 0)); } return user; }
public BO.Transaction GetTransaction(int transactionId) { BO.Transaction transaction = null; using (KapitalDataContext context = new KapitalDataContext(ConnectionString)) { RepositoryAdapter<BO.Transaction, Transaction, TransactionCopyExtensions> adapter = new RepositoryAdapter<BO.Transaction, Transaction, TransactionCopyExtensions>(this); transaction = adapter.Get(context.Transactions.Where(t => t.TransactionId == transactionId)); } return transaction; }
public BO.User GetUser(int id) { BO.User user = null; using (KapitalDataContext context = new KapitalDataContext(ConnectionString)) { RepositoryAdapter<BO.User, User, UserCopyExtensions> adapter = new RepositoryAdapter<BO.User, User, UserCopyExtensions>(this); user = adapter.Get(context.Users.Where(u => u.UserId == id)); } return user; }
public BO.Bank GetBank(int id) { BO.Bank bank = null; using (KapitalDataContext context = new KapitalDataContext(ConnectionString)) { RepositoryAdapter<BO.Bank, Bank, BankCopyExtensions> adapter = new RepositoryAdapter<BO.Bank, Bank, BankCopyExtensions>(this); bank = adapter.Get(context.Banks.Where(b => b.BankId == id)); } return bank; }