/// <summary>
    /// Gets the domain entities.
    /// </summary>
    /// <returns></returns>
    /// <remarks>by default anything that derives from EntityBase and isn't abstract or generic</remarks>
    protected virtual IEnumerable <System.Type> GetDomainEntities()
    {
        List <System.Type> domainEntities = (from t in MappingAssembly.GetExportedTypes()
                                             where typeof(EntityBase <Guid>).IsAssignableFrom(t) &&
                                             (!t.IsGenericType || !t.IsAbstract)
                                             select t
                                             ).ToList();

        return(domainEntities);
    }
Пример #2
0
        private HbmMapping GetHbmMappings()
        {
            var mapper = new ConventionModelMapper();

            var mappings = MappingAssembly.GetExportedTypes().Where(MappingTypeFinder).ToList();

            mapper.AddMappings(mappings);

            mapper.ApplyNamingConventions();

            if (AutoMappingOverride != null)
            {
                AutoMappingOverride(mapper);
            }

            var mapping = mapper.CompileMappingForAllExplicitlyAddedEntities();

            ShowOutputXmlMappings(mapping);

            return(mapping);
        }