public ConstructorInfo Build(Type parentType)
{
Guard.IsNotNull(parentType, "parentType");
string typeName = "$" + parentType.FullName.Replace(".", string.Empty);
TypeBuilder typeBuilder = module.DefineType(typeName, TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.AutoClass | TypeAttributes.AnsiClass | TypeAttributes.BeforeFieldInit, parentType, new[] { authorizeAttributeType });
typeBuilder.DefineDefaultConstructor(MethodAttributes.Public | MethodAttributes.HideBySig | MethodAttributes.SpecialName | MethodAttributes.RTSpecialName);
typeBuilder.AddInterfaceImplementation(authorizeAttributeType);
WriteProperty(parentType, typeBuilder, "Order", typeof(int));
WriteProperty(parentType, typeBuilder, "Roles", typeof(string));
WriteProperty(parentType, typeBuilder, "Users", typeof(string));
WriteIsAuthorized(parentType, typeBuilder);
Type type = typeBuilder.CreateType();
return type.GetConstructor(Type.EmptyTypes);
}