Castle.MicroKernel.ModelBuilder.Inspectors.LifestyleModelInspector.GetMandatoryTypeFromAttribute C# (CSharp) Method

GetMandatoryTypeFromAttribute() private method

private GetMandatoryTypeFromAttribute ( ComponentModel model, string attribute, LifestyleType lifestyleType ) : Type
model Castle.Core.ComponentModel
attribute string
lifestyleType LifestyleType
return System.Type
		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);
		}