| | 1 | | using AutoMapper; |
| | 2 | | using Despesas.Repository.UnitOfWork.Abstractions; |
| | 3 | | using Repository.Persistency.Generic; |
| | 4 | |
|
| | 5 | | namespace Despesas.Application.Abstractions; |
| | 6 | | public abstract class BusinessBase<Dto, Entity> : IBusinessBase<Dto, Entity> where Dto : class where Entity : class, new |
| | 7 | | { |
| 57 | 8 | | protected IUnitOfWork<Entity>? UnitOfWork { get; } |
| 46 | 9 | | protected IMapper Mapper { get; set; } |
| | 10 | |
|
| 0 | 11 | | protected IRepositorio<Entity> Repository { get; } |
| | 12 | |
|
| 26 | 13 | | protected BusinessBase(IMapper mapper, IRepositorio<Entity> repository, IUnitOfWork<Entity> unitOfWork = null) |
| 26 | 14 | | { |
| 26 | 15 | | Repository = repository; |
| 26 | 16 | | Mapper = mapper; |
| 26 | 17 | | UnitOfWork = unitOfWork; |
| 26 | 18 | | } |
| | 19 | |
|
| | 20 | | public abstract Task<Dto> Create(Dto dto); |
| | 21 | |
|
| | 22 | | public virtual Task<Dto> FindById(Guid id) |
| 0 | 23 | | { |
| 0 | 24 | | throw new NotImplementedException("Este método não foi implementado."); |
| | 25 | | } |
| | 26 | |
|
| 0 | 27 | | public virtual Task<Dto> FindById(Guid id, Guid idUsuario) { return null; } |
| | 28 | |
|
| | 29 | | public abstract Task<List<Dto>> FindAll(Guid idUsuario); |
| | 30 | |
|
| | 31 | | public abstract Task<Dto> Update(Dto dto); |
| | 32 | |
|
| | 33 | | public abstract Task<bool> Delete(Dto dto); |
| | 34 | | } |