Beispiel #1
0
        private Project GetMergeProject(ProjectEntity projectEntity, ElasticProjectData elasticProjectData)
        {
            var project = mapper.Map <Project>(Tuple.Create(elasticProjectData, projectEntity));

            project.HasPhoto(
                File.ReadAllBytes(projectEntity.PhotoLink),
                Path.GetExtension(projectEntity.PhotoLink)
                );
            return(project);
        }
Beispiel #2
0
        public void Add(Project item)
        {
            ProjectEntity pe = mapper.Map <ProjectEntity>(item);

            projectRepository.Add(pe);

            item.UpdateId(pe.Id);
            ElasticProjectData epd = mapper.Map <ElasticProjectData>(item);

            elastic.AddItem(epd);
        }