Пример #1
0
        public static void AddBookOrder(BookOrderView a)
        {
            ApplicationDbContext db = new ApplicationDbContext();

            db.BookOrders.Add(ModelConverter.ViewToBookOrder(a));
            db.SaveChanges();
        }
Пример #2
0
 public static BookOrder ViewToBookOrder(BookOrderView a)
 {
     return(new BookOrder
     {
         ApplicationUser = a.ApplicationUser,
         BookId = a.BookId,
         ApplicationUserId = a.ApplicationUserId,
         Book = a.Book,
         BuyDate = a.BuyDate
     });
 }