How to save user data to List in ASP.Net Core

We need to register a new training course in the system. Save the Course Name, Course Price and Lesson List into the database. The number of lessons for each course is different, so the user will dynamically add fields to enter the name of each lesson. How to get the data entered by the user from the fields and save them to the list, and subsequently to the database?

Foreach loop not looping through checkbox list asp .net

I am trying to read a list of values that exist in a SQL database and if the value exists, it needs to check a checkbox in a checkbox list. At the moment, I can read the values of a specific employee but when I try to loop through the checkbox list, it skips it completely. I can add a new data entry by checking items perfectly but it’s only reading that is causing issues:

Can’t login after adding configure application cookies

I’m developing Asp.Net Core 3.1 MVC web application with Identity. My login page works fine but after adding the services.ConfigureApplicationCookie it not worked as expected and it keeps redirecting me to my local index. I can’t figure out what really happen. If I comment this block, everything works as expected.