public async Task <IActionResult> AddObject([FromBody] Authenticate model) { if (model == null) { throw new ArgumentNullException(nameof(model)); } else { var response = await _service.AddObject(model); if (response != null) { //return Ok(response); return(CreatedAtAction(nameof(GetObjectById), new { id = model.Id }, model)); //Get model after creating } return(NotFound()); } }