Example #1
0
 public IEnumerable <Book> Books(addBookTemplate parameter)
 {
     return(new List <Book>
     {
         new Book
         {
             Title = parameter.Title,
             Author = parameter.Author
         }
     });
 }
Example #2
0
        public IHttpActionResult Books(addBookTemplate parameter)
        {
            var template = new Book
            {
                Title  = parameter.Title,
                Author = parameter.Author,
            };

            _bookService.CreateBook(template);



            return(CreatedAtRoute("GetBookById", new { id = template.Id }, template));
        }