// TODO breeze doesn't support this at the moment / coni2k - 31 Jul. '17 // [ConcurrencyValidator(typeof(ResourcePool))] public async Task <IHttpActionResult> Delete(int key, Delta <ResourcePool> patch) { var resourcePool = await _resourcePoolManager.GetResourcePoolSet(key).SingleOrDefaultAsync(); // Owner check: Entity must belong to the current user var currentUserId = User.Identity.GetUserId <int>(); if (currentUserId != resourcePool.UserId) { return(StatusCode(HttpStatusCode.Forbidden)); } await _resourcePoolManager.DeleteResourcePoolAsync(resourcePool.Id); return(StatusCode(HttpStatusCode.NoContent)); }