Beispiel #1
0
        public void RemoveCustomerWithId(int Id)
        {
            tCliente Element = this.dbEntity.tCliente.FirstOrDefault(x => x.Id == Id);

            if (Element != null)
            {
                dbEntity.tCliente.Remove(Element);
                dbEntity.SaveChangesAsync();
            }
        }
        public void RemovePreventiveWithId(int id)
        {
            tPreventiveDetails PreventiveToDelete =
                dbEntity.
                tPreventiveDetails.
                FirstOrDefault(
                    ptd => ptd.IdPreventivo == id
                    );

            if (PreventiveToDelete != null)
            {
                dbEntity.tPreventiveDetails.Remove(PreventiveToDelete);
                dbEntity.SaveChangesAsync();
            }
        }