Exemple #1
0
 internal static Application CreateApplication(MembershipContext ctx, string appName)
 {
     Application entity = new Application {
         ApplicationId = Guid.NewGuid(),
         ApplicationName = appName
     };
     ctx.Applications.Add(entity);
     return entity;
 }
Exemple #2
0
 internal static User CreateUser(MembershipContext ctx, Guid id, string userName, Guid appId, bool isAnon)
 {
     User entity = new User {
         UserId = id,
         ApplicationId = appId,
         LastActivityDate = DateTime.UtcNow,
         UserName = userName,
         IsAnonymous = isAnon
     };
     ctx.Users.Add(entity);
     return entity;
 }
Exemple #3
0
 internal static MembershipContext CreateMembershipContext(ConnectionStringSettings setting)
 {
     if (!DbInitialized)
     {
         DatabaseInitialize();
     }
     MembershipContext db = new MembershipContext(setting.Name);
     if (!MembershipInitialized)
     {
         EnsureDatabaseCreated(db);
         ExecuteSql(db, "CREATE NONCLUSTERED INDEX IDX_UserName ON Users (UserName)");
         MembershipInitialized = true;
     }
     return db;
 }