Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var db = new NewsDbContext();
- Console.WriteLine("Application started.");
- var firstNew = db.News.First();
- var firstNewContent = firstNew.Content;
- Console.Write("Text from DB: {0}. Enter the corrected text: ", firstNew.Content);
- string input = Console.ReadLine();
- if (firstNewContent == db.News.First().Content)
- {
- firstNew.Content = input;
- db.SaveChanges();
- Console.WriteLine("Changes successfully saved in the DB.");
- }
- else
- {
- Console.WriteLine("Conflict! Text from DB: {0}. Enter the corrected text:", firstNew.Content);
- }
Advertisement
Add Comment
Please, Sign In to add comment