/// <summary> /// Delete a permission /// </summary> /// <param name="permission">Permission</param> public virtual void DeleteSystemPermission(SystemPermission permission) { if (permission == null) throw new ArgumentNullException("permission"); using (var context = new SsepsIIEntities()) { context.SystemPermissions.Attach(permission); ((IObjectContextAdapter)context).ObjectContext.ObjectStateManager.ChangeObjectState(permission, System.Data.EntityState.Modified); context.SystemPermissions.Remove(permission); context.SaveChanges(); } ClearCache(); }
/// <summary> /// Inserts a permission /// </summary> /// <param name="permission">Permission</param> public virtual void InsertSystemPermission(SystemPermission permission) { if (permission == null) throw new ArgumentNullException("permission"); using (var context = new SsepsIIEntities()) { context.SystemPermissions.Add(permission); context.SaveChanges(); } ClearCache(); }
public void DeleteSystemRolePermission(SystemRolePermission rolePermission) { using (var context = new SsepsIIEntities()) { context.SystemRolePermissions.Attach(rolePermission); ((IObjectContextAdapter)context).ObjectContext.ObjectStateManager.ChangeObjectState(rolePermission, System.Data.EntityState.Modified); context.SystemRolePermissions.Remove(rolePermission); context.SaveChanges(); } ClearCache(); }
public void InsertSystemRolePermission(SystemRolePermission rolePermissionRecord) { using (var context = new SsepsIIEntities()) { context.SystemRolePermissions.Add(rolePermissionRecord); context.SaveChanges(); } ClearCache(); }