0
0
mirror of https://github.com/alex289/CleanArchitecture.git synced 2025-06-30 02:31:08 +00:00

fix: json deserializing

This commit is contained in:
Alexander Konietzko 2023-09-01 17:03:48 +02:00
parent e29cb8d860
commit 71a36a0905
No known key found for this signature in database
GPG Key ID: BA6905F37AEC2B5B
4 changed files with 30 additions and 14 deletions

View File

@ -8,6 +8,7 @@
<ItemGroup>
<PackageReference Include="AspNetCore.HealthChecks.ApplicationStatus" Version="7.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.Redis" Version="7.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="7.0.0" />
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="7.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.10" />

View File

@ -18,7 +18,7 @@ public sealed class TenantViewModel
{
Id = tenant.Id,
Name = tenant.Name,
Users = tenant.Users.Select(UserViewModel.FromUser)
Users = tenant.Users.Select(UserViewModel.FromUser).ToList()
};
}
}

View File

@ -7,6 +7,7 @@ namespace CleanArchitecture.Application.ViewModels.Users;
public sealed class UserViewModel
{
public Guid Id { get; set; }
public Guid TenantId { get; set; }
public string Email { get; set; } = string.Empty;
public string FirstName { get; set; } = string.Empty;
public string LastName { get; set; } = string.Empty;
@ -18,6 +19,7 @@ public sealed class UserViewModel
return new UserViewModel
{
Id = user.Id,
TenantId = user.TenantId,
Email = user.Email,
FirstName = user.FirstName,
LastName = user.LastName,

View File

@ -38,6 +38,19 @@ To run the project, follow these steps:
### Using docker
Requirements
> This is only needed if running the API locally or only the docker image
1. Redis: `docker run --name redis -d -p 6379:6379 -e ALLOW_EMPTY_PASSWORD=yes redis:latest`
2. Add this to the redis configuration in the Program.cs
```csharp
options.ConfigurationOptions = new ConfigurationOptions
{
AbortOnConnectFail = false,
EndPoints = { "localhost", "6379" }
};
```
Running the container
1. Build the Dockerfile: `docker build -t clean-architecture .`
2. Run the Container: `docker run -p 80:80 clean-architecture`