Example #1
0
//        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);
        }
Example #2
0
        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;
 }