Exemple #1
0
 public Specialization add(Specialization acc)
 {
     try
     {
         _context.Specializations.Add(acc);
         _context.SaveChanges();
         Logger.Log(acc.name + " is Added", LogType.Info);
     }
     catch (Exception e)
     {
         Logger.Log(e.ToString(), LogType.Error);
     }
     return(acc);
 }
Exemple #2
0
 public Specialization delete(Specialization acc)
 {
     try
     {
         _context.Entry(acc).State = System.Data.Entity.EntityState.Deleted;
         _context.SaveChanges();
         Logger.Log(acc.name + " is Deleted", LogType.Info);
     }
     catch (Exception e)
     {
         Logger.Log(e.ToString(), LogType.Error);
     }
     return(acc);
 }
Exemple #3
0
        public Specialization getByName(string name)
        {
            Specialization acc = _context.Specializations.FirstOrDefault(o => o.name == name);

            return(acc);
        }