DataContext²

This commit is contained in:
femsci 2023-10-21 16:51:31 +02:00
parent fc10a2dd30
commit f6f6c17555
Signed by: femsci
GPG key ID: 08F7911F0E650C67
2 changed files with 3 additions and 1 deletions

View file

@ -15,6 +15,6 @@ public class DataContext : DbContext
{ {
base.OnModelCreating(mb); base.OnModelCreating(mb);
mb.Entity<IncidentSubmission>().HasIndex(s => new { s.SubmitterAddress, s.Producer });
} }
} }

View file

@ -15,6 +15,8 @@ public class IncidentSubmission
public required string Name { get; set; } public required string Name { get; set; }
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public DateTime Submitted { get; set; } public DateTime Submitted { get; set; }
[EmailAddress]
public string? SubmitterAddress { get; set; }
public required string ProductName { get; set; } public required string ProductName { get; set; }
public required string Producer { get; set; } public required string Producer { get; set; }
public required string Description { get; set; } public required string Description { get; set; }