Cannot remove an entity that has not been attached on delete
Posted
by mazhar
on Stack Overflow
See other posts from Stack Overflow
or by mazhar
Published on 2010-05-15T09:59:46Z
Indexed on
2010/05/15
10:04 UTC
Read the original article
Hit count: 1500
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
© Stack Overflow or respective owner