Cannot remove an entity that has not been attached on delete
- by mazhar
public IQueryable<Feature> GetAllFeaturesByLinkAndParentID(int id)
{
return from gp in db.Features where gp.int_ParentId == id && gp.bit_IsLink == false
select gp;
}
var DeleteFeature = FeatureRepository.GetAllFeaturesByLinkAndParentID(GetFeatureId);
_db.Features.DeleteAllOnSubmit(DeleteFeature);
_db.SubmitChanges();
how will i remove the error Cannot remove an entity that has not been attached in this code