Esempio n. 1
0
        public async Task <IActionResult> Put(int id, [FromBody] ExampleVM model)
        {
            var exampleModel = _mapper.Map <ExampleModel>(model);
            await _exampleService.UpdateExampleModelAsync(exampleModel);

            return(Ok());
        }
Esempio n. 2
0
        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"];
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
 public Examples(MainWindow window, long WordID)
 {
     DataContext = new ExampleVM(window, WordID);
     InitializeComponent();
 }