public Discount Create(Discount discount) { var id = Discounts.Max(c => c.Id); discount.Id = id; Discounts.Add(discount); return discount; }
public Discount Update(string id, Discount instance) { var index = int.Parse(id); var query = from c in Discounts where c.Id == index select c; var discount = query.FirstOrDefault(); discount = instance; return discount; }