using Forwarder.Data.Configurations;
using Forwarder.Domain;

using Microsoft.EntityFrameworkCore;

namespace Forwarder.Data;

/// <inheritdoc />
public class DataContext(DbContextOptions<DataContext> options)
	: DbContext(options), IDataContext
{
	/// <inheritdoc />
	public required DbSet<AssetMap> Maps { get; set; }
	/// <inheritdoc />
	public required DbSet<Message> Messages { get; set; }

	/// <inheritdoc />
	protected override void OnModelCreating(ModelBuilder modelBuilder)
	{
		_ = modelBuilder.ApplyConfiguration(new AssetMapConfiguration());
		_ = modelBuilder.ApplyConfiguration(new MessageConfiguration());
	}
}
