Example #1
0
        public async Task <IActionResult> Create([FromBody] ParticipantInputModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var item = new Participant
            {
                Name  = model.Name,
                Email = model.Email
            };

            _context.Add(item);
            await _context.SaveChangesAsync();

            return(Ok(
                       new ParticipantOutputModel
            {
                Name = item.Name,
                Email = model.Email,
                Id = item.Id,
            }
                       ));
        }
Example #2
0
 public ParticipantModel GetParticipant(ParticipantInputModel participantInputModel)
 {
     return(Post <ParticipantModel, ParticipantInputModel>("mod_assign_get_participant", participantInputModel));
 }