Ejemplo n.º 1
0
        /// <summary>
        /// 构造
        /// </summary>
        /// <param name="connectionString"></param>
        public ApplicationDbContext(string connectionString)
            : base(connectionString)
        {
            Plots                 = GetCollection <Plot>("Plots");
            Metadata              = GetCollection <Metadata>("Metadata");
            Translations          = GetCollection <Translation>("Translations");
            ImageFaceCenterPoints = GetCollection <ImageFaceCenterPoint>("ImageFaceCenterPoints");

            Plots.EnsureIndex(o => o.num);
            Plots.EnsureIndex(o => o.provider);

            Metadata.EnsureIndex(o => o.num);
            Metadata.EnsureIndex(o => o.provider);
            Metadata.EnsureIndex(o => o.url);

            Translations.EnsureIndex(o => o.hash);
            Translations.EnsureIndex(o => o.lang);
        }