Building Module problem - ContentBaseMetadataSource constructor issue
Hi,
I have been working through a tutorial in creating content based modules for an Email module, I have found myself stuck with the following code which is in the moduleFluentMetadataSources.cs file:
namespace Cinema.Model
public class CinemaFluentMetadataSource : ContentBaseMetadataSource
public CinemaFluentMetadataSource() : base()
public CinemaFluentMetadataSource(IDatabaseMappingContext context) : base(context)
protected override IList<
IOpenAccessFluentMapping
> BuildCustomMappings()
var sitefinityMappings = base.BuildCustomMappings();
sitefinityMappings.Add(new CinemaFluentMapping(this.Context));
return sitefinityMappings;
public CinemaFluentMetadataSource() : base()
Hello Andrew,
Please, implement your MetaDataSource like in the Products sample, by providing parameterless constructor that calls the base constructor with null. The parameterless constructor is needed for the OA enhancer - it looks into the assembly using reflection for MetaDataSoruces with public parameterless constructors and than executes the mapping in order to get information which classes and properties to enhance. The ContentBaseMetadataSource doesn't have empty constructor since it shouldn't be considered during enhancing -> it is just a helper metadata source combining the necessary fluent mappings for Content based providers. Another reason to change this is was not to forget to implement a constructor with a call to the base constructor with the context parameter - since this is very important for the correct functioning for different backend databases.
public class ProductsFluentMetadataSource : ContentBaseMetadataSource
#region Construction
public ProductsFluentMetadataSource()
: base(null)
public ProductsFluentMetadataSource(IDatabaseMappingContext context)
: base(context)