public dynamic addCity(dynamic data) { dynamic objdata = new ExpandoObject(); string serializedObject = string.Empty; try { UserLogin objUser = new UserLogin(); objUser.Email = Request.Headers["Email"]; objUser.Password = Request.Headers["Password"]; var objVal = _user.CheckloginUser(objUser); if (objVal.success == true) { serializedObject = JsonSerializer.Serialize(data); CityModel rootobj = JsonSerializer.Deserialize <CityModel>(serializedObject); return(Ok(_city.addCity(rootobj))); } return(Ok(objVal)); } catch (Exception ex) { objdata.success = false; objdata.result = ""; objdata.message = ex.Message.ToString(); throw; } }
public dynamic checkloginUser() { UserLogin objUser = new UserLogin(); string serialized_data = string.Empty; try { objUser.Email = Request.Headers["Email"]; objUser.Password = Request.Headers["Password"]; var obj = _user.CheckloginUser(objUser); return(Ok(obj)); } catch (Exception ex) { throw ex; } }