Beispiel #1
0
        /// <summary>
        /// Creates an list builder expression that allows you to create a list of entities.
        /// You can call .First(x), .Last(x), etc. methods followed by chained builder method calls.
        /// When you are done call .BuildList() to get the list of entities.
        /// This override allows you to specify the factory that is used to construct the objects,
        ///   the default implementation uses the <see cref="AllPropertiesFactory"/>.
        /// </summary>
        /// <param name="size">The size of list</param>
        /// <param name="factory">The factory to use to construct the object</param>
        /// <returns>The list builder for a list of {TBuilder} of the specified size</returns>
        public static ListBuilder <T, Builder <T> > CreateListOfSize(int size, IFactory factory)
        {
            var lb = new ListBuilder <T, Builder <T> >(size);

            lb.All().With(b => b.SetFactory(factory));
            return(lb);
        }