public Task <MyEntity> Post(MyEntityViewModel model, CancellationToken cancellationToken)
        {
            var entity = new MyEntity
            {
                Name = model.Name,
                Age  = model.Age
            };

            return(_repository.Insert(entity, cancellationToken));
        }
        public async Task <MyEntity> Put([Required, Range(0, int.MaxValue)] int id, MyEntityViewModel model, CancellationToken cancellationToken)
        {
            var entity = await _repository.Get(id, cancellationToken);

            if (entity != null)
            {
                entity.Name = model.Name;
                entity.Age  = model.Age;
            }

            return(await _repository.Update(entity, cancellationToken));
        }