views:

551

answers:

1

I've been trying to use #harp architecture and Fluent-NHibernate. I am trying to sublass off of SharpArch.Core.DomainModel.Entity since I have some entities in my domain model that must have a unique name.

public abstract class UniqueNamedEntity : Entity
{
    protected UniqueNamedEntity() {

    }

    protected UniqueNamedEntity(string uniqueName) {
        Check.Require(!string.IsNullOrEmpty(uniqueName) && uniqueName.Trim() != String.Empty,
                      "The unique name must be provided");

        UniqueName = uniqueName;
    }

    [DomainSignature]
    [NotNull, NotEmpty]
    public virtual string UniqueName { get; protected set; }
}

When I try to map this using the Fluent Nhibernate AutoMap classes I get the following error: Object of type 'FluentNHibernate.AutoMap.AutoMap1[Assembly.SomeSubclassOfUniqueNamedEntity]' cannot be converted to type 'FluentNHibernate.AutoMap.AutoMap1[Assembly.UniqueNamedEntity]'.

I've tried setting the SomeSubclassOfUniqueNamedEntityMap class to subclass off of UniqueNamedEntityMap, but that doesn't work. If anyone has anythoughts that would be great.

A: 

Nevermind. I figured out what I was doing wrong. Hadn't informed the BaseTypeConvention of the new base type.

MisterHux

related questions