private async Task CreateUserWithRole(RegisterViewModel userModel)
        {
            var user = await userManager.FindByEmailAsync(userModel.Email);

            if (userModel.Job == Job.Developer)
            {
                var roleExist = await roleManager.FindByNameAsync("Developer");

                if (roleExist == null)
                {
                    await roleManager.CreateAsync(new Role { Name = "Developer", Id = Guid.NewGuid().ToString() });
                }
                await userManager.AddToRoleAsync(user, "Developer");

                await freelancerDb.Developers.AddAsync(new Developer { User = user, DeveloperId = user.Id });
            }
            else
            {
                var roleExist = await roleManager.FindByNameAsync("Owner");

                if (roleExist == null)
                {
                    await roleManager.CreateAsync(new Role { Name = "Owner", Id = Guid.NewGuid().ToString() });
                }
                await userManager.AddToRoleAsync(user, "Owner");

                await freelancerDb.Owners.AddAsync(new Owner { User = user, OwnerId = user.Id });
            }
            await freelancerDb.SaveChangesAsync();
        }
        public async Task <IActionResult> UploadProfilePhoto(IFormFile file)
        {
            var current     = Directory.GetCurrentDirectory();
            var imgSrc      = Path.Combine(current, "wwwroot", "img", file.FileName);
            var currentUser = await _userManager.GetUserAsync(HttpContext.User);

            currentUser.ProfilePicture = $"~/img/{file.FileName}";
            await _freelancerDbContext.SaveChangesAsync();

            await using var stream = new FileStream(imgSrc, FileMode.Create);
            await file.CopyToAsync(stream);

            return(RedirectToAction("Profile", "Owner"));
        }