Exemplo n.º 1
0
		public void SetShipCount(int shipTypeID, int count)
		{
			var entry = FleetShips.SingleOrDefault(x => x.ShipTypeID == shipTypeID);
			if (entry == null)
			{
				entry = new FleetShip();
				entry.ShipTypeID = shipTypeID;
				FleetShips.Add(entry);
			}
			entry.Count = count;
			if (count == 0) FleetShips.Remove(entry);
		}
 partial void DeleteFleetShip(FleetShip instance);
 partial void UpdateFleetShip(FleetShip instance);
		private void detach_FleetShips(FleetShip entity)
		{
			this.SendPropertyChanging();
			entity.ShipType = null;
		}
 partial void InsertFleetShip(FleetShip instance);
		private void attach_FleetShips(FleetShip entity)
		{
			this.SendPropertyChanging();
			entity.ShipType = this;
		}