Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/csharp/MetaObjects.Codegen/CSharpNaming.cs
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public static string RoutePath(MetaObject entity) =>

/// <summary>
/// The DbSet property name for an object: its collection name (rc.19, R57) — its own
/// <c>@collectionName</c> (or the deprecated <c>@dbSetName</c> alias), else the configured
/// <c>@collectionName</c>, else the configured
/// pluralizer (<c>naming.collections</c>) over <c>Pascal(name)</c>, else the historical
/// <c>Pluralize(Pascal(name))</c> (which keeps C#'s <c>-sis</c> rule, so an unconfigured
/// project's DbSets are unchanged). Every site that names the property (the context, the routes,
Expand All @@ -451,7 +451,7 @@ public static string DbSetName(MetaObject entity)
// error in the generated context (or a property that hides DbContext.Database).
if (!System.Text.RegularExpressions.Regex.IsMatch(declared, "^[A-Za-z_][A-Za-z0-9_]*$") || ReservedDbSetNames.Contains(declared))
throw new InvalidOperationException(
$"{entity.ResolutionKey()}: the collection name \"{declared}\" (@collectionName, or its deprecated alias @dbSetName) cannot be the DbSet property name — it must be a C# identifier " +
$"{entity.ResolutionKey()}: the collection name \"{declared}\" (@collectionName) cannot be the DbSet property name — it must be a C# identifier " +
"(letters, digits and underscores, not starting with a digit) and not a DbContext member (Database, Model, ChangeTracker, ContextId).");
return declared;
}
Expand Down
Loading