public async Task <IActionResult> Create([Bind("Id,Displayname,Firstname,Lastname,Bio,UserAccountId")] BuildUser buildUser, IFormFile FilePhoto)
        {
            if (FilePhoto.Length > 0)
            {
                string photoPath = _webroot.WebRootPath + "\\userPhotos\\";
                var    fileName  = Path.GetFileName(FilePhoto.FileName);

                using (var stream = System.IO.File.Create(photoPath + fileName))
                {
                    await FilePhoto.CopyToAsync(stream);

                    buildUser.PhotoPath = fileName;
                }
            }

            if (ModelState.IsValid)
            {
                _context.Add(buildUser);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(ProfileInfo)));
            }
            return(View(buildUser));
        }
        public async Task <IActionResult> Create([Bind("Id,Buildname,BuildContent,MaterialUsed,BuildTime,BuildBiome,ProfileId,BuilderNum,WorldSeed,BuildDate")] BuildTable buildTable, IFormFile FilePhoto)
        {
            if (FilePhoto.Length > 0)
            {
                string buildPhoto = _webroot.WebRootPath + "\\buildPhotos\\";
                var    fileName   = Path.GetFileName(FilePhoto.FileName);

                using (var stream = System.IO.File.Create(buildPhoto + fileName))
                {
                    await FilePhoto.CopyToAsync(stream);

                    buildTable.BuildPhoto = fileName;
                }
            }
            if (ModelState.IsValid)
            {
                _context.Add(buildTable);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProfileId"] = new SelectList(_context.BuildUser, "Id", "Bio", buildTable.ProfileId);
            return(View(buildTable));
        }