Database is not fetching data. Applied everything properly.
I am sending data from postman. Method is receiving data but when comparing data send by client and from data. It is not showing any data. See customer and card var. both are null. I don't know why data is not fetching from database. There is no any error.
35 Replies
You sure the customer with those values exists?
.FirstOrDefaultAsync()
returns null
if there's no entry matching the predicateI have data in Database
I am sending data through Postman which is available in Database.
Is account number a unique value?
Yes
can you join meet?
Is it then not unnecessary to also check for birthdate and crn
Okay. I am just trying to make it realistic
meet ? in vc
yes
So I can share my screen
im in vc2
Oh
Sorry
I don't know why it is not fetching the data
well if account number is a unique value use that for fetching and make sure it exists in db
Okay
lemme chect it just a sc
No, Account number is not unique
only customerid is unique
can u use that in your dto
Yes
No. I am not using CustomerId anywhere
so what is the meaning of account number then if its not a unique value
Actually, I have created method to assign unique account number
Will First or default not work if accountNumber is not unique?
It will
the code you wrote is correct and it will work if the values exist
I just think using things like birthdate for querying users is not what you want
Look at the database and see if a row with this data exists
lemme show you
Account number is present
brithdate
You're querying by CRN, AccountNumber, and Birthdate
With
&&
between themYeah
2000-11-11
birthday account has an ID that ends with a 1
And CRN
that ends with a 1
Account with those values does not exist
Is it the reason of it?
Uh, yeah?
"Give me an account with birthday of
a
, account number of b
, and crn of c
" you tell the database
"No such thing exists", the database replies
Because, indeed, no such account existsgot it
I'll try and come back again.
Thanks, you a lot of friend.
You solved my so big problem
No problem
You made my day
Unknown User•2w ago
Message Not Public
Sign In & Join Server To View
If you have no further questions, please use /close to mark the forum thread as answered
How to do this?
Close post?