Example #1
0
 public PredicateProgramDto ToDto()
 {
     return(new PredicateProgramDto
     {
         AndConditions = AndConditions != null?AndConditions.Select(ParameterPredicate.ToDto).ToList() : null,
                             OrConditions = OrConditions != null?OrConditions.Select(ParameterPredicate.ToDto).ToList() : null,
                                                Condition = ParameterPredicate.ToDto(Condition),
                                                Program = Program.Name
     });
 }
Example #2
0
        public static ParameterPredicateDto ToDto(ParameterPredicate p)
        {
            if (p == null) return null;

            return new ParameterPredicateDto
            {
                Op = (int) p.Op,
                Parameter = p.Parameter,
                Value =p.Value
            };
        }
Example #3
0
        public static PredicateProgram FromDto(PredicateProgramDto dto, EffectsManager manager)
        {
            var p = manager.Programs[dto.Program];

            return(new PredicateProgram
            {
                AndConditions = dto.AndConditions != null?dto.AndConditions.Select(ParameterPredicate.FromDto).ToList() : null,
                                    OrConditions = dto.OrConditions != null?dto.OrConditions.Select(ParameterPredicate.FromDto).ToList() : null,
                                                       Condition = ParameterPredicate.FromDto(dto.Condition),
                                                       Program = p
            });
        }