예제 #1
0
        public static void Exist()
        {
            var context = ApplicationIdentityContext.Create();

            IndexChecks.EnsureUniqueIndexOnUserName(context.Users);

            IndexChecks.EnsureUniqueIndexOnRoleName(context.Roles);
        }
예제 #2
0
        public static void Exist()
        {
            var context = ApplicationIdentityContext.Create();

            IndexChecks.EnsureUniqueIndexOnUserName(context.Users);
            IndexChecks.EnsureUniqueIndexOnRoleName(context.Roles);
            context.Books.Indexes.CreateOne(Builders <Book> .IndexKeys.Ascending("BookName"));
        }