コード例 #1
0
        public static void SubscribeMessage(this ConsumerScanResult consumerScanResult, IRegisterCallbacks registerCallbacks)
        {
            var contract = consumerScanResult.GetConsumerContract();

            registerCallbacks.SingletonRegisterCallback(typeof(IConsumerDefinition), contract.ConsumerDefinition);
            registerCallbacks.CallScopeRegisterCallback(contract.ConsumerInterface, contract.Consumer);
            registerCallbacks.CallScopeRegisterCallback(contract.MessageHandlerInterface, contract.Adapter, Guid.NewGuid().ToString());
        }
コード例 #2
0
        public static void RegisterViewModels(
            this IEnumerable <TypeScanResult> enumerable,
            IRegisterCallbacks callbacks)
        {
            Guard.NotNull(callbacks, nameof(callbacks));
            Guard.NotNull(enumerable, nameof(enumerable));

            foreach (var typeScanResult in enumerable)
            {
                if (typeScanResult.Type.Name.Contains(ViewModelConvention))
                {
                    callbacks.SingletonRegisterCallback(typeScanResult.Type, typeScanResult.Type);
                }
            }
        }