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

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

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