Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Replace Array.ConvertAll in Aspnet 5 NetCore

$
0
0

My current code is using Array.ConvertAll, which i need to migrate to net core. How to migrate it to work in Net core. 

Can we use foreach statement with custom conversion code to handle the conversion?
But i dont know how to do it, Any help appreciated.

private DA.PBInformation[] ConvertInfo(Wsdl.Info_Type[] originalType)
    {
        DA.PBInformation[] sapRPInfo= null;
        if (originalType != null)
        {
            sapRPInfo= Array.ConvertAll<Wsdl.Info_Type, DA.PBInformation>(originalType,
                (Wsdl.Info_Type wsdlAltInfo) =>
                {
                    var pkInfo = new DA.PBInformation();
                    pkInfo.BfCode = wsdlAltInfo.APkAllType;
                    if ( wsdlAltInfo.MaxCountSpecified )
                    {
                        pkInfo.NumAll = (int)( wsdlAltInfo.MaxCount );
                    }
                    if ( wsdlAltInfo.LCountSp )
                    {
                        pknfo.NumAll = (int)( wsdlAltInfo.LCount );
                    }
                    return pkInfo;
                });
        }
        return sapRPInfo;

    }

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>