public IHttpActionResult Search(string query)
 {
     if (!string.IsNullOrEmpty(query) && query.Length > 1)
     {
         return(Ok(ThreatService.Search(query)));
     }
     else
     {
         return(Ok(new List <SimpleSearchResult>()));
     }
 }
Example #2
0
 public BaseController()
 {
     UserService          = new UserService();
     CompanyService       = new CompanyService(UserService);
     ProcessService       = new ProcessService(UserService);
     HelpService          = new HelpService();
     ControlService       = new ControlService(UserService);
     SoaService           = new SoaService(UserService);
     ThreatService        = new ThreatService(UserService);
     AssetService         = new AssetService(UserService);
     VulnerabilityService = new VulnerabilityService(UserService);
     UploadService        = new UploadService(UserService);
     ReportService        = new ReportService(UserService);
 }
 public IHttpActionResult Delete(int id)
 {
     ThreatService.Delete(id);
     return(Ok());
 }
 public IHttpActionResult Put([FromBody] Contracts.Threat.UpdateThreat update)
 {
     ThreatService.Update(update);
     return(Ok());
 }
        public IHttpActionResult Post([FromBody] Contracts.Threat.CreateThreat create)
        {
            var created = ThreatService.Create(create);

            return(Ok(created));
        }
        public IHttpActionResult Get(int id)
        {
            var result = ThreatService.GetSingle(id);

            return(Ok(result));
        }
        public IHttpActionResult Get([FromUri] PagedQuery pagedQuery, [FromUri] int[] excludeIds)
        {
            var result = ThreatService.Get(pagedQuery, excludeIds);

            return(Ok(result));
        }