public static void AddBookOrder(BookOrderView a) { ApplicationDbContext db = new ApplicationDbContext(); db.BookOrders.Add(ModelConverter.ViewToBookOrder(a)); db.SaveChanges(); }
public static BookOrder ViewToBookOrder(BookOrderView a) { return(new BookOrder { ApplicationUser = a.ApplicationUser, BookId = a.BookId, ApplicationUserId = a.ApplicationUserId, Book = a.Book, BuyDate = a.BuyDate }); }