public IHttpActionResult GiveRegInfo([FromBody] List <RegExModel> modelList) { string finalRegularExpression = ""; if (modelList == null) { return(BadRequest("Requirement can not be null")); } RegularExpression experssion = new RegularExpression(); foreach (RegExModel model in modelList) { finalRegularExpression = finalRegularExpression + experssion.CreateRegularExpression(model); } return(Ok("^" + finalRegularExpression + "$")); }