示例#1
0
        /// <summary>
        /// Remove Conten
        /// </summary>
        /// <param name="contentViewModel"></param>
        public void RemoveContent(ContentViewModel contentViewModel)
        {
            var content = contentViewModel.ConvertToContentModel();

            _contentRepository.Delete(content);
            _contentRepository.SaveChanges();
        }
示例#2
0
        /// <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();
        }
示例#3
0
        /// <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);
        }