diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserInfo.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserInfo.cs index 21717894..2b950064 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserInfo.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Auth/UserInfo.cs @@ -14,6 +14,7 @@ public class UserInfo public required ICollection Permissions { get; set; } #endif #if Tenancy + [MaxLength(36)] public string? TenantId { get; set; } public string? TenantName { get; set; } #endif diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/GlobalUsings.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/GlobalUsings.cs index c8a1c432..59d0f8d4 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/GlobalUsings.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/GlobalUsings.cs @@ -10,7 +10,7 @@ global using Coalesce.Starter.Vue.Data.Auth; global using Coalesce.Starter.Vue.Data.Coalesce; global using Coalesce.Starter.Vue.Data.Utilities; -#if (Identity || ExampleModel) +#if (Identity || ExampleModel || TrackingBase) global using Coalesce.Starter.Vue.Data.Models; #endif diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/AuditLog.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/AuditLog.cs index 43b2bd8e..c05b0147 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/AuditLog.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/AuditLog.cs @@ -21,7 +21,7 @@ public class AuditLog : DefaultAuditLog // NOTE: Audit logs are *optionally* tenanted because they can log changes // to non-tenanted entities as well. Read security is implemented in the below datasource. - [InternalUse] + [InternalUse, MaxLength(36)] public string? TenantId { get; set; } [InternalUse] public Tenant? Tenant { get; set; } diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Role.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Role.cs index 47318d66..4b3a93d5 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Role.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Role.cs @@ -18,6 +18,7 @@ public class Role #if Tenancy [InternalUse] [DefaultOrderBy(FieldOrder = 0)] + [MaxLength(36)] public string TenantId { get; set; } = null!; [InternalUse] [ForeignKey(nameof(TenantId))] @@ -62,6 +63,7 @@ public class RoleClaim : IdentityRoleClaim, ITenanted [InternalUse] [DefaultOrderBy(FieldOrder = 0)] + [MaxLength(36)] public required string TenantId { get; set; } [InternalUse] [ForeignKey(nameof(TenantId))] diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/Tenant.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/Tenant.cs index 5a4ec35b..50d5f727 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/Tenant.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/Tenant.cs @@ -12,6 +12,7 @@ namespace Coalesce.Starter.Vue.Data.Models; [Display(Name = "Organization")] public class Tenant { + [MaxLength(36)] public string TenantId { get; set; } = Guid.NewGuid().ToString(); public required string Name { get; set; } diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantMembership.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantMembership.cs index 3b9e0f6f..cb3f0fad 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantMembership.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantMembership.cs @@ -4,6 +4,7 @@ [InternalUse] public class TenantMembership : TenantedBase { + [MaxLength(36)] public string TenantMembershipId { get; set; } = Guid.NewGuid().ToString(); [Required] diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantedBase.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantedBase.cs index 6d547cb1..3deb3867 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantedBase.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/Tenancy/TenantedBase.cs @@ -7,7 +7,7 @@ public abstract class TenantedBase : ITenanted #endif { - [InternalUse, Required] + [InternalUse, Required, MaxLength(36)] public string TenantId { get; set; } = null!; [InternalUse] public Tenant? Tenant { get; set; } diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/UserRole.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/UserRole.cs index 1bc1518c..e7fd9553 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/UserRole.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Data/Models/UserRole.cs @@ -27,6 +27,7 @@ public string Id #if Tenancy [InternalUse] [DefaultOrderBy(FieldOrder = 0)] + [MaxLength(36)] public string TenantId { get; set; } = null!; [InternalUse] public Tenant? Tenant { get; set; } diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Pages/_Layout.cshtml b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Pages/_Layout.cshtml index 46e32b71..4a854efb 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Pages/_Layout.cshtml +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Pages/_Layout.cshtml @@ -1,6 +1,7 @@ -@*#if (AppInsights) +@*#if (AppInsights) @inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet #endif*@ +@namespace Coalesce.Starter.Vue.Web.Pages diff --git a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Program.cs b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Program.cs index 3e3eeb43..34bbd97d 100644 --- a/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Program.cs +++ b/templates/Coalesce.Vue.Template/content/Coalesce.Starter.Vue.Web/Program.cs @@ -14,6 +14,7 @@ #if OpenAPI using Microsoft.OpenApi.Models; #endif +using System.Security.Claims; using System.Text.Json; using System.Text.Json.Serialization; using System.Text.RegularExpressions;