Skip to content

Commit

Permalink
feat: Adicionando repositório para Noticias Classificadas
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Fuso committed May 15, 2023
1 parent b4e4352 commit 39d9a8e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using ComitivaEsperanca.API.Domain.Entities;

namespace ComitivaEsperanca.API.Domain.Interfaces.Repositories.Entities
{
public interface IClassifiedNewsRepository : IBaseRepository<ClassifiedNews>
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ namespace ComitivaEsperanca.API.Domain.Interfaces.UnitOfWork
public interface IUnitOfWork : IDisposable
{
INewsRepository NewsRepository { get;}
IClassifiedNewsRepository ClassifiedNewsRepository { get;}
int Commit();
dynamic GetContext();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using ComitivaEsperanca.API.Data.Context;
using ComitivaEsperanca.API.Domain.Entities;
using ComitivaEsperanca.API.Domain.Interfaces.Repositories.Entities;

namespace ComitivaEsperanca.API.Data.Repositories.Entities
{
public class ClassifiedNewsRepository : BaseRepository<ClassifiedNews>, IClassifiedNewsRepository
{
public ClassifiedNewsRepository(CoreContext context) : base(context)
{

}
}
}
2 changes: 2 additions & 0 deletions ComitivaEsperanca.Data/UnitOfWork/UnitOfWork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ public class UnitOfWork : IUnitOfWork
private bool disposed = false;

public INewsRepository NewsRepository { get; set; }
public IClassifiedNewsRepository ClassifiedNewsRepository { get; set; }

public UnitOfWork(CoreContext context)
{
_context = context;
this.NewsRepository = new NewsRepository(_context);
this.ClassifiedNewsRepository = new ClassifiedNewsRepository(_context);
}

protected virtual void Dispose(bool disposing)
Expand Down

0 comments on commit 39d9a8e

Please sign in to comment.