WIP setting up new data project structure and event handlers
This commit is contained in:
22
BrightGlimmer.Data/Interfaces/IRepository.cs
Normal file
22
BrightGlimmer.Data/Interfaces/IRepository.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BrightGlimmer.Data.Interfaces
|
||||
{
|
||||
public interface IRepository<T>
|
||||
{
|
||||
IUnitOfWork UnitOfWork { get; }
|
||||
|
||||
T Create(T entity);
|
||||
|
||||
T Update(T entity);
|
||||
|
||||
void Remove(Guid id);
|
||||
|
||||
IQueryable<T> Get();
|
||||
|
||||
T Get(Guid id);
|
||||
}
|
||||
}
|
||||
13
BrightGlimmer.Data/Interfaces/IUnitOfWork.cs
Normal file
13
BrightGlimmer.Data/Interfaces/IUnitOfWork.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BrightGlimmer.Data.Interfaces
|
||||
{
|
||||
public interface IUnitOfWork
|
||||
{
|
||||
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user