Answer the question
In order to leave comments, you need to log in
Loading related data does not work, how to solve?
I have code
// подключил
using IslandCity.Models;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using IslandCity.App_Data;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using Microsoft.EntityFrameworkCore;
User user = db.Users
.Include(context => context.Lands)
.ThenInclude(land => land.Card)
.Include(context => context.Cards)
.FirstOrDefault(u => u.Name == accountName);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question