using System; using System.Collections.Generic; using System.Text; namespace SessionCompanion.Services.Services { using System.Linq; using System.Threading.Tasks; using AutoMapper; using Microsoft.EntityFrameworkCore; using SessionCompanion.Database.Repositories.Base; using SessionCompanion.Database.Tables; using SessionCompanion.Services.Base; using SessionCompanion.Services.Interfaces; using SessionCompanion.ViewModels.CharacterArmorViewModels; using SessionCompanion.ViewModels.CharacterOtherEquipmentViewModels; public class CharacterArmorService : ServiceBase, ICharacterArmorService { public CharacterArmorService(IMapper mapper, IRepository repository) : base(mapper, repository) { } /// /// Metoda pobiera listę pancerzy konkretnej postaci /// /// Id postaci /// Lista pancerzy posiadanych przez postać public async Task> GetCharacterArmorsTaskList(int characterId) { var characterWeapons = await Repository.Get().Where(a => a.CharacterId.Equals(characterId)).Include(a => a.Armor).ToListAsync(); var result = Mapper.Map>(characterWeapons); return result; } } }