public void Validate() { if (!AssemblyPath.HasValue()) { throw new CommandException(Resources.FormatMissingOption(AssemblyPath.LongName)); } if (!ProjectName.HasValue()) { throw new CommandException(Resources.FormatMissingOption(ProjectName.LongName)); } if (!TargetFramework.HasValue()) { throw new CommandException(Resources.FormatMissingOption(TargetFramework.LongName)); } }
private Project CreateProject() { if (ProjectName.HasValue()) { var project = new Project { Name = ProjectName, }; _context.Projects.Add(project); _context.SaveChanges(); return(project); } return(null); }
protected override void Validate() { base.Validate(); if (!AssemblyPath.HasValue()) { throw new CommandException(Resources.FormatMissingOption(AssemblyPath.LongName)); } if (!ProjectName.HasValue()) { throw new CommandException(Resources.FormatMissingOption(ProjectName.LongName)); } if (!ToolsDirectory.HasValue()) { throw new CommandException(Resources.FormatMissingOption(ToolsDirectory.LongName)); } }