示例#1
0
        public long Insert(Post post)
        {
            PostDTO dto = new PostDTO();

            dto = converter.ModelToDTO(post);
            return(context.Insert(dto));
        }
示例#2
0
        public IActionResult MaakPostAan(PostStelPostOpViewModel vm)
        {
            Post post = new Post {
                Categorie = vm.Categorie, Naam = vm.Naam, BeschrijvingTaal = vm.BeschrijvingTaal,
                MoeilijkheidsgraadOnderwerp = vm.MoeilijkheidsgraadOnderwerp, TaalVersie = vm.TaalVersie
            };

            try
            {
                postContext.Insert(post);
                return(RedirectToAction("Index"));
            } catch (SqlException exp)
            {
                return(RedirectToAction("StelPostOp", vm));
            }
        }
示例#3
0
 public Post InsertPost(Post post)
 {
     return(_context.Insert(post));
 }
 public void Insert(Post post)
 {
     context.Insert(post);
 }