Exemplo n.º 1
0
 internal bool Add(ProjectNewsEntity projectNews)
 {
     bool isAdded = false;
     db.ProjectNews.Add(projectNews);
     db.SaveChanges();
     return isAdded;
 }
Exemplo n.º 2
0
 internal bool Update(ProjectNewsEntity projectNews)
 {
     ProjectNewsEntity entity = Get(projectNews.Id);
     entity.News = projectNews.News;
     entity.NewsTitle = projectNews.NewsTitle;
     db.SaveChanges();
     //TODO: Updating image
     return true;
 }
Exemplo n.º 3
0
        public static ProjectNewsModel ProjectNewsEntityToProjectNewsModel(ProjectNewsEntity entity)
        {
            return new ProjectNewsModel
            {
                Id = entity.Id,
                News = entity.News,
                NewsImageContent = entity.NewsImage,
                NewsTitle = entity.NewsTitle,
                ProjectId = entity.ProjectId

            };
        }