├── .gitignore ├── Layer.Architecture.Application ├── Controllers │ └── UserController.cs ├── Layer.Architecture.Application.csproj ├── Models │ ├── CreateUserModel.cs │ ├── UpdateUserModel.cs │ └── UserModel.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── appsettings.Development.json └── appsettings.json ├── Layer.Architecture.Domain ├── Entities │ ├── BaseEntity.cs │ └── User.cs ├── Interfaces │ ├── IBaseRepository.cs │ └── IBaseService.cs └── Layer.Architecture.Domain.csproj ├── Layer.Architecture.Infra.CrossCutting └── Layer.Architecture.Infra.CrossCutting.csproj ├── Layer.Architecture.Infra.Data ├── Context │ └── MySqlContext.cs ├── Layer.Architecture.Infra.Data.csproj ├── Mapping │ └── UserMap.cs ├── Migrations │ ├── 20210305191608_InitialVersion.Designer.cs │ ├── 20210305191608_InitialVersion.cs │ └── MySqlContextModelSnapshot.cs └── Repository │ └── BaseRepository.cs ├── Layer.Architecture.Service ├── Layer.Architecture.Service.csproj ├── Services │ └── BaseService.cs └── Validators │ └── UserValidator.cs ├── Layer.Architecture.sln ├── README.md └── images ├── add_controller.jpeg ├── add_folders.jpeg ├── api_empty.jpeg ├── architecture.png ├── asp_net_core_app.jpeg ├── asp_net_webapi.jpeg ├── blank_solution.png ├── data_layer.jpeg ├── domain_layer.jpeg ├── folders.jpeg ├── layers.jpeg ├── net_core_class_lib.jpeg └── service_layer.jpeg /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Controllers/UserController.cs: -------------------------------------------------------------------------------- 1 | using Layer.Architecture.Application.Models; 2 | using Layer.Architecture.Domain.Entities; 3 | using Layer.Architecture.Domain.Interfaces; 4 | using Layer.Architecture.Service.Validators; 5 | using Microsoft.AspNetCore.Mvc; 6 | using System; 7 | 8 | namespace Layer.Architecture.Application.Controllers 9 | { 10 | [Route("api/[controller]")] 11 | [ApiController] 12 | public class UserController : ControllerBase 13 | { 14 | private IBaseService _baseUserService; 15 | 16 | public UserController(IBaseService baseUserService) 17 | { 18 | _baseUserService = baseUserService; 19 | } 20 | 21 | [HttpPost] 22 | public IActionResult Create([FromBody] CreateUserModel user) 23 | { 24 | if (user == null) 25 | return NotFound(); 26 | 27 | return Execute(() => _baseUserService.Add(user)); 28 | } 29 | 30 | [HttpPut] 31 | public IActionResult Update([FromBody] UpdateUserModel user) 32 | { 33 | if (user == null) 34 | return NotFound(); 35 | 36 | return Execute(() => _baseUserService.Update(user)); 37 | } 38 | 39 | [HttpDelete("{id}")] 40 | public IActionResult Delete(int id) 41 | { 42 | if (id == 0) 43 | return NotFound(); 44 | 45 | Execute(() => 46 | { 47 | _baseUserService.Delete(id); 48 | return true; 49 | }); 50 | 51 | return new NoContentResult(); 52 | } 53 | 54 | [HttpGet] 55 | public IActionResult Get() 56 | { 57 | return Execute(() => _baseUserService.Get()); 58 | } 59 | 60 | [HttpGet("{id}")] 61 | public IActionResult Get(int id) 62 | { 63 | if (id == 0) 64 | return NotFound(); 65 | 66 | return Execute(() => _baseUserService.GetById(id)); 67 | } 68 | 69 | private IActionResult Execute(Func func) 70 | { 71 | try 72 | { 73 | var result = func(); 74 | 75 | return Ok(result); 76 | } 77 | catch (Exception ex) 78 | { 79 | return BadRequest(ex); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Layer.Architecture.Application.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | all 11 | runtime; build; native; contentfiles; analyzers; buildtransitive 12 | 13 | 14 | all 15 | runtime; build; native; contentfiles; analyzers; buildtransitive 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Models/CreateUserModel.cs: -------------------------------------------------------------------------------- 1 | namespace Layer.Architecture.Application.Models 2 | { 3 | public class CreateUserModel 4 | { 5 | public string Name { get; set; } 6 | 7 | public string Email { get; set; } 8 | 9 | public string Password { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Models/UpdateUserModel.cs: -------------------------------------------------------------------------------- 1 | namespace Layer.Architecture.Application.Models 2 | { 3 | public class UpdateUserModel : UserModel 4 | { 5 | 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Models/UserModel.cs: -------------------------------------------------------------------------------- 1 | namespace Layer.Architecture.Application.Models 2 | { 3 | public class UserModel 4 | { 5 | public int Id { get; set; } 6 | 7 | public string Name { get; set; } 8 | 9 | public string Email { get; set; } 10 | 11 | public string Password { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace Layer.Architecture.Application 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:57519", 8 | "sslPort": 44384 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "api/user", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "Layer.Architecture.Application": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "api/user", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/Startup.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using Layer.Architecture.Application.Models; 3 | using Layer.Architecture.Domain.Entities; 4 | using Layer.Architecture.Domain.Interfaces; 5 | using Layer.Architecture.Infra.Data.Context; 6 | using Layer.Architecture.Infra.Data.Repository; 7 | using Layer.Architecture.Service.Services; 8 | using Microsoft.AspNetCore.Builder; 9 | using Microsoft.AspNetCore.Hosting; 10 | using Microsoft.EntityFrameworkCore; 11 | using Microsoft.Extensions.Configuration; 12 | using Microsoft.Extensions.DependencyInjection; 13 | using Microsoft.Extensions.Hosting; 14 | 15 | namespace Layer.Architecture.Application 16 | { 17 | public class Startup 18 | { 19 | public Startup(IConfiguration configuration) 20 | { 21 | Configuration = configuration; 22 | } 23 | 24 | public IConfiguration Configuration { get; } 25 | 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddControllers(); 29 | 30 | services.AddDbContext(options => 31 | { 32 | var server = Configuration["database:mysql:server"]; 33 | var port = Configuration["database:mysql:port"]; 34 | var database = Configuration["database:mysql:database"]; 35 | var username = Configuration["database:mysql:username"]; 36 | var password = Configuration["database:mysql:password"]; 37 | 38 | options.UseMySql($"Server={server};Port={port};Database={database};Uid={username};Pwd={password}", opt => 39 | { 40 | opt.CommandTimeout(180); 41 | opt.EnableRetryOnFailure(5); 42 | }); 43 | }); 44 | 45 | services.AddScoped, BaseRepository>(); 46 | services.AddScoped, BaseService>(); 47 | 48 | services.AddSingleton(new MapperConfiguration(config => 49 | { 50 | config.CreateMap(); 51 | config.CreateMap(); 52 | config.CreateMap(); 53 | }).CreateMapper()); 54 | } 55 | 56 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 57 | { 58 | if (env.IsDevelopment()) 59 | { 60 | app.UseDeveloperExceptionPage(); 61 | } 62 | 63 | app.UseHttpsRedirection(); 64 | 65 | app.UseRouting(); 66 | 67 | app.UseAuthorization(); 68 | 69 | app.UseEndpoints(endpoints => 70 | { 71 | endpoints.MapControllers(); 72 | }); 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Layer.Architecture.Application/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*", 10 | "database": { 11 | "mysql": { 12 | "server": "db4free.net", 13 | "port": 3306, 14 | "database": "aurora_api_proj", 15 | "username": "aurora_api_proj", 16 | "password": "12345678" 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Layer.Architecture.Domain/Entities/BaseEntity.cs: -------------------------------------------------------------------------------- 1 | namespace Layer.Architecture.Domain.Entities 2 | { 3 | public abstract class BaseEntity 4 | { 5 | public virtual int Id { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Layer.Architecture.Domain/Entities/User.cs: -------------------------------------------------------------------------------- 1 | namespace Layer.Architecture.Domain.Entities 2 | { 3 | public class User : BaseEntity 4 | { 5 | public string Name { get; set; } 6 | 7 | public string Email { get; set; } 8 | 9 | public string Password { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Layer.Architecture.Domain/Interfaces/IBaseRepository.cs: -------------------------------------------------------------------------------- 1 | using Layer.Architecture.Domain.Entities; 2 | using System.Collections.Generic; 3 | 4 | namespace Layer.Architecture.Domain.Interfaces 5 | { 6 | public interface IBaseRepository where TEntity : BaseEntity 7 | { 8 | void Insert(TEntity obj); 9 | 10 | void Update(TEntity obj); 11 | 12 | void Delete(int id); 13 | 14 | IList Select(); 15 | 16 | TEntity Select(int id); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Layer.Architecture.Domain/Interfaces/IBaseService.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using Layer.Architecture.Domain.Entities; 3 | using System.Collections.Generic; 4 | 5 | namespace Layer.Architecture.Domain.Interfaces 6 | { 7 | public interface IBaseService where TEntity : BaseEntity 8 | { 9 | TOutputModel Add(TInputModel inputModel) 10 | where TValidator : AbstractValidator 11 | where TInputModel : class 12 | where TOutputModel : class; 13 | 14 | void Delete(int id); 15 | 16 | IEnumerable Get() where TOutputModel : class; 17 | 18 | TOutputModel GetById(int id) where TOutputModel : class; 19 | 20 | TOutputModel Update(TInputModel inputModel) 21 | where TValidator : AbstractValidator 22 | where TInputModel : class 23 | where TOutputModel : class; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Layer.Architecture.Domain/Layer.Architecture.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.CrossCutting/Layer.Architecture.Infra.CrossCutting.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.Data/Context/MySqlContext.cs: -------------------------------------------------------------------------------- 1 | using Layer.Architecture.Domain.Entities; 2 | using Layer.Architecture.Infra.Data.Mapping; 3 | using Microsoft.EntityFrameworkCore; 4 | 5 | namespace Layer.Architecture.Infra.Data.Context 6 | { 7 | public class MySqlContext : DbContext 8 | { 9 | public MySqlContext(DbContextOptions options) : base(options) 10 | { 11 | 12 | } 13 | 14 | public DbSet Users { get; set; } 15 | 16 | protected override void OnModelCreating(ModelBuilder modelBuilder) 17 | { 18 | base.OnModelCreating(modelBuilder); 19 | 20 | modelBuilder.Entity(new UserMap().Configure); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.Data/Layer.Architecture.Infra.Data.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | all 10 | runtime; build; native; contentfiles; analyzers; buildtransitive 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.Data/Mapping/UserMap.cs: -------------------------------------------------------------------------------- 1 | using Layer.Architecture.Domain.Entities; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata.Builders; 4 | 5 | namespace Layer.Architecture.Infra.Data.Mapping 6 | { 7 | public class UserMap : IEntityTypeConfiguration 8 | { 9 | public void Configure(EntityTypeBuilder builder) 10 | { 11 | builder.ToTable("User"); 12 | 13 | builder.HasKey(prop => prop.Id); 14 | 15 | builder.Property(prop => prop.Name) 16 | .HasConversion(prop => prop.ToString(), prop => prop) 17 | .IsRequired() 18 | .HasColumnName("Name") 19 | .HasColumnType("varchar(100)"); 20 | 21 | builder.Property(prop => prop.Email) 22 | .HasConversion(prop => prop.ToString(), prop => prop) 23 | .IsRequired() 24 | .HasColumnName("Email") 25 | .HasColumnType("varchar(100)"); 26 | 27 | builder.Property(prop => prop.Password) 28 | .HasConversion(prop => prop.ToString(), prop => prop) 29 | .IsRequired() 30 | .HasColumnName("Password") 31 | .HasColumnType("varchar(100)"); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.Data/Migrations/20210305191608_InitialVersion.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using Layer.Architecture.Infra.Data.Context; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Migrations; 6 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 7 | 8 | namespace Layer.Architecture.Infra.Data.Migrations 9 | { 10 | [DbContext(typeof(MySqlContext))] 11 | [Migration("20210305191608_InitialVersion")] 12 | partial class InitialVersion 13 | { 14 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 15 | { 16 | #pragma warning disable 612, 618 17 | modelBuilder 18 | .HasAnnotation("ProductVersion", "3.1.5") 19 | .HasAnnotation("Relational:MaxIdentifierLength", 64); 20 | 21 | modelBuilder.Entity("Layer.Architecture.Domain.Entities.User", b => 22 | { 23 | b.Property("Id") 24 | .ValueGeneratedOnAdd() 25 | .HasColumnType("int"); 26 | 27 | b.Property("Email") 28 | .IsRequired() 29 | .HasColumnName("Email") 30 | .HasColumnType("varchar(100)"); 31 | 32 | b.Property("Name") 33 | .IsRequired() 34 | .HasColumnName("Name") 35 | .HasColumnType("varchar(100)"); 36 | 37 | b.Property("Password") 38 | .IsRequired() 39 | .HasColumnName("Password") 40 | .HasColumnType("varchar(100)"); 41 | 42 | b.HasKey("Id"); 43 | 44 | b.ToTable("User"); 45 | }); 46 | #pragma warning restore 612, 618 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.Data/Migrations/20210305191608_InitialVersion.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Metadata; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | namespace Layer.Architecture.Infra.Data.Migrations 5 | { 6 | public partial class InitialVersion : Migration 7 | { 8 | protected override void Up(MigrationBuilder migrationBuilder) 9 | { 10 | migrationBuilder.CreateTable( 11 | name: "User", 12 | columns: table => new 13 | { 14 | Id = table.Column(nullable: false) 15 | .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), 16 | Name = table.Column(type: "varchar(100)", nullable: false), 17 | Email = table.Column(type: "varchar(100)", nullable: false), 18 | Password = table.Column(type: "varchar(100)", nullable: false) 19 | }, 20 | constraints: table => 21 | { 22 | table.PrimaryKey("PK_User", x => x.Id); 23 | }); 24 | } 25 | 26 | protected override void Down(MigrationBuilder migrationBuilder) 27 | { 28 | migrationBuilder.DropTable( 29 | name: "User"); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.Data/Migrations/MySqlContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | // 2 | using Layer.Architecture.Infra.Data.Context; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 6 | 7 | namespace Layer.Architecture.Infra.Data.Migrations 8 | { 9 | [DbContext(typeof(MySqlContext))] 10 | partial class MySqlContextModelSnapshot : ModelSnapshot 11 | { 12 | protected override void BuildModel(ModelBuilder modelBuilder) 13 | { 14 | #pragma warning disable 612, 618 15 | modelBuilder 16 | .HasAnnotation("ProductVersion", "3.1.5") 17 | .HasAnnotation("Relational:MaxIdentifierLength", 64); 18 | 19 | modelBuilder.Entity("Layer.Architecture.Domain.Entities.User", b => 20 | { 21 | b.Property("Id") 22 | .ValueGeneratedOnAdd() 23 | .HasColumnType("int"); 24 | 25 | b.Property("Email") 26 | .IsRequired() 27 | .HasColumnName("Email") 28 | .HasColumnType("varchar(100)"); 29 | 30 | b.Property("Name") 31 | .IsRequired() 32 | .HasColumnName("Name") 33 | .HasColumnType("varchar(100)"); 34 | 35 | b.Property("Password") 36 | .IsRequired() 37 | .HasColumnName("Password") 38 | .HasColumnType("varchar(100)"); 39 | 40 | b.HasKey("Id"); 41 | 42 | b.ToTable("User"); 43 | }); 44 | #pragma warning restore 612, 618 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Layer.Architecture.Infra.Data/Repository/BaseRepository.cs: -------------------------------------------------------------------------------- 1 | using Layer.Architecture.Domain.Entities; 2 | using Layer.Architecture.Domain.Interfaces; 3 | using Layer.Architecture.Infra.Data.Context; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | 7 | namespace Layer.Architecture.Infra.Data.Repository 8 | { 9 | public class BaseRepository : IBaseRepository where TEntity : BaseEntity 10 | { 11 | protected readonly MySqlContext _mySqlContext; 12 | 13 | public BaseRepository(MySqlContext mySqlContext) 14 | { 15 | _mySqlContext = mySqlContext; 16 | } 17 | 18 | public void Insert(TEntity obj) 19 | { 20 | _mySqlContext.Set().Add(obj); 21 | _mySqlContext.SaveChanges(); 22 | } 23 | 24 | public void Update(TEntity obj) 25 | { 26 | _mySqlContext.Entry(obj).State = Microsoft.EntityFrameworkCore.EntityState.Modified; 27 | _mySqlContext.SaveChanges(); 28 | } 29 | 30 | public void Delete(int id) 31 | { 32 | _mySqlContext.Set().Remove(Select(id)); 33 | _mySqlContext.SaveChanges(); 34 | } 35 | 36 | public IList Select() => 37 | _mySqlContext.Set().ToList(); 38 | 39 | public TEntity Select(int id) => 40 | _mySqlContext.Set().Find(id); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Layer.Architecture.Service/Layer.Architecture.Service.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Layer.Architecture.Service/Services/BaseService.cs: -------------------------------------------------------------------------------- 1 | using AutoMapper; 2 | using FluentValidation; 3 | using Layer.Architecture.Domain.Entities; 4 | using Layer.Architecture.Domain.Interfaces; 5 | using System; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | 9 | namespace Layer.Architecture.Service.Services 10 | { 11 | public class BaseService : IBaseService where TEntity : BaseEntity 12 | { 13 | private readonly IBaseRepository _baseRepository; 14 | private readonly IMapper _mapper; 15 | 16 | public BaseService(IBaseRepository baseRepository, IMapper mapper) 17 | { 18 | _baseRepository = baseRepository; 19 | _mapper = mapper; 20 | } 21 | 22 | public TOutputModel Add(TInputModel inputModel) 23 | where TValidator : AbstractValidator 24 | where TInputModel : class 25 | where TOutputModel : class 26 | { 27 | TEntity entity = _mapper.Map(inputModel); 28 | 29 | Validate(entity, Activator.CreateInstance()); 30 | _baseRepository.Insert(entity); 31 | 32 | TOutputModel outputModel = _mapper.Map(entity); 33 | 34 | return outputModel; 35 | } 36 | 37 | public void Delete(int id) => _baseRepository.Delete(id); 38 | 39 | public IEnumerable Get() where TOutputModel : class 40 | { 41 | var entities = _baseRepository.Select(); 42 | 43 | var outputModels = entities.Select(s => _mapper.Map(s)); 44 | 45 | return outputModels; 46 | } 47 | 48 | public TOutputModel GetById(int id) where TOutputModel : class 49 | { 50 | var entity = _baseRepository.Select(id); 51 | 52 | var outputModel = _mapper.Map(entity); 53 | 54 | return outputModel; 55 | } 56 | 57 | public TOutputModel Update(TInputModel inputModel) 58 | where TValidator : AbstractValidator 59 | where TInputModel : class 60 | where TOutputModel : class 61 | { 62 | TEntity entity = _mapper.Map(inputModel); 63 | 64 | Validate(entity, Activator.CreateInstance()); 65 | _baseRepository.Update(entity); 66 | 67 | TOutputModel outputModel = _mapper.Map(entity); 68 | 69 | return outputModel; 70 | } 71 | 72 | private void Validate(TEntity obj, AbstractValidator validator) 73 | { 74 | if (obj == null) 75 | throw new Exception("Registros não detectados!"); 76 | 77 | validator.ValidateAndThrow(obj); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Layer.Architecture.Service/Validators/UserValidator.cs: -------------------------------------------------------------------------------- 1 | using FluentValidation; 2 | using Layer.Architecture.Domain.Entities; 3 | 4 | namespace Layer.Architecture.Service.Validators 5 | { 6 | public class UserValidator : AbstractValidator 7 | { 8 | public UserValidator() 9 | { 10 | RuleFor(c => c.Name) 11 | .NotEmpty().WithMessage("Please enter the name.") 12 | .NotNull().WithMessage("Please enter the name."); 13 | 14 | RuleFor(c => c.Email) 15 | .NotEmpty().WithMessage("Please enter the email.") 16 | .NotNull().WithMessage("Please enter the email."); 17 | 18 | RuleFor(c => c.Password) 19 | .NotEmpty().WithMessage("Please enter the password.") 20 | .NotNull().WithMessage("Please enter the password."); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Layer.Architecture.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30517.126 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1 - Application", "1 - Application", "{C8998EAC-1648-47C1-BF93-0126AC79FA35}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2 - Domain", "2 - Domain", "{A31EBD86-66E9-4A8B-9EAE-79A49E495FBD}" 9 | EndProject 10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "3 - Service", "3 - Service", "{1A88E49C-C0CE-4153-99A8-C9521ED348AB}" 11 | EndProject 12 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4 - Infra", "4 - Infra", "{CEF5C18A-54C7-4657-B46D-9E6AB708ED49}" 13 | EndProject 14 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.1 - Data", "4.1 - Data", "{E5B56F4E-D6DE-444A-9E0A-93E4BF3973C5}" 15 | EndProject 16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4.2 - CrossCutting", "4.2 - CrossCutting", "{E0CFB179-7D09-446A-82D4-9813B734D6D4}" 17 | EndProject 18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Layer.Architecture.Infra.CrossCutting", "Layer.Architecture.Infra.CrossCutting\Layer.Architecture.Infra.CrossCutting.csproj", "{087939EC-B7C7-4635-95E2-0AEE30F64B42}" 19 | EndProject 20 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Layer.Architecture.Infra.Data", "Layer.Architecture.Infra.Data\Layer.Architecture.Infra.Data.csproj", "{38F8D945-F452-43CC-8AB5-1A802D5E9EBE}" 21 | EndProject 22 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Layer.Architecture.Service", "Layer.Architecture.Service\Layer.Architecture.Service.csproj", "{9A840C8C-02A5-4092-ADA3-616A780FB3BC}" 23 | EndProject 24 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Layer.Architecture.Domain", "Layer.Architecture.Domain\Layer.Architecture.Domain.csproj", "{3BDB63E7-1BC6-461F-9A2C-87A3B9F7BE85}" 25 | EndProject 26 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Layer.Architecture.Application", "Layer.Architecture.Application\Layer.Architecture.Application.csproj", "{56DBF4C8-61AA-4B6D-8AFD-A95D6B74E6E9}" 27 | EndProject 28 | Global 29 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 30 | Debug|Any CPU = Debug|Any CPU 31 | Release|Any CPU = Release|Any CPU 32 | EndGlobalSection 33 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 34 | {087939EC-B7C7-4635-95E2-0AEE30F64B42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 35 | {087939EC-B7C7-4635-95E2-0AEE30F64B42}.Debug|Any CPU.Build.0 = Debug|Any CPU 36 | {087939EC-B7C7-4635-95E2-0AEE30F64B42}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {087939EC-B7C7-4635-95E2-0AEE30F64B42}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {38F8D945-F452-43CC-8AB5-1A802D5E9EBE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {38F8D945-F452-43CC-8AB5-1A802D5E9EBE}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {38F8D945-F452-43CC-8AB5-1A802D5E9EBE}.Release|Any CPU.ActiveCfg = Release|Any CPU 41 | {38F8D945-F452-43CC-8AB5-1A802D5E9EBE}.Release|Any CPU.Build.0 = Release|Any CPU 42 | {9A840C8C-02A5-4092-ADA3-616A780FB3BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 43 | {9A840C8C-02A5-4092-ADA3-616A780FB3BC}.Debug|Any CPU.Build.0 = Debug|Any CPU 44 | {9A840C8C-02A5-4092-ADA3-616A780FB3BC}.Release|Any CPU.ActiveCfg = Release|Any CPU 45 | {9A840C8C-02A5-4092-ADA3-616A780FB3BC}.Release|Any CPU.Build.0 = Release|Any CPU 46 | {3BDB63E7-1BC6-461F-9A2C-87A3B9F7BE85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {3BDB63E7-1BC6-461F-9A2C-87A3B9F7BE85}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {3BDB63E7-1BC6-461F-9A2C-87A3B9F7BE85}.Release|Any CPU.ActiveCfg = Release|Any CPU 49 | {3BDB63E7-1BC6-461F-9A2C-87A3B9F7BE85}.Release|Any CPU.Build.0 = Release|Any CPU 50 | {56DBF4C8-61AA-4B6D-8AFD-A95D6B74E6E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 51 | {56DBF4C8-61AA-4B6D-8AFD-A95D6B74E6E9}.Debug|Any CPU.Build.0 = Debug|Any CPU 52 | {56DBF4C8-61AA-4B6D-8AFD-A95D6B74E6E9}.Release|Any CPU.ActiveCfg = Release|Any CPU 53 | {56DBF4C8-61AA-4B6D-8AFD-A95D6B74E6E9}.Release|Any CPU.Build.0 = Release|Any CPU 54 | EndGlobalSection 55 | GlobalSection(SolutionProperties) = preSolution 56 | HideSolutionNode = FALSE 57 | EndGlobalSection 58 | GlobalSection(NestedProjects) = preSolution 59 | {E5B56F4E-D6DE-444A-9E0A-93E4BF3973C5} = {CEF5C18A-54C7-4657-B46D-9E6AB708ED49} 60 | {E0CFB179-7D09-446A-82D4-9813B734D6D4} = {CEF5C18A-54C7-4657-B46D-9E6AB708ED49} 61 | {087939EC-B7C7-4635-95E2-0AEE30F64B42} = {E0CFB179-7D09-446A-82D4-9813B734D6D4} 62 | {38F8D945-F452-43CC-8AB5-1A802D5E9EBE} = {E5B56F4E-D6DE-444A-9E0A-93E4BF3973C5} 63 | {9A840C8C-02A5-4092-ADA3-616A780FB3BC} = {1A88E49C-C0CE-4153-99A8-C9521ED348AB} 64 | {3BDB63E7-1BC6-461F-9A2C-87A3B9F7BE85} = {A31EBD86-66E9-4A8B-9EAE-79A49E495FBD} 65 | {56DBF4C8-61AA-4B6D-8AFD-A95D6B74E6E9} = {C8998EAC-1648-47C1-BF93-0126AC79FA35} 66 | EndGlobalSection 67 | GlobalSection(ExtensibilityGlobals) = postSolution 68 | SolutionGuid = {00E22CFA-2F63-4120-B758-3562AD4D209B} 69 | EndGlobalSection 70 | EndGlobal 71 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Mais sobre este projeto: 2 | 3 | Para saber mais sobre este projeto, você pode ler o seguinte artigo (que se encontra na Wiki do Projeto): 4 | 5 | https://github.com/alexalvess/layer-architecture/wiki/Uma-arquitetura,-em-.Net-Core,-baseada-nos-princ%C3%ADpios-do-DDD 6 | 7 | --- 8 | 9 | Ou, se preferir, leia o artigo direto do Medium: 10 | 11 | https://alexalvess.medium.com/criando-uma-api-em-net-core-baseado-na-arquitetura-ddd-2c6a409c686 12 | -------------------------------------------------------------------------------- /images/add_controller.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/add_controller.jpeg -------------------------------------------------------------------------------- /images/add_folders.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/add_folders.jpeg -------------------------------------------------------------------------------- /images/api_empty.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/api_empty.jpeg -------------------------------------------------------------------------------- /images/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/architecture.png -------------------------------------------------------------------------------- /images/asp_net_core_app.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/asp_net_core_app.jpeg -------------------------------------------------------------------------------- /images/asp_net_webapi.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/asp_net_webapi.jpeg -------------------------------------------------------------------------------- /images/blank_solution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/blank_solution.png -------------------------------------------------------------------------------- /images/data_layer.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/data_layer.jpeg -------------------------------------------------------------------------------- /images/domain_layer.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/domain_layer.jpeg -------------------------------------------------------------------------------- /images/folders.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/folders.jpeg -------------------------------------------------------------------------------- /images/layers.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/layers.jpeg -------------------------------------------------------------------------------- /images/net_core_class_lib.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/net_core_class_lib.jpeg -------------------------------------------------------------------------------- /images/service_layer.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexalvess/layer-architecture/00eac132a4830eda6acf4541a4fcf5dcda4ce685/images/service_layer.jpeg --------------------------------------------------------------------------------