public void SaveSort(SectionContent content) { var contentPart = content.ToContent(); CurrentDbSet.Attach(contentPart); DbContext.Entry(contentPart).Property(n => n.Order).IsModified = true; DbContext.SaveChanges(); }
public void Add(SectionContent item) { item.ID = Guid.NewGuid().ToString("N"); if (!item.Order.HasValue || item.Order.Value == 0) { item.Order = Count(m => m.SectionWidgetId == item.SectionWidgetId && m.SectionGroupId == item.SectionGroupId) + 1; } var contentBase = item.ToContent(); base.Add(contentBase); _sectionContentServices.First(m => (int)m.ContentType == item.SectionContentType).AddContent(item); }
public void Update(SectionContent item) { base.Update(item.ToContent()); _sectionContentServices.First(m => (int)m.ContentType == item.SectionContentType).UpdateContent(item); }