public void Delete(Securables entity) { try { entities.Securabless.Remove(entity); } catch (Exception ex) { throw ex; } }
public void Add(Securables entity) { try { entities.Securabless.Add(entity); } catch (Exception ex) { throw ex; } }
public void Attach(Securables entity) { try { entities.Securabless.Attach(entity); entities.Entry(entity).State = EntityState.Modified; } catch (Exception ex) { throw ex; } }
public void Save(Securables entity) { try { Securables securables = entities.Securabless .Where(x => x.SecurableID == entity.SecurableID).FirstOrDefault(); if (securables != null) { entities.Entry(securables).State = EntityState.Modified; } else { Add(entity); } } catch (Exception ex) { throw ex; } }
public bool IsSecuredAllowed(string securable) { return(Securables.ContainsKey(securable) && Securables[securable]); }