When I register the views models I do
SimpleIoc.Default.Register(
() => SimpleIoc.Default.GetInstanceWithoutCaching<INewsViewModel>(),
flow.Guid.ToString());
ViewModelsCache.Instance.AddViewModelInfo(flow.Guid.ToString(), INewsViewModel);
After I logout I am trying to do:
foreach (var viewModelInfo in ViewModelsCache.Instance.ViewModelsInfo)
{
Type type = viewModelInfo.Value.GetType();
SimpleIoc.Default.Unregister<type>(viewModelInfo.key);
}
But I am getting the error:
'type' is a variable but is used like a type
Do you have an alternative suggestion?