I can explain why. Enable saves the object to load all included objects. So our site object has all the links to your clusses (City, Country, User Client). I think this is a problem. The solution may be to download only the site object:
Site result = context.Sites.SingleOrDefault(s => s.ID == siteID);
. , , , .
, , include, . dbContext
context.SaveChanges();
:
public static Site Update(Site _updatedSite)
{
using (DragonRentalsEntities context = new DragonRentalsEntities(new ConfigurationManager().ConnectionString))
{
if (context.Entry(_updatedSite).State == EntityState.Detached)
context.Entry(_updatedSite).State = EntityState.Modified;
context.SaveChanges();
return _updatedSite;
}
}
Slauma, null, ,
:
, .
Btw sql- , db City .