diff options
Diffstat (limited to 'Models')
-rw-r--r-- | Models/ApplicationDbContext.cs | 2 | ||||
-rw-r--r-- | Models/Raffle.cs | 14 |
2 files changed, 15 insertions, 1 deletions
diff --git a/Models/ApplicationDbContext.cs b/Models/ApplicationDbContext.cs index b3b0b15..07907c7 100644 --- a/Models/ApplicationDbContext.cs +++ b/Models/ApplicationDbContext.cs @@ -3,6 +3,8 @@ using Microsoft.EntityFrameworkCore; namespace BackendPIA.Models { public class ApplicationDbContext : IdentityDbContext<UserAccount> { + public DbSet<Raffle>? Raffles { get; set; } + public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : base(options) {} protected override void OnModelCreating(ModelBuilder builder) { diff --git a/Models/Raffle.cs b/Models/Raffle.cs index e06b173..c2dcc58 100644 --- a/Models/Raffle.cs +++ b/Models/Raffle.cs @@ -1,2 +1,14 @@ using System.ComponentModel.DataAnnotations; -using Microsoft.AspNetCore.Identity;
\ No newline at end of file +using Microsoft.AspNetCore.Identity; + +namespace BackendPIA.Models { + public class Raffle { + public long Id { get; set; } + [Required] + [StringLength(128)] + public string? Name { get; set; } + [Required] + public int Winners { get; set; } + public bool IsClosed { get; set; } + } +}
\ No newline at end of file |