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));
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 partial void OnAfterFetchOrderPkRequest(IDataAccessAdapter adapter, OrderPkRequest request, OrderEntity entity, IPrefetchPath2 prefetchPath, ExcludeIncludeFieldsList excludedIncludedFields);