コード例 #1
0
        public void Post([FromBody] Joke újVicc)
        {
            FunnyDatabaseContext context = new FunnyDatabaseContext();

            context.Jokes.Add(újVicc);
            context.SaveChanges();
        }
コード例 #2
0
 public void Delete(int id)
 {
     FunnyDatabaseContext context = new FunnyDatabaseContext();
     var törlendőVicc = (from x in context.Jokes
                         where x.JokeSk == id
                         select x).FirstOrDefault();
     context.Remove(törlendőVicc);
     context.SaveChanges();
 }