コード例 #1
0
 public EstablishmentsController([NotNull] IEstablishmentRepository establishmentRepository,
                                 [NotNull] ILogger <EstablishmentsController> logger,
                                 [NotNull] IDomainMapper domainMapper)
 {
     _establishmentRepository = establishmentRepository ?? throw new ArgumentNullException(nameof(establishmentRepository));
     _logger       = logger ?? throw new ArgumentNullException(nameof(logger));
     _domainMapper = domainMapper ?? throw new ArgumentNullException(nameof(domainMapper));
 }
コード例 #2
0
ファイル: Server.cs プロジェクト: Gtach/ruh
        public static void Send(IDomainMapper domainMapper, Socket publisher, RuntimeTypeModel typeModel, MemoryStream stream, DomainBase instance)
        {
            var status = publisher.SendMore(domainMapper.Type2Bytes(instance.GetType()));
            if (status != SendStatus.Sent) throw new InvalidOperationException("Key not sent!");

            stream.SetLength(0);
            typeModel.Serialize(stream, instance);
            status = publisher.Send(stream.ToArray());
            if (status != SendStatus.Sent) throw new InvalidOperationException("Instance not sent!");
        }
コード例 #3
0
 protected BaseService(IDataUnitOfWork unitOfWork, ILogger logger, IValidatorService validationService,
                       IValidatorRuleset validatorRuleset, IMapperUnitOfWork mapperUnitOfWork, ISecurity security)
 {
     _unitOfWork        = unitOfWork;
     _mapperUnitOfWork  = mapperUnitOfWork;
     _repositoryAsync   = unitOfWork.Repository <TEntity>();
     _logger            = logger;
     _validationService = validationService;
     _instanceId        = Guid.NewGuid();
     _validatorRuleset  = validatorRuleset;
     _mapper            = mapperUnitOfWork.Repository <IDomainMapper <TEntity, TEntity> >();
     _currentDomainUser = security.GetCurrentUser();
 }
コード例 #4
0
ファイル: Server.cs プロジェクト: Gtach/ruh
        public static void Send(IDomainMapper domainMapper, Socket publisher, RuntimeTypeModel typeModel, MemoryStream stream, DomainBase instance)
        {
            var status = publisher.SendMore(domainMapper.Type2Bytes(instance.GetType()));

            if (status != SendStatus.Sent)
            {
                throw new InvalidOperationException("Key not sent!");
            }

            stream.SetLength(0);
            typeModel.Serialize(stream, instance);
            status = publisher.Send(stream.ToArray());
            if (status != SendStatus.Sent)
            {
                throw new InvalidOperationException("Instance not sent!");
            }
        }
コード例 #5
0
ファイル: ZmqRepository.cs プロジェクト: Gtach/ruh
        public ZmqRepository(IDomainMapper domainMapper, IPropertyManager propertyManager, string path)
        {
            if (domainMapper == null)
            {
                throw new ArgumentNullException("domainMapper");
            }
            if (propertyManager == null)
            {
                throw new ArgumentNullException("propertyManager");
            }
            if (path == null)
            {
                throw new ArgumentNullException("path");
            }

            _domainMapper    = domainMapper;
            _propertyManager = propertyManager;
            _path            = path;
        }
コード例 #6
0
 public ListController(IConfigInfo configInfo, ICsvParser parser, IDomainMapper <PlacesToStay> domainMapper)
 {
     csvClient      = new CsvContentClient(configInfo.CsvReadUrl, string.Empty);
     this.csvParser = parser;
     this.mapper    = domainMapper;
 }
コード例 #7
0
 /// <summary>
 /// Creates the service.
 /// </summary>
 public ToDoService(IUnitOfWork unitOfWork, IUnitOfWorkElastic unitOfWorkElastic, IDomainMapper mapper)
 {
     _unitOfWork        = unitOfWork;
     _unitOfWorkElastic = unitOfWorkElastic;
     _mapper            = mapper;
 }