dev
Last change
on this file since b25b9ea was b25b9ea, checked in by Стојков Марко <mst@…>, 3 years ago |
Get question state endpoint
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Line | |
---|
1 | using Microsoft.EntityFrameworkCore;
|
---|
2 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
---|
3 | using System;
|
---|
4 | using System.Collections.Generic;
|
---|
5 | using System.Linq;
|
---|
6 | using System.Text;
|
---|
7 | using System.Threading.Tasks;
|
---|
8 | using FinkiChattery.Persistence.Models;
|
---|
9 |
|
---|
10 | namespace FinkiChattery.Persistence.Configurations
|
---|
11 | {
|
---|
12 | public class QuestionCategoryConfig : BaseConfig<QuestionCategory>
|
---|
13 | {
|
---|
14 | public QuestionCategoryConfig(string schema) : base(schema)
|
---|
15 | {
|
---|
16 | }
|
---|
17 |
|
---|
18 | public override void Configure(EntityTypeBuilder<QuestionCategory> builder)
|
---|
19 | {
|
---|
20 | base.Configure(builder);
|
---|
21 |
|
---|
22 | builder.ToTable("QuestionCategory", Schema);
|
---|
23 |
|
---|
24 | builder.Property(x => x.QuestionFk).HasColumnName(@"QuestionFk").HasColumnType("bigint").IsRequired();
|
---|
25 | builder.Property(x => x.CategoryFk).HasColumnName(@"CategoryFk").HasColumnType("bigint").IsRequired();
|
---|
26 |
|
---|
27 | builder.HasOne(x => x.Question).WithMany(x => x.QuestionCategories).HasForeignKey(x => x.QuestionFk).OnDelete(DeleteBehavior.Restrict);
|
---|
28 | builder.HasOne(x => x.Category).WithMany().HasForeignKey(x => x.CategoryFk).OnDelete(DeleteBehavior.Restrict);
|
---|
29 | }
|
---|
30 | }
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.