I have using jsReport lib in different enviroments (Windows, OsX and Linux)
In Startup.cs I use this code, to launch library
services.AddJsReport(new LocalReporting()
.UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? JsReportBinary.GetBinary()
: jsreport.Binary.OSX.JsReportBinary.GetBinary()).AsUtility()
.Create());
So if it's not Windows platform, he looking for binary for OSX.
But when somebody will use project on Linux he need to change code to:
services.AddJsReport(new LocalReporting()
.UseBinary(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
? JsReportBinary.GetBinary()
: jsreport.Binary.Linux.JsReportBinary.GetBinary())
How I can write ternary condition for using Windows as main, and if not it will select between OSX and Linux?
But it might be easier just writing 3
ifs and doing it like so: