Hello,

In my class map, I have the following.

public class DiscordGuidMap : DiscordModelBaseMap<DiscordGuild, SocketGuild>
{
    public DiscordGuidMap() : base()
    {
        Map(x => x.Name)
            .Length(DiscordModelBase.NameMaxLength)
            .Not.Nullable();

        Map(x => x.Description)
            .Length(DiscordGuild.DescriptionMaxLength)
            .Nullable();
 
        HasMany(x => x.TextChannels)
            .AsBag()
            .Cascade.AllDeleteOrphan().Inverse();
    }
}

There is an internal property Source which we pick up the SocketGuild in 
this case, and for DiscordTextChannel the SocketTextChannel as well.

These are properly unmapped, should not be mapped.

I got this to save or update "once" now does not seem to work again, 
getting the infamous "no persister for". Now with the exception messages:

- $exception {"An invalid or incomplete configuration was used while 
creating a SessionFactory. Check PotentialReasons collection, and 
InnerException for more detail.\r\n\r\n"} 
FluentNHibernate.Cfg.FluentConfigurationException
+ InnerException {"Could not determine type for: 
Discord.WebSocket.SocketGuild, Discord.Net.WebSocket, Version=3.15.3.0, 
Culture=neutral, PublicKeyToken=null, for columns: 
NHibernate.Mapping.Column(Source)"} System.Exception 
{NHibernate.MappingException}

Note, there should NOT be a persister for Source, nor do we want to map 
that property, it is strictly for internal use only.

My mappings are properly configured including ClassMap<t> from the 
appropriate assemblies.

private static void OnMappingConfiguration<TMappingProvider, 
TConvention>(MappingConfiguration mappingConfiguration)
    where TMappingProvider : class, IMappingProvider
    where TConvention : class, IConvention
{
    mappingConfiguration.FluentMappings
        .Conventions.AddFromAssemblyOf<TConvention>()
        .AddFromAssemblyOf<TMappingProvider>();
}

private static (string appSettingsPath, Action<MappingConfiguration> 
onMapping, Action<Configuration> onExpose) _configurationHandlers = (
    "appsettings.json"
    , OnMappingConfiguration<CredentialMap, PrimaryKeyConvention>
    , delegate { }
);

And we deconstruct the tuple and use accordingly in the correct places. 
We're "this far" as evidence things are wired and plumbed correctly.

The only way we could be getting that exception is if somehow Source is 
somehow being seen and included in the map, which it should not be. And 
solutions I have seen in some forums to annotate with an [Ignore] or 
perhaps [NotMapped attribute, not a desirable approach, starts getting 
overtly invasive of the mapped models. Besides which, we are not auto 
mapping, but rather fluent ClassMap mapping.

Any thoughts how to contend with this?

Thank you!

Best,

Michael W. Powell

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/fluent-nhibernate/90711226-d5bc-4085-935a-de37720e1116n%40googlegroups.com.

Reply via email to