public async Task <IActionResult> Create(AddApartmentViewModel model) { if (ModelState.IsValid) { var user = await GetActiveUserId(); //var owner = await _ownerService.GetOwnerByUserIdAsync(user.ToString()); await _apartmentService.AddAsync(model, user.ToString()); return(RedirectToAction("Index", "Owner")); } ViewBag.LocationId = new SelectList(await _locationService.GetAll(), "LocationId", "Address"); return(View(model)); }