public IRolePermissionState Get(RolePermissionId id) { IRolePermissionState state = CurrentSession.Get <RolePermissionState> (id); if (state == null) { state = new RolePermissionState(); (state as RolePermissionState).Id = id; } return(state); }
public IRolePermissionState Get(RolePermissionId id, bool nullAllowed) { IRolePermissionState state = CurrentSession.Get <RolePermissionState> (id); if (!nullAllowed && state == null) { state = new RolePermissionState(); (state as RolePermissionState).Id = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IRolePermissionState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }