SES-105 list of logged charcters #36

Merged
s426134 merged 7 commits from SES-105 into dev 2020-12-21 13:40:47 +01:00
2 changed files with 15 additions and 0 deletions
Showing only changes of commit 11af142a09 - Show all commits

View File

@ -10,6 +10,7 @@ namespace SessionCompanion.Services.Interfaces
{
public interface ICharacterService : IServiceBase<CharacterViewModel, Character>
{
Task<CharacterBasicStatsViewModel> GetBasicCharacterData(int characterId);
Task<IEnumerable<CharacterForLoginViewModel>> GetUserLoginCharacters(int userId);
}
}

View File

@ -37,5 +37,19 @@ namespace SessionCompanion.Services.Services
return result;
}
/// <summary>
/// Funkcja zwraca podstawowy widok postaci na podstawie ich id
/// </summary>
/// <param name="characterId">identyfikator postaci</param>
/// <returns>Podstawowy widok danej postaci</returns>
public async Task<CharacterBasicStatsViewModel> GetBasicCharacterData(int characterId)
{
var characters = await Repository.Get(c => c.Id == characterId)
.Include(x => x.Biography)
.Include(x => x.Statistics).ToListAsync();
var result = Mapper.Map<CharacterBasicStatsViewModel>(characters);
return result;
}
}
}