예제 #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();
        }