public bool UpdateMaleModel(MaleModeModel model) { var item = _maleModels.Where(a => a.id == model.id).FirstOrDefault(); item = model; return(true); }
public async void Register() { MaleModeModel model = new MaleModeModel(); model.Username = loginmodel.UserName; model.Password = loginmodel.Password; await _maleModelDataService.AddMaleModel(model); navmanager.NavigateTo("/"); }
public async Task <MaleModeModel> AddMaleModel(MaleModeModel model) { var modelJson = new StringContent(JsonSerializer.Serialize(model), System.Text.Encoding.UTF8, "application/json"); var response = await _httpClient.PostAsync("api/MaleModel", modelJson); if (response.IsSuccessStatusCode) { return(await JsonSerializer.DeserializeAsync <MaleModeModel>(await response.Content.ReadAsStreamAsync())); } return(null); }
public IActionResult Post([FromBody] MaleModeModel 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("event", _dataService.AddMaleModelReturnType(model))); }
public IActionResult Put([FromBody] MaleModeModel model) { if (model == null) { return(BadRequest()); } if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var item = _dataService.ReturnMaleModel(model.id); if (item == null) { return(NotFound()); } _dataService.UpdateMaleModel(model); return(NoContent()); //success }
public bool RemoveMaleModel(MaleModeModel model) { _maleModels.Remove(model); return(true); }
public MaleModeModel AddMaleModelReturnType(MaleModeModel model) { model.id = Guid.NewGuid().ToString(); _maleModels.Add(model); return(model); }
public bool AddMaleModel(MaleModeModel model) { model.id = Guid.NewGuid().ToString(); _maleModels.Add(model); return(true); }
public async Task UpdateMaleModel(MaleModeModel model) { var modelJson = new StringContent(JsonSerializer.Serialize(model), System.Text.Encoding.UTF8, "application/json"); await _httpClient.PutAsync("api/MaleModel", modelJson); }
public void test() { MaleModeModel model = new MaleModeModel(); Console.WriteLine("something"); }