ienumerable string use of unassigned local variable c# using
Hello sir,
In mvc 4 c# view page:-
@{
IEnumerable<string> ListGroupID;
}
@if (TempData["Message"] != null) {
var listTopline = TempData["Message"] as EMGUI.ViewModel.TopLineToExposure;
var ListGroupIds = listTopline.GroupIds;
ListGroupID = ListGroupIds.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries).Distinct();
}
Problem: when I am tring to use 'ListGroupID' inside foreach there is error occuring "ienumerable string use of unassigned local variable". How to solve this?
@foreach (var item in ListGroupID)
{
}