Wednesday, 27 April 2016


To check if object is an array and loop over it in C#


 public object value { get; set; }

Recently stuck with to check object is array or not.  if an object is an array then convert that array to comm separated string .

if (objArray != null) 
 {
            string ElementValue = "";
           var objArrayType = objArray.GetType();
           if (objArrayType .IsArray)
          {
               foreach (object o in (Array)objArray)
             {
                     ElementValue = ElementValue + "," + o;
             }
                     ElementValue = ElementValue.Substring(1);
         }
          else
          {
                    ElementValue = Convert.ToString(item.value);
            }
}

Thursday, 21 April 2016

Important Articles :

1.List vs IEnumerable vs IQueryable vs ICollection vs IDictionary

http://www.codeproject.com/Articles/832189/List-vs-IEnumerable-vs-IQueryable-vs-ICollection-v