Base solution for your next web application
Open Closed

Repository Get Method Exception on NULL Values #9086


User avatar
0
SEB_ADMIN created

The repository Get methods throw exception whenever a varchar field is NULLABLE and has NULL values. I have to replace them with empty strings all the time. Is this a problem with ZERO Repository framework ? Should it not handle NULL values.

"Operation Not allowed on NULL Values" is the error message I get on any Repository.Get(primary key) methods if it has NULL values.


3 Answer(s)
  • User Avatar
    0
    musa.demir created

    Here is how it works. It works in that way by desing.

  • User Avatar
    0
    SEB_ADMIN created

    This is not when Entity is not there for a primary key ( say Id for value 2.)

    If the entity has varchar column that is NULLABLE and if NULL value exists in that column, It throws the following error.

    "Operation Not allowed on NULL Values"

    but the Entity record is present for the given primary key.

    It looks like Abp is not checking NULL values before converting/casting to a String.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @SEB_ADMIN,

    Could you share;

    1. Your entity defintion
    2. name of the column/field which contains null value
    3. And sample code for getting this error.
    4. Entire exception message

    Thanks,