public List <ParksResults> AddParksContract(string cicoid, string sYear, string atCode) { var varParksResults = _hmEntities.GetParkContracts(cicoid, sYear, atCode).ToList(); var lstParksResults = new List <ParksResults>(); if (varParksResults.Any()) { lstParksResults = varParksResults.AsEnumerable().Select(item => new ParksResults() { ParksEntityType = item.Project_Type, ParksContractId = item.Contract_ID, ParksEntity = item.Entity }).ToList(); for (var i = 0; i < 3; i++) { var parks = new ParksResults { ParksEntityType = "Park", ParksContractId = 0, ParksEntity = "" }; lstParksResults.Add(parks); } } else { for (var i = 0; i < 3; i++) { var parks = new ParksResults { ParksEntityType = "Park", ParksContractId = 0, ParksEntity = "" }; lstParksResults.Add(parks); } } return(lstParksResults); }
public List <ParksResults> FetchParksResults(string cicoid, string fiscalYr, string atCd) { var varParksResults = _hmEntities.GetParkContracts(cicoid, fiscalYr, atCd).ToList(); if (varParksResults.Any()) { var lstParksResults = varParksResults.AsEnumerable().Select(item => new ParksResults() { ParksEntityType = item.Project_Type, ParksContractId = item.Contract_ID, ParksEntity = item.Entity }).ToList(); return(lstParksResults); } var parksResultses = new List <ParksResults>(); for (var i = 0; i < 3; i++) { var parks = new ParksResults { ParksEntityType = "Park", ParksContractId = 0, ParksEntity = "" }; parksResultses.Add(parks); } return(parksResultses); }