Пример #1
0
        public UserAccountService(IOptions <AppSettings> appSettings)
        {
            var userAccountsDataPath = Path.Combine(AssemblyUtils.AssemblyDirectory, @"Data\UserAccounts.json");

            UserAccounts = UserDataMock.GetUserAccountsWithAutoIncrement(userAccountsDataPath).ToList();
            AppSettings  = appSettings.Value;
        }
Пример #2
0
        public void Configure(EntityTypeBuilder <User> builder)
        {
            var usersDataPath = Path.Combine(AssemblyUtils.AssemblyDirectory, @"Data\Users.json");
            var users         = UserDataMock.GetUsersWithAutoIncrement(usersDataPath);

            builder.HasData(users.ToArray());
        }
Пример #3
0
        private static void AddTestData(RepositoryContext context)
        {
            var usersDataPath = Path.Combine(AssemblyUtils.AssemblyDirectory, @"Data\Users.json");
            var users         = UserDataMock.GetUsersWithAutoIncrement(usersDataPath);

            foreach (var user in users)
            {
                context.Users.AddRange(user);
                context.SaveChanges();
            }
        }
Пример #4
0
        public PasswordHashTest()
        {
            var userAccountsDataPath = Path.Combine(AssemblyUtils.AssemblyDirectory, @"Sample\Data\UserAccounts.json");

            UserAccounts = UserDataMock.GetUserAccountsWithAutoIncrement(userAccountsDataPath).ToList();
        }
Пример #5
0
        public UserTest()
        {
            var usersDataPath = Path.Combine(AssemblyUtils.AssemblyDirectory, @"Sample\Data\Users.json");

            Users = UserDataMock.GetUsersWithAutoIncrement(usersDataPath).ToList();
        }