I have class:
[AllowMultiple = true]
CustomAttribute : Attribute
When I try add more than one CustomAttribute to MetaColumn, after registering modelprovider, MetaColumn has only the last one of CustomAttributes.
It seams that somewhere the modelprovider did distinct select on the attributes types.
I global.asax in Application_Start a have following code:
MetaModel model = new MetaModel();
ContextConfiguration config = new ContextConfiguration();
config.MetadataProviderFactory =
(
type => new Microsoft.Web.DynamicData.InMemoryMetadataTypeDescriptionProvider
(
type, new System.ComponentModel.DataAnnotations.AssociatedMetadataTypeTypeDescriptionProvider(type)
)
);
//** NOW I ADD SOME CustomAttributes TO CustomerEntity's CustomeName FIELD
My.BLL.AttributesManager.SetAttributesFromDb();
SD.LLBLGen.Pro.DynamicDataSupportClasses.LLBLGenProDataModelProvider modelProvider =
new SD.LLBLGen.Pro.DynamicDataSupportClasses.LLBLGenProDataModelProvider(
typeof(My.LLBL.EntityType),
new My.LLBL.Linq.LinqMetaData(),
new My.LLBL.FactoryClasses.ElementCreator());
model.RegisterContext(modelProvider, config);
//and now there is only single custom attribute in
//model.GetTable("Customer").GetColumn("CustomerName").Attributes
slice from My.BLL.AttributesManager.SetAttributesFromDb
foreach (IEntityField field in entity.Fields)
{
PropertyInfo info = entity.GetType().GetProperty(field.Name);
List<Attribute> attributes = SecurityManager.GetFieldAttributes(entityType.ToString(), field.Name);
//attributes contains Attributes like DisplayNameAttribute, ScaffoldAttribute and few CustomAttributes
InMemoryMetadataManager.AddColumnAttributes(info, attributes.ToArray());
}
Its a very serious problem for me, because a whole DynamicData application is based on Metadata Attributes and there are many customization based on CustomAttributes
Daniel, using v2.6