Removed strongly typed inventory objects
Added EAV inventory types Added EAV object handling philosophy Added controllers Added EF Core migration integration
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
using WyvernInventory.Core.Interfaces.Repos;
|
||||
using WyvernInventory.Core.Interfaces.Services;
|
||||
using WyvernInventory.Core.Models;
|
||||
|
||||
namespace WyvernInventory.Infrastructure.Services;
|
||||
|
||||
public class GenericInventoryItemService(IDbObjectRepo<GenericInventoryItem> dbRepo)
|
||||
: IDataObjectService<GenericInventoryItem>
|
||||
{
|
||||
private readonly IDbObjectRepo<GenericInventoryItem> _dbRepo = dbRepo;
|
||||
|
||||
public async Task<List<GenericInventoryItem>> GetAsync(Predicate<GenericInventoryItem>? filter = null) => await _dbRepo.GetAsync(filter);
|
||||
|
||||
public async Task<(int created, int updated)> UpsertAsync(List<GenericInventoryItem> items) => await _dbRepo.UpsertAsync(items);
|
||||
|
||||
public async Task DeleteAsync(List<GenericInventoryItem> items) => await _dbRepo.DeleteAsync(items);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using WyvernInventory.Core.Interfaces.Repos;
|
||||
using WyvernInventory.Core.Interfaces.Services;
|
||||
using WyvernInventory.Core.Models;
|
||||
|
||||
namespace WyvernInventory.Infrastructure.Services;
|
||||
|
||||
public class InventoryItemService(IInventoryItemRepo repo) : IInventoryItemService
|
||||
{
|
||||
private IInventoryItemRepo _repo = repo;
|
||||
|
||||
public async Task<List<InventoryItemDto>> GetAsync(List<InventoryItemRequest>? filter = null) => await _repo.GetAsync(filter);
|
||||
|
||||
public async Task<(int created, int updated)> UpsertAsync(List<InventoryItemRequest> items) => await _repo.UpsertAsync(items);
|
||||
|
||||
public async Task<int> DeleteAsync(List<InventoryItemRequest> items) => await _repo.DeleteAsync(items);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using WyvernInventory.Core.Interfaces.Repos;
|
||||
using WyvernInventory.Core.Interfaces.Services;
|
||||
using WyvernInventory.Core.Models;
|
||||
|
||||
namespace WyvernInventory.Infrastructure.Services;
|
||||
|
||||
public class InventoryTypeService(IDbObjectRepo<InventoryType, InventoryTypeDto> repo) : IDataObjectService<InventoryType, InventoryTypeDto>
|
||||
{
|
||||
private IDbObjectRepo<InventoryType, InventoryTypeDto> _repo = repo;
|
||||
|
||||
public async Task<List<InventoryTypeDto>> GetAsync(List<InventoryType>? filter = null) => await _repo.GetAsync(filter);
|
||||
|
||||
public async Task<(int created, int updated)> UpsertAsync(List<InventoryType> items) => await _repo.UpsertAsync(items);
|
||||
|
||||
public async Task<int> DeleteAsync(List<InventoryType> items) => await _repo.DeleteAsync(items);
|
||||
}
|
||||
Reference in New Issue
Block a user