Ejemplo n.º 1
0
        private async Task <AjaxResponse> AddParty(AddPartyModel newParty)
        {
            Tuple <string, bool> response = await _voteDataAppService.AddParty(newParty.Name, newParty.Detail, newParty.Image);

            AjaxResponse ar = new AjaxResponse();

            if (response.Item2)
            {
                ar.Success = true;
                ar.Result  = response.Item1;
            }
            else
            {
                ar.Success = false;
                ar.Error   = new ErrorInfo(response.Item1);
            }

            return(ar);
        }
Ejemplo n.º 2
0
 public async Task <AjaxResponse> AddPartyAsync([FromBody] AddPartyModel newParty)
 {
     return(await Task <AjaxResponse> .Run(() => AddParty(newParty)));
 }