public async Task UpdateQuote (Quote quote) { await Task.Delay (TimeSpan.FromSeconds (2)); if (quote.Id == 0) { quote.Id = _quotes.Count + 1; _quotes.Add(quote); } else { var oldQuote = _quotes.Find(c => c.Id == quote.Id); oldQuote.CustomerName = quote.CustomerName; oldQuote.Total = quote.Total; } }
public override void Init (object initData) { Quote = initData as Quote; if (Quote == null) Quote = new Quote (); }