public bool UpdateFemaleModel(FemaleModelModel model) { var item = _femaleModels.Where(a => a.id == model.id).FirstOrDefault(); item = model; return(true); }
public async void Register() { FemaleModelModel model = new FemaleModelModel(); model.Username = loginmodel.UserName; model.Password = loginmodel.Password; await _femaleModelDataService.AddFemaleModel(model); navmanager.NavigateTo("/"); }
public async Task <FemaleModelModel> AddFemaleModel(FemaleModelModel model) { var modelJson = new StringContent(JsonSerializer.Serialize(model), System.Text.Encoding.UTF8, "application/json"); var response = await _httpClient.PostAsync("api/FemaleModel", modelJson); if (response.IsSuccessStatusCode) { return(await JsonSerializer.DeserializeAsync <FemaleModelModel>(await response.Content.ReadAsStreamAsync())); } return(null); }
public IActionResult Post([FromBody] FemaleModelModel model) { if (model == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } model.Image = GeneralStaticdata.chosenimage; model.imagepath = GeneralStaticdata.ImagePath; GeneralStaticdata.chosenimage = null; GeneralStaticdata.ImagePath = null; return(Created("femalemodel", _dataService.AddFemaleModelReturnType(model))); }
public IActionResult Put([FromBody] FemaleModelModel model) { if (model == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var item = _dataService.ReturnFemaleModel(model.id); if (item == null) { return(NotFound()); } _dataService.UpdateFemaleModel(model); return(NoContent()); //success }
public bool RemoveFemaleModel(FemaleModelModel model) { _femaleModels.Remove(model); return(true); }
public FemaleModelModel AddFemaleModelReturnType(FemaleModelModel model) { model.id = Guid.NewGuid().ToString(); _femaleModels.Add(model); return(model); }
public bool AddFemaleModel(FemaleModelModel model) { model.id = Guid.NewGuid().ToString(); _femaleModels.Add(model); return(true); }
public async Task UpdateFemaleModel(FemaleModelModel model) { var modelJson = new StringContent(JsonSerializer.Serialize(model), System.Text.Encoding.UTF8, "application/json"); await _httpClient.PutAsync("api/FemaleModel", modelJson); }