Ejemplo n.º 1
0
        public dbRespose updataArtice(article model)
        {
            dbRespose response = new dbRespose();

            try
            {
                article selectedArticle = getArticle(model.arcticleID);
                selectedArticle.hashtags = model.hashtags;
                if (model.image != "")
                {
                    selectedArticle.image = model.image;
                }
                selectedArticle.title   = model.title;
                selectedArticle.content = model.content;
                context.SaveChanges();
                response.status = 200;
            }
            catch (Exception)
            {
                response.status = 400;
            }

            return(response);
        }