// POST: api/Collection public void Post(Collection collection) { dynamic result = collectionRepository.getById(collection.UserId, collection.ResourceId); if (result == null) { collectionRepository.add(collection); } }