﻿using System.Xml;
using FluentNHibernate;
using FluentNHibernate.Mapping;

namespace FluentNHibernate.QuickStart.Domain.Mapping
{
    public class CatMap : ClassMap<Cat>, IMapGenerator
    {
        public CatMap()
        {
            //set up our generator as UUID.HEX
            Id(x => x.Id)
                .GeneratedBy
                .UuidHex("B");


            //non-nullable string with a length of 16
            Map(x => x.Name)
                .WithLengthOf(16)
                .CanNotBeNull();

            //simple properties
            Map(x => x.Sex);
            Map(x => x.Weight);
        }

        #region IMapGenerator Members

        public XmlDocument Generate()
        {
            return CreateMapping(new MappingVisitor());
        }

        #endregion
    }
}
﻿using System.Xml;
using FluentNHibernate;
using FluentNHibernate.Mapping;

namespace FluentNHibernate.QuickStart.Domain.Mapping
{
    public class CatMap : ClassMap<Cat>, IMapGenerator
    {
        public CatMap()
        {
            //set up our generator as UUID.HEX
            Id(x => x.Id)
                .GeneratedBy
                .UuidHex("B");


            //non-nullable string with a length of 16
            Map(x => x.Name)
                .WithLengthOf(16)
                .Not.Nullable();

            //simple properties
            Map(x => x.Sex);
            Map(x => x.Weight);
        }

        #region IMapGenerator Members

        public XmlDocument Generate()
        {
            return CreateMapping(new MappingVisitor());
        }

        #endregion
    }
}
Fix for a compile error in the QuickStart.
Fix for a compile error in the QuickStart.


git-svn-id: a161142445158cf41e00e2afdd70bb78aded5464@286 48f0ce17-cc52-0410-af8c-857c09b6549b
