public dbRespose addArticleCat(articleCat model) { dbRespose MR = new dbRespose(); try { context.articleCats.Add(model); context.SaveChanges(); MR.status = 200; } catch (Exception err) { MR.status = 400; } return(MR); }
public dbRespose updataCatArtice(articleCat model) { dbRespose response = new dbRespose(); try { articleCat selectedArticle = getCatArtice(model.articleCatID); if (model.image != "") { selectedArticle.image = model.image; } selectedArticle.title = model.title; context.SaveChanges(); response.status = 200; } catch (Exception) { response.status = 400; } return(response); }