Primera subida
This commit is contained in:
26
back/Application/Contracts/Persistence/IAsyncRepository.cs
Normal file
26
back/Application/Contracts/Persistence/IAsyncRepository.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using back.Entities;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace back.Application.Contracts.Persistence
|
||||
{
|
||||
public interface IAsyncRepository<T> where T : BaseEntity
|
||||
{
|
||||
Task<IReadOnlyList<T>> GetAllAsync();
|
||||
Task<IReadOnlyList<T>> GetAsync(Expression<Func<T, bool>>? predicate);
|
||||
Task<IReadOnlyList<T>> GetAsync(Expression<Func<T, bool>>? predicate = null,
|
||||
Func<IQueryable<T>, IOrderedQueryable<T>>? orderBy = null,
|
||||
string? includeString = null,
|
||||
bool disableTracking = true);
|
||||
Task<IReadOnlyList<T>> GetAsync(Expression<Func<T, bool>>? predicate = null,
|
||||
Func<IQueryable<T>, IOrderedQueryable<T>>? orderBy = null,
|
||||
List<Expression<Func<T, object>>>? includes = null,
|
||||
bool disableTracking = true);
|
||||
Task<T> GetByIdAsync(int id);
|
||||
|
||||
Task<T> AddAsync(T entity);
|
||||
Task<T> UpdateAsync(T entity);
|
||||
Task DeleteAsync(T entity);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
14
back/Application/Contracts/Services/IBaseService.cs
Normal file
14
back/Application/Contracts/Services/IBaseService.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using back.Entities.DTOs.Request;
|
||||
using back.Entities;
|
||||
|
||||
namespace back.Application.Contracts.Services
|
||||
{
|
||||
public interface IBaseService<T, A, U> where T : class
|
||||
{
|
||||
Task<IEnumerable<T>> GetAll();
|
||||
Task<T> GetOne(int id);
|
||||
Task<T> Add(A dto);
|
||||
Task<bool> Delete(int id);
|
||||
Task<T> Update(U dto);
|
||||
}
|
||||
}
|
||||
10
back/Application/Contracts/Services/ICasaService.cs
Normal file
10
back/Application/Contracts/Services/ICasaService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using back.Entities;
|
||||
using back.Entities.DTOs.Request;
|
||||
using back.Infra;
|
||||
|
||||
namespace back.Application.Contracts.Services
|
||||
{
|
||||
public interface ICasaService : IBaseService<Casa, CasaRequestDto, CasaUpdateRequestDto>
|
||||
{
|
||||
}
|
||||
}
|
||||
9
back/Application/Contracts/Services/IDireccionService.cs
Normal file
9
back/Application/Contracts/Services/IDireccionService.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using back.Entities;
|
||||
using back.Entities.DTOs.Request;
|
||||
|
||||
namespace back.Application.Contracts.Services
|
||||
{
|
||||
public interface IDireccionService:IBaseService<Direccion, DireccionRequestDto, DireccionUpdateRequestDto>
|
||||
{
|
||||
}
|
||||
}
|
||||
11
back/Application/Contracts/Services/IPersonaService.cs
Normal file
11
back/Application/Contracts/Services/IPersonaService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using back.Entities;
|
||||
using back.Entities.DTOs.Request;
|
||||
using back.Entities.DTOs.Response;
|
||||
|
||||
namespace back.Application.Contracts.Services
|
||||
{
|
||||
public interface IPersonaService : IBaseService<Persona, PersonaRequestDto, PersonaUpdateRequestDto>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
10
back/Application/Contracts/Services/IWantItAllService.cs
Normal file
10
back/Application/Contracts/Services/IWantItAllService.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using back.Entities.DTOs.Response;
|
||||
|
||||
namespace back.Application.Contracts.Services
|
||||
{
|
||||
public interface IWantItAllService
|
||||
{
|
||||
Task<IWantItAll> GetWithAsyncAwait();
|
||||
Task<IWantItAll> GetWithTasks();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user