Update to Onion Architecture.

This commit is contained in:
Sébastien André
2021-03-01 20:33:00 +01:00
parent e0c41131cc
commit 9341bb284e
70 changed files with 222 additions and 202 deletions

View File

@@ -3,11 +3,12 @@ using System.Linq;
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class AircraftRepository : IAircraftRepository
{

View File

@@ -3,11 +3,12 @@ using System.Linq;
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class DropZoneRepository : IDropZoneRepository
{

View File

@@ -1,13 +1,13 @@
using System.Collections.Generic;
using System.Linq;
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class GearRepository : IGearRepository
{

View File

@@ -1,9 +0,0 @@
using skydiveLogs_api.Model;
namespace skydiveLogs_api.Data.Interface
{
public interface IAircraftRepository : IRepository<Aircraft>
{
}
}

View File

@@ -1,9 +0,0 @@
using skydiveLogs_api.Model;
namespace skydiveLogs_api.Data.Interface
{
public interface IDropZoneRepository : IRepository<DropZone>
{
}
}

View File

@@ -1,10 +0,0 @@
using skydiveLogs_api.Model;
using System.Collections.Generic;
namespace skydiveLogs_api.Data.Interface
{
public interface IGearRepository : IRepository<Gear>
{
IEnumerable<Gear> GetAll(User connectedUser);
}
}

View File

@@ -1,10 +0,0 @@
using skydiveLogs_api.Model;
using System.Collections.Generic;
namespace skydiveLogs_api.Data.Interface
{
public interface IJumpRepository : IRepository<Jump>
{
IEnumerable<Jump> GetAll(User user);
}
}

View File

@@ -1,9 +0,0 @@
using skydiveLogs_api.Model;
namespace skydiveLogs_api.Data.Interface
{
public interface IJumpTypeRepository : IRepository<JumpType>
{
}
}

View File

@@ -1,15 +0,0 @@
using System.Collections.Generic;
namespace skydiveLogs_api.Data.Interface
{
public interface IRepository<T>
{
IEnumerable<T> GetAll();
T GetById(int id);
bool Update(T updated);
bool Add(T newEntity);
}
}

View File

@@ -1,11 +0,0 @@
using System.Collections.Generic;
using skydiveLogs_api.Model;
namespace skydiveLogs_api.Data.Interface
{
public interface IUserImageRepository : IRepository<UserImage>
{
IEnumerable<UserImage> GetAll(User user);
}
}

View File

@@ -1,10 +0,0 @@
using skydiveLogs_api.Model;
namespace skydiveLogs_api.Data.Interface
{
public interface IUserRepository : IRepository<User>
{
User GetByLogin(string login, string password);
}
}

View File

@@ -1,9 +1,9 @@
using LiteDB;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
namespace skydiveLogs_api.Data.Interface
namespace skydiveLogs_api.Infrastructure.Interfaces
{
public interface IDataProvider
{

View File

@@ -2,11 +2,12 @@
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class JumpRepository : IJumpRepository
{

View File

@@ -3,11 +3,12 @@ using System.Linq;
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class JumpTypeRepository : IJumpTypeRepository
{

View File

@@ -1,9 +1,10 @@
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class LiteDbProvider : IDataProvider
{

View File

@@ -1,13 +1,13 @@
using System.Collections.Generic;
using System.Linq;
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class UserImageRepository : IUserImageRepository
{

View File

@@ -1,14 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using LiteDB;
using skydiveLogs_api.Data.Interface;
using skydiveLogs_api.Model;
using skydiveLogs_api.Domain;
using skydiveLogs_api.DomainService.Repositories;
using skydiveLogs_api.Infrastructure.Interfaces;
namespace skydiveLogs_api.Data
namespace skydiveLogs_api.Infrastructure
{
public class UserRepository : IUserRepository
{

View File

@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>skydiveLogs_api.Data</RootNamespace>
<RootNamespace>skydiveLogs_api.Infrastructure</RootNamespace>
</PropertyGroup>
<ItemGroup>
@@ -10,7 +10,8 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\skydiveLogs-api.Model\skydiveLogs-api.Model.csproj" />
<ProjectReference Include="..\skydiveLogs-api.DomainService\skydiveLogs-api.DomainService.csproj" />
<ProjectReference Include="..\skydiveLogs-api.Model\skydiveLogs-api.Domain.csproj" />
</ItemGroup>
</Project>