public virtual bool Delete(T item) { var mapper = new MapperConfiguration(cfg => cfg.CreateMap <T, K>()).CreateMapper(); var itemToDelete = mapper.Map <T, K>(item); bool deleteResult = _curEFRep.Delete(itemToDelete); return(deleteResult); }
public void Given_InstanciaRepositorio_When_Delete_Then_ReturnTrue() { Personal persona = new Personal { Id = 19, Nombre = "Jazmin", Apellidos = "Zarate Marin", Edad = 36 }; bool?result; using (var repository = new RepositoryEF(new CSIContext(connectionString))) { result = repository.Delete <Personal>(persona); } if (result != null) { Assert.IsTrue((bool)result); } else { Assert.IsNotNull(result); } }