Я использую «Asp.Net Core 2.0» и установил пакет nuget «Microsoft.EntityFrameworkCore» версии «3.0.0-preview5.19227.1», когда я хочу использовать функции IQuarable, я получаю вышеуказанную ошибку.
public partial class Wfuser
{
public Wfuser()
{
UserRole = new HashSet<UserRole>();
}
public int IdUser { get; set; }
public string FullName { get; set; }
public string UserName { get; set; }
public virtual Userauth Userauth { get; set; }
public virtual ICollection<UserRole> UserRole { get; set; }
}
public class NormalUser : IUser
{
public string UserName { get; set; }
public string Password { get; set; }
public NormalUser(string UserName, string Password)
{
this.UserName = UserName;
this.Password = Password;
}
public Wfuser CurrentWFUSER { get; set; }
public string ErrorMessage { get; set; }
ITTMSContext db;
public bool IsAuthenticated { get; set; }
public UserProfile Profile { get; set; }
public bool Authenticate()
{
db = new ITTMSContext();
CurrentWFUSER = db.Wfuser.FirstOrDefault(u => u.UserName == UserName);
int idUser = CurrentWFUSER.IdUser;
}
}
Полное сообщение об ошибке:
'Невозможно определить отношение, представленное свойством навигации' JToken.Parent 'типа' JContainer '.Либо настройте отношение вручную, либо игнорируйте это свойство с помощью атрибута [NotMapped] или с помощью EntityTypeBuilder.Ignore в OnModelCreating.