kamagra how much to take

What Are The Biggest SharePoint API Mistakes?

The most prevalent SharePoint API mistake that I see is the lack of freaking Exist properties on proxy objects.

What do I mean?

One can’t do this in order to test, for example, whether a SPList object exists:

  1. public static void DoesMyListExistIDunno()
  2. {
  3. SPWeb web = SPContext.Current.Web;
  4. SPList list = web.Lists["Heres My List"];
  5.  
  6. bool areYouThere = list.{An Exists Property Would Be Sweet Wouldn't It?};
  7. }

As opposed to this, a developer is forced to do this (or a mild variation of this, I am just using the LINQ because it looks fancy) which is lame:

  1. public static bool InspectForList(string listName)
  2. {
  3. var results = SPContext.Current.Web.Lists.Cast<SPList>().Where(item => Equals(string.Compare(item.Title, listName, true), 0));
  4. return results.Count()> 0;
  5. }

What do you think is the most rampant and cumbersome? I am interested in what other people see as being a pain in the butt.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>