public string GetSituationBundle(string filter) { var noSqlWorker = new NoSqlWorker(); noSqlWorker.Initialization(); var bundle = noSqlWorker.Select(); var liteBundle = bundle.Select(situation => new liteBundleElement { id = situation.id, name = situation.name, type = situation.type, date = situation.create_date.ToShortDateString() }).ToList(); return(new JavaScriptSerializer().Serialize(liteBundle)); }
public IHttpActionResult GetAllSituations(Situation situationIn) { var noSqlWorker = new NoSqlWorker(); noSqlWorker.Initialization(); var bundle = noSqlWorker.Select(); SituationSearcher ss = new SituationSearcher(); ss.SituationsInBase = bundle; ss.SearchStart(situationIn); var liteBundle = bundle.Select(situation => new LiteBundleElement { id = situation.id, name = situation.name, type = situation.type, rate = situation.rate }).ToList(); return(Ok(liteBundle)); }
//get bundle by filter //search start public HttpResponseMessage Post([FromBody] Situation situationIn) { var noSqlWorker = new NoSqlWorker(); noSqlWorker.Initialization(); var bundle = noSqlWorker.Select(); var ss = new SituationSearcher { SituationsInBase = bundle }; ss.SearchStart(situationIn); bundle = ss.SituationsInBase; var liteBundle = bundle.Select(situation => new LiteBundleElement { id = situation.id, name = situation.name, type = situation.type, rate = situation.rate }).ToList(); return(Request.CreateResponse(HttpStatusCode.OK, liteBundle)); }