예제 #1
0
        public Indhold Update(Indhold indholdChanges)
        {
            var indhold = context.Indholds.Attach(indholdChanges);

            indhold.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(indholdChanges);
        }
예제 #2
0
        public Indhold Delete(int id)
        {
            Indhold indhold = context.Indholds.Find(id);

            if (indhold != null)
            {
                context.Indholds.Remove(indhold);
                context.SaveChanges();
            }
            return(indhold);
        }
예제 #3
0
 public Indhold Create(Indhold indhold)
 {
     context.Indholds.Add(indhold);
     context.SaveChanges();
     return(indhold);
 }