Advertisement
Ludwiq

Dodawanie notatek

Feb 4th, 2015
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.40 KB | None | 0 0
  1. string[] separatedTags = tags.Split(' ');
  2.  
  3. foreach(string tagName in separatedTags){
  4.     Tag tag;
  5.     try
  6.     {
  7.         tag = db.Tags.Where(t => t.Name == tagName).Single();
  8.     }
  9.     catch
  10.     {
  11.             //tu ma się odbyć tworzenie nowego taga, bo nie istnieje żaden o tej nazwie
  12.                 //z tym że muszę coś przypisać zmiennej Notes w klasie Tag. Co mam robić?
  13.     }
  14. }
  15.  
  16. db.Notes.Add(note);
  17. db.SaveChanges();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement