Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions eventz-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Build results
bin/
obj/
out/
publish/
artifacts/

## Visual Studio files
.vs/

## Rider files
.idea/

## VS Code settings
.vscode/

## User-specific files
*.user
*.userosscache
*.suo
*.sln.docstates

## Logs
*.log

## Temporary files
*.tmp
*.temp
*.tmp.*
*.backup
*.bak

## NuGet
*.nupkg
*.snupkg
.nuget/
packages/

## Azure
*.azurePubxml
*.pubxml
*.publishproj

## ASP.NET Scaffolding
ScaffoldingReadMe.txt

## Resharper
_ReSharper*/
*.[Rr]e[Ss]harper

## DotCover
*.dotCover

## Coverage reports
coverage/
*.coverage
*.coveragexml

## Others
node_modules/
wwwroot/lib/
48 changes: 48 additions & 0 deletions eventz-api/eventz-api.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.14.36408.4
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eventz.api", "eventz.api\eventz.api.csproj", "{DF28F22E-A6EF-4308-AB2F-A175121273D8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eventz.application", "eventz.application\eventz.application.csproj", "{AC4781AE-874C-44DC-9974-FCB075ED4A6E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eventz.domain", "eventz.domain\eventz.domain.csproj", "{5C3DA3B1-F35A-4696-906A-39E1DC25391B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eventz.infrastructure", "eventz.infrastructure\eventz.infrastructure.csproj", "{14A23E1B-72FD-4727-BFD8-B839E201261D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DF28F22E-A6EF-4308-AB2F-A175121273D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF28F22E-A6EF-4308-AB2F-A175121273D8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF28F22E-A6EF-4308-AB2F-A175121273D8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF28F22E-A6EF-4308-AB2F-A175121273D8}.Release|Any CPU.Build.0 = Release|Any CPU
{AC4781AE-874C-44DC-9974-FCB075ED4A6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC4781AE-874C-44DC-9974-FCB075ED4A6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC4781AE-874C-44DC-9974-FCB075ED4A6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC4781AE-874C-44DC-9974-FCB075ED4A6E}.Release|Any CPU.Build.0 = Release|Any CPU
{5C3DA3B1-F35A-4696-906A-39E1DC25391B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5C3DA3B1-F35A-4696-906A-39E1DC25391B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5C3DA3B1-F35A-4696-906A-39E1DC25391B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5C3DA3B1-F35A-4696-906A-39E1DC25391B}.Release|Any CPU.Build.0 = Release|Any CPU
{14A23E1B-72FD-4727-BFD8-B839E201261D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14A23E1B-72FD-4727-BFD8-B839E201261D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14A23E1B-72FD-4727-BFD8-B839E201261D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14A23E1B-72FD-4727-BFD8-B839E201261D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {57BF6152-CF7D-433F-A7BD-B3C91AFBE91D}
EndGlobalSection
EndGlobal
62 changes: 62 additions & 0 deletions eventz-api/eventz.api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
## Build results
bin/
obj/
out/
publish/
artifacts/

## Visual Studio files
.vs/
eventz-api/.vs

## Rider files
.idea/

## VS Code settings
.vscode/

## User-specific files
*.user
*.userosscache
*.suo
*.sln.docstates

## Logs
*.log

## Temporary files
*.tmp
*.temp
*.tmp.*
*.backup
*.bak

## NuGet
*.nupkg
*.snupkg
.nuget/
packages/

## Azure
*.azurePubxml
*.pubxml
*.publishproj

## ASP.NET Scaffolding
ScaffoldingReadMe.txt

## Resharper
_ReSharper*/
*.[Rr]e[Ss]harper

## DotCover
*.dotCover

## Coverage reports
coverage/
*.coverage
*.coveragexml

## Others
node_modules/
wwwroot/lib/
33 changes: 33 additions & 0 deletions eventz-api/eventz.api/Controllers/WeatherForecastController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using Microsoft.AspNetCore.Mvc;

namespace eventz.api.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};

private readonly ILogger<WeatherForecastController> _logger;

public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}

[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateOnly.FromDateTime(DateTime.Now.AddDays(index)),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
}
25 changes: 25 additions & 0 deletions eventz-api/eventz.api/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var builder = WebApplication.CreateBuilder(args);

// Add services to the container.

builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();

var app = builder.Build();

// Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}

app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();

app.Run();
41 changes: 41 additions & 0 deletions eventz-api/eventz.api/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:59645",
"sslPort": 44349
}
},
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5156",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7106;http://localhost:5156",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
13 changes: 13 additions & 0 deletions eventz-api/eventz.api/WeatherForecast.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace eventz.api
{
public class WeatherForecast
{
public DateOnly Date { get; set; }

public int TemperatureC { get; set; }

public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);

public string? Summary { get; set; }
}
}
8 changes: 8 additions & 0 deletions eventz-api/eventz.api/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
}
}
9 changes: 9 additions & 0 deletions eventz-api/eventz.api/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}
13 changes: 13 additions & 0 deletions eventz-api/eventz.api/eventz.api.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

</Project>
6 changes: 6 additions & 0 deletions eventz-api/eventz.api/eventz.api.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@eventz.api_HostAddress = http://localhost:5156

GET {{eventz.api_HostAddress}}/weatherforecast/
Accept: application/json

###
61 changes: 61 additions & 0 deletions eventz-api/eventz.application/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
## Build results
bin/
obj/
out/
publish/
artifacts/

## Visual Studio files
.vs/

## Rider files
.idea/

## VS Code settings
.vscode/

## User-specific files
*.user
*.userosscache
*.suo
*.sln.docstates

## Logs
*.log

## Temporary files
*.tmp
*.temp
*.tmp.*
*.backup
*.bak

## NuGet
*.nupkg
*.snupkg
.nuget/
packages/

## Azure
*.azurePubxml
*.pubxml
*.publishproj

## ASP.NET Scaffolding
ScaffoldingReadMe.txt

## Resharper
_ReSharper*/
*.[Rr]e[Ss]harper

## DotCover
*.dotCover

## Coverage reports
coverage/
*.coverage
*.coveragexml

## Others
node_modules/
wwwroot/lib/
Loading