public static ProjectDto FromModelToDto(ProjectModel model)
 {
     var dto = new ProjectDto();
     dto.OwnerUserId = model.OwnerUserId;
     CopyIProjectItemModelMembers(dto, model);
     CopyProjectContainerItemsFromModelToDto(dto, model);
     return dto;
 }
        public static void IntegrateFileModel(ProjectModel projectModel, ProjectFileModel fileModel)
        {
            // Parse C# code file => SyntaxTree
            // NOTE:  The NRefactory Test project uses a somewhat "cleaner"/more "sanitized" version of the 
            // file content for creating the AST.  Why?  I can't be certain, but I suspect that this is to 
            // simplify testing by eliminating stuff that contribute to errors... but maybe there's something 
            // more to it.  Doing some more routine tests on our end should prove whether omitting this step 
            // actually makes any difference.
            fileModel.Parser = new CSharpParser();
            fileModel.SyntaxTree = fileModel.Parser.Parse(fileModel.Content, fileModel.Name);
            fileModel.SyntaxTree.Freeze();
            
            // Convert syntax tree into parsed file that can be stored in the type system.
            fileModel.UnresolvedFile = fileModel.SyntaxTree.ToTypeSystem();

            // Add specified file to the project content.  
            // If a file with the same name already exists, this will update the existing file.
            projectModel.ProjectContent = projectModel.ProjectContent.AddOrUpdateFiles(fileModel.UnresolvedFile);
        }
 public static ProjectModel FromDtoToModel(ProjectDto dto)
 {
     var model = new ProjectModel();
     model.OwnerUserId = dto.OwnerUserId;
     CopyIProjectItemModelMembers(model, dto);
     CopyProjectContainerItemsFromDtoToModel(model, dto);
     return model;
 }