2024-08-17 16:38:40 +02:00
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
2025-06-12 18:22:37 +02:00
|
|
|
|
using Vegasco.Server.Api.Cars;
|
|
|
|
|
|
using Vegasco.Server.Api.Common;
|
|
|
|
|
|
using Vegasco.Server.Api.Consumptions;
|
|
|
|
|
|
using Vegasco.Server.Api.Users;
|
2024-08-17 16:38:40 +02:00
|
|
|
|
|
2025-06-12 18:22:37 +02:00
|
|
|
|
namespace Vegasco.Server.Api.Persistence;
|
2024-08-17 16:38:40 +02:00
|
|
|
|
|
|
|
|
|
|
public class ApplicationDbContext(DbContextOptions<ApplicationDbContext> options) : DbContext(options)
|
|
|
|
|
|
{
|
|
|
|
|
|
public DbSet<Car> Cars { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
public DbSet<User> Users { get; set; }
|
|
|
|
|
|
|
2024-08-23 18:02:18 +02:00
|
|
|
|
public DbSet<Consumption> Consumptions { get; set; }
|
|
|
|
|
|
|
2024-08-17 16:38:40 +02:00
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
|
{
|
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
2025-06-12 18:22:37 +02:00
|
|
|
|
modelBuilder.ApplyConfigurationsFromAssembly(typeof(IApiMarker).Assembly);
|
2024-08-17 16:38:40 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|