public async Task <NetResult <ProjectConfig> > AddConfig([FromBody] ProjectConfig config) { try { Project project = null; if (!string.IsNullOrEmpty(config.ProjectId)) { project = _project.Get(config.ProjectId); } if (project == null) { } config.DateTime = DateTime.Now; if (config.ProjectServers == null && config.ProjectServers.Count() == 0) { config.IsDefault = true; } await _config.AddNewConfig(project, config); _project.Update(project); return(config); } catch (Exception ext) { return(ext); } }