prevent update of linked SiteGroup
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user