public ActionResult Edit(Sermon sermon) { if (sermon == null) { throw new ParameterNullException("sermon"); } sermon.ModifiedByUserId = this.ControllerContext.HttpContext.Profile.UserId(); var success = this.sermonService.UpdateSermon(sermon); return this.Json(success, JsonRequestBehavior.AllowGet).AsCamelCaseResolverResult(); }
public ActionResult Add(Sermon sermon, HttpPostedFileBase file) { if (sermon == null) { throw new ParameterNullException("sermon"); } sermon.ModifiedByUserId = this.ControllerContext.HttpContext.Profile.UserId(); ; var sermonId = this.sermonService.AddSermon(sermon); return this.Json(sermonId, JsonRequestBehavior.AllowGet).AsCamelCaseResolverResult(); }
public static Sermon ToModel(this Data.Entities.Sermon sermonEntity) { var sermon = new Sermon(); if (sermonEntity == null) { return sermon; } sermon.DateCreated = sermonEntity.DateCreated; sermon.DateModified = sermonEntity.DateModified; sermon.ModifiedByUserId = sermonEntity.ModifiedByUserId; sermon.SermonDate = sermonEntity.SermonDate; sermon.SermonId = sermonEntity.SermonId; sermon.SoundCloudId = sermonEntity.SoundCloudId; sermon.Speaker = sermonEntity.Speaker; sermon.Tags = sermonEntity.Tags; sermon.Title = sermonEntity.Title; return sermon; }
public void Setup() { this.sermonRepository = new Mock<ISermonRepository>(); this.sermonService = new SermonService(this.sermonRepository.Object); this.sermon = this.OneSermon(); }