/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/fundamentals/runtime-libraries/snippets/System/InvalidOperationException/Overview/fsharp/Enumerable2.fs
19 строк
475 B
Genevieve Warren
Remarks for exception types and Registry class (#38930)
03 янв 2024, 22:30
Не верифицирован
03 янв 2024, 22:30
932bcca
Код
Авторство
О чём код?
module Enumerable2 // <Snippet7> open System open System.Linq let dbQueryResults = [| 1; 2; 3; 4 |] let moreThan4 = dbQueryResults.Where(fun num -> num > 4) if moreThan4.Any() then printfn $"Average value of numbers greater than 4: {moreThan4.Average()}:" else // handle empty collection printfn "The dataset has no values greater than 4." // The example displays the following output: // The dataset has no values greater than 4. // </Snippet7>