Skip to content

Commit

Permalink
Added HQ.Abstractions project for common models.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmaffitsancsoft committed Apr 9, 2024
1 parent 94eee8d commit 6c332f0
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 4 deletions.
9 changes: 9 additions & 0 deletions src/dotnet/HQ.Abstractions/HQ.Abstractions.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace HQ.Server;
namespace HQ.Abstractions;

public class WeatherForecast
{
Expand Down
4 changes: 4 additions & 0 deletions src/dotnet/HQ.SDK/HQ.SDK.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\HQ.Abstractions\HQ.Abstractions.csproj" />
</ItemGroup>

</Project>
8 changes: 5 additions & 3 deletions src/dotnet/HQ.SDK/TestApiService.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using HQ.Abstractions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Json;
using System.Text;
using System.Threading.Tasks;

Expand All @@ -15,9 +17,9 @@ public TestApiService(HttpClient httpClient)
_httpClient = httpClient;
}

public async Task<string> GetWeatherForecastAsync()
public async Task<List<WeatherForecast>?> GetWeatherForecastAsync()
{
return await _httpClient.GetStringAsync("/v1/weather-forecast");
return await _httpClient.GetFromJsonAsync<List<WeatherForecast>>("/v1/weather-forecast");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Asp.Versioning;
using HQ.Abstractions;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

Expand Down
4 changes: 4 additions & 0 deletions src/dotnet/HQ.Server/HQ.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@
<PackageReference Include="Swashbuckle.AspNetCore.Filters" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\HQ.Abstractions\HQ.Abstractions.csproj" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions src/dotnet/HQ.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HQ.CLI", "HQ.CLI\HQ.CLI.csp
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HQ.SDK", "HQ.SDK\HQ.SDK.csproj", "{8BE654C4-9AAC-499D-BDAC-33A99A1CC089}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HQ.Abstractions", "HQ.Abstractions\HQ.Abstractions.csproj", "{D0253812-BD5E-4764-8813-D73B083C72DE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -38,6 +40,10 @@ Global
{8BE654C4-9AAC-499D-BDAC-33A99A1CC089}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8BE654C4-9AAC-499D-BDAC-33A99A1CC089}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8BE654C4-9AAC-499D-BDAC-33A99A1CC089}.Release|Any CPU.Build.0 = Release|Any CPU
{D0253812-BD5E-4764-8813-D73B083C72DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D0253812-BD5E-4764-8813-D73B083C72DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D0253812-BD5E-4764-8813-D73B083C72DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D0253812-BD5E-4764-8813-D73B083C72DE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 6c332f0

Please sign in to comment.