Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Error on GetAll____ForLookupTable #8450


User avatar
0
rdcinformatics created

Hi,

we use ASP NET Zero Power tools to create our entities. All lookuptables crashes with errors because we see on all services generated code the below code

         var query = _lookup_yyyRepository.GetAll()
            .WhereIf(!string.IsNullOrWhiteSpace(input.Filter), e=> e.PropertyName1.ToString().Contains(input.Filter)|| e.PropertyName2.ToString().Contains(input.Filter));
            

which cannot run if propertyName1 or propertyName2 has value. PropertyName1, PropertyName2 are strings

AspNetZero version 8.0.0 PowerTools 2.1.1.1


1 Answer(s)
  • User Avatar
    0
    yekalkan created

    which cannot run if propertyName1 or propertyName2 has value

    did you mean "doesn't have value" ?

    I think we should make it (e.PropertyName1 != null ? e.PropertyName1.ToString() : "").Contains(input.Filter)

    Thanks for reporting