diff --git a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs index 08eaab1..ee0ec57 100644 --- a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs +++ b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs @@ -131,6 +131,7 @@ public class InitService Name = "Master", IsMaster = true, OwnerId = housemasterUser.Id!.Value, + Subjects = [housemasterUser] }; _applicationContext.Tenants.Add(masterTenant); @@ -141,21 +142,14 @@ public class InitService Visibility = EntityVisibility.Active, TenantId = masterTenant.Id!.Value, Name = "Master", - BaseAddress = baseAddress + BaseAddress = baseAddress, + Tenant = masterTenant, + Subjects = [housemasterUser] }; _applicationContext.Apps.Add(masterApp); await _applicationContext.SaveChangesAsync(); - var appSubjectRelation = new AppSubjectRelationEntity - { - AppId = masterApp.Id!.Value, - SubjectId = housemasterUser.Id!.Value - }; - - _applicationContext.AppSubjectRelations.Add(appSubjectRelation); - await _applicationContext.SaveChangesAsync(); - _logger.LogInformation($""" ----- Housemaster initial login information ----- username: {housemasterUser.Name}