Example #1
0
        public void AddSource(FeedSource toAdd)
        {
            try
            {
                Context.FeedSources.Add(toAdd);
                Context.SaveChanges();

            }
            catch (Exception ex)
            {
                throw;
            }
        }
Example #2
0
        //[Scope("isLogged")]
        public int Add(string id, [FromUri]string url, [FromUri]int catId)
        {
            var newSource = new FeedSource
            {
                CategoryId = catId,
                CreationDate = DateTime.Now,
                Public = true,
                Url = url,
                UserId = id,
                Title = GetTitleFromUrl(url),
                ViewedNumber = 0,
                ViewState = "none"
            };
            SourceManager.AddSource(newSource);

            return newSource.Id;
        }
Example #3
0
 public void DeleteSource(FeedSource toDelete)
 {
     Context.FeedSources.Remove(toDelete);
     Context.SaveChanges();
 }