문제

How would I convert the existing C# code

_containerBuilder = new ContainerBuilder();
_containerBuilder.RegisterGeneric(typeof(CommandObserver<>)).As(typeof(ICommandObserver<>));
_containerBuilder.RegisterGeneric(typeof(PropertyProvider<>)).As(typeof(IPropertyProvider<>)); 

into F#?

도움이 되었습니까?

해결책

open Autofac
let _containerBuilder = new ContainerBuilder()

_containerBuilder.RegisterGeneric(typedefof<CommandObserver<_>>)
    .As(typedefof<ICommandObserver<_>>);

_containerBuilder.RegisterGeneric(typedefof<PropertyProvider<_>>)
    .As(typedefof<IPropertyProvider<_>>);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top