using Microsoft.EntityFrameworkCore;
using ms_useCaseService.Database.Models;

namespace ms_useCaseService.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 Rules.
    /// </summary>
    public DbSet<Rule> Rules { get; set; }

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

    /// <summary>
    /// Gets or sets the entity set for RuleTypes.
    /// </summary>
    public DbSet<RuleType> RuleTypes { 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("usecases"); 
        base.OnModelCreating(builder);
    }
}