feat: add WebMessage model and controller with CRUD endpoints #7

This commit is contained in:
Marek Lesko
2025-10-31 15:56:21 +00:00
parent 4c85d18a79
commit 426b4c55fc
6 changed files with 299 additions and 53 deletions

View File

@@ -15,6 +15,8 @@ namespace Api.Models
public AppDbContext(DbContextOptions<AppDbContext> options) : base(options) { }
public DbSet<Product> Products { get; set; }
public DbSet<WebMessage> WebMessages { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);

16
Api/Models/WebMessage.cs Normal file
View File

@@ -0,0 +1,16 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
public class WebMessage
{
[Key]
public int Id { get; set; }
public string? Name { get; set; }
public string? Surname { get; set; }
public string? Email { get; set; }
public string? Phone { get; set; }
public string? Subject { get; set; }
public string? Message { get; set; }
[NotMapped]
public string? RecaptchaToken { get; set; }
}