/// <summary> /// Processa o resultado da consulta a carrega as entidades de negócio. /// </summary> /// <typeparam name="TEntity">Tipo da entidade de negócio.</typeparam> /// <param name="queryResult">Resultado da consulta.</param> /// <param name="sourceContext">Contexto de origem.</param> /// <param name="uiContext"></param> /// <returns></returns> public static IEnumerable <TEntity> ProcessLazyResult <TEntity>(this Colosoft.Query.IQueryResult queryResult, Colosoft.Query.ISourceContext sourceContext = null, string uiContext = null) where TEntity : class, Colosoft.Business.IEntity { queryResult.Require("queryResult").NotNull(); if (Colosoft.Business.EntityManager.Instance == null) { throw new InvalidOperationException("EntityManager instance is null"); } return(Colosoft.Business.EntityManager.Instance.ProcessLazyResult <TEntity>(queryResult, sourceContext, uiContext)); }
/// <summary> /// Processa o resultado para a preparação da consulta. /// </summary> /// <typeparam name="TEntity"></typeparam> /// <param name="prepareResult"></param> /// <param name="queryResult"></param> /// <returns></returns> public static IEnumerable <TEntity> ProcessResult <TEntity>(this Colosoft.Business.PrepareNestedQueriesResult prepareResult, Colosoft.Query.IQueryResult queryResult = null) where TEntity : class, Colosoft.Business.IEntity { prepareResult.Require("prepareResult").NotNull(); return(Colosoft.Business.EntityManager.Instance.ProcessResult <TEntity>(prepareResult, prepareResult.Queryable.SourceContext, queryResult)); }