示例#1
0
 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));
 }
示例#2
0
 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));
 }
示例#3
0
        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);
示例#5
0
 public NigerianStates PostState(NigerianStates state) => storageBroker.Post(state);