public async Task <IActionResult> CreateEducator([FromForm] CreateEducatorDto input) { try { var user = await _educatorAppService.CreateEducator(input); return(Ok(user)); } catch (Exception e) { Console.WriteLine(e); throw; } }
public async Task <Educator> CreateEducator(CreateEducatorDto input) { var logoPath = await _blobService.InsertFile(input.File); var hashedPassword = SecurePasswordHasherHelper.Hash(input.Password); var educator = new Educator { Name = input.Name, Surname = input.Surname, Email = input.Email, Password = hashedPassword, Profession = input.Profession, Resume = input.Resume, ProfileImagePath = logoPath }; await _educatorRepository.AddAsync(educator); return(educator); }