I have entity framework project and I want to reset the value when the day is changed, or tomorrow the value will reset into 0. I have two tables name Goal and Calculation. Goal table has goalId, calorieToday, and calorieGoal and Calculation table has goalId, date, and amount. I want to reset calorieToday and amount when the day is changed and it works on background. So when user open again the application for tomorrow, calorieToday and amount values will became 0.
This is inside of GoalDataContext:
public DbSet<Goal> Goals { get; set; }
public DbSet<Calculation> Calculations { get; set; }
Edit: What I want is erase all value of calorieToday when day is changes. Everyday, the calorieToday value is became 0 after changes the day. The goalId from Goal is Primary key and also the foreign key for Calculation