Exemplo n.º 1
0
 public void DeleteFavourite(int id)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         IQueryable <vsb_favourite> entityQuery = from fav in context.Favourites where fav.ID.Equals(id) select fav;
         vsb_favourite entityToDelete           = entityQuery.FirstOrDefault();
         context.Favourites.DeleteOnSubmit(entityToDelete);
         context.SubmitChanges();
     }
 }
Exemplo n.º 2
0
 public void FavoriteThis(String title, String content)
 {
     using (AppDatabase context = new AppDatabase(AppDatabase.DBConnectionString))
     {
         vsb_favourite favour = new vsb_favourite();
         favour.Title   = title;
         favour.Content = content;
         context.Favourites.InsertOnSubmit(favour);
         context.SubmitChanges();
     }
 }