I have a entity class RenderingTemplates. Inside this i have a property List which holds all versions of rendering template. RenderingTemplateVersion has a property VersionName which stores version name as "Version 1.0".
I am creating a new version and want to find last version no.so that i can append it by 1 and make new VersionName as "Version 2.0".
To accomplish this i have
LatestVersion = template.RenderingTemplateVersionList.OrderByDescending(e => e.VersionName.Split(new char[] { ' ', '.' })[1]).First()
LatestVersion is a integer. How to convert this to integer.Please help or suggest some other way.