// public List<SimpleShip> shipsSetting = new List<SimpleShip>(); public GameController(BattleShipContext context) { _context = context; // SimpleShip simpleShip = new SimpleShip(); // shipsSetting.Add(); // shipsSetting.Add(2,3); // shipsSetting.Add(3, 3); }
private BattleShipContext GetDatabaseContext() { string BattleShipConnectionString = "Server=ISHCHENKO;Database=BattleShip2;User Id=Roman;Password=123456"; var options = new DbContextOptionsBuilder <BattleShipContext>() .UseSqlServer(BattleShipConnectionString) .Options; var databaseContext = new BattleShipContext(options); databaseContext.Database.EnsureCreated(); return(databaseContext); }
public PlayersController(BattleShipContext context) { _context = context; }