Skip to content

Commit

Permalink
Rider cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
BorisGerretzen committed Aug 31, 2024
1 parent 990100c commit 8d7bd65
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 146 deletions.
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
# WeerLive.Net

WeerLive.Net is a library for the Dutch weather service [WeerLive](https://weerlive.nl/delen.php).
This library provides the following features:

- Get the live weather for a location
- Get the weather forecast for the coming 24 hours for a location
- Get the weather forecast for the coming 5 days for a location

The location can be either a city name or latitude and longitude coordinates.

## Usage
Here you can see a simple example of how to use the library combined with the Microsoft.Extensions.DependencyInjection library.
This example can also be found in the [example project](https://github.com/BorisGerretzen/WeerLive.Net/tree/main/src/WeerLive.Example).

Here you can see a simple example of how to use the library combined with the Microsoft.Extensions.DependencyInjection
library.
This example can also be found in
the [example project](https://github.com/BorisGerretzen/WeerLive.Net/tree/main/src/WeerLive.Example).

```csharp
var builder = Host.CreateDefaultBuilder(args);
Expand All @@ -34,6 +39,7 @@ logger.LogInformation("Today in Amsterdam: {Temperature}°C with a RH of {Humidi
```

And without dependency injection:

```csharp
var httpClient = new HttpClient();
var options = new WeerLiveOptions
Expand All @@ -53,5 +59,8 @@ Console.WriteLine($"Today in Amsterdam: {forecast.LiveWeather.Temperature}°C wi
```

## API key
To use the WeerLive API, you need an API key. You can get a free API key by registering on the [WeerLive website](https://weerlive.nl/delen.php).
With an API key you can make up to 300 requests per day. In the responses you can find how many requests you have left for the day.

To use the WeerLive API, you need an API key. You can get a free API key by registering on
the [WeerLive website](https://weerlive.nl/delen.php).
With an API key you can make up to 300 requests per day. In the responses you can find how many requests you have left
for the day.
1 change: 0 additions & 1 deletion build/Build.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Linq;
using Nuke.Common;
using Nuke.Common.CI.GitHubActions;
Expand Down
13 changes: 4 additions & 9 deletions build/Configuration.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
using System;
using System.ComponentModel;
using System.Linq;
using Nuke.Common.Tooling;

[TypeConverter(typeof(TypeConverter<Configuration>))]
public class Configuration : Enumeration
{
public static Configuration Debug = new Configuration { Value = nameof(Debug) };
public static Configuration Release = new Configuration { Value = nameof(Release) };
public static Configuration Debug = new() { Value = nameof(Debug) };
public static Configuration Release = new() { Value = nameof(Release) };

public static implicit operator string(Configuration configuration)
{
return configuration.Value;
}
}
public static implicit operator string(Configuration configuration) => configuration.Value;
}
6 changes: 3 additions & 3 deletions build/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- This file prevents unintended imports of unrelated MSBuild files -->
<!-- Uncomment to include parent Directory.Build.props file -->
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />-->
<!-- This file prevents unintended imports of unrelated MSBuild files -->
<!-- Uncomment to include parent Directory.Build.props file -->
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />-->

</Project>
6 changes: 3 additions & 3 deletions build/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

<!-- This file prevents unintended imports of unrelated MSBuild files -->
<!-- Uncomment to include parent Directory.Build.targets file -->
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />-->
<!-- This file prevents unintended imports of unrelated MSBuild files -->
<!-- Uncomment to include parent Directory.Build.targets file -->
<!--<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />-->

</Project>
32 changes: 16 additions & 16 deletions build/_build.csproj
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace></RootNamespace>
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
<NukeRootDirectory>..</NukeRootDirectory>
<NukeScriptDirectory>..</NukeScriptDirectory>
<NukeTelemetryVersion>1</NukeTelemetryVersion>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Common" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Nuke.Common" Version="8.0.0"/>
</ItemGroup>

<ItemGroup>
<PackageDownload Include="GitVersion.Tool" Version="[6.0.2]" />
</ItemGroup>
<ItemGroup>
<PackageDownload Include="GitVersion.Tool" Version="[6.0.2]"/>
</ItemGroup>

</Project>
12 changes: 6 additions & 6 deletions src/WeerLive.Example/WeerLive.Example.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\WeerLive.Lib\WeerLive.Lib.csproj" />
<ProjectReference Include="..\WeerLive.Lib\WeerLive.Lib.csproj"/>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0"/>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0"/>
</ItemGroup>

<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/WeerLive.Lib/DependencyInjectionExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
using WeerLive.Lib.Client;

namespace WeerLive.Lib;
Expand Down
4 changes: 2 additions & 2 deletions src/WeerLive.Lib/WeerLive.Lib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<PackageTags>weer, weerlive, weersvoorspelling</PackageTags>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE">
<Pack>True</Pack>
Expand All @@ -24,7 +24,7 @@
<PackagePath>\</PackagePath>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0"/>
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/WeerLive.Test/WeerLive.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.0"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/>
<PackageReference Include="Moq" Version="4.20.70" />
<PackageReference Include="Moq" Version="4.20.70"/>
<PackageReference Include="NUnit" Version="3.14.0"/>
<PackageReference Include="NUnit.Analyzers" Version="3.9.0"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0"/>
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0"/>
</ItemGroup>

<ItemGroup>
<Using Include="NUnit.Framework"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\WeerLive.Lib\WeerLive.Lib.csproj" />
<ProjectReference Include="..\WeerLive.Lib\WeerLive.Lib.csproj"/>
</ItemGroup>

</Project>
Loading

0 comments on commit 8d7bd65

Please sign in to comment.