Skip to content

Move TimeZone instance property of AtataContext to AtataContext.GlobalProperties #823

Description

@YevgeniyShunevych

Having a TimeZone as an instance property of AtataContext is wrong, as time zone should be the same for all the contexts, thus it should not be configured within regular AtataContext configuration, which can be different for tests.
Such global properties starting v3 are now located in AtataContext.GlobalProperties.

AtataContext.GlobalProperties time zone related members:

/// <summary>
/// Gets or sets the time zone.
/// The default value is <see cref="TimeZoneInfo.Local"/>.
/// </summary>
public TimeZoneInfo TimeZone { get; set; }

/// <summary>
/// Sets the UTC time zone.
/// </summary>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseUtcTimeZone();

/// <summary>
/// Sets the time zone by identifier, which corresponds to the <see cref="TimeZoneInfo.Id"/> property.
/// </summary>
/// <param name="timeZoneId">The time zone identifier.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseTimeZone(string timeZoneId);

/// <summary>
/// Sets the time zone.
/// </summary>
/// <param name="timeZone">The time zone.</param>
/// <returns>The same <see cref="AtataContextGlobalProperties"/> instance.</returns>
public AtataContextGlobalProperties UseTimeZone(TimeZoneInfo timeZone);

Old AtataContextBuilder time zone configurational methods are marked as obsolete.

Activity

  1. added this to the 3.0.0 milestone on Feb 17, 2024
  2. added a commit that references this issue on Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions