/// <summary>
 /// Initializes a new instance of the <see cref="FeedConfiguration" /> class.
 /// </summary>
 /// <param name="feed">The feed.</param>
 /// <param name="targetFolder">The target folder.</param>
 public FeedConfiguration(FeedDefinition feed, string targetFolder)
 {
     this.Name           = feed.Name;
     this.LatestDownload = feed.LatestDownload;
     this.Url            = feed.Url;
     this.TargetFolder   = targetFolder;
 }
 public static FeedDefinitionBindingModel ToBindingModel(this FeedDefinition model)
 {
     return(new FeedDefinitionBindingModel()
     {
         ID = model.ID,
         Title = model.Title
     });
 }
 public static FeedDefinitionViewModel ToViewModel(this FeedDefinition feedDefinition)
 {
     return(new FeedDefinitionViewModel()
     {
         ID = feedDefinition.ID,
         Title = feedDefinition.Title
     });
 }
        public FeedDefinition Update(FeedDefinition entity)
        {
            var found = Find(entity.ID);

            found.Title        = entity.Title;
            found.XMLNameSpace = entity.XMLNameSpace;

            context.SaveChanges();

            return(entity);
        }
        // GET: FeedDefinitions/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id.HasValue == false)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            FeedDefinition feedDefinition = repo.Find(id.Value);

            if (feedDefinition == null)
            {
                return(HttpNotFound());
            }
            return(View(feedDefinition.ToViewModel()));
        }
 public FeedDefinition Create(FeedDefinition entity)
 {
     context.FeedDefinitions.Add(entity);
     context.SaveChanges();
     return(entity);
 }