コード例 #1
0
        public static void AddAuthor()
        {
            Console.WriteLine("Имя автора: ");
            string firstname = Console.ReadLine();

            Console.WriteLine("Фамилия автора: ");
            string lastname = Console.ReadLine();

            Console.WriteLine("Отчество автора: ");
            string middlename = Console.ReadLine();
            var    newAuthor  = new Author()
            {
                FirstName  = firstname,
                LastName   = lastname,
                MiddleName = middlename
            };

            authorLogic.AddAuthor(newAuthor);
        }
コード例 #2
0
 public ActionResult Create(CreateAuthorVM author)
 {
     if (ModelState.IsValid)
     {
         try
         {
             _authorLogic.AddAuthor(_mapper.Map <Author>(author));
             return(ShowDropdownMultiSelect());
         }
         catch (Exception ex)
         {
             Logger.Error(ex.Message);
         }
     }
     else
     {
         Logger.Info("Model State is not Valid for Author Creation.");
     }
     return(View(author));
 }