I have a class that has a password property that I want to keep encrypted in db. The property is a string type, and I have my own EncryptedStringType type that I want to use NHibernate to map this to the database. Here is my corresponding autopilot code:
var mappings = AutoMap.AssemblyOf<Business>() .Where(x=>x.IsSubclassOf(typeof(EntityBase))) .IgnoreBase(typeof(EntityBase)) .Conventions.Add ( ConventionBuilder.Id.Always(x => x.GeneratedBy.HiLo(HILO_TABLE, HILO_COLUMN, HILO_MAX_LO)), ConventionBuilder.HasMany.Always(x => x.Cascade.AllDeleteOrphan()), Table.Is(o => Inflector.Pluralize(o.EntityType.Name)), PrimaryKey.Name.Is(o => "Id"), ForeignKey.EndsWith("Id"), DefaultLazy.Always(), DefaultCascade.All() );
I cannot understand the syntax to override the type of UserPassword property for a business class. I thought I could do something with overrides like:
mappings.Override<Business>(map=> );
Any help is appreciated.
Chris source share