diff --git a/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/GraphPresenter.cs b/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/GraphPresenter.cs index 930d27d..5fa1a3c 100644 --- a/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/GraphPresenter.cs +++ b/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/GraphPresenter.cs @@ -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(); + request.QueryOptions = QueryOptions?.Select(option => (Microsoft.Graph.QueryOption)option)?.ToList() ?? new List(); // Handle Special QueryOptions if (!string.IsNullOrWhiteSpace(OrderBy)) diff --git a/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/QueryOption.cs b/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/QueryOption.cs index ff05eb3..bce6e8f 100644 --- a/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/QueryOption.cs +++ b/Microsoft.Toolkit.Graph.Controls/Controls/GraphPresenter/QueryOption.cs @@ -23,12 +23,12 @@ public sealed class QueryOption public string Value { get; set; } /// - /// Constructs a value representing this proxy. + /// Implicit conversion for to . /// - /// result. - public Microsoft.Graph.QueryOption ToQueryOption() + /// query option to convert + 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); } } } diff --git a/SampleTest/MainPage.xaml.cs b/SampleTest/MainPage.xaml.cs index 174e225..428741f 100644 --- a/SampleTest/MainPage.xaml.cs +++ b/SampleTest/MainPage.xaml.cs @@ -16,10 +16,10 @@ namespace SampleTest /// 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() @@ -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", " "); } @@ -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; } }