public Directorate Update(Directorate directorate)
        {
            var newDirectorate = context.Directorates.Attach(directorate);

            newDirectorate.State = Microsoft.EntityFrameworkCore.EntityState.Modified;
            context.SaveChanges();
            return(directorate);
        }
        public Directorate Delete(int id)
        {
            Directorate directorate = context.Directorates.Find(id);

            if (directorate != null)
            {
                context.Directorates.Remove(directorate);
                context.SaveChanges();
            }
            return(directorate);
        }
 public Directorate AddDirectorate(Directorate directorate)
 {
     context.Directorates.Add(directorate);
     context.SaveChanges();
     return(directorate);
 }