public async Task <IActionResult> Create([FromBody] EventFlowEvent record) { await genericRepository.AddOneAsync(record); // This approach assumes you will be passing a valid action name to the controller. return(CreatedAtAction(createdAtActionName, new { id = record.Id }, record)); }
public async Task <IActionResult> ReplaceDocument(string id, [FromBody] EventFlowEvent record) { if (id != record.Id.ToString()) { return(BadRequest()); } var rec = await genericRepository.ReplaceOneAndGetAsync <EventFlowEvent>(id, record, null); return(Ok(rec)); }