예제 #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);
            }
        }
예제 #2
0
        public async Task EliminarServico(Servico servico)
        {
            await servicosDAL.DeleteAsync(servico);

            Servicos.Remove(servico);
        }