Пример #1
0
        /// <summary>
        /// Check if the dynamic object have all the members needed to map a new T object, except those setted as IEnumerable,
        /// which should be provided in others dynamic.
        /// </summary>
        /// <param name="membersDict"></param>
        /// <returns></returns>
        public bool CheckIfDynamicHasAllTypeMembersByName(IDictionary <string, object> membersDict)
        {
            IEnumerable <string> dynList = membersDict.Select(kvp => kvp.Key);
            PrePostFixesParser   parser  = new PrePostFixesParser(this);

            return(dynList.SequenceEqual(parser.GetCleanNamesList(this.NamesList)));
        }
Пример #2
0
        /// <summary>
        /// Check if the dynamic object have all the members needed to map a new T object, except those setted as IEnumerable,
        /// which should be provided in others dynamic.
        /// </summary>
        /// <param name="dyn"></param>
        /// <returns></returns>
        public bool CheckIfDynamicHasAllTypeMembersByName(dynamic dyn)
        {
            IDictionary <string, object> membersDict = dyn as IDictionary <string, object>;
            IEnumerable <string>         dynList     = membersDict.Select(kvp => kvp.Key);
            PrePostFixesParser           parser      = new PrePostFixesParser(this);
            IEnumerable <string>         list        = parser.GetCleanNamesList(this.NamesList);

            return(!dynList.Except(list).Any() && !list.Except(dynList).Any());
        }