예제 #1
0
        /// <summary>
        /// Creates an object of the specified type associated with the attribute type
        /// </summary>
        /// <param name="ServiceType">Service type</param>
        /// <param name="AttributeType">Attribute type</param>
        /// <returns>An object of the specified type</returns>
        public object Get(Type ServiceType, Type AttributeType)
        {
            IMapping Mapping = MappingManager.GetMapping(ServiceType, AttributeType);

            if (Mapping.IsNull())
            {
                throw new ArgumentException("ServiceType not found in mappings");
            }
            return(Mapping.Implementation.Create());
        }
예제 #2
0
        private object GetObject(Type Type, Type AttributeType)
        {
            IMapping Mapping = MappingManager.GetMapping(Type, AttributeType);

            return(Mapping.IsNull() ? null : Mapping.Implementation.Create());
        }