Exemple #1
0
 private static System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.OrderEntity, NWService.Dtos.DtoClasses.Order> > CreateProjectionFunc()
 {
     System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.OrderEntity, NWService.Dtos.DtoClasses.Order> > mainProjection = p__0 => new NWService.Dtos.DtoClasses.Order()
     {
         CustomerId   = p__0.CustomerId,
         EmployeeId   = p__0.EmployeeId,
         Freight      = p__0.Freight,
         OrderDate    = p__0.OrderDate,
         OrderDetails = p__0.OrderDetails.Select(p__1 => new NWService.Dtos.DtoClasses.OrderTypes.OrderDetail()
         {
             Discount  = p__1.Discount,
             ProductId = p__1.ProductId,
             Quantity  = p__1.Quantity,
             UnitPrice = p__1.UnitPrice,
         }).ToList(),
         OrderId        = p__0.OrderId,
         RequiredDate   = p__0.RequiredDate,
         ShipAddress    = p__0.ShipAddress,
         ShipCity       = p__0.ShipCity,
         ShipCountry    = p__0.ShipCountry,
         ShipName       = p__0.ShipName,
         ShippedDate    = p__0.ShippedDate,
         ShipPostalCode = p__0.ShipPostalCode,
         ShipRegion     = p__0.ShipRegion,
         ShipVia        = p__0.ShipVia,
         // __LLBLGENPRO_USER_CODE_REGION_START ProjectionRegion_Order
         // __LLBLGENPRO_USER_CODE_REGION_END
     };
     System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.OrderEntity, NWService.Dtos.DtoClasses.Order> > projectionAdjustments = null;
     GetAdjustmentsForProjectToOrder(ref projectionAdjustments);
     return(LinqUtils.MergeProjectionAdjustmentsIntoProjection(mainProjection, projectionAdjustments, true));
 }
