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); }
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); }
public Specialization getByName(string name) { Specialization acc = _context.Specializations.FirstOrDefault(o => o.name == name); return(acc); }