且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将列表转换为列表

更新时间:2022-12-12 09:36:15

sp_SearchHotelResult和Hotel是两个不同的类.一些属性可以存在于酒店中,但不能存在于其他属性中.
所以***的方法是
sp_SearchHotelResult and Hotel are two different classes. Some of the properties can be present in Hotel but not in other.
So the best way to do is
List <sp_searchhotelresult>lstHotel = HotelMaster.SearchHotel("d");
List<hotel> ll = new List<hotel>();
foreach(SP_SearchHotelResult  obj in lstHostel)
{
Hotel h=new Hotel();
Hotel.ID=obj.Id;
//set values for Hotel obj here
ll.Add(h);
}</hotel></hotel></sp_searchhotelresult>