Esempio n. 1
0
        //***       Tags

        ///<exception cref="SystemException"></exception>
        public async Task AddTag(BlogArticleTag inTag)
        {
            await Task.Run(
                () =>
            {
                _blogDBContext.BlogArticlesTags.Add(inTag);
                _blogDBContext.SaveChanges();
            });
        }
Esempio n. 2
0
        public async Task <IHttpActionResult> DeleteTag(BlogArticleTag inTag)
        {
            try
            {
                await _blogService.DeleteTag(inTag);

                return(Ok());
            }
            catch (SystemException error)
            {
                return(BadRequest(error.Message));
            }
        }
Esempio n. 3
0
        ///<exception cref=SystemException"></exception>
        public async Task DeleteTag(BlogArticleTag inTag)
        {
            await Task.Run(
                () =>
            {
                _blogDBContext.
                BlogArticlesTags.
                Remove(_blogDBContext.
                       BlogArticlesTags.
                       Attach(inTag));

                _blogDBContext.SaveChanges();
            });
        }