Skip to content

Commit

Permalink
Remove CS8618
Browse files Browse the repository at this point in the history
  • Loading branch information
svrooij committed May 7, 2024
1 parent b4126ac commit efa0cd0
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,25 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0|AnyCPU'">
<WarningLevel>7</WarningLevel>
<NoWarn>1701;1702;CS8618</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0|AnyCPU'">
<WarningLevel>7</WarningLevel>
<NoWarn>1701;1702;CS8618</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net6.0|AnyCPU'">
<NoWarn>1701;1702;CS8618</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0|AnyCPU'">
<NoWarn>1701;1702;CS8618</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand All @@ -18,7 +32,7 @@
<ProjectReference Include="..\Winget.CommunityRepository\Winget.CommunityRepository.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' ">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.29">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
10 changes: 2 additions & 8 deletions src/Winget.CommunityRepository/Models/WingetEntry.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Winget.CommunityRepository.Models;
namespace Winget.CommunityRepository.Models;
public class WingetEntry
{
internal string? Name { get; set; }
public string PackageId { get; set; }
public string? PackageId { get; set; }
public string? Version { get; set; }
}
4 changes: 2 additions & 2 deletions src/Winget.CommunityRepository/WingetRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public WingetRepository(HttpClient? httpClient = null, ILogger<WingetRepository>
{
await LoadEntries(cancellationToken, false, cacheFile);

var entry = Entries!.FirstOrDefault(e => e.PackageId.Equals(packageId, StringComparison.OrdinalIgnoreCase));
var entry = Entries!.FirstOrDefault(e => e.PackageId!.Equals(packageId, StringComparison.OrdinalIgnoreCase));
return entry;
}

public async ValueTask<IEnumerable<Models.WingetEntry>> SearchPackage(string query, CancellationToken cancellationToken = default)
{
await LoadEntries(cancellationToken, false, cacheFile);

var results = Entries!.Where(e => e.Name?.Contains(query, StringComparison.OrdinalIgnoreCase) == true || e.PackageId.Contains(query, StringComparison.OrdinalIgnoreCase));
var results = Entries!.Where(e => e.Name?.Contains(query, StringComparison.OrdinalIgnoreCase) == true || e.PackageId!.Contains(query, StringComparison.OrdinalIgnoreCase));
return results;
}

Expand Down

0 comments on commit efa0cd0

Please sign in to comment.