Exemplo n.º 1
0
        public void AddCategory(FeedCategory toAdd)
        {
            var context = new RssAgregatorDataContext();

            context.FeedCategories.Add(toAdd);
            context.SaveChanges();
        }
Exemplo n.º 2
0
 public void DeleteCategory(FeedCategory toDelete)
 {
     using (var context = new RssAgregatorDataContext())
     {
         FeedCategory cat = (FeedCategory)context.FeedCategories.Where(b => b.Id == toDelete.Id).First();
         context.FeedCategories.Remove(cat);
         context.SaveChanges();
     }
 }
Exemplo n.º 3
0
        //[Scope("isLogged")]
        public int Add(string userId, string param)
        {
            var toCreateCategory = new FeedCategory
            {
                CreationDate = DateTime.Now,
                Name = param,
                Public = true,
                UserId = userId
            };
            CategoryManager.AddCategory(toCreateCategory);

            return toCreateCategory.Id;
        }