public void Add(Student student) { try { if (student != null) { Student newEntity = dbSet.Add(student); dbSet.Attach(newEntity); context.Entry(newEntity).State = EntityState.Added; } } catch (Exception) { throw; } }
public void Add(News news) { try { if (news != null) { News newEntity = dbSet.Add(news); dbSet.Attach(newEntity); context.Entry(newEntity).State = EntityState.Added; } } catch (Exception) { throw; } }
public void Add(Department department) { try { if (department != null) { Department newEntity = dbSet.Add(department); dbSet.Attach(newEntity); context.Entry(newEntity).State = EntityState.Added; } } catch (Exception) { throw; } }
public void Add(Event events) { try { if (events != null) { Event newEntity = dbSet.Add(events); dbSet.Attach(newEntity); context.Entry(newEntity).State = EntityState.Added; } } catch (Exception) { throw; } }