Cache management refinement
This commit is contained in:
@@ -20,6 +20,25 @@ namespace MP.Stats.Data
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inizializzazione con periodo e arrotondamento
|
||||
/// </summary>
|
||||
/// <param name="minRound"></param>
|
||||
/// <param name="numDayPrev"></param>
|
||||
/// <returns></returns>
|
||||
public static SelectData Init(int minRound, int numDayPrev)
|
||||
{
|
||||
TimeSpan DayElapsed = DateTime.Now.Subtract(DateTime.Today);
|
||||
int minDay = (int)(DayElapsed.TotalMinutes / minRound) * minRound;
|
||||
DateTime endRounded = DateTime.Today.AddMinutes(minDay);
|
||||
SelectData answ = new SelectData()
|
||||
{
|
||||
DateEnd = endRounded,
|
||||
DateStart = endRounded.AddDays(-numDayPrev)
|
||||
};
|
||||
return answ;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
{
|
||||
if (!(obj is SelectData item))
|
||||
|
||||
Reference in New Issue
Block a user