KooriByte
KooriByte
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
I'll read the links you sent to understand this better
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
Well, I'll close this. You both saved my day, thank you so much for helping 😄
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
oh, I'm sorry, I forgot to add the await
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
I can put .Result after the user, but I think it makes it synchronous the same way
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
if I take the Result off
_context.Entry(user)
.Collection(b => b.People)
.Load();
_context.Entry(user)
.Collection(b => b.People)
.Load();
stop working because b turns into a Task<ApplicationUser>
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
I used the .Result after, VS was screaming with me if I didn't use it
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
IT WORKED
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
do I need to put .Result after .GetUserAsync(User)?
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
yes, this was in a link you sent previously. Problem was that I couldn't make it work too :c ApplicationUsers appeared null in this case
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
ApplicationUsers was null
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
it is like this
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
var userWithPeople = _context.ApplicationUsers.Include(x => x.People).FirstOrDefault(x => x.Id == user.Id) ;
var userWithPeople = _context.ApplicationUsers.Include(x => x.People).FirstOrDefault(x => x.Id == user.Id) ;
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
the line bellow was the other attempt to correct this
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
yep
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
this is way out of my current knowledge level, it's really frustrating sometimes
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
well, I think I'll try another solution
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
noooo, was half way into it already
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
do you know if there is another approach for this? I still couldn't make it work
85 replies
CC#
Created by KooriByte on 2/5/2023 in #help
✅ Collection appears to be null, even though it's not null on DB
oh, thank you, I'll read it
85 replies