Working full stack forums get
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
interface IFoorumDbContext
|
||||
public interface IFoorumDbContext
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
6
DAL/Interfaces/IFoorumRepository.cs
Normal file
6
DAL/Interfaces/IFoorumRepository.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using DAL.Domain;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface IFoorumRepository: IRepository<Foorum> { }
|
||||
}
|
||||
6
DAL/Interfaces/IPostRepository.cs
Normal file
6
DAL/Interfaces/IPostRepository.cs
Normal file
@@ -0,0 +1,6 @@
|
||||
using DAL.Domain;
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface IPostRepository: IRepository<Post> { }
|
||||
}
|
||||
20
DAL/Interfaces/IRepository.cs
Normal file
20
DAL/Interfaces/IRepository.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
|
||||
namespace DAL.Interfaces
|
||||
{
|
||||
public interface IRepository<T> where T : class
|
||||
{
|
||||
T Add(T entity);
|
||||
T Update(T entity);
|
||||
void Delete(T entity);
|
||||
void Delete(Expression<Func<T, bool>> where);
|
||||
T GetById(int id);
|
||||
T Get(Expression<Func<T, bool>> where);
|
||||
IEnumerable<T> GetAll();
|
||||
IEnumerable<T> GetMany(Expression<Func<T, bool>> where);
|
||||
int SaveChanges();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user