コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,Name,Company,Article,Price,Image,ImageType")] Watch watch)
        {
            if (ModelState.IsValid)
            {
                _context.Add(watch);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(watch));
        }
コード例 #2
0
        public void AddCustomer(Library.Customer customer)
        {
            Customer Entity = Map.MapCustomerWithEF(customer);

            MyDBContext.Add(Entity);
        }