summaryrefslogtreecommitdiff
path: root/Models
diff options
context:
space:
mode:
authorHombreLaser <sebastian-440@live.com>2022-11-20 20:55:16 -0600
committerHombreLaser <sebastian-440@live.com>2022-11-20 20:55:16 -0600
commit3e67b71325f51c1a83a4cb7d78586690c4d89a0c (patch)
tree1ef007e79310bd78905062bec93a09a01be377d2 /Models
parente587ec71da3f457a945c1d3c5d6cf8c89445cd11 (diff)
Añadido modelo de rifa
Diffstat (limited to 'Models')
-rw-r--r--Models/ApplicationDbContext.cs2
-rw-r--r--Models/Raffle.cs14
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