dev
Last change
on this file since 6738cc0 was 6738cc0, checked in by Стојков Марко <mst@…>, 2 years ago |
Added notifications
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | using FinkiChattery.Persistence.Models;
|
---|
2 | using Microsoft.EntityFrameworkCore;
|
---|
3 | using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
---|
4 | using System;
|
---|
5 |
|
---|
6 | namespace FinkiChattery.Persistence.Configurations
|
---|
7 | {
|
---|
8 | public class StudentNotificationConfig : BaseConfig<StudentNotification>
|
---|
9 | {
|
---|
10 | public StudentNotificationConfig(string schema) : base(schema)
|
---|
11 | {
|
---|
12 | }
|
---|
13 |
|
---|
14 | public override void Configure(EntityTypeBuilder<StudentNotification> builder)
|
---|
15 | {
|
---|
16 | base.Configure(builder);
|
---|
17 |
|
---|
18 | builder.ToTable("StudentNotification", Schema);
|
---|
19 |
|
---|
20 | builder.Property(x => x.Text).HasColumnName(@"Text").HasColumnType("nvarchar").IsRequired().HasMaxLength(500);
|
---|
21 | builder.Property(x => x.StudentFk).HasColumnName(@"StudentFk").HasColumnType("bigint").IsRequired();
|
---|
22 | builder.Property(x => x.CreatedOn).HasColumnName(@"CreatedOn").HasColumnType("smalldatetime").IsRequired().HasConversion(v => v, v => DateTime.SpecifyKind(v, DateTimeKind.Utc)); ;
|
---|
23 | builder.Property(x => x.QuestionUid).HasColumnName(@"QuestionUid").HasColumnType("uniqueidentifier").IsRequired();
|
---|
24 |
|
---|
25 | builder.HasOne(x => x.Student).WithMany(x => x.StudentNotifications).HasForeignKey(x => x.StudentFk).OnDelete(DeleteBehavior.Restrict);
|
---|
26 | }
|
---|
27 | }
|
---|
28 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.