SES-152 Add profiles and services

This commit is contained in:
Karol Górzyński 2021-01-20 18:54:56 +01:00
parent 3e1f7cd637
commit b31cf9c703
5 changed files with 80 additions and 0 deletions

View File

@ -0,0 +1,19 @@
using AutoMapper;
using SessionCompanion.Database.Tables;
using SessionCompanion.ViewModels.ShopkeeperItemsViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Services.Profiles
{
public class ShopkeeperItemsProfile : Profile
{
public ShopkeeperItemsProfile()
{
CreateMap<ShopkeeperItemViewModel, ShopkeeperItem>().ReverseMap();
}
}
}

View File

@ -0,0 +1,19 @@
using AutoMapper;
using SessionCompanion.Database.Tables;
using SessionCompanion.ViewModels.ShopkeeperViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Services.Profiles
{
public class ShopkeeperProfile : Profile
{
public ShopkeeperProfile()
{
CreateMap<ShopkeeperViewModel, Shopkeeper>().ReverseMap();
}
}
}

View File

@ -0,0 +1,20 @@
using AutoMapper;
using SessionCompanion.Database.Repositories.Base;
using SessionCompanion.Database.Tables;
using SessionCompanion.Services.Base;
using SessionCompanion.Services.Interfaces;
using SessionCompanion.ViewModels.ShopkeeperItemsViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Services.Services
{
public class ShopkeeperItemService : ServiceBase<ShopkeeperItemViewModel, ShopkeeperItem>, IShopkeeperItemService
{
public ShopkeeperItemService(IMapper mapper, IRepository<ShopkeeperItem> repository) : base(mapper, repository)
{ }
}
}

View File

@ -0,0 +1,20 @@
using AutoMapper;
using SessionCompanion.Database.Repositories.Base;
using SessionCompanion.Database.Tables;
using SessionCompanion.Services.Base;
using SessionCompanion.Services.Interfaces;
using SessionCompanion.ViewModels.ShopkeeperViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SessionCompanion.Services.Services
{
public class ShopkeeperService : ServiceBase<ShopkeeperViewModel, Shopkeeper>, IShopkeeperService
{
public ShopkeeperService(IMapper mapper, IRepository<Shopkeeper> repository) : base(mapper, repository)
{ }
}
}

View File

@ -36,6 +36,8 @@ namespace SessionCompanion.Configurations
services.AddScoped<IWeaponService, WeaponService>();
services.AddScoped<ICharacterWeaponService, CharacterWeaponService>();
services.AddScoped<IMonsterService, MonsterService>();
services.AddScoped<IShopkeeperService, ShopkeeperService>();
services.AddScoped<IShopkeeperItemService, ShopkeeperItemService>();
return services;
}