Switching to dotnet5 w/ C#9

This commit is contained in:
Zoe Roux
2021-01-24 22:26:23 +01:00
parent f8546ebf64
commit 8e72b37950
5 changed files with 12 additions and 9 deletions
+4 -2
View File
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net5.0</TargetFramework>
<AssemblyName>Kyoo.CommonApi</AssemblyName>
<RootNamespace>Kyoo.CommonApi</RootNamespace>
<PackageId>Kyoo.CommonApi</PackageId>
<Authors>AnonymusRaccoon</Authors>
<Authors>Zoe Roux</Authors>
<RepositoryUrl>https://github.com/AnonymusRaccoon/Kyoo</RepositoryUrl>
<OutputType>Library</OutputType>
<LangVersion>default</LangVersion>
</PropertyGroup>
<ItemGroup>
+1 -1
View File
@@ -234,7 +234,7 @@ namespace Kyoo.Controllers
&& !typeof(string).IsAssignableFrom(x.PropertyType)))
{
object value = property.GetValue(resource);
if (value == null || value is ICollection || Utility.IsOfType(value, typeof(ICollection<>)))
if (value == null || value is ICollection || Utility.IsOfGenericType(value, typeof(ICollection<>)))
continue;
value = Utility.RunGenericMethod(typeof(Enumerable), "ToList", Utility.GetEnumerableType((IEnumerable)value), value);
property.SetValue(resource, value);