Exemple #1
0
        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));
        }
Exemple #2
0
        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));
        }