Esempio n. 1
0
        public ClassMap <T> Tuplizer(TuplizerMode mode, Type tuplizerType)
        {
            tuplizerMapping      = new TuplizerMapping();
            tuplizerMapping.Mode = mode;
            tuplizerMapping.Type = new TypeReference(tuplizerType);

            return(this);
        }
Esempio n. 2
0
        /// <summary>
        /// Configures the tuplizer for this entity. The tuplizer defines how to transform
        /// a Property-Value to its persistent representation, and viceversa a Column-Value
        /// to its in-memory representation, and the EntityMode defines which tuplizer is in use.
        /// </summary>
        /// <param name="mode">Tuplizer entity-mode</param>
        /// <param name="tuplizerType">Tuplizer type</param>
        public TuplizerPart Tuplizer(TuplizerMode mode, Type tuplizerType)
        {
            tuplizerMapping      = new TuplizerMapping();
            tuplizerMapping.Mode = mode;
            tuplizerMapping.Type = new TypeReference(tuplizerType);

            return(new TuplizerPart(tuplizerMapping)
                   .Type(tuplizerType)
                   .Mode(mode));
        }
Esempio n. 3
0
        /// <summary>
        /// Configures the tuplizer for this entity. The tuplizer defines how to transform
        /// a Property-Value to its persistent representation, and viceversa a Column-Value
        /// to its in-memory representation, and the EntityMode defines which tuplizer is in use.
        /// </summary>
        /// <param name="mode">Tuplizer entity-mode</param>
        /// <param name="tuplizerType">Tuplizer type</param>
        public TuplizerPart Tuplizer(TuplizerMode mode, Type tuplizerType)
        {
            providers.TuplizerMapping = new TuplizerMapping();
            providers.TuplizerMapping.Set(x => x.Mode, Layer.UserSupplied, mode);
            providers.TuplizerMapping.Set(x => x.Type, Layer.UserSupplied, new TypeReference(tuplizerType));

            return(new TuplizerPart(providers.TuplizerMapping)
                   .Type(tuplizerType)
                   .Mode(mode));
        }
Esempio n. 4
0
        private string GetModeString(TuplizerMode mode)
        {
            switch (mode)
            {
            case TuplizerMode.Poco:
                return("poco");

            case TuplizerMode.DynamicMap:
                return("dynamic-map");

            case TuplizerMode.Xml:
                return("xml");

            default:
                throw new ArgumentException(string.Format("Unknown tuplizer entity mode '{0}'.", mode));
            }
        }
Esempio n. 5
0
 /// <summary>
 /// Sets the tuplizer mode
 /// </summary>
 /// <param name="mode">Mode</param>
 public TuplizerPart Mode(TuplizerMode mode)
 {
     mapping.Set(x => x.Mode, Layer.UserSupplied, mode);
     return(this);
 }
Esempio n. 6
0
 /// <summary>
 /// Sets the tuplizer mode
 /// </summary>
 /// <param name="mode">Mode</param>
 public TuplizerPart Mode(TuplizerMode mode)
 {
     mapping.Mode = mode;
     return(this);
 }