private Type GetMandatoryTypeFromAttribute(ComponentModel model, string attribute, LifestyleType lifestyleType)
{
var rawAttribute = model.Configuration.Attributes[attribute];
if (rawAttribute == null)
{
throw new InvalidOperationException(string.Format("Component {0} has {1} lifestyle, but its configuration doesn't have mandatory '{2}' attribute.", model.Name, lifestyleType, attribute));
}
return converter.PerformConversion<Type>(rawAttribute);
}