public async Task <IActionResult> Put(int id, [FromBody] ExampleVM model) { var exampleModel = _mapper.Map <ExampleModel>(model); await _exampleService.UpdateExampleModelAsync(exampleModel); return(Ok()); }
public MainViewModel() { _dict = new Dictionary <string, IVM>(); ExampleVM vm1 = new ExampleVM(); ExampleVM2 vm2 = new ExampleVM2(); _dict.Add("vm1", vm1); _dict.Add("vm2", vm2); _name = "Initial"; CurrentView = _dict["vm1"]; }
public ActionResult Post([FromBody] ExampleVM model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var exampleModel = _mapper.Map <ExampleModel>(model); _exampleService.CreateExampleModel(exampleModel); return(CreatedAtAction(nameof(GetById), new { id = exampleModel.Id }, exampleModel)); }
public Examples(MainWindow window, long WordID) { DataContext = new ExampleVM(window, WordID); InitializeComponent(); }