public LegalEntityValidator(IValidatorEngine validatorEngine, IRepository repository)
 {
     Rules.Add(
         new ChildCollectionRule <LegalEntity, MdmId>(
             validatorEngine,
             p => p.Identifiers));
 }
 public SourceSystemValidator(IValidatorEngine validatorEngine, IRepository repository)
 {
     Rules.Add(new ChildCollectionRule <SourceSystem, MdmId>(validatorEngine, p => p.Identifiers));
     Rules.Add(new PredicateRule <SourceSystem>(p => !string.IsNullOrWhiteSpace(p.Details.Name), "Name must not be null or an empty string"));
     Rules.Add(new NexusEntityExistsRule <EnergyTrading.Mdm.Contracts.SourceSystem, Mdm.SourceSystem, Mdm.SourceSystemMapping>(repository, x => x.Details.Parent, false));
     Rules.Add(new ParentDiffersRule <EnergyTrading.Mdm.Contracts.SourceSystem, Mdm.SourceSystem, Mdm.SourceSystemMapping>(repository, x => x.Details.Name, x => x.Details.Parent, y => y.Name));
 }
Exemplo n.º 3
0
 public PersonService(
     IValidatorEngine validatorFactory,
     IMappingEngine mappingEngine,
     IRepository repository,
     ISearchCache searchCache)
     : base(validatorFactory, mappingEngine, repository, searchCache)
 {
 }
 public AbcEntityTestService(
     IValidatorEngine validatorEngine,
     IMappingEngine mappingEngine,
     IRepository repository,
     ISearchCache searchCache)
     : base(validatorEngine, mappingEngine, repository, searchCache)
 {
 }
Exemplo n.º 5
0
 public PersonValidator(IValidatorEngine validatorEngine, IRepository repository)
 {
     Rules.Add(
         new ChildCollectionRule <Person, MdmId>(validatorEngine, p => p.Identifiers));
     Rules.Add(
         new PredicateRule <Person>(
             p => !string.IsNullOrWhiteSpace(p.Details.Surname),
             "Surname must not be null or an empty string"));
 }
Exemplo n.º 6
0
        protected MdmService(IValidatorEngine validatorEngine, IMappingEngine mappingEngine, IRepository repository, ISearchCache searchCache, uint version)

        {
            this.MappingEngine   = mappingEngine;
            this.validatorEngine = validatorEngine;
            this.repository      = repository;
            this.searchCache     = searchCache;
            this.ContractVersion = version;
        }
 public BrokerValidator(IValidatorEngine validatorEngine, IRepository repository)
 {
     Rules.Add(
         new ChildCollectionRule <Broker, MdmId>(validatorEngine, p => p.Identifiers));
     Rules.Add(
         new PredicateRule <Broker>(
             p => !string.IsNullOrWhiteSpace(p.Details.Name),
             "Name must not be null or an empty string"));
     Rules.Add(new NexusEntityExistsRule <Broker, Party, PartyMapping>(repository, x => x.Party, true));
 }
Exemplo n.º 8
0
        public PartyValidator(IValidatorEngine validatorEngine, IRepository repository)
        {
            Rules.Add(
                new ChildCollectionRule <Party, MdmId>(validatorEngine, p => p.Identifiers));
            Rules.Add(
                new PredicateRule <Party>(
                    p => !string.IsNullOrWhiteSpace(p.Details.Name),
                    "Name must not be null or an empty string"));

            // Rules.Add(new EntityNoOverlappingRule<Party>(repository, p=>p.ToMdmKey(), p => p.Details.Name, p => p.Nexus.StartDate, p => p.Nexus.EndDate));
        }
Exemplo n.º 9
0
 public LocationValidator(IValidatorEngine validatorEngine, IRepository repository)
 {
     Rules.Add(
         new ChildCollectionRule <Location, MdmId>(
             validatorEngine,
             p => p.Identifiers));
     Rules.Add(
         new PredicateRule <Location>(
             p => !string.IsNullOrWhiteSpace(p.Details.Name),
             "Name must not be null or an empty string"));
     Rules.Add(
         new NexusEntityExistsRule <Location, MDM.Location, LocationMapping>(
             repository,
             x => x.Details.Parent,
             false));
     Rules.Add(
         new ParentDiffersRule <Location, MDM.Location, LocationMapping>(
             repository,
             x => x.Details.Name,
             x => x.Details.Parent,
             y => y.Name));
 }
Exemplo n.º 10
0
 public static void Assign(IValidatorEngine engine)
 {
     _engine = engine;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a new ChildRule.
 /// </summary>
 /// <param name="validatorEngine">Validation engine to use</param>
 /// <param name="accessor">Function that returns the child object to validate.</param>
 public ChildRule(IValidatorEngine validatorEngine, Func <TParent, TChild> accessor)
 {
     this.validatorEngine = validatorEngine;
     this.accessor        = accessor;
 }
Exemplo n.º 12
0
 public ChildCollectionRule(IValidatorEngine validatorEngine, Func <TParent, IEnumerable <TChild> > accessor)
 {
     this.validatorEngine = validatorEngine;
     this.accessor        = accessor;
 }
 public MappingRequestValidator(IValidatorEngine validatorEngine, IRepository repository)
 {
     Rules.Add(new SystemExistsRule(repository));
 }
Exemplo n.º 14
0
 protected MdmService(IValidatorEngine validatorEngine, IMappingEngine mappingEngine, IRepository repository, ISearchCache searchCache)
     : this(validatorEngine, mappingEngine, repository, searchCache, 0)
 {
 }
Exemplo n.º 15
0
 public PartyRoleCreateMappingRequestValidator(IValidatorEngine validatorEngine, IRepository repository)
 {
     this.Rules.Add(
         new ChildRule <CreateMappingRequest, MdmId>(validatorEngine, p => p.Mapping));
     this.Rules.Add(new PartyRoleCreateMappingdNoOverlappingRule <TEntity, TMapping>(repository));
 }
 public CreateMappingRequestValidator(IValidatorEngine validatorEngine)
 {
     Rules.Add(new ChildRule <CreateMappingRequest, MdmId>(validatorEngine, p => p.Mapping));
 }