示例#1
0
        //ADD
        public async void AddUpdateYoutubePersistedItem(YoutubePersistedItem item)
        {
            LoggingService.LogInformation("writing to db 'Scene'", "AppDatabase.AddUpdateYoutubePersistedItem");
            var found = RetrieveYoutubePersistedItem(item.Id);

            if (found != null && found.Count() > 0)
            {
                this.SqliteDb.Update(item);
                //await mstScene.UpdateAsync(scene);
            }
            else
            {
                var newId = this.SqliteDb.Insert(item);
                //await mstScene.InsertAsync(scene);
            }

            Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("updating ...")
            {
                Identifier = "DB", SourceId = "YoutubePersistedItem"
            });

            Messenger.Default.Send <GeneralSystemWideMessage>(new GeneralSystemWideMessage("")
            {
                Identifier = "YOUTUBE", AggregateId = item.Id.ToString(), Action = "UPDATED"
            });
        }
示例#2
0
        //ADD
        public async void AddUpdateYoutubePersistedItem(YoutubePersistedItem item)
        {
            LoggingService.LogInformation("writing to db 'Scene'", "AppDatabase.AddUpdateYoutubePersistedItem");
            var found = RetrieveYoutubePersistedItem(item.Id);
            
            if (found != null && found.Count() > 0)
            {
                this.SqliteDb.Update(item);
                //await mstScene.UpdateAsync(scene);
            }
            else
            {
                var newId = this.SqliteDb.Insert(item);
                //await mstScene.InsertAsync(scene);
            }

            Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("updating ...") { Identifier = "DB", SourceId = "YoutubePersistedItem" });

            Messenger.Default.Send<GeneralSystemWideMessage>(new GeneralSystemWideMessage("") { Identifier = "YOUTUBE", AggregateId = item.Id.ToString(), Action = "UPDATED" });

        }