public Project CreateProject(ProjectModel projectmodel)
        {
            //cast to dbo
            var project = CastToDbo(projectmodel);
            var _projectTechnologies = project.ProjectTechnologies;
            var _projectImagesUrls   = project.ProjectImages;

            project.ProjectTechnologies = null;
            project.ProjectImages       = null;

            var savedProject = _projectRepository.Create(project);

            if (_projectTechnologies != null)
            {
                foreach (var tech in _projectTechnologies)
                {
                    tech.ProjectId = savedProject.ProjectId;
                    _projectTechnologyRepository.Create(tech);
                }
            }

            if (_projectImagesUrls != null)
            {
                foreach (var image in _projectImagesUrls)
                {
                    image.ProjectId = savedProject.ProjectId;
                    _projectImageRepository.Create(image);
                }
            }

            return(_projectRepository.GetById(savedProject.ProjectId));
        }
 public ProjectImage AddImage(ProjectImage image, int projectId)
 {
     image.ProjectId = projectId;
     return(_projectImageRepository.Create(image));
 }