Base solution for your next web application
Open Closed

7.7.2 RAD Tool in entity GetAll server method, is using manual db to dto object mapping not objectmapper. Why the change in approach? #7707


User avatar
0
AidanCostcoAU created

Just starting a migration to 7.7.2, and looking at our custom RAD tool template merges, and noticed the change in usage of the ObjectMapper. Interested in the reason for the change, so we can decide whether we will follow this in our custom template.


5 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Can you share your screenshots to explain your problem?

  • User Avatar
    0
    AidanCostcoAU created

    It looks like GetAll and Get....ToExcel have similar changes

    This is how a snippet of code looks in our custom 6.8 GetAll server code looks today (which uses ObjectMapper):

        var results = (from o in selectedGIFuelTransactionTrackings
                         select new GetGIFuelTransactionTrackingForViewDto() { GIFuelTransactionTracking = ObjectMapper.Map<GIFuelTransactionTrackingDto>(o)
    					 
    					 })
              
    

    This is a similar part of the code generated in 7.2.2, which shows the field by field mapping:

    var giFuelTransactionTrackings = from o in pagedAndFilteredGIFuelTransactionTrackings
                         select new GetGIFuelTransactionTrackingForViewDto() {
    						GIFuelTransactionTracking = new GIFuelTransactionTrackingDto
    						{
                                SourceTran = o.SourceTran,
                                Location = o.Location,
                                ValidationStatus = o.ValidationStatus,
                                TranSeqStatus = o.TranSeqStatus,
                                FCCSeqStatus = o.FCCSeqStatus,
                                PreAuthAmtStatus = o.PreAuthAmtStatus,
                                STANStatus = o.STANStatus,
                                SiteIdStatus = o.SiteIdStatus,
                                PumpStatus = o.PumpStatus,
                                HoseStatus = o.HoseStatus,
                                GradeStatus = o.GradeStatus,
                                PriceStatus = o.PriceStatus,
                                VolumeStatus = o.VolumeStatus,
                                SaleAmtStatus = o.SaleAmtStatus,
                                SaleMathStatus = o.SaleMathStatus,
                                MemberIdStatus = o.MemberIdStatus,
                                PANStatus = o.PANStatus,
                                Annotation = o.Annotation,
                                Updated = o.Updated,
                                FuelSystemType = o.FuelSystemType,
                                Id = o.Id
    						}
    					};                         
         
         
    
  • User Avatar
    0
    AidanCostcoAU created

    Looking at our checkin history the change to the base AppServiceClass MainTemplate.txt appeared around July.

  • User Avatar
    0
    maliming created
    Support Team

    see https://github.com/aspnetzero/aspnet-zero-core/issues/2387

  • User Avatar
    0
    AidanCostcoAU created

    thanks for that We haven't seen that particular error (yet), but will follow your changes to be safe.