public async void Remove(Guid ID) { await Task.Factory.StartNew(() => { Flat.CadCustomer.Remove(Flat.CadCustomer.Find(X => X.Id == ID)); Flat.SetCadastro <Customer>(Flat.CadCustomer, Flat.ArqCustomer); }); }
public async void Add(Domain.Models.Customer customer) { if (customer.Id == null) { customer.AddID(Guid.NewGuid()); } Flat.CadCustomer.Add(customer); await Task.Factory.StartNew(() => { Flat.SetCadastro <Customer>(Flat.CadCustomer, Flat.ArqCustomer); }); }
public async void Update(Customer customer) { await Task.Factory.StartNew(() => { var Cad = Flat.CadCustomer.Find(X => X.Id == customer.Id); if (Cad != null) { Flat.CadCustomer[Flat.CadCustomer.IndexOf(Cad)] = customer; } var Prod = Flat.CadCustomer.Find(X => X.Id == customer.Id); Flat.SetCadastro <Customer>(Flat.CadCustomer, Flat.ArqCustomer); }); }