コード例 #1
0
        public ActionResult Add(int id)
        {
            IntentAddViewModel model = new IntentAddViewModel()
            {
                SkillId = id
            };


            return(View(model));
        }
コード例 #2
0
 public ActionResult Add(IntentAddViewModel model)
 {
     using (AlexaSkillEntities db = new AlexaSkillEntities())
     {
         Intent intent = new Intent()
         {
             SkillId          = model.SkillId,
             Name             = model.Name.Replace(" ", ""),
             ShouldEndSession = model.ShouldEndSession
         };
         db.Intents.Add(intent);
         db.SaveChanges();
         return(RedirectToAction("Detail", "Intent", new { id = intent.Id }));
     }
 }