public OrderPositionNamedReference(Reference orderPosition, NamedReference packagePosition, NamedReference itemPosition, NamedReference order)
     : base(orderPosition, packagePosition.Name)
 {
     Order           = order;
     PackagePosition = packagePosition;
     ItemPosition    = itemPosition;
 }
        private ValidationResult.Reference ConvertReference(NamedReference reference)
        => new ValidationResult.Reference
        {
            Id   = reference.Reference.Id,
            Name = reference.Name,

            TypeId = reference.Reference.EntityType,
            Type   = _knownEntityTypes[reference.Reference.EntityType]
        };
Example #3
0
        public MessageComposerResult(NamedReference mainReference, string template, params object[] args)
        {
            var index          = 0;
            var references     = args.OfType <NamedReference>().ToArray();
            var templateParams = args.Select(x => PrepareTemplateParameter(x, ref index)).ToArray();

            MainReference = mainReference;
            Template      = string.Format(template, templateParams);
            References    = references;
        }
        public MessageComposerResult(NamedReference mainReference, string template, params object[] args)
        {
            var templateArgs = args.Aggregate((List: new List <object>(), Index: 0), (tuple, x) =>
            {
                (x, tuple.Index) = PrepareTemplateParameter(x, tuple.Index);
                tuple.List.Add(x);
                return(tuple);
            }).List.ToArray();

            MainReference = mainReference;
            Template      = string.Format(template, templateArgs);
            References    = args.OfType <NamedReference>().ToList();
        }
 public MessageComposerResult(NamedReference mainReference, string template)
     : this(mainReference, template, Array.Empty <NamedReference>())
 {
 }
 public MessageComposerResult(NamedReference mainReference, string template, params NamedReference[] references)
 {
     MainReference = mainReference;
     Template      = template;
     References    = references;
 }