public void AddSource(FeedSource toAdd) { try { Context.FeedSources.Add(toAdd); Context.SaveChanges(); } catch (Exception ex) { throw; } }
//[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; }
public void DeleteSource(FeedSource toDelete) { Context.FeedSources.Remove(toDelete); Context.SaveChanges(); }