Ejemplo n.º 1
0
 private static void GetDateKinds(TableDefinition main, TableDefinition changes, TableDefinition tableDefinition)
 {
     foreach (var dateField in main.LocalDates.Concat(main.UtcDates).Concat(changes.LocalDates).Concat(changes.UtcDates).Distinct())
     {
         if (changes.LocalDates.Contains(dateField))
         {
             tableDefinition.SetDateType(dateField, DateTimeKind.Local);
         }
         else if (changes.UtcDates.Contains(dateField))
         {
             tableDefinition.SetDateType(dateField, DateTimeKind.Utc);
         }
         else if (main.LocalDates.Contains(dateField))
         {
             tableDefinition.SetDateType(dateField, DateTimeKind.Local);
         }
         else if (main.UtcDates.Contains(dateField))
         {
             tableDefinition.SetDateType(dateField, DateTimeKind.Utc);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Define that a field contains a UTC date. This is only useful on unpredictable date fields, but it allows the field to be tagged as a "mid-test" timestamp. The collection
 /// needs to know how to handle the date values for this feature to work. You can apply this setting to any field, but it will have no effect unless the field is an
 /// unpredictable date that has its value set to the current time.
 /// </summary>
 /// <param name="fieldName">The field name</param>
 public TableDefiner Utc(string fieldName)
 {
     _tableDefinition.SetDateType(fieldName, DateTimeKind.Utc);
     return(this);
 }