Exemple #1
0
 /// <summary>
 /// Create a new UsageCounter object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="month">Initial value of the Month property.</param>
 /// <param name="year">Initial value of the Year property.</param>
 /// <param name="requestCount">Initial value of the RequestCount property.</param>
 /// <param name="day">Initial value of the Day property.</param>
 public static UsageCounter CreateUsageCounter(global::System.Int32 id, global::System.Byte month, global::System.Int16 year, global::System.Int32 requestCount, global::System.Byte day)
 {
     UsageCounter usageCounter = new UsageCounter();
     usageCounter.Id = id;
     usageCounter.Month = month;
     usageCounter.Year = year;
     usageCounter.RequestCount = requestCount;
     usageCounter.Day = day;
     return usageCounter;
 }
Exemple #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the UsageCounter EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToUsageCounter(UsageCounter usageCounter)
 {
     base.AddObject("UsageCounter", usageCounter);
 }
Exemple #3
0
        private static bool IsValidCounter(UsageCounter uc)
        {
            var dtNow = DateTime.Now;
            var counterDate = new DateTime(uc.Year, uc.Month, uc.Day);

            return counterDate.AddDays(30) >= dtNow;
        }