<commit_before>﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;

namespace Recipe.Dal.Models
{
    public partial class RecipeContext : DbContext
    {
        public static readonly ILoggerFactory ContextLoggerFactory = LoggerFactory.Create(builder =>
        {
            builder.AddConsole();
        });

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
             optionsBuilder
                .UseLoggerFactory(ContextLoggerFactory)
                .UseSqlServer(@"data source=.;initial catalog=recipecore;integrated security=true;multipleactiveresultsets=True;",
                options =>
                {
                    options.EnableRetryOnFailure(maxRetryCount: 3);
                    options.MaxBatchSize(10);
                })
                .UseLazyLoadingProxies();
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Direction>(entity =>
            {
                entity.HasIndex(e => e.RecipeId)
                    .HasName("IX_Recipe_RecipeId");

                entity.HasIndex(e => new { e.RecipeId, e.LineNumber })
                    .HasName("IX_Directions_RecipeLineNumber");

                entity.HasIndex(e => new { e.LineNumber, e.Description, e.RecipeId, e.Id })
                    .HasName("_dta_index_Directions_5_709577566__K4_K1_2_3");
            });
            modelBuilder.Entity<Ingredient>(entity =>
            {
                entity.HasIndex(e => e.RecipeId)
                    .HasName("IX_Recipe_RecipeId");

                entity.HasIndex(e => new { e.SortOrder, e.Units, e.UnitType, e.Description, e.RecipeId, e.Id })
                    .HasName("_dta_index_Ingredients_5_661577395__K6_K1_2_3_4_5");
            });

            modelBuilder.Entity<Recipe>(entity =>
            {
                entity.HasIndex(e => e.Title)
                    .HasName("IX_Recipes_Title");<commit_msg>Add enablesensitivedatalogging<commit_after>﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;

namespace Recipe.Dal.Models
{
    public partial class RecipeContext : DbContext
    {
        public static readonly ILoggerFactory ContextLoggerFactory = LoggerFactory.Create(builder =>
        {
            builder.AddConsole();
        });

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
             optionsBuilder
                .UseSqlServer(@"data source=.;initial catalog=recipecore;integrated security=true;multipleactiveresultsets=True;",
                options =>
                {
                    options.EnableRetryOnFailure(maxRetryCount: 3);
                    options.MaxBatchSize(10);
                })
                .EnableSensitiveDataLogging()
                .UseLoggerFactory(ContextLoggerFactory)
                .UseLazyLoadingProxies();
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Direction>(entity =>
            {
                entity.HasIndex(e => e.RecipeId)
                    .HasName("IX_Recipe_RecipeId");

                entity.HasIndex(e => new { e.RecipeId, e.LineNumber })
                    .HasName("IX_Directions_RecipeLineNumber");

                entity.HasIndex(e => new { e.LineNumber, e.Description, e.RecipeId, e.Id })
                    .HasName("_dta_index_Directions_5_709577566__K4_K1_2_3");
            });
            modelBuilder.Entity<Ingredient>(entity =>
            {
                entity.HasIndex(e => e.RecipeId)
                    .HasName("IX_Recipe_RecipeId");

                entity.HasIndex(e => new { e.SortOrder, e.Units, e.UnitType, e.Description, e.RecipeId, e.Id })
                    .HasName("_dta_index_Ingredients_5_661577395__K6_K1_2_3_4_5");
            });

            modelBuilder.Entity<Recipe>(entity =>
            {
                entity.HasIndex(e => e.Title)
                    .HasName("IX_Recipes_Title");
{'fraction_non_alphanumeric': 0.09385704498744006, 'fraction_numerical': 0.015071934231559716, 'mean_word_length': 2.0248618784530388, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5430076', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1152, 'n_words': 161}