public bool Add(ICRUDableEntity Entity)
        {
            var mapper  = BookMap.InitializeMapper();
            var bookDTO = mapper.Map <Models.Books>(Entity);

            using (var context = new BookStoreContext())
            {
                context.Books.Add(bookDTO);
                context.SaveChanges();
            }

            return(true);
        }
        public bool Update(int ID, ICRUDableEntity Entity)
        {
            var mapper    = AuthorMap.InitializeMapper();
            var authorDTO = mapper.Map <Models.Authors>(Entity);

            authorDTO.AuthorId = ID;

            using (var context = new BookStoreContext())
            {
                context.Authors.Update(authorDTO);
                context.SaveChanges();
            }

            return(true);
        }
        public bool Update(int ID, ICRUDableEntity Entity)
        {
            var mapper      = BookSaleMap.InitializeMapper();
            var bookSaleDTO = mapper.Map <Models.BookSales>(Entity);

            bookSaleDTO.SaleId = ID;

            using (var context = new BookStoreContext())
            {
                context.BookSales.Update(bookSaleDTO);
                context.SaveChanges();
            }

            return(true);
        }