Mukesh Kumar Tiwari

Mukesh Kumar Tiwari

  • NA
  • 980
  • 252.5k

How to return a single massege with a list of records ???

Jan 9 2015 7:32 AM

hi please help me out.
List<BAL.User> buddiesList = objBuddies.GetBuddies(Convert.ToInt64(UserId));
if (buddiesList.Count > 0) {

foreach (var list in buddiesList)
{
objReturnBuddeisData.UserID = list.UserID;
objReturnBuddeisData.DeviceID = list.DeviceType;
objReturnBuddeisData.DeviceType = list.DeviceType;
objReturnBuddeisData.UserName = list.UserName;
objReturnBuddeisData.ProfileName = list.ProfileName;
objReturnBuddeisData.EmailID = list.EmailID;
objReturnBuddeisData.ProfileImage = list.ProfieImage;
objReturnBuddeisData.FacebookId = list.FacebookId;
objReturnBuddeisData.errorMessage = "OK";//insted of this i want single errormessge for hole list.
objReturnBuddiesList.Add(objReturnBuddeisData);
}
}
Context.Response.Clear();
Context.Response.ContentType = "application/json";
JavaScriptSerializer js = new JavaScriptSerializer();
string json = js.Serialize(objReturnBuddiesList);
return json;
================
 i want to return only one single massege  for all the records in  response with this list object.