Example #1
0
        /// <summary>
        /// Where
        /// </summary>
        /// <param name="predicate"></param>
        /// <returns></returns>
        /// <exception cref="ArgumentNullException"></exception>
        public DynamicMaybe Where(Func <dynamic, bool> predicate)
        {
            if (predicate is null)
            {
                throw new ArgumentNullException(nameof(predicate));
            }
            var dictionary    = Filter(_dynamicOptionalObject, predicate).ToDictionary(k => k.Key, v => v.Value);
            var queueLikeList = _dynamicOptionalObject.InternalQueueLikeList.Where(s => dictionary.Keys.Contains(s));

            return(DynamicOptionalBuilder.Returns(dictionary, queueLikeList).Build());
        }
Example #2
0
 /// <inheritdoc />
 public DynamicMaybe Join(dynamic value, string key)
 {
     return(DynamicOptionalBuilder.Returns(_dynamicOptionalObject).SilenceMay(value, key).Build());
 }