protected virtual void RegisterCodecs(IDependencyResolver resolver) { var repo = resolver.Resolve <ICodecRepository>(); var typeSystem = resolver.Resolve <ITypeSystem>(); foreach (Type codecType in CodecTypes) { if (!resolver.HasDependency(codecType)) { resolver.AddDependency(codecType, DependencyLifetime.Transient); } IEnumerable <CodecRegistration> registrations = CodecRegistration.FromCodecType(codecType, typeSystem); registrations.ForEach(repo.Add); } }
protected void given_registration_codec <TCodec>() { CodecRegistration.FromCodecType(typeof(TCodec), TypeSystem).ForEach(x => Codecs.Add(x)); }