public OrderResponse Fetch(OrderPkRequest request) { var entity = new OrderEntity(); entity.OrderId = request.OrderId; var excludedIncludedFields = RepositoryHelper.ConvertStringToExcludedIncludedFields(EntityType, request.Select); var prefetchPath = RepositoryHelper.ConvertStringToPrefetchPath(EntityType, request.Include, request.Select); using (var adapter = DataAccessAdapterFactory.NewDataAccessAdapter()) { OnBeforeFetchOrderPkRequest(adapter, request, entity, prefetchPath, excludedIncludedFields); if (adapter.FetchEntity(entity, prefetchPath, null, excludedIncludedFields)) { OnAfterFetchOrderPkRequest(adapter, request, entity, prefetchPath, excludedIncludedFields); return(new OrderResponse(entity.ToDto())); } } return(new OrderResponse(null)); }
public OrderResponse Fetch(OrderPkRequest request) { var entity = new OrderEntity(); entity.OrderId = request.OrderId; var excludedIncludedFields = RepositoryHelper.ConvertStringToExcludedIncludedFields(EntityType, request.Select); var prefetchPath = RepositoryHelper.ConvertStringToPrefetchPath(EntityType, request.Include, request.Select); using (var adapter = DataAccessAdapterFactory.NewDataAccessAdapter()) { OnBeforeFetchOrderPkRequest(adapter, request, entity, prefetchPath, excludedIncludedFields); var pkPredicate = adapter.CreatePrimaryKeyFilter(entity.Fields.PrimaryKeyFields); entity = base.Fetch(adapter, pkPredicate, prefetchPath, excludedIncludedFields, request.RCache); if (entity != null) { OnAfterFetchOrderPkRequest(adapter, request, entity, prefetchPath, excludedIncludedFields); return(new OrderResponse(entity.ToDto())); } } return(new OrderResponse(null)); }
partial void OnAfterFetchOrderPkRequest(IDataAccessAdapter adapter, OrderPkRequest request, OrderEntity entity, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields);