using AutoMapper; using SessionCompanion.Database.Repositories.Base; using SessionCompanion.Database.Tables; using SessionCompanion.Services.Base; using SessionCompanion.Services.Interfaces; using SessionCompanion.ViewModels.UserViewModels; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; using System.Linq; using Microsoft.EntityFrameworkCore; namespace SessionCompanion.Services.Services { public class UserService : ServiceBase, IUserService { public UserService(IMapper mapper, IRepository repository) : base(mapper, repository) { } public async Task SearchUserByNickname(string userName) { var User = await Repository.Get(u => u.Nickname.Equals(userName)).FirstOrDefaultAsync(); return Mapper.Map(User); } } }