示例#1
0
        private void Init()
        {
            var builder = new DbContextOptionsBuilder <FundraiseContext>()
                          .UseInMemoryDatabase("FundraiseTestDB");

            var context = new FundraiseContext(builder.Options);

            _campaignRepository = new CampaignRepository(context);

            var currencyRepository = new CurrencyRepository(context);

            usd = currencyRepository.FindByCode("USD");
            if (usd == null)
            {
                usd = currencyRepository.Create("USD", "$", "US Dollar");
            }
        }