Esempio n. 1
0
        public void AddQoute(AddOrUpdateQuoteForm form)
        {
            var quote = new Quote(form.Author, form.Text);

            var query = QueryToQuote.InsertQoute;

            query = query.Replace("@author", quote.Author);
            query = query.Replace("@text", quote.Text);
            query = query.Replace("@createdat", quote.CreatedAt.ToString());
            if (form.CategoryId != Guid.Empty)
            {
                query = query.Replace("@categoryid", form.CategoryId.ToString());
            }
            _db.Context.Execute(query);
        }
Esempio n. 2
0
        public void UpdateQuote(AddOrUpdateQuoteForm form)
        {
            var quote = new Quote(form.Author, form.Text);

            var query = QueryToQuote.UpdateQouteById;

            query = query.Replace("@author", quote.Author);
            query = query.Replace("@text", quote.Text);
            if (form.CategoryId != Guid.Empty)
            {
                query = query.Replace("@categoryid", form.CategoryId.ToString());
            }
            query = query.Replace("@quoteId", quote.Id.ToString());

            _db.Context.Execute(query);
        }
Esempio n. 3
0
 public void UpdateQuote(AddOrUpdateQuoteForm form) => _quoteRepo.UpdateQuote(form);
Esempio n. 4
0
 public void AddQuote(AddOrUpdateQuoteForm form) => _quoteRepo.AddQoute(form);