Exemple #1
0
        public static List <T> MapToObjects <T>(QueryResultSet resultSet, DomainModel.Spi.DomainModel model, DomainModel.Spi.DomainObject domainObject = null)
            where T : class
        {
            if (resultSet == null)
            {
                throw new ArgumentNullException("ORMappingService.MapToObject.resultSet");
            }

            if (model == null)
            {
                throw new ArgumentNullException("ORMappingService.MapToObject.model");
            }

            if (domainObject == null)
            {
                domainObject = model.RootDomainObject;
            }

            var plugin = ORMPluginFactory.GetInstance().GetOrCreatePlugin(model);
            var objs   = plugin.MapToObjects(resultSet, model, domainObject);

            return(new List <T>(objs.Select(i => i as T)));
        }