コード例 #1
0
        /// <summary>
        /// Create new
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public IObjectData CreateObjectData(object obj)
        {
            // technically we could allow metadata to be created for something implementing IDictionary<string,object>
            // but usually this would represent something that's arleady been mapped. The conservative approach
            // is to reject them. This can be evaluated in the future.

            if (obj is IDictionary <string, object> || !IQObjectMapper.Types.IsMappable(obj.GetType()))
            {
                return(null);
            }
            IObjectData newObjectData = new DbObjectData(obj);

            ObjectValueData[obj] = newObjectData;
            return(newObjectData);
        }
コード例 #2
0
ファイル: MapperCache.cs プロジェクト: jamietre/IQMap
        /// <summary>
        /// Create new
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public IObjectData CreateObjectData(object obj)
        {
            // technically we could allow metadata to be created for something implementing IDictionary<string,object>
            // but usually this would represent something that's arleady been mapped. The conservative approach
            // is to reject them. This can be evaluated in the future.

            if (obj is IDictionary<string, object> || !IQObjectMapper.Types.IsMappable(obj.GetType()))
            {
                return null;
            }
            IObjectData newObjectData = new DbObjectData(obj);
            ObjectValueData[obj] = newObjectData;
            return newObjectData;
        }