当前位置: 首页>>代码示例>>C#>>正文


C# DataSource.Query方法代码示例

本文整理汇总了C#中DataSource.Query方法的典型用法代码示例。如果您正苦于以下问题:C# DataSource.Query方法的具体用法?C# DataSource.Query怎么用?C# DataSource.Query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataSource的用法示例。


在下文中一共展示了DataSource.Query方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PopulateAvailableTranslations

        public static void PopulateAvailableTranslations(DataSource dataSource)
        {
            if (dataSource == null)
                throw new ArgumentNullException("dataSource", "dataSource cannot be null.");

            var query = new GetTranslationsQuery();
            _availableTranslations = dataSource.Query(query)
                .Select(x => new TranslationViewModel(x))
                .ToArray();
        }
开发者ID:pcrockett,项目名称:Ruminate,代码行数:10,代码来源:TranslationViewModel.cs

示例2: Initialize

        public static void Initialize(DataSource dataSource = null)
        {
            if (dataSource == null || DesignerProperties.IsInDesignTool)
            {
                _allBooks = new BibleBook[]
                {
                    new BibleBook(0, "Genesis", "Gen"),
                    new BibleBook(1, "Exodus", "Exo"),
                    new BibleBook(2, "Leviticus", "Lev"),
                    new BibleBook(3, "Numbers", "Num"),
                    new BibleBook(4, "Deuteronomy", "Deu"),
                    new BibleBook(5, "Joshua", "Jsh"),
                    new BibleBook(6, "Judges", "Jdg"),
                    new BibleBook(7, "Ruth", "Rut"),
                    new BibleBook(8, "1 Samuel", "1Sa"),
                    new BibleBook(9, "2 Samuel", "2Sa"),
                    new BibleBook(10, "1 Kings", "1Ki"),
                    new BibleBook(11, "2 Kings", "2Ki"),
                    new BibleBook(12, "1 Chronicles", "1Ch"),
                    new BibleBook(13, "2 Chronicles", "2Ch"),
                    new BibleBook(14, "Ezra", "Ezr"),
                    new BibleBook(15, "Nehemiah", "Neh"),
                    new BibleBook(16, "Esther", "Est"),
                    new BibleBook(17, "Job", "Job"),
                    new BibleBook(18, "Psalms", "Psa"),
                    new BibleBook(19, "Proverbs", "Pro"),
                    new BibleBook(20, "Ecclesiastes", "Ecc"),
                    new BibleBook(21, "Song of Solomon", "Song"),
                    new BibleBook(22, "Isaiah", "Isa"),
                    new BibleBook(23, "Jeremiah", "Jer"),
                    new BibleBook(24, "Lamentations", "Lam"),
                    new BibleBook(25, "Ezekiel", "Eze"),
                    new BibleBook(26, "Daniel", "Dan"),
                    new BibleBook(27, "Hosea", "Hos"),
                    new BibleBook(28, "Joel", "Joe"),
                    new BibleBook(29, "Amos", "Amo"),
                    new BibleBook(30, "Obadiah", "Oba"),
                    new BibleBook(31, "Jonah", "Jon"),
                    new BibleBook(32, "Micah", "Mic"),
                    new BibleBook(33, "Nahum", "Nah"),
                    new BibleBook(34, "Habakkuk", "Hab"),
                    new BibleBook(35, "Zephaniah", "Zep"),
                    new BibleBook(36, "Haggai", "Hag"),
                    new BibleBook(37, "Zechariah", "Zec"),
                    new BibleBook(38, "Malachi", "Mal"),
                    new BibleBook(39, "Matthew", "Mat"),
                    new BibleBook(40, "Mark", "Mar"),
                    new BibleBook(41, "Luke", "Luk"),
                    new BibleBook(42, "John", "Jn"),
                    new BibleBook(43, "Acts", "Act"),
                    new BibleBook(44, "Romans", "Rom"),
                    new BibleBook(45, "1 Corinthians", "1Co"),
                    new BibleBook(46, "2 Corinthians", "2Co"),
                    new BibleBook(47, "Galatians", "Gal"),
                    new BibleBook(48, "Ephesians", "Eph"),
                    new BibleBook(49, "Philippians", "Phi"),
                    new BibleBook(50, "Colossians", "Col"),
                    new BibleBook(51, "1 Thessalonians", "1Th"),
                    new BibleBook(52, "2 Thessalonians", "2Th"),
                    new BibleBook(53, "1 Timothy", "1Ti"),
                    new BibleBook(54, "2 Timothy", "2Ti"),
                    new BibleBook(55, "Titus", "Tit"),
                    new BibleBook(56, "Philemon", "Phm"),
                    new BibleBook(57, "Hebrews", "Heb"),
                    new BibleBook(58, "James", "Jam"),
                    new BibleBook(59, "1 Peter", "1Pe"),
                    new BibleBook(60, "2 Peter", "2Pe"),
                    new BibleBook(61, "1 John", "1Jo"),
                    new BibleBook(62, "2 John", "2Jo"),
                    new BibleBook(63, "3 John", "3Jo"),
                    new BibleBook(64, "Jude", "Jud"),
                    new BibleBook(65, "Revelation", "Rev")
                };
            }
            else
            {
                _allBooks = dataSource.Query(new GetBooksQuery())
                    .Select(x => new BibleBook(x.Id, x.FullName, x.Abbrev))
                    .ToArray();
            }

            _bookLookup = _allBooks.ToDictionary(x => x.Id);

            _isInitialized = true;
        }
开发者ID:pcrockett,项目名称:Ruminate,代码行数:85,代码来源:BibleBook.cs

示例3: Load

        public void Load(DataSource dataSource)
        {
            if (dataSource == null)
                throw new ArgumentNullException("dataSource", "dataSource cannot be null.");

            Lists.Clear();

            var listsInDb = dataSource.Query(new GetListsQuery());

            foreach (var item in listsInDb)
                Lists.Add(new VerseListViewModel(dataSource, item));

            CreateVerseVm.Reset();
        }
开发者ID:pcrockett,项目名称:Ruminate,代码行数:14,代码来源:MainViewModel.cs


注:本文中的DataSource.Query方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。