diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca08c63 --- /dev/null +++ b/.gitignore @@ -0,0 +1,438 @@ +# Created by https://www.toptal.com/developers/gitignore/api/linux,visualstudiocode,csharp,dotnetcore +# Edit at https://www.toptal.com/developers/gitignore?templates=linux,visualstudiocode,csharp,dotnetcore + +### Csharp ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml + +### DotnetCore ### +# .NET Core build folders +bin/ +obj/ + +# Common node modules locations +/node_modules +/wwwroot/node_modules + +### Linux ### + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### VisualStudioCode ### +!.vscode/*.code-snippets + +# Local History for Visual Studio Code + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/linux,visualstudiocode,csharp,dotnetcore \ No newline at end of file diff --git a/CleanArchitecture.sln b/CleanArchitecture.sln new file mode 100644 index 0000000..d2c4219 --- /dev/null +++ b/CleanArchitecture.sln @@ -0,0 +1,67 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CleanArchitecture", "CleanArchitecture", "{A4BCB43D-8D6A-4978-A2F7-D7D7EB520575}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{10EE58A6-F3CC-4648-9413-3AE2C4BBE0B6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArchitecture.Domain", "CleanArchitecture\Core\CleanArchitecture.Domain\CleanArchitecture.Domain.csproj", "{E8827D07-D9B4-44EF-95D8-170BB231B549}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArchitecture.Aplication", "CleanArchitecture\Core\CleanArchitecture.Aplication\CleanArchitecture.Aplication.csproj", "{766F5657-CC7E-497B-8FBF-9BAD0D39762D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{2EDDD49C-B01C-4005-BD6C-972F57D0C264}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArchitecture.Persistence", "CleanArchitecture\Infrastructure\CleanArchitecture.Persistence\CleanArchitecture.Persistence.csproj", "{38D17CA3-EC03-4F3C-8CB5-FF7CBD348A31}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Presentation", "Presentation", "{CB63D658-3245-440D-9860-E735BDE9BEF9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArchitecture.API", "CleanArchitecture\Presentation\CleanArchitecture.API\CleanArchitecture.API.csproj", "{69ECBB8F-80BB-4862-9357-51A35C2D363E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{3584D67B-E7B8-4D97-8167-3398D05923FD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CleanArchitecture.Tests", "CleanArchitecture\Test\CleanArchitecture.Tests\CleanArchitecture.Tests.csproj", "{9AF52972-03E5-4F6F-A084-D88CE42C47DE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E8827D07-D9B4-44EF-95D8-170BB231B549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E8827D07-D9B4-44EF-95D8-170BB231B549}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E8827D07-D9B4-44EF-95D8-170BB231B549}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E8827D07-D9B4-44EF-95D8-170BB231B549}.Release|Any CPU.Build.0 = Release|Any CPU + {766F5657-CC7E-497B-8FBF-9BAD0D39762D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {766F5657-CC7E-497B-8FBF-9BAD0D39762D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {766F5657-CC7E-497B-8FBF-9BAD0D39762D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {766F5657-CC7E-497B-8FBF-9BAD0D39762D}.Release|Any CPU.Build.0 = Release|Any CPU + {38D17CA3-EC03-4F3C-8CB5-FF7CBD348A31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {38D17CA3-EC03-4F3C-8CB5-FF7CBD348A31}.Debug|Any CPU.Build.0 = Debug|Any CPU + {38D17CA3-EC03-4F3C-8CB5-FF7CBD348A31}.Release|Any CPU.ActiveCfg = Release|Any CPU + {38D17CA3-EC03-4F3C-8CB5-FF7CBD348A31}.Release|Any CPU.Build.0 = Release|Any CPU + {69ECBB8F-80BB-4862-9357-51A35C2D363E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {69ECBB8F-80BB-4862-9357-51A35C2D363E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {69ECBB8F-80BB-4862-9357-51A35C2D363E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {69ECBB8F-80BB-4862-9357-51A35C2D363E}.Release|Any CPU.Build.0 = Release|Any CPU + {9AF52972-03E5-4F6F-A084-D88CE42C47DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9AF52972-03E5-4F6F-A084-D88CE42C47DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9AF52972-03E5-4F6F-A084-D88CE42C47DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9AF52972-03E5-4F6F-A084-D88CE42C47DE}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {10EE58A6-F3CC-4648-9413-3AE2C4BBE0B6} = {A4BCB43D-8D6A-4978-A2F7-D7D7EB520575} + {E8827D07-D9B4-44EF-95D8-170BB231B549} = {10EE58A6-F3CC-4648-9413-3AE2C4BBE0B6} + {766F5657-CC7E-497B-8FBF-9BAD0D39762D} = {10EE58A6-F3CC-4648-9413-3AE2C4BBE0B6} + {2EDDD49C-B01C-4005-BD6C-972F57D0C264} = {A4BCB43D-8D6A-4978-A2F7-D7D7EB520575} + {38D17CA3-EC03-4F3C-8CB5-FF7CBD348A31} = {2EDDD49C-B01C-4005-BD6C-972F57D0C264} + {CB63D658-3245-440D-9860-E735BDE9BEF9} = {A4BCB43D-8D6A-4978-A2F7-D7D7EB520575} + {69ECBB8F-80BB-4862-9357-51A35C2D363E} = {CB63D658-3245-440D-9860-E735BDE9BEF9} + {3584D67B-E7B8-4D97-8167-3398D05923FD} = {A4BCB43D-8D6A-4978-A2F7-D7D7EB520575} + {9AF52972-03E5-4F6F-A084-D88CE42C47DE} = {3584D67B-E7B8-4D97-8167-3398D05923FD} + EndGlobalSection +EndGlobal diff --git a/CleanArchitecture/Core/CleanArchitecture.Aplication/CleanArchitecture.Aplication.csproj b/CleanArchitecture/Core/CleanArchitecture.Aplication/CleanArchitecture.Aplication.csproj new file mode 100644 index 0000000..cfadb03 --- /dev/null +++ b/CleanArchitecture/Core/CleanArchitecture.Aplication/CleanArchitecture.Aplication.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/CleanArchitecture/Core/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj b/CleanArchitecture/Core/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj new file mode 100644 index 0000000..cfadb03 --- /dev/null +++ b/CleanArchitecture/Core/CleanArchitecture.Domain/CleanArchitecture.Domain.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/CleanArchitecture/Core/CleanArchitecture.Domain/Entities/BaseEntity.cs b/CleanArchitecture/Core/CleanArchitecture.Domain/Entities/BaseEntity.cs new file mode 100644 index 0000000..472263d --- /dev/null +++ b/CleanArchitecture/Core/CleanArchitecture.Domain/Entities/BaseEntity.cs @@ -0,0 +1,7 @@ +namespace CleanArchitecture.Domain.Entities; +public abstract class BaseEntity { + public Guid Id { get; set; } + public DateTimeOffset DateCreated { get; set; } + public DateTimeOffset? DateUpdated { get; set; } + public DateTimeOffset? DateDeleted { get; set; } +} diff --git a/CleanArchitecture/Core/CleanArchitecture.Domain/Entities/User.cs b/CleanArchitecture/Core/CleanArchitecture.Domain/Entities/User.cs new file mode 100644 index 0000000..a77db11 --- /dev/null +++ b/CleanArchitecture/Core/CleanArchitecture.Domain/Entities/User.cs @@ -0,0 +1,7 @@ +namespace CleanArchitecture.Domain.Entities; + +public sealed class User : BaseEntity +{ + public string? Email { get; set; } + public string? Name { get; set; } +} \ No newline at end of file diff --git a/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IBaseRepository.cs b/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IBaseRepository.cs new file mode 100644 index 0000000..ce2d122 --- /dev/null +++ b/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IBaseRepository.cs @@ -0,0 +1,12 @@ +using CleanArchitecture.Domain.Entities; + +namespace CleanArchitecture.Domain.Interfaces; + +public interface IBaseRepository where T : BaseEntity +{ + void Create(T entity); + void Update(T entity); + void Delete(T entity); + Task Get(Guid id, CancellationToken cancellationToken); + Task> GetAll(CancellationToken cancellationToken); +} \ No newline at end of file diff --git a/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IUnitOfWork.cs b/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IUnitOfWork.cs new file mode 100644 index 0000000..8c83ef1 --- /dev/null +++ b/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IUnitOfWork.cs @@ -0,0 +1,6 @@ +namespace CleanArchitecture.Domain.Interfaces; + +public interface IUnitOfWork +{ + Task Commit(CancellationToken cancellationToken); +} \ No newline at end of file diff --git a/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IUserRepository.cs b/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IUserRepository.cs new file mode 100644 index 0000000..df76b55 --- /dev/null +++ b/CleanArchitecture/Core/CleanArchitecture.Domain/Interfaces/IUserRepository.cs @@ -0,0 +1,8 @@ +using CleanArchitecture.Domain.Entities; + +namespace CleanArchitecture.Domain.Interfaces; + +public interface IUserRepository : IBaseRepository +{ + Task GetByEmail(string email, CancellationToken cancellationToken); +} \ No newline at end of file diff --git a/CleanArchitecture/Infrastructure/CleanArchitecture.Persistence/CleanArchitecture.Persistence.csproj b/CleanArchitecture/Infrastructure/CleanArchitecture.Persistence/CleanArchitecture.Persistence.csproj new file mode 100644 index 0000000..cfadb03 --- /dev/null +++ b/CleanArchitecture/Infrastructure/CleanArchitecture.Persistence/CleanArchitecture.Persistence.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/CleanArchitecture/Presentation/CleanArchitecture.API/CleanArchitecture.API.csproj b/CleanArchitecture/Presentation/CleanArchitecture.API/CleanArchitecture.API.csproj new file mode 100644 index 0000000..6ab232c --- /dev/null +++ b/CleanArchitecture/Presentation/CleanArchitecture.API/CleanArchitecture.API.csproj @@ -0,0 +1,14 @@ + + + + net7.0 + enable + enable + + + + + + + + diff --git a/CleanArchitecture/Presentation/CleanArchitecture.API/Controllers/WeatherForecastController.cs b/CleanArchitecture/Presentation/CleanArchitecture.API/Controllers/WeatherForecastController.cs new file mode 100644 index 0000000..2b0c587 --- /dev/null +++ b/CleanArchitecture/Presentation/CleanArchitecture.API/Controllers/WeatherForecastController.cs @@ -0,0 +1,32 @@ +using Microsoft.AspNetCore.Mvc; + +namespace CleanArchitecture.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 _logger; + + public WeatherForecastController(ILogger logger) + { + _logger = logger; + } + + [HttpGet(Name = "GetWeatherForecast")] + public IEnumerable 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(); + } +} diff --git a/CleanArchitecture/Presentation/CleanArchitecture.API/Program.cs b/CleanArchitecture/Presentation/CleanArchitecture.API/Program.cs new file mode 100644 index 0000000..48863a6 --- /dev/null +++ b/CleanArchitecture/Presentation/CleanArchitecture.API/Program.cs @@ -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(); diff --git a/CleanArchitecture/Presentation/CleanArchitecture.API/Properties/launchSettings.json b/CleanArchitecture/Presentation/CleanArchitecture.API/Properties/launchSettings.json new file mode 100644 index 0000000..6848bee --- /dev/null +++ b/CleanArchitecture/Presentation/CleanArchitecture.API/Properties/launchSettings.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:11167", + "sslPort": 44392 + } + }, + "profiles": { + "http": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "http://localhost:5147", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "launchUrl": "swagger", + "applicationUrl": "https://localhost:7067;http://localhost:5147", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/CleanArchitecture/Presentation/CleanArchitecture.API/WeatherForecast.cs b/CleanArchitecture/Presentation/CleanArchitecture.API/WeatherForecast.cs new file mode 100644 index 0000000..f12a3a8 --- /dev/null +++ b/CleanArchitecture/Presentation/CleanArchitecture.API/WeatherForecast.cs @@ -0,0 +1,12 @@ +namespace CleanArchitecture.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; } +} diff --git a/CleanArchitecture/Presentation/CleanArchitecture.API/appsettings.Development.json b/CleanArchitecture/Presentation/CleanArchitecture.API/appsettings.Development.json new file mode 100644 index 0000000..0c208ae --- /dev/null +++ b/CleanArchitecture/Presentation/CleanArchitecture.API/appsettings.Development.json @@ -0,0 +1,8 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + } +} diff --git a/CleanArchitecture/Presentation/CleanArchitecture.API/appsettings.json b/CleanArchitecture/Presentation/CleanArchitecture.API/appsettings.json new file mode 100644 index 0000000..10f68b8 --- /dev/null +++ b/CleanArchitecture/Presentation/CleanArchitecture.API/appsettings.json @@ -0,0 +1,9 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft.AspNetCore": "Warning" + } + }, + "AllowedHosts": "*" +} diff --git a/CleanArchitecture/Test/CleanArchitecture.Tests/CleanArchitecture.Tests.csproj b/CleanArchitecture/Test/CleanArchitecture.Tests/CleanArchitecture.Tests.csproj new file mode 100644 index 0000000..86a36ef --- /dev/null +++ b/CleanArchitecture/Test/CleanArchitecture.Tests/CleanArchitecture.Tests.csproj @@ -0,0 +1,24 @@ + + + + net7.0 + enable + enable + + false + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/CleanArchitecture/Test/CleanArchitecture.Tests/UnitTest1.cs b/CleanArchitecture/Test/CleanArchitecture.Tests/UnitTest1.cs new file mode 100644 index 0000000..1db2235 --- /dev/null +++ b/CleanArchitecture/Test/CleanArchitecture.Tests/UnitTest1.cs @@ -0,0 +1,10 @@ +namespace CleanArchitecture.Tests; + +public class UnitTest1 +{ + [Fact] + public void Test1() + { + + } +} \ No newline at end of file diff --git a/CleanArchitecture/Test/CleanArchitecture.Tests/Usings.cs b/CleanArchitecture/Test/CleanArchitecture.Tests/Usings.cs new file mode 100644 index 0000000..8c927eb --- /dev/null +++ b/CleanArchitecture/Test/CleanArchitecture.Tests/Usings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file