public PrivateCorporation(ITechTreeService techTreeService, IChannelManager channelManager, IReadOnlyRepository <int, CharacterProfile> characterProfiles, IVoteHandler voteHandler, CharacterWalletFactory characterWalletFactory, IMarketOrderRepository marketOrderRepository) { _techTreeService = techTreeService; _channelManager = channelManager; _characterProfiles = characterProfiles; _voteHandler = voteHandler; _characterWalletFactory = characterWalletFactory; _marketOrderRepository = marketOrderRepository; }
private IVoteHandler GetVoteHandler(Database.Model.Vote vote) { IVoteHandler handler = null; var type = ObjectContext.GetObjectType(vote.GetType()); try { handler = _scope.Resolve(typeof(IVoteHandler <>).MakeGenericType(type), new TypedParameter(typeof(Database.Model.Vote), vote)) as IVoteHandler; } catch (Exception ex) { Logging.LogException($"Failed to resolve IVoteHandler for type '{type.Name}'", ex, GetType(), LogLevel.ERROR, ExceptionLevel.Unhandled); return(null); } if (handler == null) { Logging.Log($"Failed to resolve IVoteHandler for type '{type.Name}'", GetType(), LogLevel.ERROR); return(null); } return(handler); }