public void Init()
        {
            var options = new DbContextOptionsBuilder <ApplicationContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;
            var context = new ApplicationContext(options);

            RepositoryCoin = new RepositoryCoin(context);
            RepositoryCoin.Add(_coin, _quality);
        }
Example #2
0
        public CoinController(IApplicationContext db, IMapper mapper)
        {
            _repositoryCoins = new RepositoryCoin(db);
            _mapper          = mapper;

            foreach (EnumCoin par in Enum.GetValues(typeof(EnumCoin)))
            {
                if (_repositoryCoins.Get(new Coin(par)) == null)
                {
                    _repositoryCoins.Add(new Coin(par), 0);
                }
            }
        }