public void UpdateRollerSkateMapLocation(RollerSkateMapLocation updatedRollerSkateMapLocation)
        {
            RollerSkateMapLocation location = _appDbContext.RollerSkateMapLocations.FirstOrDefault(x => x.Id == updatedRollerSkateMapLocation.Id);

            if (location != null)
            {
                location = updatedRollerSkateMapLocation;
                _appDbContext.SaveChanges();
            }
        }
Ejemplo n.º 2
0
        public IActionResult AddRollerSkateMapLocation([FromBody] RollerSkateMapLocationViewModel newRollerSkateMapLocationViewModel)
        {
            if (newRollerSkateMapLocationViewModel.UserId < 1)
            {
                return(BadRequest());
            }
            RollerSkateMapLocation rollerSkateMapLocation = new RollerSkateMapLocation()
            {
                UserId                  = newRollerSkateMapLocationViewModel.UserId,
                LocationName            = newRollerSkateMapLocationViewModel.LocationName,
                Longitude               = newRollerSkateMapLocationViewModel.Longitude,
                Latitude                = newRollerSkateMapLocationViewModel.Latitude,
                LocationCreatedDateTime = DateTime.Now,
                Address                 = newRollerSkateMapLocationViewModel.Address,
                Description             = newRollerSkateMapLocationViewModel.Description
            };

            _rollerSkateMapLocationRepository.AddRollerSkateMapLocation(rollerSkateMapLocation);
            return(Json("Ok"));
        }
 public void AddRollerSkateMapLocation(RollerSkateMapLocation newRollerSkateMapLocation)
 {
     _appDbContext.RollerSkateMapLocations.Add(newRollerSkateMapLocation);
     _appDbContext.SaveChanges();
 }
Ejemplo n.º 4
0
 public IActionResult UpdateRollerSkateMapLocation([FromBody] RollerSkateMapLocation updatedRollerSkateMapLocation)
 {
     _rollerSkateMapLocationRepository.UpdateRollerSkateMapLocation(updatedRollerSkateMapLocation);
     return(Ok());
 }