Exemple #1
0
        public async Task <bool> ProcessAsync(TcpClient client, Guid clientId, Request request)
        {
            try
            {
                var info = JsonConvert.DeserializeObject <Dictionary <string, string> >(request.Body);
                await m_participantService.CreateParticipant(Guid.Parse(info["idParticipant"]), info["participantName"], int.Parse(info["participantAge"]));

                return(true);
            }
            catch (Exception e)
            {
                m_logger.LogError($"Could not add to DataBase : {request.Body}");
                return(false);
            }
        }
 public async Task <IActionResult> CreateParticipant(CreateParticipantModel participantModel)
 {
     return(Ok(await _participantService.CreateParticipant(participantModel)));
 }