prevent update of linked SiteGroup

This commit is contained in:
sbwalker
2026-03-04 09:59:52 -05:00
parent 147ee8b1e7
commit ef92a88908

View File

@@ -2,6 +2,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Oqtane.Models; using Oqtane.Models;
using Radzen;
namespace Oqtane.Repository namespace Oqtane.Repository
{ {
@@ -51,6 +52,7 @@ namespace Oqtane.Repository
{ {
using var db = _dbContextFactory.CreateDbContext(); using var db = _dbContextFactory.CreateDbContext();
db.Entry(siteGroupMember).State = EntityState.Modified; db.Entry(siteGroupMember).State = EntityState.Modified;
db.Entry(siteGroupMember.SiteGroup).State = EntityState.Unchanged; // prevent update of linked entity
db.SaveChanges(); db.SaveChanges();
return siteGroupMember; return siteGroupMember;
} }