private static bool IsMatchedByStatus(CiphertextStatus ciphertextStatus, bool isDeleted) { switch (ciphertextStatus) { case CiphertextStatus.Any: return true; case CiphertextStatus.Active: return !isDeleted; case CiphertextStatus.Deleted: return isDeleted; default: throw new NotSupportedException("The account status filter specified is not supported: " + ciphertextStatus); } }
private static bool IsMatchedByStatus(CiphertextStatus ciphertextStatus, bool isDeleted) { switch (ciphertextStatus) { case CiphertextStatus.Any: return(true); case CiphertextStatus.Active: return(!isDeleted); case CiphertextStatus.Deleted: return(isDeleted); default: throw new NotSupportedException("The account status filter specified is not supported: " + ciphertextStatus); } }
public CiphertextDto[] GetAll(CiphertextStatus ciphertextStatus = CiphertextStatus.Active) { return GetAllIds().Select(Get).Where(ciphertextDto => IsMatchedByStatus(ciphertextStatus, ciphertextDto.Deleted)).ToArray(); }
public CiphertextDto[] GetAll(CiphertextStatus ciphertextStatus = CiphertextStatus.Active) { return(GetAllIds().Select(Get).Where(ciphertextDto => IsMatchedByStatus(ciphertextStatus, ciphertextDto.Deleted)).ToArray()); }