I have a list of strings 'obAttachmentTypes' where each string looks like this: (ID|NAME|LEVEL). I'm trying to convert these strings into a list of AttachmentType objects so there are easier to manage. I use the .Select function to translate the list of strings, but Im having trouble trying to split the strings. Ive looked into using the Split() function, but I'm not sure how to use it in this case.
List<KeywordDataSetItem> obAttachmentTypes = GetAttachmentTypes(app);
var attachTypes = obAttachmentTypes
.Select(at => new AttachmentType
{
//use split here?
AttachmentTypeId = at.AlphaNumericValue.Split(''),
AttachmentTypeName = at.AlphaNumericValue.Split(''),
IsPopular = true,
AttachmentTypeLevel = at.AlphaNumericValue.Split(''),
})
.ToList();
return attachTypes;