June 30, 2016 at 7:08 am
I am trying to Implement Cascade delete but getting Error in the Calling C# code. Attached is how my table looks like. Any help will be appreciate. I am Implementing the delete with MVC C#
private void DeleteNewsFeed(int p)
{
try
{
var feeds = _uow.RepositoryAsync<Feed>().Find(p);
if (feeds == null) return;
_uow.RepositoryAsync<Feed>().Delete(feeds);
_uow.SaveChanges();
}
catch (Exception ex)
{
ControllerProvider.ProcessDataAccessLayerException(ex);
ControllerUnHandledExp.LogError(ex);
throw;
}
}
June 30, 2016 at 7:20 am
Hi Kdanaipam,
This is a SQL server forum. However is there any SQL error you are getting? What do you mean by cascade delete? have you created the FK with' on delete cascade'?
June 30, 2016 at 7:23 am
Yes, I have Implemented Foreign Keys with on delete cascade but getting error unable to delete on multiple keys
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply