Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	isdayoff/Core/IsDayOffService.cs
#	isdayoff/IsDayOff.cs
#	isdayoff/isdayoff.csproj
  • Loading branch information
picolino committed Aug 12, 2022
2 parents 7c5fee9 + 90944f5 commit fdf9042
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
APP_NAME: isdayoff # set this to your application's name
APP_PACKAGE_PATH: './published' # set this to the path to your app project, defaults to the repository root
NETCORE_VERSION: '5.0.103' # set this to the .NET Core version to use
NETCORE_VERSION: '6.0.300' # set this to the .NET Core version to use
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} # set this to access token to github.com
GITHUB_API_KEY: ${{ github.token }} # set this to access token to github.com
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} # set this to access token to nuget.org
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-in.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check-in

env:
NETCORE_VERSION: '5.0.103' # set this to the .NET Core version to use
NETCORE_VERSION: '6.0.300' # set this to the .NET Core version to use
GITHUB_API_KEY: ${{ github.token }} # set this to access token to github.com

on:
Expand Down
2 changes: 1 addition & 1 deletion isdayoff.Tests/isdayoff.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
25 changes: 25 additions & 0 deletions isdayoff.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "isdayoff", "isdayoff\isdayo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "isdayoff.Tests", "isdayoff.Tests\isdayoff.Tests.csproj", "{76FCBEDF-FDE1-4C4D-83FB-B694423EA61A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{5BFE32FF-A5E6-430C-9FF8-EDE60337091C}"
ProjectSection(SolutionItems) = preProject
.github\CODE_OF_CONDUCT.md = .github\CODE_OF_CONDUCT.md
.github\funding.yml = .github\funding.yml
.github\PULL_REQUEST_TEMPLATE.md = .github\PULL_REQUEST_TEMPLATE.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{4A472E8A-FEA3-4E62-9DD6-F91A1B1F3E5E}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build-and-publish.yml = .github\workflows\build-and-publish.yml
.github\workflows\check-in.yml = .github\workflows\check-in.yml
.github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEMPLATE", "{4649628D-6A39-4A61-B364-63E42635B1A0}"
ProjectSection(SolutionItems) = preProject
.github\ISSUE_TEMPLATE\---bug-report.md = .github\ISSUE_TEMPLATE\---bug-report.md
.github\ISSUE_TEMPLATE\---feature-requests.md = .github\ISSUE_TEMPLATE\---feature-requests.md
.github\ISSUE_TEMPLATE\---questions-and-help.md = .github\ISSUE_TEMPLATE\---questions-and-help.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -19,4 +40,8 @@ Global
{76FCBEDF-FDE1-4C4D-83FB-B694423EA61A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76FCBEDF-FDE1-4C4D-83FB-B694423EA61A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4A472E8A-FEA3-4E62-9DD6-F91A1B1F3E5E} = {5BFE32FF-A5E6-430C-9FF8-EDE60337091C}
{4649628D-6A39-4A61-B364-63E42635B1A0} = {5BFE32FF-A5E6-430C-9FF8-EDE60337091C}
EndGlobalSection
EndGlobal
6 changes: 3 additions & 3 deletions isdayoff/Core/IsDayOffApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public async Task<GetDataApiResponse> GetDataAsync(
useShortDays,
treatNonWorkingDaysByCovidAsWorkingDayAdvanced,
useSixDaysWorkWeek,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

private async Task<GetDataApiResponse> GetDataInternalAsync(
Expand Down Expand Up @@ -80,8 +80,8 @@ private async Task<GetDataApiResponse> GetDataInternalAsync(
IsDayOff.Tracer.TraceEvent(TraceEventType.Information, TraceEventIds.Requesting.REQUEST_SENDING,
"Sending HTTP GET: '{0}'", requestUrl);

var response = await httpClient.GetAsync(requestUrl, cancellationToken);
var responseAsString = await response.Content.ReadAsStringAsync();
var response = await httpClient.GetAsync(requestUrl, cancellationToken).ConfigureAwait(false);
var responseAsString = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

IsDayOff.Tracer.TraceEvent(TraceEventType.Information, TraceEventIds.Requesting.REQUEST_SENT,
"Response received with status code: '{0}' and string content: '{1}'", response.StatusCode, responseAsString);
Expand Down
6 changes: 3 additions & 3 deletions isdayoff/Core/IsDayOffService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
IsDayOffGetDatesRangeArgs args,
CancellationToken cancellationToken)
{
var result = await cache.GetCachedDatesRangeOrDefault(args.From, args.To, args.Country, args.Region);
var result = await cache.GetCachedDatesRangeOrDefault(args.From, args.To, args.Country, args.Region).ConfigureAwait(false);

if (result is null)
{
Expand All @@ -37,11 +37,11 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
args.UseShortDays,
args.TreatNonWorkingDaysByCovidAsWorkingDayAdvanced,
args.UseSixDaysWorkWeek,
cancellationToken);
cancellationToken).ConfigureAwait(false);

result = GenerateDayOffDateTimeList(response.Result, args.From.ByDaysTill(args.To).ToList());

await cache.SaveDateRangeInCache(args.From, args.To, args.Country, args.Region, result);
await cache.SaveDateRangeInCache(args.From, args.To, args.Country, args.Region, result).ConfigureAwait(false);
}

return result;
Expand Down
46 changes: 23 additions & 23 deletions isdayoff/IsDayOff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public async Task<List<DayOffDateTime>> CheckYearAsync(int year)
{
return await CheckYearAsync(
year,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -87,7 +87,7 @@ public async Task<List<DayOffDateTime>> CheckYearAsync(
return await CheckYearAsync(
year,
settings.DefaultCountry,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -104,7 +104,7 @@ public async Task<List<DayOffDateTime>> CheckYearAsync(
return await CheckYearAsync(
year,
country,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -126,7 +126,7 @@ public async Task<List<DayOffDateTime>> CheckYearAsync(
yearDateTime,
yearDateTime.EndOfYear(),
country,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -143,7 +143,7 @@ public async Task<List<DayOffDateTime>> CheckMonthAsync(
return await CheckMonthAsync(
year,
month,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -163,7 +163,7 @@ public async Task<List<DayOffDateTime>> CheckMonthAsync(
year,
month,
settings.DefaultCountry,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -183,7 +183,7 @@ public async Task<List<DayOffDateTime>> CheckMonthAsync(
year,
month,
country,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -207,7 +207,7 @@ public async Task<List<DayOffDateTime>> CheckMonthAsync(
monthDateTime,
monthDateTime.EndOfMonth(),
country,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -227,7 +227,7 @@ public async Task<DayType> CheckDayAsync(
year,
month,
day,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -250,7 +250,7 @@ public async Task<DayType> CheckDayAsync(
month,
day,
settings.DefaultCountry,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -261,7 +261,7 @@ public async Task<DayType> CheckDayAsync(
/// <exception cref="IsDayOffExternalServiceException">Throws if error occured while processing request to isdayoff external service</exception>
public async Task<DayType> CheckDayAsync(DateTime day)
{
return await CheckDayAsync(day, CancellationToken.None);
return await CheckDayAsync(day, CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -278,7 +278,7 @@ public async Task<DayType> CheckDayAsync(
return await CheckDayAsync(
day,
settings.DefaultCountry,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -295,7 +295,7 @@ public async Task<DayType> CheckDayAsync(
return await CheckDayAsync(
day,
country,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -316,7 +316,7 @@ public async Task<DayType> CheckDayAsync(
day.Month,
day.Day,
country,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -339,7 +339,7 @@ public async Task<DayType> CheckDayAsync(
month,
day,
country,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -365,7 +365,7 @@ public async Task<DayType> CheckDayAsync(
dayDateTime,
dayDateTime,
country,
cancellationToken);
cancellationToken).ConfigureAwait(false);
return result.Single().DayType;
}

Expand All @@ -383,7 +383,7 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
return await CheckDatesRangeAsync(
from,
to,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -403,7 +403,7 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
from,
to,
settings.DefaultCountry,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -423,7 +423,7 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
from,
to,
country,
CancellationToken.None);
CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -449,7 +449,7 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
settings.UseShortDays,
settings.TreatNonWorkingDaysByCovidAsWorkingDayAdvanced,
settings.UseSixDaysWorkWeek,
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand Down Expand Up @@ -516,7 +516,7 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
useShortDays,
treatNonWorkingDaysByCovidAsWorkingDayAdvanced,
useSixDaysWorkWeek),
cancellationToken);
cancellationToken).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -527,7 +527,7 @@ public async Task<List<DayOffDateTime>> CheckDatesRangeAsync(
/// <exception cref="IsDayOffExternalServiceException">Throws if error occured while processing request to isdayoff external service</exception>
public async Task<List<DayOffDateTime>> CheckAsync(IsDayOffGetDatesRangeArgs args)
{
return await CheckAsync(args, CancellationToken.None);
return await CheckAsync(args, CancellationToken.None).ConfigureAwait(false);
}

/// <summary>
Expand All @@ -541,7 +541,7 @@ public async Task<List<DayOffDateTime>> CheckAsync(
IsDayOffGetDatesRangeArgs args,
CancellationToken cancellationToken)
{
return await service.CheckDatesRangeAsync(args, cancellationToken);
return await service.CheckDatesRangeAsync(args, cancellationToken).ConfigureAwait(false);
}
}
}
6 changes: 3 additions & 3 deletions isdayoff/isdayoff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyVersion>1.5</AssemblyVersion>
<PackageVersion>1.5</PackageVersion>
<AssemblyVersion>1.6</AssemblyVersion>
<PackageVersion>1.6</PackageVersion>
<Title>isdayoff</Title>
<Authors>Danila Chervonny (contact@picolino.dev)</Authors>
<Description>IsDayOff is a .NET library for API isdayoff service (https://isdayoff.ru/)</Description>
<Copyright>Danila Chervonny, Copyright © 2022 MIT</Copyright>
<PackageTags>IsDayOff, Date, Time, DateTime, Daily, IsWorkday, Holidays</PackageTags>
<FileVersion>1.5</FileVersion>
<FileVersion>1.6</FileVersion>
<PackageProjectUrl>https://isdayoff.ru/</PackageProjectUrl>
<license>MIT</license>
<RepositoryUrl>https://github.com/picolino/isdayoff</RepositoryUrl>
Expand Down

0 comments on commit fdf9042

Please sign in to comment.