public PositionTest() { DbContextOptionsBuilder <DaContext> builder = new DbContextOptionsBuilder <DaContext>(); builder.UseNpgsql("Username=postgres;Password=123;Host=localhost;Port=5432;Database=pulxer_test"); _options = builder.Options; _insDA = new InstrumDA(_options); _accountDA = new AccountDA(_options); _positionDA = new PositionDA(_options); // создание var gazp = _insDA.GetInstrum(0, "GAZP"); if (gazp == null) { _gazpID = _insDA.InsertInstrum("GAZP", "Газпром", "Газпром", 10, 2, 1); } else { _gazpID = gazp.InsID; } var lkoh = _insDA.GetInstrum(0, "LKOH"); if (lkoh == null) { _lkohID = _insDA.InsertInstrum("LKOH", "Лукойл", "Лукойл", 1, 0, 0); } else { _lkohID = lkoh.InsID; } _accountID = _accountDA.CreateAccount("", "", 0, false, Common.Data.AccountTypes.Test).AccountID; }
public PositionBL(IPositionDA positionDA, IInstrumBL instrumBL) { _positionDA = positionDA; _instrumBL = instrumBL; }