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


C# SQLiteConnection.Find方法代码示例

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


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

示例1: RunReadTest

        async Task RunReadTest()
        {
            await Task.Factory.StartNew(() =>
            {
                using (var db = new SQLiteConnection(DatabasePath))
                {
                   db.RunInTransaction(async () => {
                        var person1 = db.Find<Person>(f => f.FullName.EndsWith("8"));
                        var person2 = db.Find<Person>(f => f.FullName.EndsWith("3"));

                        var message = person1 != null && person2 != null
                                           ? "Completed!"
                                           : "Did not find both people!";

                        await dispatcher.RunIdleAsync(a => { ReadResult = message; });
                    });
                }
            });
        }
开发者ID:kiwipom,项目名称:billboard,代码行数:19,代码来源:SyncDatabaseViewModel.cs

示例2: FindCourseSchedule

		public static CourseSchedule FindCourseSchedule (decimal classId)
		{
			CheckAndCreateDatabase ();
			string path = Path.Combine (Environment.GetFolderPath (Environment.SpecialFolder.Personal), "CourseSchedule.sqlite");

			using (SQLiteConnection db = new SQLiteConnection (path)) {				
				// create the tables
				var classSchedule = db.Find<CourseSchedule> (c => c.ClassId == classId);

				// close the connection
				db.Close ();

				return classSchedule;
			}
		}
开发者ID:harryxiaxia,项目名称:ibeaconDemo,代码行数:15,代码来源:SQLiteManagement.cs

示例3: UpdateDeck

 public static void UpdateDeck(DeckViewModel deck)
 {
     using (var database = new SQLiteConnection(databasePath))
     {
         var _deck = database.Find<Deck>(d1 => d1.Id.ToString() == deck.UniqueId);
         if (_deck != null)
         {
             _deck.CategoryId = new Guid(deck.Category.UniqueId);
             _deck.Title = deck.Title;
             _deck.Author = deck.Author;
             _deck.Subject = deck.Subject;
             _deck.Description = deck.Description ;
             _deck.ImagePath = deck.ImagePath;
             database.Update(deck);
         }
     }
 }
开发者ID:cherrychelsea,项目名称:Flashcard,代码行数:17,代码来源:FlashcardDataSource.cs

示例4: UpdateCategory

 public static void UpdateCategory(CategoryViewModel category)
 {
     using (var database = new SQLiteConnection(databasePath))
     {
         var _category = database.Find<Category>(c1 => c1.Id.ToString() == category.UniqueId);
         if (_category != null)
         {
             _category.Name = category.Name;
             database.Update(_category);
         }
     }
 }
开发者ID:cherrychelsea,项目名称:Flashcard,代码行数:12,代码来源:FlashcardDataSource.cs

示例5: UpdateCard

 public static void UpdateCard(CardsViewModel card)
 {
     using (var database = new SQLiteConnection(databasePath))
     {
         var _card = database.Find<Card>(c1 => c1.Id.ToString() == card.UniqueId);
         if (_card != null)
         {
             _card.FrontContent = card.FrontContent;
             _card.BackContent = card.BackContent;
             database.Update(_card);
         }
     }
 }
开发者ID:cherrychelsea,项目名称:Flashcard,代码行数:13,代码来源:FlashcardDataSource.cs

示例6: DeleteDeck

 public static void DeleteDeck(DeckViewModel deck)
 {
     using (var database = new SQLiteConnection(databasePath))
     {
         var _deck = database.Find<Deck>(d1 => d1.Id.ToString() == deck.UniqueId);
         database.Delete(_deck);
     }
 }
开发者ID:cherrychelsea,项目名称:Flashcard,代码行数:8,代码来源:FlashcardDataSource.cs

示例7: DeleteCategory

 public static void DeleteCategory(CategoryViewModel category)
 {
     using (var database = new SQLiteConnection(databasePath))
     {
         var _category = database.Find<Category>(c1 => c1.Id.ToString() == category.UniqueId);
         database.Delete(category);
     }
 }
开发者ID:cherrychelsea,项目名称:Flashcard,代码行数:8,代码来源:FlashcardDataSource.cs

示例8: DeleteCard

 public static void DeleteCard(CardsViewModel card)
 {
     using (var database = new SQLiteConnection(databasePath))
     {
         var _card = database.Find<Card>(c1 => c1.Id.ToString() == card.UniqueId);
         database.Delete(_card);
     }
 }
开发者ID:cherrychelsea,项目名称:Flashcard,代码行数:8,代码来源:FlashcardDataSource.cs

示例9: MainWindow

        public MainWindow(string dbpath)
        {
            db_ = new SQLiteConnection(dbpath);
            db_.CreateTable<Task>();
            db_.CreateTable<ProgSettings>();
            tasks_ = new ObservableCollection<Task>(db_.Table<Task>().OrderBy(t => t.Order));
            settings_ = db_.Find<ProgSettings>(1);

            minimise_ = new MinimizeToTray(this, settings_.BallonShown);

            settings_.Plugins = new ObservableCollection<Plugin>(new Plugin[] { new PluginCore(settings_), new PluginWords(db_) });

            if (settings_ == null)
                settings_ = new ProgSettings(db_);
            else
                settings_.DB = db_;
            foreach (Task newItem in tasks_)
            {
                newItem.PropertyChanged += this.OnItemPropertyChanged;
            }

            InitializeComponent();
            List_Tasks.ItemsSource = tasks_;
            Text_Add_Item.Focus();

            workArc_.Right = true;
            playArc_.Right = false;
            workGrey_.Right = false;
            playGrey_.Right = true;

            customRenders_.Add(workArc_);
            customRenders_.Add(playArc_);
            customRenders_.Add(workGrey_);
            customRenders_.Add(playGrey_);

            this.ResetTimer(true, DateTime.Now);

            App.Tick += Tick;
            Closed += MainWindow_Closed;

            mediaPlayer_.Open(new Uri(Environment.CurrentDirectory + "\\bell.mp3"));
            mediaPlayer_.Volume = 1.0;

            tasks_.CollectionChanged += this.OnCollectionChanged;
        }
开发者ID:Y-Less,项目名称:ten2five,代码行数:45,代码来源:MainWindow.xaml.cs


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