public IEnumerable <BankAccount> GetByContextId(int contextId) { using (var context = new MyWalletDBContext()) { return(context.BankAccount.Where(b => b.ContextId == contextId).ToList()); } }
public BankAccount GetById(int id) { using (var context = new MyWalletDBContext()) { return(context.BankAccount.Find(id)); } }
public User GetById(int id) { using (var context = new MyWalletDBContext()) { return(context.User.Find(id)); } }
public IEnumerable <Context> GetAll() { using (var dbcontext = new MyWalletDBContext()) { return(dbcontext.Context.ToList()); } }
public IEnumerable <Category> GetAll() { using (var context = new MyWalletDBContext()) { return(context.Category.ToList()); } }
public Category GetById(int id) { using (var context = new MyWalletDBContext()) { return(context.Category.Find(id)); } }
public IEnumerable <BankAccount> GetAll() { using (var context = new MyWalletDBContext()) { return(context.BankAccount.ToList()); } }
public IEnumerable <CurrencyType> GetAll() { using (var context = new MyWalletDBContext()) { return(context.CurrencyType.ToList()); } }
public void Delete(Category category) { using (var context = new MyWalletDBContext()) { context.Entry(category).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); } }
public void Add(Context context) { using (var dbContext = new MyWalletDBContext()) { dbContext.Context.Add(context); dbContext.SaveChanges(); } }
public Context GetById(int id) { using (var dbContext = new MyWalletDBContext()) { var context = dbContext.Context.Find(id); return(context); } }
public void Update(User user) { using (var context = new MyWalletDBContext()) { context.Entry(user).State = EntityState.Modified; context.SaveChanges(); } }
public void Add(Income income) { using (var context = new MyWalletDBContext()) { context.Income.Add(income); context.SaveChanges(); } }
public void Add(Category category) { using (var context = new MyWalletDBContext()) { context.Category.Add(category); context.SaveChanges(); } }
public IEnumerable <Category> GetByContextId(int contextId) { using (var context = new MyWalletDBContext()) { var list = context.Category.Where(c => c.ContextId == contextId).ToList(); return(list); } }
public void Add(BankAccount bankAccount) { using (var context = new MyWalletDBContext()) { context.BankAccount.Add(bankAccount); context.SaveChanges(); } }
public void Delete(Context context) { using (var dbContext = new MyWalletDBContext()) { dbContext.Entry(context).State = System.Data.Entity.EntityState.Deleted; dbContext.SaveChanges(); } }
public void Delete(BankAccount bankAccount) { using (var context = new MyWalletDBContext()) { context.Entry(bankAccount).State = System.Data.Entity.EntityState.Deleted; context.SaveChanges(); } }
public void Add(Expense expense) { using (var context = new MyWalletDBContext()) { context.Expense.Add(expense); context.SaveChanges(); } }
public void Update(Category category) { using (var context = new MyWalletDBContext()) { context.Entry(category).State = EntityState.Modified; context.SaveChanges(); } }
public void Add(IEnumerable <Expense> expenses) { using (var context = new MyWalletDBContext()) { context.Expense.AddRange(expenses); context.SaveChanges(); } }
public void Add(User user) { using (var context = new MyWalletDBContext()) { context.User.Add(user); context.SaveChanges(); } }
public User GetByEmailAndPassword(string email, string password) { using (var context = new MyWalletDBContext()) { var userWithContexts = context.User .Include(u => u.Contexts) .FirstOrDefault(u => u.Email == email && u.Password == password); return(userWithContexts); } }
public IEnumerable <Expense> GetByContextId(int contextId) { using (var context = new MyWalletDBContext()) { var expenses = context.Expense.Where(e => e.ContextId == contextId) .Include(e => e.BankAccount) .Include(e => e.Category) .ToList(); return(expenses); } }
public IEnumerable <Income> GetByContextId(int contextId) { using (var context = new MyWalletDBContext()) { var incomeList = context.Income.Where(i => i.ContextId == contextId) .Include(i => i.BankAccount) .Include(i => i.Category) .Include(i => i.Context) .ToList(); return(incomeList); } }