public async Task <int> CreateExample(CreateExampleModel createExampleModel)
        {
            var example = new Example()
            {
                CreatedDate = DateTime.Now,
                Name        = createExampleModel.Name,
                Age         = createExampleModel.Age
            };

            var createdExample = await exampleRepository.Add(example);

            return(createdExample.Id);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> PostExample([FromBody] CreateExampleModel createExampleModel)
        {
            var createdExampleId = await exampleService.CreateExample(createExampleModel);

            return(Ok(createdExampleId));
        }