Update the repository pattern
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using skydiveLogs_api.Model;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IAircraftRepository
|
||||
public interface IAircraftRepository : IRepository<Aircraft>
|
||||
{
|
||||
IEnumerable<Aircraft> GetAllAircrafts();
|
||||
Aircraft GetAircraftById(int id);
|
||||
}
|
||||
}
|
||||
|
||||
12
Back/skydiveLogs-api.Data/Interface/IDataProvider.cs
Normal file
12
Back/skydiveLogs-api.Data/Interface/IDataProvider.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using LiteDB;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IDataProvider
|
||||
{
|
||||
LiteCollection<T> GetCollection<T>();
|
||||
|
||||
void Close();
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using skydiveLogs_api.Model;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IDropZoneRepository
|
||||
public interface IDropZoneRepository : IRepository<DropZone>
|
||||
{
|
||||
IEnumerable<DropZone> GetAllDzs();
|
||||
|
||||
DropZone GetDzById(int id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IGearRepository
|
||||
public interface IGearRepository : IRepository<Gear>
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using skydiveLogs_api.Model;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IJumpRepository
|
||||
public interface IJumpRepository : IRepository<Jump>
|
||||
{
|
||||
IEnumerable<Jump> GetAllJumps();
|
||||
|
||||
Jump GetJumpById(int id);
|
||||
|
||||
bool AddJump(Jump newJump);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using skydiveLogs_api.Model;
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IJumpTypeRepository
|
||||
public interface IJumpTypeRepository : IRepository<JumpType>
|
||||
{
|
||||
IEnumerable<JumpType> GetAllJumpTypes();
|
||||
JumpType GetJumpTypeById(int id);
|
||||
}
|
||||
}
|
||||
|
||||
12
Back/skydiveLogs-api.Data/Interface/IRepository.cs
Normal file
12
Back/skydiveLogs-api.Data/Interface/IRepository.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace skydiveLogs_api.Data.Interface
|
||||
{
|
||||
public interface IRepository<T>
|
||||
{
|
||||
IEnumerable<T> GetAll();
|
||||
|
||||
T GetById(int id);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user