Beispiel #1
0
        public async Task <Dog> Create(NewDog newDog)
        {
            var dog = this.newDogToAnimalTransform.From(newDog);

            this.animalWriter.Create(dog);
            await this.animalWriter.SaveAsync();

            return(this.animalTransform.From(dog));
        }
        public async Task <Dog> CreateDog(NewDog dog)
        {
            Dog dog2 = new Dog();

            dog2.Name = dog.Name;
            dog2.id   = ObjectId.GenerateNewId();
            var value = await repo.Create(dog2);

            return(value);
        }
        public Task <Dog> CreateDog([FromBody] NewDog dog)
        {
            var value = dogPro.Create(Dog);

            if (value == null)
            {
                return(null);
            }
            return(value);
        }