Initial commit carried over from private repo. This is V2.

This commit is contained in:
mc
2025-07-04 21:24:12 +02:00
parent 7715816029
commit 4393977389
96 changed files with 3223 additions and 0 deletions
@@ -0,0 +1,26 @@
using MessengerApi.Db.Contracts.Entities;
using MessengerApi.Db.Contracts.Repositories;
using Microsoft.EntityFrameworkCore;
namespace MessengerApi.Db.Repositories
{
public abstract class Repository<T> : IRepository<T> where T : class, IEntity<T>
{
protected readonly DbSet<T> db;
public Repository(DbSet<T> db)
{
this.db = db;
}
public void Add(T entity)
{
this.db.Add(entity);
}
public T GetById(Guid id)
{
return this.db.Single(x => x.Id == id);
}
}
}