private bool ObjectIsEnabledOfType(string objectTypeCode, int objectId) { var maybeGenderType = _objectTypesService.Get(code: objectTypeCode); if (!maybeGenderType.Success) { return(false); } var maybeGenderObject = _objectsService.GetById(objectId: objectId); if (!maybeGenderObject.Success) { return(false); } if (maybeGenderObject.Value.ObjectTypeId != maybeGenderType.Value.Id) { return(false); } if (!maybeGenderObject.Value.IsEnabled) { return(false); } return(true); }
private IEnumerable <ObjectItem> ActiveOfType(string typeCode) { var eyeColorType = _objectTypesService.Get(typeCode); return(_objectsService.ActiveOfType(eyeColorType.Value.Id)); }