Update to Onion Architecture.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IAircraftRepository : IRepository<Aircraft>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IDropZoneRepository : IRepository<DropZone>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IJumpTypeRepository : IRepository<JumpType>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IUserRepository : IRepository<User>
|
||||
{
|
||||
User GetByLogin(string login, string password);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
Reference in New Issue
Block a user