EF Core 2.1 (using Razor Pages)
I have a table, model and Razor Crud Pages to create new Examination schedules.
The db table and model has a foreign key ID to an Examination Dates table and model, which in turn contains key dates that require adding/updating to an Exam schedule at various stages of the Exam cycle. All these Dates are nullable.
When creating a new Exam schedule, the only field which would (maybe) need to be set is the scheduled date, just this one of 7 dates in the table.
My question is in two parts:
1) How do I create an empty (instantiated but with all nulls) ExaminationDates entry and then attach it's new auto-generated primary key to the Examination Schedule foreign key when the Exam schedule is created? I presume the LinQ sql will be automatic when the models and navigation properties are done correctly, so I don't want to worry about that yet.
2) How do I add a Scheduled date datepicker to the Examination schedule? I only need one, for this scheduled date. All the other dates will be automatically updated at various stages of the course of an examination, which again I think I can do with LinQ easily enough.
I am wondering about having a navigation property on the Examination for this scheduled date. I'm also worrying about Page Models, which i only partially understand. It's easy to do crud with single lookup drop-down values but with a table / model containing a whole load of dates, how would this work? I've been coding C# for many years but I'm new to EF Core and Entity Framework. As is usual in life, I've read hundreds of pages but none seem to replicate what I need to do.
Any help would be appreciated.
What I have tried:
I've tried reading all sorts of different pages.