コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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);
        }