protected async System.Threading.Tasks.Task Grid0RowSelect(Flashcardgenerator.Models.Localhost.Sentence args)
        {
            var dialogResult = await DialogService.OpenAsync <EditSentence>("Edit Sentence", new Dictionary <string, object>() { { "sentenceId", args.sentenceId } });

            await grid0.Reload();

            await InvokeAsync(() => { StateHasChanged(); });
        }
        public async Task <Models.Localhost.Sentence> CancelSentenceChanges(Models.Localhost.Sentence item)
        {
            var entityToCancel = Context.Entry(item);

            entityToCancel.CurrentValues.SetValues(entityToCancel.OriginalValues);
            entityToCancel.State = EntityState.Unchanged;

            return(item);
        }
        public async Task <Models.Localhost.Sentence> CreateSentence(Models.Localhost.Sentence sentence)
        {
            OnSentenceCreated(sentence);

            Context.Sentences.Add(sentence);
            Context.SaveChanges();

            OnAfterSentenceCreated(sentence);

            return(sentence);
        }
        protected async System.Threading.Tasks.Task Load()
        {
            var localhostGetBriefsResult = await Localhost.GetBriefs(new Query()
            {
                Expand = "Client,Brief($expand=Client)"
            });

            getBriefsResult = localhostGetBriefsResult;

            sentence = new Flashcardgenerator.Models.Localhost.Sentence()
            {
            };
        }
        protected async System.Threading.Tasks.Task Form0Submit(Flashcardgenerator.Models.Localhost.Sentence args)
        {
            try
            {
                var localhostCreateSentenceResult = await Localhost.CreateSentence(sentence);

                DialogService.Close(sentence);
            }
            catch (System.Exception localhostCreateSentenceException)
            {
                NotificationService.Notify(new NotificationMessage()
                {
                    Severity = NotificationSeverity.Error, Summary = $"Error", Detail = $"Unable to create new Sentence!"
                });
            }
        }
        public async Task <Models.Localhost.Sentence> UpdateSentence(int?sentenceId, Models.Localhost.Sentence sentence)
        {
            OnSentenceUpdated(sentence);

            var itemToUpdate = Context.Sentences
                               .Where(i => i.sentenceId == sentenceId)
                               .FirstOrDefault();

            if (itemToUpdate == null)
            {
                throw new Exception("Item no longer available");
            }
            var entryToUpdate = Context.Entry(itemToUpdate);

            entryToUpdate.CurrentValues.SetValues(sentence);
            entryToUpdate.State = EntityState.Modified;
            Context.SaveChanges();

            OnAfterSentenceUpdated(sentence);

            return(sentence);
        }
 partial void OnAfterSentenceUpdated(Models.Localhost.Sentence item);
 partial void OnSentenceGet(Models.Localhost.Sentence item);
 partial void OnSentenceDeleted(Models.Localhost.Sentence item);
 partial void OnSentenceCreated(Models.Localhost.Sentence item);