public void Update(TimelineItemUpdate timelimeItemUpdate) { var timelineItem = FindItem(timelimeItemUpdate.Id); timelineItem.ImageUrl = timelimeItemUpdate.ImageUrl; timelineItem.Caption = timelimeItemUpdate.Caption; _tourTimelineItemRepo.Update(timelineItem); }
public void Add(TimelineItemUpdate timelineItemUpdate) { var position = 0; var items = _tourTimelineItemRepo.FindBy(i => i.TourId == timelineItemUpdate.TourId); if (items.Any()) position = items.Max(i => i.Position) + 1; _tourTimelineItemRepo.Add(new TourTimelineItem { TourId = timelineItemUpdate.TourId, ImageUrl = timelineItemUpdate.ImageUrl, Caption = timelineItemUpdate.Caption, Position = position }); }
public void Add(TimelineItemUpdate timelineItemUpdate) { var position = 0; var items = _tourTimelineItemRepo.FindBy(i => i.TourId == timelineItemUpdate.TourId); if (items.Any()) { position = items.Max(i => i.Position) + 1; } _tourTimelineItemRepo.Add(new TourTimelineItem { TourId = timelineItemUpdate.TourId, ImageUrl = timelineItemUpdate.ImageUrl, Caption = timelineItemUpdate.Caption, Position = position }); }