Beispiel #1
0
 public ActionResult AddRssFeed(RssFeed newRssFeed)
 {
     UserFeed usrFeed = (UserFeed)TempData["usrfeed"];
     Guid usrFeedId = usrFeed.ID;
     UserFeed userFeed = db.UserFeeds.SingleOrDefault(u => u.ID == usrFeedId);
     if (ModelState.IsValid)
     {
         RssFeed rssFeed = new RssFeed()
                               {
                                   Address = newRssFeed.Address,
                                   ID = Guid.NewGuid(),
                                   Title = newRssFeed.Title,
                               };
         db.RssFeeds.AddObject(rssFeed);
         userFeed.RssFeeds.Add(rssFeed);
         db.SaveChanges();
         return RedirectToAction("AddRssFeed");
     }
     return View();
 }
Beispiel #2
0
 /// <summary>
 /// Create a new RssFeed object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="address">Initial value of the Address property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 public static RssFeed CreateRssFeed(global::System.Guid id, global::System.String address, global::System.String title)
 {
     RssFeed rssFeed = new RssFeed();
     rssFeed.ID = id;
     rssFeed.Address = address;
     rssFeed.Title = title;
     return rssFeed;
 }
Beispiel #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the RssFeeds EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToRssFeeds(RssFeed rssFeed)
 {
     base.AddObject("RssFeeds", rssFeed);
 }