示例#1
0
        /// <summary>
        /// Create a target object populated from a source document
        /// </summary>
        /// <param name="source"></param>
        /// <returns></returns>
        public static TTarget CreateTarget(XDocument source)
        {
            var map = new XDocumentAutoMap <TTarget>();

            return(map.Create(source));
        }
示例#2
0
        /// <summary>
        /// Create a collection of target objects from a source document
        /// </summary>
        /// <param name="sourceList"></param>
        /// <returns></returns>
        public static List <TTarget> CreateTargetList(XDocument sourceList)
        {
            var map = new XDocumentAutoMap <TTarget>();

            return(map.CreateList(sourceList));
        }
示例#3
0
        /// <summary>
        /// Populate an existing target object from a source document
        /// </summary>
        /// <param name="source"></param>
        /// <param name="target"></param>
        public static void PopulateTarget(XDocument source, TTarget target)
        {
            var map = new XDocumentAutoMap <TTarget>();

            map.Populate(source, target);
        }