Primera subida

This commit is contained in:
Alejandro Sarmiento
2024-04-06 03:32:16 +02:00
parent c97b4a8179
commit b672887299
44 changed files with 44426 additions and 0 deletions

View 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);
}
}

View 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);
}
}

View 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>
{
}
}

View 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>
{
}
}

View 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>
{
}
}

View File

@@ -0,0 +1,10 @@
using back.Entities.DTOs.Response;
namespace back.Application.Contracts.Services
{
public interface IWantItAllService
{
Task<IWantItAll> GetWithAsyncAwait();
Task<IWantItAll> GetWithTasks();
}
}