예제 #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;
 }