コード例 #1
0
        public IActionResult Register(Customer c)
        {
            //context = new BookStoreDBContext();
            var result = service.AddRecord(c);

            if (result == 0)
            {
                ModelState.AddModelError("Email", "EmailId already Exist.. Try with another EmailId...");
                return(View("Register"));
            }
            try
            {
                log.LogInformation("Executing Register method");
                log.LogInformation("This is a Test Message");
            }
            catch (Exception e)
            {
                log.LogCritical(e.Message);
                log.LogInformation("Executed Register Method..");
            };
            return(RedirectToAction("Login"));
        }
コード例 #2
0
 public IActionResult NewEmp(Emp em)
 {
     service.AddRecord(em);
     return(RedirectToAction("About"));
 }