Exemple #1
0
        /// <summary>
        /// Registers an entity set as a part of the model and returns an object that can be used to configure the entity set.
        /// This method can be called multiple times for the same type to perform multiple lines of configuration.
        /// </summary>
        /// <typeparam name="TEntityType">The entity type of the entity set.</typeparam>
        /// <param name="name">The name of the entity set.</param>
        /// <returns>The configuration object for the specified entity set.</returns>
        public EntitySetConfiguration <TEntityType> EntitySet <TEntityType>(string name) where TEntityType : class
        {
            EntityTypeConfiguration entity = AddEntityType(typeof(TEntityType));

            return(new EntitySetConfiguration <TEntityType>(this, AddEntitySet(name, entity)));
        }
Exemple #2
0
        /// <summary>
        /// Registers a singleton as a part of the model and returns an object that can be used to configure the singleton.
        /// This method can be called multiple times for the same type to perform multiple lines of configuration.
        /// </summary>
        /// <typeparam name="TEntityType">The entity type of the singleton.</typeparam>
        /// <param name="name">The name of the singleton.</param>
        /// <returns>The configuration object for the specified singleton.</returns>
        public SingletonConfiguration <TEntityType> Singleton <TEntityType>(string name) where TEntityType : class
        {
            EntityTypeConfiguration entity = AddEntityType(typeof(TEntityType));

            return(new SingletonConfiguration <TEntityType>(this, AddSingleton(name, entity)));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="SingletonConfiguration"/> class.
 /// </summary>
 /// <param name="modelBuilder">The <see cref="ODataModelBuilder"/>.</param>
 /// <param name="entityType">The entity type <see cref="EntityTypeConfiguration"/> contained in this singleton.</param>
 /// <param name="name">The name of the singleton.</param>
 public SingletonConfiguration(ODataModelBuilder modelBuilder, EntityTypeConfiguration entityType, string name)
     : base(modelBuilder, entityType, name)
 {
 }