Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Mty code is :
public static List <mcs.model.zipcodes> GetPlansbyZipCode(string ZipCodeName)
{
DataTable dt;
using (var Context = new ConserviceEntities ())
{

var list = (from zip in Context.ZipCodes
from tdsp in Context.TDSP
where zip.TDSPID == tdsp.TDSPID && zip.ZipCode.Equals(ZipCodeName)
select new { zip.ZipCodeID, zip.ZipCode, tdsp.TDSP1, tdsp.TDSPCode, tdsp.TDSPID }).ToList();
return list;

}
}
but return list showing error that cannot convert implicity generic......<anonymoustype>
Posted

The retrun type of list should be like:


public static List<classname or="" datatype...=""> GetPlansbyZipCode(string ZipCodeName)
{

}

example

public static List<string>method1
{
return list;
}

Try this, if still get error, provide the error message.
 
Share this answer
 
v3
Hello ,

You have not defined the type of List<t> .
To know about List<t></t> Refer this :
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900