コード例 #1
0
        public void Update(BookPutViewModel user)
        {
            var book = _context.Books.FirstOrDefault(f => f.Id == user.Id);

            book.Name     = user.Name;
            book.AuthorId = user.AuthorId;
            book.BookUrl  = BookUrl == null ? book.BookUrl : BookUrl;
            book.PhotoUrl = PhotoUrl == null ? user.PhotoUrl : PhotoUrl;

            _context.Update(book);
            _context.SaveChanges();

            BookUrl  = null;
            PhotoUrl = null;
        }
コード例 #2
0
        public async Task <bool> Put(BookPutViewModel model)
        {
            _bookService.Update(model);

            return(true);
        }