Answer the question
In order to leave comments, you need to log in
How to notify the user that he added something?
Hello! For example, a user adds a new article to the site, how to show the user that his article has been added?
for example there is a method
public void AddArticle(Guid userId, string articleText)
{
Db.Article.Add(new Article...);
Db.SaveChanges();
}
Answer the question
In order to leave comments, you need to log in
depends on what you want to do with the results. Based on the fact that there were no unscheduled exceptions, you can consider that the code worked correctly and the entry was added. In your case, SaveChanges returns the number of rows that were manipulated. If something more than 0 is returned, then the line has been added.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question