Exemple #2
0
 /// <summary>Extension method which produces a projection to NWService.Dtos.DtoClasses.Order which instances are projected from the
 /// results of the specified baseQuery using QuerySpec, which returns NWService.Dal.EntityClasses.OrderEntity instances, the root entity of the derived element returned by this query.</summary>
 /// <param name="baseQuery">The base query to project the derived element instances from.</param>
 /// <param name="qf">The query factory used to create baseQuery.</param>
 /// <returns>DynamicQuery to retrieve NWService.Dtos.DtoClasses.Order instances</returns>
 public static DynamicQuery <NWService.Dtos.DtoClasses.Order> ProjectToOrder(this EntityQuery <NWService.Dal.EntityClasses.OrderEntity> baseQuery, NWService.Dal.FactoryClasses.QueryFactory qf)
 {
     System.Linq.Expressions.Expression <Func <NWService.Dtos.DtoClasses.Order> > projectionAdjustments = null;
     GetAdjustmentsForProjectToOrderQs(ref projectionAdjustments);
     return(qf.Create()
            .From(baseQuery.Select(Projection.Full).As("__BQ"))
            .Select(LinqUtils.MergeProjectionAdjustmentsIntoProjection(() => new NWService.Dtos.DtoClasses.Order()
     {
         CustomerId = OrderFields.CustomerId.Source("__BQ").ToValue <System.String>(),
         EmployeeId = OrderFields.EmployeeId.Source("__BQ").ToValue <Nullable <System.Int32> >(),
         Freight = OrderFields.Freight.Source("__BQ").ToValue <Nullable <System.Decimal> >(),
         OrderDate = OrderFields.OrderDate.Source("__BQ").ToValue <Nullable <System.DateTime> >(),
         OrderDetails = (List <NWService.Dtos.DtoClasses.OrderTypes.OrderDetail>)qf.OrderDetail.TargetAs("__L1_0")
                        .CorrelatedOver(OrderFields.OrderId.Source("__BQ").Equal(OrderDetailFields.OrderId.Source("__L1_0")))
                        .Select(() => new NWService.Dtos.DtoClasses.OrderTypes.OrderDetail()
         {
             Discount = OrderDetailFields.Discount.Source("__L1_0").ToValue <System.Single>(),
             ProductId = OrderDetailFields.ProductId.Source("__L1_0").ToValue <System.Int32>(),
             Quantity = OrderDetailFields.Quantity.Source("__L1_0").ToValue <System.Int16>(),
             UnitPrice = OrderDetailFields.UnitPrice.Source("__L1_0").ToValue <System.Decimal>(),
         }).ToResultset(),
         OrderId = OrderFields.OrderId.Source("__BQ").ToValue <System.Int32>(),
         RequiredDate = OrderFields.RequiredDate.Source("__BQ").ToValue <Nullable <System.DateTime> >(),
         ShipAddress = OrderFields.ShipAddress.Source("__BQ").ToValue <System.String>(),
         ShipCity = OrderFields.ShipCity.Source("__BQ").ToValue <System.String>(),
         ShipCountry = OrderFields.ShipCountry.Source("__BQ").ToValue <System.String>(),
         ShipName = OrderFields.ShipName.Source("__BQ").ToValue <System.String>(),
         ShippedDate = OrderFields.ShippedDate.Source("__BQ").ToValue <Nullable <System.DateTime> >(),
         ShipPostalCode = OrderFields.ShipPostalCode.Source("__BQ").ToValue <System.String>(),
         ShipRegion = OrderFields.ShipRegion.Source("__BQ").ToValue <System.String>(),
         ShipVia = OrderFields.ShipVia.Source("__BQ").ToValue <Nullable <System.Int32> >(),
         // __LLBLGENPRO_USER_CODE_REGION_START ProjectionRegionQS_Order
         // __LLBLGENPRO_USER_CODE_REGION_END
     }, projectionAdjustments, false)));
 }
 private static System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.OrderDetailEntity, NWService.Dtos.DtoClasses.OrderDetail> > CreateProjectionFunc()
 {
     System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.OrderDetailEntity, NWService.Dtos.DtoClasses.OrderDetail> > mainProjection = p__0 => new NWService.Dtos.DtoClasses.OrderDetail()
     {
         Discount  = p__0.Discount,
         OrderId   = p__0.OrderId,
         ProductId = p__0.ProductId,
         Quantity  = p__0.Quantity,
         UnitPrice = p__0.UnitPrice,
         // __LLBLGENPRO_USER_CODE_REGION_START ProjectionRegion_OrderDetail
         // __LLBLGENPRO_USER_CODE_REGION_END
     };
     System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.OrderDetailEntity, NWService.Dtos.DtoClasses.OrderDetail> > projectionAdjustments = null;
     GetAdjustmentsForProjectToOrderDetail(ref projectionAdjustments);
     return(LinqUtils.MergeProjectionAdjustmentsIntoProjection(mainProjection, projectionAdjustments, true));
 }
 /// <summary>Extension method which produces a projection to NWService.Dtos.DtoClasses.OrderDetail which instances are projected from the
 /// results of the specified baseQuery using QuerySpec, which returns NWService.Dal.EntityClasses.OrderDetailEntity instances, the root entity of the derived element returned by this query.</summary>
 /// <param name="baseQuery">The base query to project the derived element instances from.</param>
 /// <param name="qf">The query factory used to create baseQuery.</param>
 /// <returns>DynamicQuery to retrieve NWService.Dtos.DtoClasses.OrderDetail instances</returns>
 public static DynamicQuery <NWService.Dtos.DtoClasses.OrderDetail> ProjectToOrderDetail(this EntityQuery <NWService.Dal.EntityClasses.OrderDetailEntity> baseQuery, NWService.Dal.FactoryClasses.QueryFactory qf)
 {
     System.Linq.Expressions.Expression <Func <NWService.Dtos.DtoClasses.OrderDetail> > projectionAdjustments = null;
     GetAdjustmentsForProjectToOrderDetailQs(ref projectionAdjustments);
     return(qf.Create()
            .From(baseQuery.Select(Projection.Full).As("__BQ"))
            .Select(LinqUtils.MergeProjectionAdjustmentsIntoProjection(() => new NWService.Dtos.DtoClasses.OrderDetail()
     {
         Discount = OrderDetailFields.Discount.Source("__BQ").ToValue <System.Single>(),
         OrderId = OrderDetailFields.OrderId.Source("__BQ").ToValue <System.Int32>(),
         ProductId = OrderDetailFields.ProductId.Source("__BQ").ToValue <System.Int32>(),
         Quantity = OrderDetailFields.Quantity.Source("__BQ").ToValue <System.Int16>(),
         UnitPrice = OrderDetailFields.UnitPrice.Source("__BQ").ToValue <System.Decimal>(),
         // __LLBLGENPRO_USER_CODE_REGION_START ProjectionRegionQS_OrderDetail
         // __LLBLGENPRO_USER_CODE_REGION_END
     }, projectionAdjustments, false)));
 }
 private static System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.CustomerEntity, NWService.Dtos.DtoClasses.Customer> > CreateProjectionFunc()
 {
     System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.CustomerEntity, NWService.Dtos.DtoClasses.Customer> > mainProjection = p__0 => new NWService.Dtos.DtoClasses.Customer()
     {
         Address      = p__0.Address,
         City         = p__0.City,
         CompanyName  = p__0.CompanyName,
         ContactName  = p__0.ContactName,
         ContactTitle = p__0.ContactTitle,
         Country      = p__0.Country,
         CustomerId   = p__0.CustomerId,
         Fax          = p__0.Fax,
         Phone        = p__0.Phone,
         PostalCode   = p__0.PostalCode,
         Region       = p__0.Region,
         // __LLBLGENPRO_USER_CODE_REGION_START ProjectionRegion_Customer
         // __LLBLGENPRO_USER_CODE_REGION_END
     };
     System.Linq.Expressions.Expression <Func <NWService.Dal.EntityClasses.CustomerEntity, NWService.Dtos.DtoClasses.Customer> > projectionAdjustments = null;
     GetAdjustmentsForProjectToCustomer(ref projectionAdjustments);
     return(LinqUtils.MergeProjectionAdjustmentsIntoProjection(mainProjection, projectionAdjustments, true));
 }
 /// <summary>Extension method which produces a projection to NWService.Dtos.DtoClasses.Customer which instances are projected from the
 /// results of the specified baseQuery using QuerySpec, which returns NWService.Dal.EntityClasses.CustomerEntity instances, the root entity of the derived element returned by this query.</summary>
 /// <param name="baseQuery">The base query to project the derived element instances from.</param>
 /// <param name="qf">The query factory used to create baseQuery.</param>
 /// <returns>DynamicQuery to retrieve NWService.Dtos.DtoClasses.Customer instances</returns>
 public static DynamicQuery <NWService.Dtos.DtoClasses.Customer> ProjectToCustomer(this EntityQuery <NWService.Dal.EntityClasses.CustomerEntity> baseQuery, NWService.Dal.FactoryClasses.QueryFactory qf)
 {
     System.Linq.Expressions.Expression <Func <NWService.Dtos.DtoClasses.Customer> > projectionAdjustments = null;
     GetAdjustmentsForProjectToCustomerQs(ref projectionAdjustments);
     return(qf.Create()
            .From(baseQuery.Select(Projection.Full).As("__BQ"))
            .Select(LinqUtils.MergeProjectionAdjustmentsIntoProjection(() => new NWService.Dtos.DtoClasses.Customer()
     {
         Address = CustomerFields.Address.Source("__BQ").ToValue <System.String>(),
         City = CustomerFields.City.Source("__BQ").ToValue <System.String>(),
         CompanyName = CustomerFields.CompanyName.Source("__BQ").ToValue <System.String>(),
         ContactName = CustomerFields.ContactName.Source("__BQ").ToValue <System.String>(),
         ContactTitle = CustomerFields.ContactTitle.Source("__BQ").ToValue <System.String>(),
         Country = CustomerFields.Country.Source("__BQ").ToValue <System.String>(),
         CustomerId = CustomerFields.CustomerId.Source("__BQ").ToValue <System.String>(),
         Fax = CustomerFields.Fax.Source("__BQ").ToValue <System.String>(),
         Phone = CustomerFields.Phone.Source("__BQ").ToValue <System.String>(),
         PostalCode = CustomerFields.PostalCode.Source("__BQ").ToValue <System.String>(),
         Region = CustomerFields.Region.Source("__BQ").ToValue <System.String>(),
         // __LLBLGENPRO_USER_CODE_REGION_START ProjectionRegionQS_Customer
         // __LLBLGENPRO_USER_CODE_REGION_END
     }, projectionAdjustments, false)));
 }