Пример #1
0
        private UserData MockUserCredentials(string username, string password)
        {
            var passwordEncrypted = password.Encrypt();
            var mockUser          = new Mock <User>();

            mockUser.SetupGet(u => u.Username).Returns(username);
            mockUser.SetupGet(u => u.Password).Returns(passwordEncrypted);
            var usersInMemory = new List <User> {
                mockUser.Object
            };
            var mockUserDbSet = MockDbSet <User>(usersInMemory);
            var context       = new Data.DbContext {
                Users = mockUserDbSet.Object
            };
            var userData = new UserData(context);

            return(userData);
        }
Пример #2
0
 public ApplicationRoleStore(DbContext context)
     : base(context)
 {
 }
 private static DbEntityEntry <T> GetEntityOrReturnNull <T>(T currentCopy, DbContext dbContext) where T : TemelVarlık
 {
     return(dbContext.ChangeTracker.Entries <T>().FirstOrDefault(e => e.Entity == currentCopy));
 }
Пример #4
0
 public ApplicationUserStore(DbContext context)
     : base(context)
 {
 }