<commit_before>﻿using BGC.Core;
using BGC.Core.Services;
using BGC.Data.Relational;
using CodeShield;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Owin.Security;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace BGC.Data
{
	public class DataLayerDependencyRegistration : IDependencyRegistration<IUnityContainer, LifetimeManager>
	{
        private static readonly Dictionary<Type, Action<IUnityContainer, LifetimeManager, string>> RegistrationDelegates = new Dictionary<Type, Action<IUnityContainer, LifetimeManager, string>>()
        {
            { typeof(IRepository<>),             (c, lm, name) => c.RegisterType(typeof(IRepository<>), typeof(MySqlRepository<>), name, lm) },
            { typeof(IUnitOfWork),               (c, lm, name) => c.RegisterType<IUnitOfWork, ComposersDbContext>(name, lm, new InjectionConstructor()) },
            { typeof(DbContext),                 (c, lm, name) => c.RegisterType<DbContext, ComposersDbContext>(name, lm, new InjectionConstructor()) },
            { typeof(IRoleStore<BgcRole, long>), (c, lm, name) => c.RegisterType<IRoleStore<BgcRole, long>, RoleStore<BgcRole, long, BgcUserRole>>(name, lm) },
            { typeof(IUserStore<BgcUser, long>), (c, lm, name) => c.RegisterType<IUserStore<BgcUser, long>, UserStore<BgcUser, BgcRole, long, BgcUserLogin, BgcUserRole, BgcUserClaim>>(name, lm, new InjectionFactory(container =>
				{
					ComposersDbContext context = container.Resolve<ComposersDbContext>();
					return new UserStore<BgcUser, BgcRole, long, BgcUserLogin, BgcUserRole, BgcUserClaim>(context);
				}))
            }
        };

        private readonly IUnityContainer _container;<commit_msg>Registered IComposerRepository with the dependency injection container.<commit_after>﻿using BGC.Core;
using BGC.Core.Services;
using BGC.Data.Relational;
using BGC.Data.Relational.Repositories;
using CodeShield;
using Microsoft.AspNet.Identity;
using Microsoft.AspNet.Identity.EntityFramework;
using Microsoft.Owin.Security;
using Microsoft.Practices.Unity;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace BGC.Data
{
	public class DataLayerDependencyRegistration : IDependencyRegistration<IUnityContainer, LifetimeManager>
	{
        private static readonly Dictionary<Type, Action<IUnityContainer, LifetimeManager, string>> RegistrationDelegates = new Dictionary<Type, Action<IUnityContainer, LifetimeManager, string>>()
        {
            { typeof(IComposerRepository),       (c, lm, name) => c.RegisterType<IComposerRepository, ComposersRepository>(name, lm) },
            { typeof(IRepository<>),             (c, lm, name) => c.RegisterType(typeof(IRepository<>), typeof(MySqlRepository<>), name, lm) },
            { typeof(IUnitOfWork),               (c, lm, name) => c.RegisterType<IUnitOfWork, ComposersDbContext>(name, lm, new InjectionConstructor()) },
            { typeof(DbContext),                 (c, lm, name) => c.RegisterType<DbContext, ComposersDbContext>(name, lm, new InjectionConstructor()) },
            { typeof(IRoleStore<BgcRole, long>), (c, lm, name) => c.RegisterType<IRoleStore<BgcRole, long>, RoleStore<BgcRole, long, BgcUserRole>>(name, lm) },
            { typeof(IUserStore<BgcUser, long>), (c, lm, name) => c.RegisterType<IUserStore<BgcUser, long>, UserStore<BgcUser, BgcRole, long, BgcUserLogin, BgcUserRole, BgcUserClaim>>(name, lm, new InjectionFactory(container =>
				{
					ComposersDbContext context = container.Resolve<ComposersDbContext>();
					return new UserStore<BgcUser, BgcRole, long, BgcUserLogin, BgcUserRole, BgcUserClaim>(context);
				}))
            }
        };

        private readonly IUnityContainer _container;
{'fraction_non_alphanumeric': 0.11965811965811966, 'fraction_numerical': 0.0, 'mean_word_length': 4.511080332409972, 'pattern_counts': {'":': 0, '<': 44, '<?xml version=': 0, '>': 57, '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': '2128885', 'n_tokens_mistral': 1230, 'n_tokens_neox': 1179, 'n_words': 250}