简体   繁体   中英

Xml Parameter needed from LIst in C#

Using LINQ to SQl I am storing a list to a variable. In my controller. I now need to pass this list stored in the variable to an XML parameter that can be called in another stored procedure. Can someone show me how to store the last XML? Thanks!

  var myVariableToAList = (from s in myResults.MyResultsList
                                select new MyResultsViewModel
                                {
                                    Id = s.Id,                                      
                                    Name = s.Name,
                                    PhoneNo1 = s.PhoneNo1,
                                    PhoneNo2 = s.PhoneNo2
                                }).ToList();


      myVariableToAList = ( I need to store this list as an XML Parameter)

You could try to store that list as JSON into an XML parameter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM