public void copyProperties(IExpense other) { other.CheckArgument(nameof(other)); BillID = other.BillID; Designation = other.Designation; Amount = other.Amount; Friend = other.Friend; }
public void Add(IExpense expense) { expense.CheckArgument(nameof(expense)); var entity = new Expense(); entity.CopyProperties(expense); ExpenseEntities.Add(entity); }
public void Add(IExpense expense) { expense.CheckArgument(nameof(expense)); var newItem = new Expense(); newItem.CopyProperties(expense); ExpenseEntities.Add(newItem); }
public void CopyProperties(IExpense other) { other.CheckArgument(nameof(other)); Id = other.Id; TravelId = other.TravelId; Date = other.Date; Description = other.Description; Amount = other.Amount; Friend = other.Friend; }
public void CopyProperties(IExpense other) { other.CheckArgument(nameof(other)); id = other.id; Date = other.Date; Title = other.Title; Description = other.Description; Currency = other.Currency; Friends = other.Friends; }
public void Remove(IExpense expense) { expense.CheckArgument(nameof(expense)); var entity = ExpenseEntities.FirstOrDefault(i => (i.Id != 0 && i.Id == expense.Id) || (i.Id == 0 && i.Designation != null && i.Designation.Equals(expense.Designation))); if (entity != null) { ExpenseEntities.Remove(entity); } }
public void Remove(IExpense expense) { expense.CheckArgument(nameof(expense)); foreach (var item in ExpenseEntities) { if (item.Id != 0 && item.Id == expense.Id) { ExpenseEntities.Remove(item); } else if (item.Designation != null && item.Designation.Equals(expense.Designation)) { ExpenseEntities.Remove(item); } } }