Exemplo n.º 1
0
 public void Apply(IgnoreDictionary other)
 {
     foreach (var member in other)
     {
         this.Merge(member.Key, member.Value);
     }
 }
Exemplo n.º 2
0
        internal IgnoreDictionary Next(ParameterExpression source, ParameterExpression?destination, string destMemberName)
        {
            var result = new IgnoreDictionary();

            foreach (var member in this)
            {
                if (!member.Key.StartsWith(destMemberName + "."))
                {
                    continue;
                }
                var next = new IgnoreItem
                {
                    Condition = member.Value.IsChildPath || member.Value.Condition == null
                        ? member.Value.Condition
                        : Expression.Lambda(member.Value.Condition.Apply(source, destination), source, destination),
                    IsChildPath = true
                };
                result.Merge(member.Key.Substring(destMemberName.Length + 1), next);
            }

            return(result);
        }
Exemplo n.º 3
0
 public static IEnumerable <InvokerModel> Next(this IEnumerable <InvokerModel> resolvers, IgnoreDictionary ignore, ParameterExpression source, string destName)
 {
     return(resolvers.Where(it => !ignore.TryGetValue(it.DestinationMemberName, out var item) || item.Condition != null)
            .Select(it => it.Next(source, destName))
            .Where(it => it != null) !);
 }