Exemplo n.º 1
0
        /// <summary>
        /// 为AbstractFactory找到他的TypeMapper,并注入
        /// </summary>
        /// <param name="factory"></param>
        public static void Assembly(IAbstarctFactoryWithTypeMapper factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }
            TypeMapperBase mapper = dictionary[factory.GetType()];

            factory.Mapper = mapper;
        }
Exemplo n.º 2
0
 public static ODocument ToDocument <T>(T genericObject)
 {
     return(TypeMapperBase.GetInstanceFor(genericObject.GetType()).ToDocument(genericObject));
 }
        public static void Assembly(IAbstractFactoryWithTypeMapper factory)
        {
            TypeMapperBase mapper = dictionary[factory.GetType()];

            factory.Mapper = mapper;
        }
Exemplo n.º 4
0
 /// <summary>
 /// Map non-edge properties of the vertex to the model
 /// </summary>
 /// <typeparam name="T">The model type</typeparam>
 /// <param name="document">The vertex</param>
 /// <param name="resultObj">The model object</param>
 private static void MapProperties <T>(ODocument document, T resultObj)
 {
     (TypeMapperBase.GetInstanceFor(typeof(T)) as TypeMapper <T>).ToObject(document, resultObj);
 }