Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-hawker committed Aug 11, 2020
1 parent 3cc9ec3 commit f012a4e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private async void GraphPresenter_Loaded(object sender, RoutedEventArgs e)
RequestBuilder.RequestUrl,
RequestBuilder.Client); // TODO: Do we need separate Options here?
request.Method = "GET";
request.QueryOptions = QueryOptions?.Select(option => option.ToQueryOption())?.ToList() ?? new List<Microsoft.Graph.QueryOption>();
request.QueryOptions = QueryOptions?.Select(option => (Microsoft.Graph.QueryOption)option)?.ToList() ?? new List<Microsoft.Graph.QueryOption>();

// Handle Special QueryOptions
if (!string.IsNullOrWhiteSpace(OrderBy))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ public sealed class QueryOption
public string Value { get; set; }

/// <summary>
/// Constructs a <see cref="Microsoft.Graph.QueryOption"/> value representing this proxy.
/// Implicit conversion for <see cref="QueryOption"/> to <see cref="Microsoft.Graph.QueryOption"/>.
/// </summary>
/// <returns><see cref="Microsoft.Graph.QueryOption"/> result.</returns>
public Microsoft.Graph.QueryOption ToQueryOption()
/// <param name="option">query option to convert</param>
public static implicit operator Microsoft.Graph.QueryOption(QueryOption option)
{
return new Microsoft.Graph.QueryOption(Name, Value);
return new Microsoft.Graph.QueryOption(option.Name, option.Value);
}
}
}
12 changes: 6 additions & 6 deletions SampleTest/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ namespace SampleTest
/// </summary>
public sealed partial class MainPage : Page
{
//// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2407
// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2407
public DateTime Today => DateTimeOffset.Now.Date.ToUniversalTime();

//// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2407
// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2407
public DateTime ThreeDaysFromNow => Today.AddDays(3);

public MainPage()
Expand All @@ -29,19 +29,19 @@ public MainPage()

public static string ToLocalTime(DateTimeTimeZone value)
{
//// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2407
// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2407
return value.ToDateTimeOffset().LocalDateTime.ToString("g");
}

public static string ToLocalTime(DateTimeOffset? value)
{
//// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2654
// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2654
return value?.LocalDateTime.ToString("g");
}

public static string RemoveWhitespace(string value)
{
//// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2654
// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/2654
return Regex.Replace(value, @"\t|\r|\n", " ");
}

Expand All @@ -52,7 +52,7 @@ public static bool IsTaskCompleted(int? percentCompleted)

public static IBaseRequestBuilder GetTeamsChannelMessagesBuilder(string team, string channel)
{
//// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/3064
// Workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/3064
return ProviderManager.Instance.GlobalProvider.Graph.Teams[team].Channels[channel].Messages;
}
}
Expand Down

0 comments on commit f012a4e

Please sign in to comment.