Ejemplo n.º 1
0
        private object PrepareGetMembeResult(GetMemberBinder binder, IEnumerable <XElement> nodes)
        {
            var    collections = new string[] { "det", "dup" };
            object result;

            if (nodes.IsEmpty())
            {
                if (collections.Contains(binder.Name))
                {
                    result = new List <DanfeDynamicXml>();
                }
                else
                {
                    result = new DanfeDynamicXml();
                }
            }
            else if (collections.Contains(binder.Name))
            {
                result = nodes.Select(n => new DanfeDynamicXml(n)).ToList();
            }
            else
            {
                result = new DanfeDynamicXml(nodes.First());
            }

            return(result);
        }
Ejemplo n.º 2
0
        public static dynamic DeserializerNFe(string path)
        {
            dynamic result = new DanfeDynamicXml(path);

            return(result.NFe);
        }