public Receipts Get(int id) { Receipts test = db.Receipts.Where(x => x.Id == id).Single(); return(test); }
public void AddPublic(string name, string discription, int Category) { Receipts recepta = new Receipts(); recepta.Name = name; recepta.Description = discription; switch (Category) { case 1: recepta.Category = "Desert"; break; case 2: recepta.Category = "Salata"; break; case 3: recepta.Category = "Supa"; break; case 4: recepta.Category = "Studena supa"; break; case 5: recepta.Category = "Osnovno qstie"; break; case 6: recepta.Category = "Morski darove"; break; default: recepta.Category = "Drugo"; break; } recepta.AuthorId = user.Id; db.Receipts.Add(recepta); db.SaveChanges(); }