Beispiel #1
0
        /// <summary>
        /// Gets image mapping specific to this project
        /// </summary>
        private ImageMapping GetImageMapping()
        {
            var content     = ProjectUtilities.ReadDockerFileConfig();
            var definitions = JsonConvert.DeserializeObject <List <ImageDefinition> >(content);
            var mappings    = definitions.Where(x => x.SdkType.Equals(_project.SdkType)).FirstOrDefault();

            return(mappings.ImageMapping.FirstOrDefault(x => x.TargetFramework.Equals(_project.TargetFramework)));
        }
        /// <summary>
        /// Gets image mapping specific to this project
        /// </summary>
        private ImageMapping GetImageMapping()
        {
            var content     = ProjectUtilities.ReadDockerFileConfig();
            var definitions = JsonConvert.DeserializeObject <List <ImageDefinition> >(content);
            var mappings    = definitions.FirstOrDefault(x => x.SdkType.Equals(_project.SdkType));

            if (mappings == null)
            {
                throw new UnsupportedProjectException($"The project with SDK Type {_project.SdkType} is not supported.");
            }

            return(mappings.ImageMapping.FirstOrDefault(x => x.TargetFramework.Equals(_project.TargetFramework))
                   ?? throw new UnsupportedProjectException($"The project with Target Framework {_project.TargetFramework} is not supported."));
        }