forked from MDCPS/DamageAssessment_Backend
Multi language dynamic object changes
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace DamageAssesment.Api.Questions.Db
|
||||
{
|
||||
public class CategoryTranslation
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
[ForeignKey("QuestionCategory")]
|
||||
public int CategoryId { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string Language { get; set; }
|
||||
}
|
||||
}
|
@ -7,8 +7,8 @@ namespace DamageAssesment.Api.Questions.Db
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
public string CategoryName { get; set; }
|
||||
public string CategoryImage { get; set; }
|
||||
public string IconName { get; set; }
|
||||
public string IconLibrary { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ namespace DamageAssesment.Api.Questions.Db
|
||||
public DbSet<Db.QuestionType> QuestionTypes { get; set; }
|
||||
public DbSet<Db.QuestionsTranslation> QuestionsTranslations { get; set; }
|
||||
public DbSet<Db.QuestionCategory> QuestionCategories { get; set; }
|
||||
public DbSet<Db.CategoryTranslation> CategoryTranslations { get; set; }
|
||||
public QuestionDbContext(DbContextOptions options) : base(options)
|
||||
{
|
||||
|
||||
@ -29,6 +30,9 @@ namespace DamageAssesment.Api.Questions.Db
|
||||
modelBuilder.Entity<QuestionCategory>()
|
||||
.Property(item => item.Id)
|
||||
.ValueGeneratedOnAdd();
|
||||
modelBuilder.Entity<CategoryTranslation>()
|
||||
.Property(item => item.Id)
|
||||
.ValueGeneratedOnAdd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user