Ejemplo n.º 1
0
        private Dictionary <IocContainer.Keyed, IocContainer.Entry> BuildKeyed()
        {
            var keyedRegistrationDictionary = new Dictionary <IocContainer.Keyed, IocContainer.Entry>();

            foreach (var entry in keyedRegistrations)
            {
                try
                {
                    var containerEntry = new IocContainer.Entry(entry.Value.RegistrationTag, GetNormalizedLambda(entry.Key.Type, entry.Value));
                    keyedRegistrationDictionary.Add(new IocContainer.Keyed(entry.Key.Type, entry.Key.Id), containerEntry);
                }
                catch (Exception ex)
                {
                    throw new CendrusIocException($"Failed to build {entry.Value.RegistrationTag} dependency {entry.Key.Type.FullName} with id {entry.Key.Id.ToString()}. {ex.Message}", ex);
                }
            }
            return(keyedRegistrationDictionary);
        }
Ejemplo n.º 2
0
        private Dictionary <Type, IocContainer.Entry> BuildRegistrations()
        {
            var registrationDictionary = new Dictionary <Type, IocContainer.Entry>();

            foreach (var entry in registrations)
            {
                try
                {
                    var containerEntry = new IocContainer.Entry(entry.Value.RegistrationTag, GetNormalizedLambda(entry.Key.Type, entry.Value));
                    registrationDictionary.Add(entry.Key.Type, containerEntry);
                }
                catch (Exception ex)
                {
                    throw new CendrusIocException($"Failed to build {entry.Value.RegistrationTag} dependency {entry.Key.Type.FullName}. {ex.Message}", ex);
                }
            }
            return(registrationDictionary);
        }