Beispiel #1
0
        public bool delete(Modelo prEntity)
        {
            try
            {
                Servico Entity = (Servico)prEntity;

                Servicos.Attach(Entity);

                if (Entry(Entity).State == EntityState.Detached)
                {
                    Servicos.Attach(Entity);
                }

                Servicos.Remove(Entity);

                return(SaveChanges() > 0);
            }
            catch (Exception e)
            {
                return(false);
            }
        }