Initial
This commit is contained in:
6
StandManager.Service/Interfaces/IManagerService.cs
Normal file
6
StandManager.Service/Interfaces/IManagerService.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace StandManager.Service.Interfaces;
|
||||
|
||||
public interface IManagerService
|
||||
{
|
||||
public IUtenteService UtenteService { get; set; }
|
||||
}
|
||||
9
StandManager.Service/Interfaces/IUtenteService.cs
Normal file
9
StandManager.Service/Interfaces/IUtenteService.cs
Normal file
@ -0,0 +1,9 @@
|
||||
using OAService.Service.Servizi.Interfacce;
|
||||
using StandManager.Domain.Entita;
|
||||
|
||||
namespace StandManager.Service.Interfaces;
|
||||
|
||||
public interface IUtenteService : ITService<Utente>
|
||||
{
|
||||
|
||||
}
|
||||
13
StandManager.Service/ManagerService.cs
Normal file
13
StandManager.Service/ManagerService.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using StandManager.Service.Interfaces;
|
||||
|
||||
namespace StandManager.Service;
|
||||
|
||||
public class ManagerService : IManagerService
|
||||
{
|
||||
public ManagerService(IUtenteService utenteService)
|
||||
{
|
||||
UtenteService = utenteService;
|
||||
}
|
||||
|
||||
public IUtenteService UtenteService { get; set; }
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
using OAService.Service.Repository;
|
||||
|
||||
namespace StandManager.Service.Repository;
|
||||
|
||||
public interface IStandManagerGenericRepository<T> : IGenericRepository<T> where T : class
|
||||
{
|
||||
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
using OAService.Service.Repository;
|
||||
using StandManager.Domain.Entita;
|
||||
|
||||
namespace StandManager.Service.Repository;
|
||||
|
||||
public interface IStandManagerUnitOfWork : IUnitOfWork
|
||||
{
|
||||
public IStandManagerGenericRepository<Utente> UtenteRepository { get; }
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
using OAService.Infrastructure.DAL.Repository;
|
||||
using StandManager.Infrastructure.DAL.Context;
|
||||
|
||||
namespace StandManager.Service.Repository;
|
||||
|
||||
public class StandManagerGenericRepository<T> : GenericRepository<T>, IStandManagerGenericRepository<T> where T : class
|
||||
{
|
||||
public StandManagerGenericRepository(StandManagerDbContext context) : base(context)
|
||||
{
|
||||
}
|
||||
}
|
||||
27
StandManager.Service/Repository/StandManagerUnitOfWork.cs
Normal file
27
StandManager.Service/Repository/StandManagerUnitOfWork.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using OAService.Infrastructure.DAL.Repository;
|
||||
using StandManager.Domain.Entita;
|
||||
using StandManager.Infrastructure.DAL.Context;
|
||||
|
||||
namespace StandManager.Service.Repository;
|
||||
|
||||
public class StandManagerUnitOfWork : UnitOfWork, IStandManagerUnitOfWork
|
||||
{
|
||||
private readonly StandManagerDbContext _context;
|
||||
private readonly IServiceProvider _provider;
|
||||
|
||||
public StandManagerUnitOfWork(StandManagerDbContext context, IServiceProvider provider) : base(context, provider)
|
||||
{
|
||||
_context = context;
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
public override IStandManagerGenericRepository<TEntity> GetRepository<TEntity>() where TEntity : class
|
||||
{
|
||||
return _provider.GetRequiredService<IStandManagerGenericRepository<TEntity>>();
|
||||
}
|
||||
|
||||
|
||||
private IStandManagerGenericRepository<Utente> _utenteRepository;
|
||||
public new IStandManagerGenericRepository<Utente> UtenteRepository => _utenteRepository ??= new StandManagerGenericRepository<Utente>(_context);
|
||||
}
|
||||
40
StandManager.Service/StandManager.Service.csproj
Normal file
40
StandManager.Service/StandManager.Service.csproj
Normal file
@ -0,0 +1,40 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Razor">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<SupportedPlatform Include="browser"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.21"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<_ContentIncludedByDefault Remove="wwwroot\background.png" />
|
||||
<_ContentIncludedByDefault Remove="wwwroot\exampleJsInterop.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\StandManager.Domain\StandManager.Domain.csproj" />
|
||||
<ProjectReference Include="..\StandManager.Infrastructure\StandManager.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="OAService.Domain">
|
||||
<HintPath>..\Libs\OAService.Domain.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OAService.Infrastructure">
|
||||
<HintPath>..\Libs\OAService.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="OAService.Service">
|
||||
<HintPath>..\Libs\OAService.Service.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
16
StandManager.Service/UtenteService.cs
Normal file
16
StandManager.Service/UtenteService.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using OAService.Service.Servizi.Implementazioni;
|
||||
using StandManager.Domain.Entita;
|
||||
using StandManager.Service.Interfaces;
|
||||
using StandManager.Service.Repository;
|
||||
|
||||
namespace StandManager.Service;
|
||||
|
||||
public class UtenteService : TService<Utente>, IUtenteService
|
||||
{
|
||||
private readonly IStandManagerUnitOfWork _unitOfWork;
|
||||
|
||||
public UtenteService(IStandManagerUnitOfWork unitOfWork) : base(unitOfWork)
|
||||
{
|
||||
_unitOfWork = unitOfWork;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user