コード例 #1
0
        // TODO breeze doesn't support this at the moment / coni2k - 31 Jul. '17
        // [ConcurrencyValidator(typeof(UserResourcePool))]
        public async Task <IHttpActionResult> Delete(int userId, int resourcePoolId, Delta <UserResourcePool> patch)
        {
            // Owner check: Entity must belong to the current user
            var currentUserId = User.Identity.GetUserId <int>();

            if (currentUserId != userId)
            {
                return(StatusCode(HttpStatusCode.Forbidden));
            }

            await _resourcePoolManager.DeleteUserResourcePoolAsync(userId, resourcePoolId);

            return(StatusCode(HttpStatusCode.NoContent));
        }