Compare commits
3 Commits
main
...
8611427557
| Author | SHA1 | Date | |
|---|---|---|---|
| 8611427557 | |||
| d5aeb0a06e | |||
| 5aa09670bc |
67
AB-API.sln
Normal file
67
AB-API.sln
Normal file
@@ -0,0 +1,67 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33205.214
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AB.WEB", "AB-API\AB.WEB.csproj", "{45855EEB-EA31-476F-A020-1A3B71AD725A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AB.Domain", "AB.Domain\AB.Domain.csproj", "{9F60492C-A480-4056-983D-0F6B1A1ABD1B}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AB.Services", "AB.Services\AB.Services.csproj", "{74E74C3E-8A8E-4771-894B-A2919B3422E5}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AB.Contracts", "AB.Contracts\AB.Contracts.csproj", "{9319695E-2237-49E2-80CD-761F53364421}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AB.Services.Abstractions", "AB.Services.Abstractions\AB.Services.Abstractions.csproj", "{4E3D1E97-AD83-4F66-825E-105441AF4E15}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{AD8DD52C-57EC-455A-9A8D-E50009FCE608}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AB.Persistence", "AB.Persistence\AB.Persistence.csproj", "{BF2F36D4-6EF4-43AB-840F-0336EB1723EC}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AB.API", "AB.API\AB.API.csproj", "{7595A349-8990-467D-8122-8E79931359DC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{45855EEB-EA31-476F-A020-1A3B71AD725A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{45855EEB-EA31-476F-A020-1A3B71AD725A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{45855EEB-EA31-476F-A020-1A3B71AD725A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{45855EEB-EA31-476F-A020-1A3B71AD725A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9F60492C-A480-4056-983D-0F6B1A1ABD1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9F60492C-A480-4056-983D-0F6B1A1ABD1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9F60492C-A480-4056-983D-0F6B1A1ABD1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9F60492C-A480-4056-983D-0F6B1A1ABD1B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{74E74C3E-8A8E-4771-894B-A2919B3422E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{74E74C3E-8A8E-4771-894B-A2919B3422E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{74E74C3E-8A8E-4771-894B-A2919B3422E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{74E74C3E-8A8E-4771-894B-A2919B3422E5}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{9319695E-2237-49E2-80CD-761F53364421}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{9319695E-2237-49E2-80CD-761F53364421}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{9319695E-2237-49E2-80CD-761F53364421}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{9319695E-2237-49E2-80CD-761F53364421}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{4E3D1E97-AD83-4F66-825E-105441AF4E15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4E3D1E97-AD83-4F66-825E-105441AF4E15}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4E3D1E97-AD83-4F66-825E-105441AF4E15}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4E3D1E97-AD83-4F66-825E-105441AF4E15}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{BF2F36D4-6EF4-43AB-840F-0336EB1723EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BF2F36D4-6EF4-43AB-840F-0336EB1723EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BF2F36D4-6EF4-43AB-840F-0336EB1723EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BF2F36D4-6EF4-43AB-840F-0336EB1723EC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7595A349-8990-467D-8122-8E79931359DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7595A349-8990-467D-8122-8E79931359DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7595A349-8990-467D-8122-8E79931359DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7595A349-8990-467D-8122-8E79931359DC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{BF2F36D4-6EF4-43AB-840F-0336EB1723EC} = {AD8DD52C-57EC-455A-9A8D-E50009FCE608}
|
||||
{7595A349-8990-467D-8122-8E79931359DC} = {AD8DD52C-57EC-455A-9A8D-E50009FCE608}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C7D1722E-5C50-4F16-BA7D-79977DD1D621}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
18
AB-API/AB.WEB.csproj
Normal file
18
AB-API/AB.WEB.csproj
Normal file
@@ -0,0 +1,18 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>AB_API</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AB.API\AB.API.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
33
AB-API/Controllers/WeatherForecastController.cs
Normal file
33
AB-API/Controllers/WeatherForecastController.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace AB_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 = DateTime.Now.AddDays(index),
|
||||
TemperatureC = Random.Shared.Next(-20, 55),
|
||||
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
25
AB-API/Program.cs
Normal file
25
AB-API/Program.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
||||
builder.Services.AddControllers().AddApplicationPart(typeof(AB.API.AssemblyReference).Assembly);
|
||||
// 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();
|
||||
31
AB-API/Properties/launchSettings.json
Normal file
31
AB-API/Properties/launchSettings.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||
"iisSettings": {
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:25034",
|
||||
"sslPort": 44354
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
"AB_API": {
|
||||
"commandName": "Project",
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7196;http://localhost:5286",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"IIS Express": {
|
||||
"commandName": "IISExpress",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
AB-API/WeatherForecast.cs
Normal file
13
AB-API/WeatherForecast.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace AB_API
|
||||
{
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string? Summary { get; set; }
|
||||
}
|
||||
}
|
||||
8
AB-API/appsettings.Development.json
Normal file
8
AB-API/appsettings.Development.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
9
AB-API/appsettings.json
Normal file
9
AB-API/appsettings.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
}
|
||||
17
AB.API/AB.API.csproj
Normal file
17
AB.API/AB.API.csproj
Normal file
@@ -0,0 +1,17 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AB.Services.Abstractions\AB.Services.Abstractions.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
12
AB.API/AssemblyReference.cs
Normal file
12
AB.API/AssemblyReference.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.API
|
||||
{
|
||||
public class AssemblyReference
|
||||
{
|
||||
}
|
||||
}
|
||||
53
AB.API/Controllers/CustomerController.cs
Normal file
53
AB.API/Controllers/CustomerController.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using AB.Contracts;
|
||||
using AB.Services.Abstractions;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.API.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("api/customers")]
|
||||
public class CustomerController : ControllerBase
|
||||
{
|
||||
|
||||
private readonly ICustomerService _customerService;
|
||||
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> GetCustomers(CancellationToken cancellationToken)
|
||||
{
|
||||
var customers = await _customerService.GetAllAsync(cancellationToken);
|
||||
|
||||
return Ok(customers);
|
||||
}
|
||||
|
||||
[HttpGet("{customerId:guid}")]
|
||||
public async Task<IActionResult> GetCustomerById(Guid customerId, CancellationToken cancellationToken)
|
||||
{
|
||||
var customer = await _customerService.GetByIdAsync(customerId, cancellationToken);
|
||||
|
||||
return Ok(customer);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> CreateCustomer([FromBody] CustomerForCreationDto customerForCreation)
|
||||
{
|
||||
var customerDto = await _customerService.CreateAsync(customerForCreation);
|
||||
|
||||
return CreatedAtAction(nameof(CreateCustomer), new {customerId = customerDto.Id}, customerDto);
|
||||
}
|
||||
|
||||
[HttpDelete("{customerId:guid}")]
|
||||
public async Task<IActionResult> DeleteCustomer(Guid customerId, CancellationToken cancellationToken)
|
||||
{
|
||||
await _customerService.DeleteAsync(customerId, cancellationToken);
|
||||
|
||||
return NoContent();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
9
AB.Contracts/AB.Contracts.csproj
Normal file
9
AB.Contracts/AB.Contracts.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
15
AB.Contracts/CustomerDto.cs
Normal file
15
AB.Contracts/CustomerDto.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Contracts
|
||||
{
|
||||
public class CustomerDto
|
||||
{
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
12
AB.Contracts/CustomerForCreationDto.cs
Normal file
12
AB.Contracts/CustomerForCreationDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Contracts
|
||||
{
|
||||
public class CustomerForCreationDto
|
||||
{
|
||||
}
|
||||
}
|
||||
12
AB.Contracts/SupplierForCreationDto.cs
Normal file
12
AB.Contracts/SupplierForCreationDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Contracts
|
||||
{
|
||||
public class SupplierForCreationDto
|
||||
{
|
||||
}
|
||||
}
|
||||
9
AB.Domain/AB.Domain.csproj
Normal file
9
AB.Domain/AB.Domain.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
14
AB.Domain/Entities/Customer.cs
Normal file
14
AB.Domain/Entities/Customer.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Entities
|
||||
{
|
||||
public class Customer
|
||||
{
|
||||
Guid coutomerId;
|
||||
|
||||
}
|
||||
}
|
||||
14
AB.Domain/Entities/Product.cs
Normal file
14
AB.Domain/Entities/Product.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Entities
|
||||
{
|
||||
public class Product
|
||||
{
|
||||
Guid productId;
|
||||
|
||||
}
|
||||
}
|
||||
14
AB.Domain/Entities/Supplier.cs
Normal file
14
AB.Domain/Entities/Supplier.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Entities
|
||||
{
|
||||
public class Supplier
|
||||
{
|
||||
|
||||
Guid supplierId;
|
||||
}
|
||||
}
|
||||
17
AB.Domain/Exceptions/BusinessPartnerNotFoundException.cs
Normal file
17
AB.Domain/Exceptions/BusinessPartnerNotFoundException.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Exceptions
|
||||
{
|
||||
public class BusinessPartnerNotFoundException : NotFoundException
|
||||
{
|
||||
|
||||
public BusinessPartnerNotFoundException(Guid businessPartnerId)
|
||||
: base ($"The BusinessPartner with the indetifier {businessPartnerId} was not found.")
|
||||
{ }
|
||||
|
||||
}
|
||||
}
|
||||
20
AB.Domain/Exceptions/NotFoundException.cs
Normal file
20
AB.Domain/Exceptions/NotFoundException.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Exceptions
|
||||
{
|
||||
|
||||
[Serializable]
|
||||
public abstract class NotFoundException : Exception
|
||||
{
|
||||
public NotFoundException() { }
|
||||
public NotFoundException(string message) : base(message) { }
|
||||
public NotFoundException(string message, Exception inner) : base(message, inner) { }
|
||||
protected NotFoundException(
|
||||
System.Runtime.Serialization.SerializationInfo info,
|
||||
System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
|
||||
}
|
||||
}
|
||||
12
AB.Domain/Repositories/ICustomerRepository.cs
Normal file
12
AB.Domain/Repositories/ICustomerRepository.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Repositories
|
||||
{
|
||||
public class ICustomerRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
12
AB.Domain/Repositories/ISupplierRepository.cs
Normal file
12
AB.Domain/Repositories/ISupplierRepository.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Repositories
|
||||
{
|
||||
public class ISupplierRepository
|
||||
{
|
||||
}
|
||||
}
|
||||
12
AB.Domain/Repositories/IUnitOfWork.cs
Normal file
12
AB.Domain/Repositories/IUnitOfWork.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Domain.Repositories
|
||||
{
|
||||
public class IUnitOfWork
|
||||
{
|
||||
}
|
||||
}
|
||||
9
AB.Persistence/AB.Persistence.csproj
Normal file
9
AB.Persistence/AB.Persistence.csproj
Normal file
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
13
AB.Services.Abstractions/AB.Services.Abstractions.csproj
Normal file
13
AB.Services.Abstractions/AB.Services.Abstractions.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AB.Contracts\AB.Contracts.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
17
AB.Services.Abstractions/ICustomerService.cs
Normal file
17
AB.Services.Abstractions/ICustomerService.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using AB.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Services.Abstractions
|
||||
{
|
||||
public interface ICustomerService
|
||||
{
|
||||
Task<CustomerDto> CreateAsync(CustomerForCreationDto customerForCreation);
|
||||
Task DeleteAsync(Guid customerId, CancellationToken cancellationToken);
|
||||
Task<IEnumerable<CustomerDto>> GetAllAsync(CancellationToken cancellationToken);
|
||||
Task<CustomerDto> GetByIdAsync(Guid customerId, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
13
AB.Services/AB.Services.csproj
Normal file
13
AB.Services/AB.Services.csproj
Normal file
@@ -0,0 +1,13 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\AB.Services.Abstractions\AB.Services.Abstractions.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
15
AB.Services/CustomerService.cs
Normal file
15
AB.Services/CustomerService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using AB.Contracts;
|
||||
using AB.Services.Abstractions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace AB.Services
|
||||
{
|
||||
internal class CustomerService : ICustomerService
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user