コード例 #1
0
        public IActionResult Create
            (GoogleMapsCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                var newEmployee = new GoogleMap
                {
                    Address = model.Address,
                    Lat     = model.Lat,
                    Long    = model.Long
                };
                _googleMapsRepository.Add(newEmployee);

                return(RedirectToAction("Index",
                                        "GoogleMaps"));
            }

            return(View());
        }
コード例 #2
0
        public IActionResult Create
            (GoogleMapsCreateViewModel model)
        {
            if (ModelState.IsValid)
            {
                var newLocation = new GoogleMapDTO
                {
                    Address = model.Address,
                    Lat     = model.Lat,
                    Long    = model.Long
                };

                _GoogleMapSvc.Add(newLocation);


                return(RedirectToAction("Index",
                                        "GoogleMaps"));
            }

            return(View());
        }