Files
vegasco/src/Vegasco.Server.Api/Persistence/ApplicationDbContext.cs

23 lines
650 B
C#
Raw Normal View History

2024-08-17 16:38:40 +02:00
using Microsoft.EntityFrameworkCore;
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
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);
modelBuilder.ApplyConfigurationsFromAssembly(typeof(IApiMarker).Assembly);
2024-08-17 16:38:40 +02:00
}
}