// TODO breeze doesn't support this at the moment / coni2k - 31 Jul. '17
        // [ConcurrencyValidator(typeof(ElementItem))]
        public async Task <IHttpActionResult> Delete(int key, Delta <ElementItem> patch)
        {
            var elementItem = await _resourcePoolManager.GetElementItemSet(key, true, item => item.Element.ResourcePool).SingleOrDefaultAsync();

            // Owner check: Entity must belong to the current user
            var currentUserId = User.Identity.GetUserId <int>();

            if (currentUserId != elementItem.Element.ResourcePool.UserId)
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            await _resourcePoolManager.DeleteElementItemAsync(elementItem.Id);

            return(StatusCode(HttpStatusCode.NoContent));
        }