SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Assuming I already have the list object, is there some difference between calling its Delete extension as opposed to removing it from the Lists collection? Why would I ever choose the latter?

share|improve this question

Basically both methods do the same thing, but SPList.Delete() is a method of SPList object, where SPWeb.Lists.Delete(guid) is a method of SPListCollection object as SPWeb.Lists represents a SPListCollection object, so you can easily understand, in most of the cases you will find SPList.Delete() suitable to your need - because it is straightforward and also efficient as you dont get the collection first (negligible though), i tend to always follow the first one

It's hard to find cases where you may find SPWeb.Lists.Delete(guid) more suitable, one possible cases (highly unlikely situation) - say you have a list of list-guids which you need to delete, then rather than getting SPList reference for each and every list you can just delete the list using this method

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.