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)); }
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!"); }
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(); }
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!"); } }
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; }
public ListController(IConfigInfo configInfo, ICsvParser parser, IDomainMapper <PlacesToStay> domainMapper) { csvClient = new CsvContentClient(configInfo.CsvReadUrl, string.Empty); this.csvParser = parser; this.mapper = domainMapper; }
/// <summary> /// Creates the service. /// </summary> public ToDoService(IUnitOfWork unitOfWork, IUnitOfWorkElastic unitOfWorkElastic, IDomainMapper mapper) { _unitOfWork = unitOfWork; _unitOfWorkElastic = unitOfWorkElastic; _mapper = mapper; }