using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace Telegram.Bot.SpaceApi.Backend.Database.Tables; public class Bot { public int Id { get; set; } public string Name { get; set; } = null!; public string Token { get; set; } = null!; public string Chat { get; set; } = null!; public string ApiUrl { get; set; } = null!; public string? ApiOverrideAddress { get; set; } public class Configuration : IEntityTypeConfiguration { public void Configure(EntityTypeBuilder builder) { builder.ToTable("Bots"); builder.HasKey(p => p.Id); builder.Property(b => b.Name).HasColumnName("Name").IsRequired(); builder.Property(b => b.Chat).HasColumnName("Chat").IsRequired(); builder.Property(b => b.Token).HasColumnName("Token").IsRequired(); builder.Property(b => b.ApiUrl).HasColumnName("ApiUrl").IsRequired(); builder.Property(b => b.ApiOverrideAddress).HasColumnName("ApiOverrideAddress"); } } }