I am working with Entity Framework code-first and ASP.NET MVC in C#. I have a table:
public class Project
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
[Required]
public DateTime CreationDate{ get; set; }
[Required]
public DateTime EndDate { get; set; }
[Required]
public bool Active{ get; set; }
}
My question is, given the above fields, how do I update the Active
field, after the EndDate
passed?
For instance, the end date is 08/04/2018 and today is 08/05/2018, then Active=false.
Please take into account that performance is important in this case. Each user creates a project that other users can see.
Thank you.