using Microsoft.EntityFrameworkCore;
using ms_namingservice.Database.Models;

namespace ms_namingservice.Database;

/// <summary>
/// Provides a DbContext for the database communication using Entity Framework.
/// </summary>
public class RulesContext : DbContext
{
    /// <summary>
    /// Initializes a new instance of the RulesContext class.
    /// </summary>
    /// <param name="options">The options for configuring this context.</param>
    public RulesContext(DbContextOptions<RulesContext> options) : base(options)
    {
    }
    
    /// <summary>
    /// Gets or sets the entity set for LesType.
    /// </summary>
    public DbSet<LesType> LesTypes { get; set; }

    /// <summary>
    /// Gets or sets the entity set for LesTypesCategory.
    /// </summary>
    public DbSet<LesTypesCategory> LesTypesCategories { get; set; }

    /// <summary>
    /// Gets or sets the entity set for FrameworkType2FrameworkMetadataType.
    /// </summary>
    public DbSet<FrameworkType2FrameworkMetadataType> FrameworkType2FrameworkMetadataTypes { get; set; }

    /// <summary>
    /// Configures the default schema name for this context.
    /// </summary>
    /// <param name="builder">The model builder to configure.</param>
    protected override void OnModelCreating(ModelBuilder builder)
    {
        builder.HasDefaultSchema("naming"); 
        base.OnModelCreating(builder);
    }
}