public ActionResult SetElements(int userID, string elementID, int moduleID) { string[] tempIds = elementID.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries); int[] elementIds = Array.ConvertAll(tempIds, s => Convert.ToInt32(s)); ReturnDescription description = UserInfoServices.SetUserModuleElements(userID, elementIds, moduleID); if (description.Flag) { return(Ok(new Result { State = 1, Message = description.Message })); } else { return(BadRequest(new Result { State = 0, Message = description.Message })); } }