public MainPage() { this.InitializeComponent(); AppValidator appVal = new AppValidator(new UWPDialog()); appVal.Validate(); }
public IActionResult Post([FromBody] TodoDto model) { var result = new GenericResult <TodoDto>(); var validatorResult = validator.Validate(model); if (validatorResult.IsValid) { try { result.Result = appService.Create(model); result.Success = true; } catch (Exception ex) { result.Errors = new string[] { ex.Message }; } } else { result.Errors = validatorResult.GetErrors(); } return(Ok(result)); }