public ActionResult Complete(int companyId, AssistantData[] assistants, int userId) { var res = ActionResult.NoAction; foreach (var assitant in assistants) { res = Assistant.Complete(assitant.AssistantId, companyId, userId); if (!res.Success) { break; } } if (res.Success) { string message = "["; bool first = true; foreach (var data in assistants) { if (first) { first = false; } else { message += ","; } message += string.Format(CultureInfo.GetCultureInfo("en-us"), @"{{AssistantId:{0},EmployeeId:{1}}}", data.AssistantId, data.EmployeeId); } message += "]"; res.SetSuccess(message); } return(res); }