We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello
To avoid this error in Postgres add unique index to the table PluralTranslation in LocalizationDbContext.cs:
builder.Entity().HasIndex(e => new { e.LocalizationRecordId, e.Index }, "IX_LOCRECID_INDEX").IsUnique();
Else this row will be generate error 42P10 :
localization DbContext.Plural Translations.UpsertRange(plural Translations).On(l => new { l.Localization RecordId, l.Index }).RunAsync();
The text was updated successfully, but these errors were encountered:
Thanks, would you care to share it as a PR?
Sorry, something went wrong.
Yes, you can use this code in a blazorboilerplate project. New content of the LocalizationDbContext.cs:
` using BlazorBoilerplate.Infrastructure.Storage.DataModels; using Microsoft.EntityFrameworkCore;
namespace BlazorBoilerplate.Storage { public class LocalizationDbContext : DbContext { public LocalizationDbContext(DbContextOptions options) : base(options) { }
public DbSet<PluralFormRule> PluralFormRules { get; set; } public DbSet<PluralTranslation> PluralTranslations { get; set; } public DbSet<LocalizationRecord> LocalizationRecords { get; set; } protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); builder.Entity<LocalizationRecord>().HasIndex(c => new { c.MsgId, c.Culture, c.ContextId }).IsUnique(); builder.Entity<PluralTranslation>().HasIndex(e => new { e.LocalizationRecordId, e.Index }, "IX_LOCRECID_INDEX").IsUnique(); } }
}`
No branches or pull requests
Hello
To avoid this error in Postgres add unique index to the table PluralTranslation in LocalizationDbContext.cs:
builder.Entity().HasIndex(e => new { e.LocalizationRecordId, e.Index }, "IX_LOCRECID_INDEX").IsUnique();
Else this row will be generate error 42P10 :
localization DbContext.Plural Translations.UpsertRange(plural Translations).On(l => new { l.Localization RecordId, l.Index }).RunAsync();
The text was updated successfully, but these errors were encountered: