public IActionResult SaveBackground([FromBody] BackgroundLocation model) { try { _backgroundLocQuery.SaveBackground(model); return(Ok()); } catch (Exception ex) { return(BadRequest(ex.Message)); } }
public string SaveBackground(BackgroundLocation model) { //var userid = _httpContextAccessor.HttpContext.User.GetLoggedInUserId<string>(); //if (string.IsNullOrEmpty(userid)) // throw new InvalidOperationException("User Not found"); CoreSQLConnection CoreSQL = new CoreSQLConnection(); ArrayList arrayList = new ArrayList(); Guid guid = Guid.NewGuid(); var sqlQuery = "Insert Into tbl_background_location(id, lat, lng, speed)" + " Values ( '" + guid.ToString() + "', '" + model.lat + "','" + model.lng + "', '" + model.speed + "')"; arrayList.Add(sqlQuery); CoreSQL.CoreSQL_SaveDataUseSQLCommand(arrayList); return("Success"); }