public HttpResponseMessage Delete(string collection, string ids, string hub = "appboxr")
{
var _repo = GlobalHost.DependencyResolver.Resolve<IDataLayer>();
var _ids = ids.Split(',');
List<string> wrapped = new List<string>();
foreach (var id in _ids)
wrapped.Add("{ \"$oid\": \"" + id.Replace("\"", "") + "\"}");
var _res = _repo.Delete(new { collection = collection, ids = String.Concat("[", String.Join(",", wrapped), "]") });
//notify user UIs of the delete
var c = GlobalHost.ConnectionManager.GetHubContext(hub);
c.Clients.All.process(new { appBoxr = new { process = new { top = "DELETE" } } });
return this.Request.CreateResponse(
HttpStatusCode.OK
, _res
);
}