0
juslwk created
My delete entity is not working, any possible reasons? I have tried Delete And DeleteAsync methods as well. This is the way I test it.
public void DeleteFile(EntityDto input)
{
var fileToBeDeleted = _fileRepository.Get(input.Id);
_fileRepository.DeleteAsync(fileToBeDeleted);
var deletedFile = _fileRepository.Get(input.Id);
}
I put a break point after var deletedFile, and check their values, but both fileToBeDeleted & deletedFile are equal in value. Am I doing something wrong? Thank you EDIT There are no error messages or exceptions occurring.
Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)
2 Answer(s)
-
0
Hi @juslwk,
You need to call untOfWork.SaveChanges after DeleteAsync if you want changes to effect.
Thanks.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Yes thank you, it works now
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)