/// <summary> /// Remove Conten /// </summary> /// <param name="contentViewModel"></param> public void RemoveContent(ContentViewModel contentViewModel) { var content = contentViewModel.ConvertToContentModel(); _contentRepository.Delete(content); _contentRepository.SaveChanges(); }
/// <summary> /// Create Content /// </summary> /// <param name="contentViewModel"></param> /// <returns></returns> public void CreateContent(ContentViewModel contentViewModel) { var content = contentViewModel.ConvertToContentModel(); content.CreationTime = DateTime.Now; _contentRepository.Add(content); _contentRepository.SaveChanges(); }
/// <summary> /// Update the Content of Content /// </summary> /// <param name="contentViewModel"></param> /// <returns></returns> public Content UpdateContent(ContentViewModel contentViewModel) { var content = contentViewModel.ConvertToContentModel(); content.CreationTime = DateTime.Now; _contentRepository.Update(content); _contentRepository.SaveChanges(); return(content); }