Ejemplo n.º 1
0
        public BookWriter Post(BookWriterDTO value)
        {
            BookWriter model = new BookWriter()
            {
                BookId   = value.BookId,
                WriterId = value.WriterId
            };

            return(IBookWriterRepository.Create(model));
        }
Ejemplo n.º 2
0
        public BookWriter Put(int id, BookWriterDTO value)
        {
            BookWriter model = IBookWriterRepository.Get(id);

            if (value.BookId != 0)
            {
                model.BookId = value.BookId;
            }
            if (value.WriterId != 0)
            {
                model.WriterId = value.WriterId;
            }

            return(IBookWriterRepository.Update(model));
        }