Hi I have been looking at certain tutorials on sharparchitecture and trying to no avail (the online convertors don’t seem to be able to do this):
private Action<AutoMappingExpressions> GetSetup()
{
return c =>
{
c.FindIdentity = type => type.Name == "Id";
};
}
private Action<IConventionFinder> GetConventions()
{
return c =>
{
c.Add<MVCTemp.Data.NHibernateMaps.Conventions.ForeignKeyConvention>();
c.Add<MVCTemp.Data.NHibernateMaps.Conventions.HasManyConvention>();
c.Add<MVCTemp.Data.NHibernateMaps.Conventions.HasManyToManyConvention>();
c.Add<MVCTemp.Data.NHibernateMaps.Conventions.ManyToManyTableNameConvention>();
c.Add<MVCTemp.Data.NHibernateMaps.Conventions.PrimaryKeyConvention>();
c.Add<MVCTemp.Data.NHibernateMaps.Conventions.ReferenceConvention>();
c.Add<MVCTemp.Data.NHibernateMaps.Conventions.TableNameConvention>();
};
}
I assume that you’re trying to convert this to VB.Net.
Until Visual Basic 2010 (currently in beta), it’s not possible.
Lambda expressions in VB.Net 2008 can only hold a single expression.
However, you could create
Sharedhelper functions that do the work and return them.For example: (In VB)