예제 #1
0
        /// <summary>
        /// Configures the MicroLite ORM Framework to use attribute based mapping instead of the default convention based mapping.
        /// </summary>
        /// <param name="configureExtensions">The interface to configure extensions.</param>
        /// <returns>The interface which provides the extension points.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown if any argument is null.</exception>
        public static IConfigureExtensions WithAttributeBasedMapping(
            this IConfigureExtensions configureExtensions)
        {
            if (configureExtensions is null)
            {
                throw new ArgumentNullException(nameof(configureExtensions));
            }

            configureExtensions.SetMappingConvention(new AttributeMappingConvention());

            return(configureExtensions);
        }
예제 #2
0
        /// <summary>
        /// Configures the MicroLite ORM Framework to use custom convention settings for the default convention based mapping.
        /// </summary>
        /// <param name="configureExtensions">The interface to configure extensions.</param>
        /// <param name="settings">The settings for the convention mapping.</param>
        /// <returns>The interface which provides the extension points.</returns>
        /// <exception cref="System.ArgumentNullException">Thrown if any argument is null.</exception>
        public static IConfigureExtensions WithConventionBasedMapping(
            this IConfigureExtensions configureExtensions,
            ConventionMappingSettings settings)
        {
            if (configureExtensions is null)
            {
                throw new ArgumentNullException(nameof(configureExtensions));
            }

            if (settings is null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            configureExtensions.SetMappingConvention(new ConventionMappingConvention(settings));

            return(configureExtensions);
        }
예제 #3
0
 public WhenCallingExtensionsMultipleTimes()
 {
     this.extensions1 = Configure.Extensions();
     this.extensions2 = Configure.Extensions();
 }
예제 #4
0
 public WhenCallingExtensionsMultipleTimes()
 {
     this.extensions1 = Configure.Extensions();
     this.extensions2 = Configure.Extensions();
 }