Exemplo n.º 1
0
        static MappingRepo()
        {
            var map = MappingRepoDictionary.GetMap <T>();

            if (map != null)
            {
                Map = map;
                return;
            }

            var classMapBase = typeof(ClassMap <T>).GetTypeInfo();

            Map = typeof(T)
                  .GetTypeInfo()
                  .Assembly
                  .ExportedTypes
                  .Where(x => classMapBase.IsAssignableFrom(x.GetTypeInfo().BaseType?.GetTypeInfo()))
                  .Select(x => (ClassMap <T>)Activator.CreateInstance(x))
                  .FirstOrDefault();
        }
Exemplo n.º 2
0
 public CompositeId(ClassMap <T> classMap)
 {
     ClassMap = classMap;
 }