forums.asp.net forums.asp.net

Problem in JsonConvert.SerializeObject to serialize list of entities to TempData.

Hi I have a main problem which i created in thread (please read it before this thread). Anyway, After a lot of digging & debugging my code, I Think the problem is related to serializing lstPackageDetails to TempData via this method : private void SetPackageDetailsList(List<DefaultVisitProductDetails> lstPackageDetails) { TempData["_lstPackageDetails"] = JsonConvert.SerializeObject(lstPackageDetails,...

forums.asp.net forums.asp.net

The property 'JobTitle' is not a navigation property of entity type 'Job'. The 'Include(string)' method can only be used with a '.' separated list of navigation property names.

I am attempting to read related data across three tables in ASP.NET CORE MVC 2.2 with Entity Framework Core. To be more specific I am using this tutorial to build my project https://docs.microsoft.com/en-us/aspnet/core/data/ef-mvc/read-related-data?view=aspnetcore-2.2. I am using Eager Loading to read Job.JobTitle all the way from the Problem Index method. Reading this I realize I want to find where Problem navigation property that...

forums.asp.net forums.asp.net

How to load Navigation Properties in a generic method

I would like to read data from a DB context and eagerly load the navigation properties.  My code successfully does this: List<Peoplemvc> ap = await _context.People.Include(x => x.Links).ToListAsync(); The model I'm using is this [Table("peoplemvc")] public partial class Peoplemvc { [Key] [Column(TypeName = "int(11)")] public int PersonNumber { get; set; } [Display(Name...

forums.asp.net forums.asp.net

Bind certain properties of the navigation properties inside my action method

I have the following 2 model classes:- public Submission() { SubmissionQuestionSubmission = new HashSet<SubmissionQuestionSubmission>(); } public int Id { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string Npi { get; set; } public bool Independent { get; set; } public string Comment { get; set; } ...