Exemplo n.º 1
0
        public static Bean ToBean(this object poco, string kind)
        {
            if (poco.GetType().GetInterface("IEnumerable") != null)
            {
                throw CannotMapIEnumerableException.Create();
            }

            var factory = new BeanFactory();

            return(factory.Dispense(kind).ImportPoco(poco));
        }
Exemplo n.º 2
0
        public static IEnumerable <Bean> ToBeanList(this IEnumerable <object> pocos, string kind)
        {
            var factory = new BeanFactory();

            return(pocos.Select(poco => factory.Dispense(kind).ImportPoco(poco)).ToList());
        }