Files
vegasco/src/WebApi/Persistence/ApplicationDbContext.cs

23 lines
633 B
C#
Raw Normal View History

2024-08-17 16:38:40 +02:00
using Microsoft.EntityFrameworkCore;
using Vegasco.WebApi.Cars;
using Vegasco.WebApi.Common;
2024-08-23 18:02:18 +02:00
using Vegasco.WebApi.Consumptions;
2024-08-17 16:38:40 +02:00
using Vegasco.WebApi.Users;
namespace Vegasco.WebApi.Persistence;
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(IWebApiMarker).Assembly);
}
}