public ActionResult Create([Bind("Id,Name,FullAddress,Latitude,Longitude,ImageUrl,PhoneNumber,Description")] PublicPlaces publicPlaces) { if (ModelState.IsValid) { publicPlaces.Id = Guid.NewGuid(); publicPlaces.PostedBy = PersistUser.userName; storage.Post(publicPlaces); return(RedirectToAction(nameof(Index))); } return(View(publicPlaces)); }
public ActionResult Create([Bind("Id,Name,FullAddress,Latitude,Longitude,Description")] PublicPlaces publicPlaces) { if (ModelState.IsValid) { publicPlaces.Id = Guid.NewGuid(); storage.Post(publicPlaces); //_context.Add(publicPlaces); //await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(publicPlaces)); }
public IActionResult Create([Bind("UserId,UserName,Email,Password,IsSignedIn")] User user) { SignInViewModel signInViewModel = new SignInViewModel() { Email = user.Email, Password = user.Password }; if (ModelState.IsValid) { user.UserId = Guid.NewGuid(); user.IsSignedIn = true; storage.Post(user); PersistUser.userId = default; userManager.SignIn(signInViewModel); PersistUser.userId = user.UserId; return(RedirectToAction("Index", "Home")); } return(View(user)); }
public PublicPlaces PostPlaces(PublicPlaces places) => storageBroker.Post(places);
public NigerianStates PostState(NigerianStates state) => storageBroker.Post(state);