public int Add(string title, string description, int goalAmount, int estimatedDays, int categoryId, string userId, string imageUrl, string documentsUrl) { var storyToAdd = new Story { ExpirationDate = DateTime.Now.AddDays(estimatedDays), Title = title, Description = description, GoalAmount = goalAmount, CategoryId = categoryId, UserId = userId, ImageUrl = imageUrl, IsRemoved = false, IsClosed = false, CollectedAmount = 0, DocumentUrl = documentsUrl, IsAccept = false, PostDate = DateTime.Now }; this.storyRepo.Add(storyToAdd); this.storyRepo.SaveChanges(); return storyToAdd.Id; }
public void Remove(Story project) { project.IsRemoved = true; this.storyRepo.Update(project); this.storyRepo.SaveChanges(); }
public void Update(Story project) { this.storyRepo.Update(project); this.storyRepo.SaveChanges(); }