Skip to content

Commit

Permalink
Merge pull request #14 from microsoft/feature/downgradeRuntime
Browse files Browse the repository at this point in the history
Changes target runtime to netstandard2.0
  • Loading branch information
andrueastman authored Apr 12, 2022
2 parents 0bc68bd + 9641ae7 commit 6872c32
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 6 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

## [1.0.0-preview.5] - 2022-04-12

### Changed

- Breaking: Changes target runtime to netstandard2.0

## [1.0.0-preview.4] - 2022-04-06

### Added
Expand Down
1 change: 1 addition & 0 deletions src/ApiClientBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System;
using System.Linq;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using Microsoft.Kiota.Abstractions.Store;

Expand Down
6 changes: 3 additions & 3 deletions src/Microsoft.Kiota.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<AssemblyTitle>Kiota Abstractions Library for dotnet</AssemblyTitle>
<Authors>Microsoft</Authors>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>latest</LangVersion>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryUrl>https://github.com/microsoft/kiota-abstractions-dotnet</RepositoryUrl>
<PackageProjectUrl>https://microsoft.github.io/kiota/</PackageProjectUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<Deterministic>true</Deterministic>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>preview.4</VersionSuffix>
<VersionSuffix>preview.5</VersionSuffix>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<SignAssembly>false</SignAssembly>
<DelaySign>false</DelaySign>
Expand All @@ -23,7 +23,7 @@
<!-- Enable this line once we go live to prevent breaking changes -->
<!-- <PackageValidationBaselineVersion>1.0.0</PackageValidationBaselineVersion> -->
<PackageReleaseNotes>
- Adds support for query parameters name attribute.
- [Breaking] Change target runtime to netstandard 2.0
</PackageReleaseNotes>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
Expand Down
1 change: 1 addition & 0 deletions src/RequestInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Kiota.Abstractions.Extensions;
using Microsoft.Kiota.Abstractions.Serialization;
using Tavis.UriTemplates;

Expand Down
42 changes: 42 additions & 0 deletions src/extensions/IDictionaryExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;

namespace Microsoft.Kiota.Abstractions.Extensions
{
/// <summary>
/// Extension methods for the <see cref="IDictionary"/>
/// </summary>
public static class IDictionaryExtensions
{
/// <summary>
/// Try to add the element to the <see cref="IDictionary"/> instance.
/// </summary>
/// <typeparam name="TKey"> The type of the key</typeparam>
/// <typeparam name="TValue">The type of the value</typeparam>
/// <param name="dictionary">The dictionary to add to.</param>
/// <param name="key">The key parameter.</param>
/// <param name="value">The value</param>
/// <returns>True or False based on whether the item is added successfully</returns>
public static bool TryAdd<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key, TValue value)
{
if(dictionary == null)
{
throw new ArgumentNullException(nameof(dictionary));
}

if(!dictionary.ContainsKey(key))
{
dictionary.Add(key, value);
return true;
}

return false;
}

}
}
2 changes: 1 addition & 1 deletion src/extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public static class StringExtensions
/// <param name="input">The string to lowercase.</param>
/// <returns>The input string with the first letter lowered.</returns>
public static string ToFirstCharacterLowerCase(this string input)
=> string.IsNullOrEmpty(input) ? input : $"{char.ToLowerInvariant(input[0])}{input[1..]}";
=> string.IsNullOrEmpty(input) ? input : $"{char.ToLowerInvariant(input[0])}{input.Substring(1)}";
}
}
2 changes: 1 addition & 1 deletion src/serialization/ParseNodeFactoryRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public IParseNode GetRootParseNode(string contentType, Stream content)
throw new ArgumentNullException(nameof(contentType));
_ = content ?? throw new ArgumentNullException(nameof(content));

var vendorSpecificContentType = contentType.Split(";", StringSplitOptions.RemoveEmptyEntries).First();
var vendorSpecificContentType = contentType.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).First();
if(ContentTypeAssociatedFactories.ContainsKey(vendorSpecificContentType))
return ContentTypeAssociatedFactories[vendorSpecificContentType].GetRootParseNode(vendorSpecificContentType, content);

Expand Down
2 changes: 1 addition & 1 deletion src/serialization/SerializationWriterFactoryRegistry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public ISerializationWriter GetSerializationWriter(string contentType)
if(string.IsNullOrEmpty(contentType))
throw new ArgumentNullException(nameof(contentType));

var vendorSpecificContentType = contentType.Split(";", StringSplitOptions.RemoveEmptyEntries).First();
var vendorSpecificContentType = contentType.Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries).First();
if(ContentTypeAssociatedFactories.ContainsKey(vendorSpecificContentType))
return ContentTypeAssociatedFactories[vendorSpecificContentType].GetSerializationWriter(vendorSpecificContentType);

Expand Down
1 change: 1 addition & 0 deletions src/store/InMemoryBackingStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Kiota.Abstractions.Extensions;

namespace Microsoft.Kiota.Abstractions.Store
{
Expand Down

0 comments on commit 6872c32

Please sign in to comment.