Esempio n. 1
0
        public void AddComic(ComicBookDTO dto, string currentUser)
        {
            var user = new ApplicationUser(); // THIS IS JUST MOCK CODE. GET THE USER FROM THE DB

            var dbItem = new ComicBook() {

                Title = dto.Title,
                IssueNumber = dto.IssueNumber,
                CoverImageUrl = dto.CoverImageUrl,
                Genre = dto.Genre,
                Price = dto.Price,
                ReleaseDate = dto.ReleaseDate,
                User = user
            };

            _comicRepo.Add(dbItem);
        }
Esempio n. 2
0
 public void Add(ComicBook book)
 {
     _db.ComicBooks.Add(book);
     _db.SaveChanges();
 }