public async ValueTask <IActionResult> Post([FromBody] DeaneryViewModel model) { if (ModelState.IsValid) { Deanery deanery = model.Convert <DeaneryViewModel, Deanery>(_mapper); (bool succeeded, Deanery addedDeanery, string error) = await _repo.Add(deanery); if (succeeded) { return(await Get(addedDeanery.Id)); } return(BadRequest(new { Message = error })); } return(BadRequest(new { Errors = ModelState.Values.SelectMany(e => e.Errors).ToList() })); }
public DeaneryPage() { InitializeComponent(); BindingContext = viewModel = new DeaneryViewModel(); }