internal static AppToken VisibleApp(Application app) => new AppToken( id: IdFactory.App(app), isActive: app.IsActive(), isVisible: true, version: app.VersionName(), books: app.Workbooks.OfType <Workbook>().Select(Book));
internal static AppToken App(Application app) { Requires.NotNull(app, nameof(app)); return(app.IsVisible() ? VisibleApp(app) : InvisibleApp(IdFactory.App(app))); }