|
|
|
|
@ -8,7 +8,10 @@ using System.Linq;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using System.Xml;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using Npgsql.Replication.PgOutput.Messages;
|
|
|
|
|
using skyscraper8.Skyscraper.Scraper.Storage.Utilities;
|
|
|
|
|
|
|
|
|
|
namespace skyscraper5.Data.PostgreSql
|
|
|
|
|
{
|
|
|
|
|
@ -101,10 +104,55 @@ namespace skyscraper5.Data.PostgreSql
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//PDS noch nicht bekannt
|
|
|
|
|
EnqueueTask(x => InsertDvbNipPrivateDataSpecifier(x,coordinates,versionUpdate,privateDataSessions));
|
|
|
|
|
_dvbNipPrivateDataSpecifiers[coordinates] = versionUpdate;
|
|
|
|
|
return true;
|
|
|
|
|
//PDS noch nicht bekannt, also in DB nachgucken
|
|
|
|
|
|
|
|
|
|
bool result = false;
|
|
|
|
|
DateTime lastUpdated = DateTime.MinValue;
|
|
|
|
|
NpgsqlConnection connection = new NpgsqlConnection(connectionStringBuilder.ToString());
|
|
|
|
|
connection.Open();
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText =
|
|
|
|
|
"SELECT version_update FROM dvbnip_private_data_specifiers WHERE nid = @nid AND cid = @cid AND lid = @lid AND sid = @sid AND private_data_specifier = @pds";
|
|
|
|
|
command.Parameters.AddWithValue("@nid", NpgsqlDbType.Integer, (int)coordinates.Item1);
|
|
|
|
|
command.Parameters.AddWithValue("@cid", NpgsqlDbType.Integer, (int)coordinates.Item2);
|
|
|
|
|
command.Parameters.AddWithValue("@lid", NpgsqlDbType.Integer, (int)coordinates.Item3);
|
|
|
|
|
command.Parameters.AddWithValue("@sid", NpgsqlDbType.Integer, (int)coordinates.Item4);
|
|
|
|
|
command.Parameters.AddWithValue("@pds", NpgsqlDbType.Bigint, (long)coordinates.Item5);
|
|
|
|
|
NpgsqlDataReader dataReader = command.ExecuteReader();
|
|
|
|
|
result = dataReader.Read();
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
lastUpdated = dataReader.GetDateTime(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dataReader.Close();
|
|
|
|
|
command.Dispose();
|
|
|
|
|
connection.Close();
|
|
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
{
|
|
|
|
|
//schon in DB
|
|
|
|
|
if (lastUpdated < versionUpdate)
|
|
|
|
|
{
|
|
|
|
|
//Gesendetes Paket neuer als das in DB
|
|
|
|
|
EnqueueTask(x => UpdateDvbNipPrivateDataSpecifier(x, coordinates, versionUpdate, privateDataSessions));
|
|
|
|
|
_dvbNipPrivateDataSpecifiers[coordinates] = versionUpdate;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//Keine Änderung.
|
|
|
|
|
_dvbNipPrivateDataSpecifiers[coordinates] = versionUpdate;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//noch nicht in DB
|
|
|
|
|
EnqueueTask(x => InsertDvbNipPrivateDataSpecifier(x, coordinates, versionUpdate, privateDataSessions));
|
|
|
|
|
_dvbNipPrivateDataSpecifiers[coordinates] = versionUpdate;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -273,26 +321,245 @@ namespace skyscraper5.Data.PostgreSql
|
|
|
|
|
_knownDvbNipServices.Add(coordinates);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private HashSet<string> _knownDvbNipMulticastSessions;
|
|
|
|
|
public bool DvbNipTestForMulticastSession(MulticastSessionType multicastSession)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
if (_knownDvbNipMulticastSessions == null)
|
|
|
|
|
_knownDvbNipMulticastSessions = new HashSet<string>();
|
|
|
|
|
|
|
|
|
|
if (_knownDvbNipMulticastSessions.Contains(multicastSession.serviceIdentifier))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
bool result;
|
|
|
|
|
NpgsqlConnection connection = new NpgsqlConnection(connectionStringBuilder.ToString());
|
|
|
|
|
connection.Open();
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText = "SELECT dateadded FROM dvbnip_multicast_sessions WHERE service_identifier = @si";
|
|
|
|
|
command.Parameters.AddWithValue("@si", NpgsqlDbType.Text, multicastSession.serviceIdentifier);
|
|
|
|
|
NpgsqlDataReader dataReader = command.ExecuteReader();
|
|
|
|
|
if (result = dataReader.Read())
|
|
|
|
|
{
|
|
|
|
|
_knownDvbNipMulticastSessions.Add(multicastSession.serviceIdentifier);
|
|
|
|
|
}
|
|
|
|
|
dataReader.Close();
|
|
|
|
|
command.Dispose();
|
|
|
|
|
connection.Close();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DvbNipInsertMulticastSession(MulticastSessionType multicastSession)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
EnqueueTask(x => DvbNipInsertMulticastSessionEx(x, multicastSession));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DvbNipInsertMulticastSessionEx(NpgsqlConnection connection, MulticastSessionType multicastSession)
|
|
|
|
|
{
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText =
|
|
|
|
|
"INSERT INTO dvbnip_multicast_sessions (service_identifier, content_playback_availability_offset) VALUES (@si,@cpao) RETURNING serial";
|
|
|
|
|
command.Parameters.AddWithValue("@si", multicastSession.serviceIdentifier);
|
|
|
|
|
command.Parameters.AddWithValue("@cpao", multicastSession.contentPlaybackAvailabilityOffset);
|
|
|
|
|
NpgsqlDataReader dataReader = command.ExecuteReader();
|
|
|
|
|
dataReader.Read();
|
|
|
|
|
int serial = dataReader.GetInt32(0);
|
|
|
|
|
dataReader.Close();
|
|
|
|
|
command.Dispose();
|
|
|
|
|
|
|
|
|
|
if (multicastSession.MulticastGatewaySessionReporting != null)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException(nameof(multicastSession.MulticastGatewaySessionReporting));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (multicastSession.MulticastTransportSession != null)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < multicastSession.MulticastTransportSession.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
DvbNipInsertMulticastSessionTransport(connection,serial,i,multicastSession.MulticastTransportSession[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (multicastSession.PresentationManifestLocator != null)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < multicastSession.PresentationManifestLocator.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
DvbNipInsertPresentationManifestLocator(connection, serial, i, multicastSession.PresentationManifestLocator[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DvbNipInsertPresentationManifestLocator(NpgsqlConnection connection, int serial, int ordinal, MulticastSessionTypePresentationManifestLocator multicastSessionTypePresentationManifestLocator)
|
|
|
|
|
{
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText = "INSERT INTO dvbnip_presentation_manifest_locator VALUES (@parent,@ordinal,DEFAULT,@cppp,@ct,@mi,@to)";
|
|
|
|
|
command.Parameters.AddWithValue("@parent", NpgsqlDbType.Integer, serial);
|
|
|
|
|
command.Parameters.AddWithValue("@ordinal", NpgsqlDbType.Integer, ordinal);
|
|
|
|
|
command.Parameters.AddWithValue("@cppp", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.contentPlaybackPathPattern);
|
|
|
|
|
command.Parameters.AddWithValue("@ct", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.contentType);
|
|
|
|
|
command.Parameters.AddWithValue("@mi", NpgsqlDbType.Uuid, Guid.Parse(multicastSessionTypePresentationManifestLocator.manifestId));
|
|
|
|
|
command.Parameters.AddWithValue("@to", NpgsqlDbType.Text, multicastSessionTypePresentationManifestLocator.transportObjectURI);
|
|
|
|
|
int executeNonQuery = command.ExecuteNonQuery();
|
|
|
|
|
if (executeNonQuery != 1)
|
|
|
|
|
throw new DataException(String.Format("Expected to insert {0} rows, but it were {1}", 1, executeNonQuery));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DvbNipInsertMulticastSessionTransport(NpgsqlConnection connection, int serial, int ordinal, MulticastTransportSessionType transport)
|
|
|
|
|
{
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText =
|
|
|
|
|
"INSERT INTO dvbnip_multicast_transport_session VALUES " +
|
|
|
|
|
"(@serial,@ordinal,DEFAULT,DEFAULT,@id,@average,@maximum,@mediaTsi,@dstaddr,@srcaddr,@dstport,@protocolId,@protocolVersion,@contentIngestMethod," +
|
|
|
|
|
" @sessionIdleTimeout,@transmissionMode,@transportSecurity) " +
|
|
|
|
|
"RETURNING uuid";
|
|
|
|
|
command.Parameters.AddWithValue("@serial", NpgsqlDbType.Integer, serial);
|
|
|
|
|
command.Parameters.AddWithValue("@ordinal", NpgsqlDbType.Integer, ordinal);
|
|
|
|
|
command.Parameters.AddWithValue("@id", NpgsqlDbType.Text, transport.id);
|
|
|
|
|
command.Parameters.AddWithValue("@average", NpgsqlDbType.Integer, int.Parse(transport.BitRate.average));
|
|
|
|
|
command.Parameters.AddWithValue("@maximum", NpgsqlDbType.Integer, int.Parse(transport.BitRate.maximum));
|
|
|
|
|
command.Parameters.AddWithValue("@mediaTsi", NpgsqlDbType.Integer, int.Parse(transport.EndpointAddress[0].MediaTransportSessionIdentifier));
|
|
|
|
|
command.Parameters.AddWithValue("@dstaddr", NpgsqlDbType.Inet, IPAddress.Parse(transport.EndpointAddress[0].NetworkDestinationGroupAddress));
|
|
|
|
|
command.Parameters.AddWithValue("@srcaddr", NpgsqlDbType.Inet, IPAddress.Parse(transport.EndpointAddress[0].NetworkSourceAddress));
|
|
|
|
|
command.Parameters.AddWithValue("@dstport", NpgsqlDbType.Integer, int.Parse(transport.EndpointAddress[0].TransportDestinationPort));
|
|
|
|
|
command.Parameters.AddWithValue("@protocolId", NpgsqlDbType.Text, transport.TransportProtocol.protocolIdentifier);
|
|
|
|
|
command.Parameters.AddWithValue("@protocolVersion", NpgsqlDbType.Integer, int.Parse(transport.TransportProtocol.protocolVersion));
|
|
|
|
|
command.Parameters.AddWithValue("@contentIngestMethod", NpgsqlDbType.Integer, (int)transport.contentIngestMethod);
|
|
|
|
|
command.Parameters.AddWithValue("@sessionIdleTimeout", NpgsqlDbType.Integer, int.Parse(transport.sessionIdleTimeout));
|
|
|
|
|
command.Parameters.AddWithValue("@transmissionMode", NpgsqlDbType.Integer, (int)transport.transmissionMode);
|
|
|
|
|
command.Parameters.AddWithValue("@transportSecurity", NpgsqlDbType.Integer, (int)transport.transportSecurity);
|
|
|
|
|
NpgsqlDataReader dataReader = command.ExecuteReader();
|
|
|
|
|
dataReader.Read();
|
|
|
|
|
Guid uuid = dataReader.GetGuid(0);
|
|
|
|
|
dataReader.Close();
|
|
|
|
|
command.Dispose();
|
|
|
|
|
|
|
|
|
|
if (transport.ForwardErrorCorrectionParameters != null)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException(nameof(transport.ForwardErrorCorrectionParameters));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (transport.EndpointAddress.Length > 1)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException(nameof(transport.EndpointAddress));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (transport.ServiceComponentIdentifier != null)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < transport.ServiceComponentIdentifier.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
ServiceComponentIdentifierType serviceComponentIdentifier = transport.ServiceComponentIdentifier[i];
|
|
|
|
|
DvbNipInsertServiceComponentIdentifier(connection,uuid, i, serviceComponentIdentifier);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (transport.UnicastRepairParameters != null)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException(nameof(transport.UnicastRepairParameters));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DvbNipInsertServiceComponentIdentifier(NpgsqlConnection connection, Guid uuid, int i, ServiceComponentIdentifierType serviceComponentIdentifier)
|
|
|
|
|
{
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText = "INSERT INTO dvbnip_service_component_identifier VALUES (@guid,@ordinal,@xsiType,@manifestId,@representation_id,@period_id,@adaption_set_id,@media_playlist_locator)";
|
|
|
|
|
command.Parameters.AddWithValue("@guid", NpgsqlDbType.Uuid, uuid);
|
|
|
|
|
command.Parameters.AddWithValue("@ordinal", NpgsqlDbType.Integer, i);
|
|
|
|
|
command.Parameters.Add("@xsiType", NpgsqlDbType.Integer);
|
|
|
|
|
command.Parameters.AddWithValue("@manifestId", NpgsqlDbType.Uuid, Guid.Parse(serviceComponentIdentifier.manifestIdRef));
|
|
|
|
|
command.Parameters.Add("@representation_id", NpgsqlDbType.Text);
|
|
|
|
|
command.Parameters.Add("@period_id", NpgsqlDbType.Text);
|
|
|
|
|
command.Parameters.Add("@adaption_set_id", NpgsqlDbType.Integer);
|
|
|
|
|
command.Parameters.Add("@media_playlist_locator", NpgsqlDbType.Text);
|
|
|
|
|
|
|
|
|
|
XmlAttribute xmlAttribute = serviceComponentIdentifier.AnyAttr[0];
|
|
|
|
|
string xsiType = xmlAttribute.Value;
|
|
|
|
|
switch (xsiType)
|
|
|
|
|
{
|
|
|
|
|
case "DASHComponentIdentifierType":
|
|
|
|
|
command.Parameters["@xsiType"].Value = 1;
|
|
|
|
|
DASHComponentIdentifierType dash = (DASHComponentIdentifierType)serviceComponentIdentifier;
|
|
|
|
|
command.Parameters["@representation_id"].Value = dash.representationIdentifier;
|
|
|
|
|
command.Parameters["@period_id"].Value = dash.periodIdentifier;
|
|
|
|
|
command.Parameters["@adaption_set_id"].Value = (int)dash.adaptationSetIdentifier;
|
|
|
|
|
break;
|
|
|
|
|
case "HLSComponentIdentifierType":
|
|
|
|
|
command.Parameters["@xsiType"].Value = 2;
|
|
|
|
|
HLSComponentIdentifierType hls = (HLSComponentIdentifierType)serviceComponentIdentifier;
|
|
|
|
|
command.Parameters["@media_playlist_locator"].Value = hls.mediaPlaylistLocator;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
throw new NotImplementedException(xsiType);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SetNulls(command);
|
|
|
|
|
int executeNonQuery = command.ExecuteNonQuery();
|
|
|
|
|
if (executeNonQuery != 1)
|
|
|
|
|
throw new DataException(String.Format("Expected to insert {0} rows, but it were {1}", 1, executeNonQuery));
|
|
|
|
|
command.Dispose();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private HashSet<DatabaseKeyNipMulticastGatewayConfigurationTransportSession> _knownNipMulticastGatewayConfigurationTransportSessions;
|
|
|
|
|
public bool DvbNipTestForMulticastGatewayConfigurationTransportSession(NipActualCarrierInformation carrier,
|
|
|
|
|
MulticastEndpointAddressType multicastEndpointAddressType)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
if (_knownNipMulticastGatewayConfigurationTransportSessions == null)
|
|
|
|
|
_knownNipMulticastGatewayConfigurationTransportSessions = new HashSet<DatabaseKeyNipMulticastGatewayConfigurationTransportSession>();
|
|
|
|
|
|
|
|
|
|
DatabaseKeyNipMulticastGatewayConfigurationTransportSession key = new DatabaseKeyNipMulticastGatewayConfigurationTransportSession(carrier, multicastEndpointAddressType);
|
|
|
|
|
if (_knownNipMulticastGatewayConfigurationTransportSessions.Contains(key))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
bool result;
|
|
|
|
|
NpgsqlConnection connection = new NpgsqlConnection(connectionStringBuilder.ToString());
|
|
|
|
|
connection.Open();
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText =
|
|
|
|
|
"SELECT dateadded " +
|
|
|
|
|
"FROM dvbnip_multicast_gateway_configuration_transport_sessions " +
|
|
|
|
|
"WHERE network_id = @nid AND carrier_id = @cid AND link_id = @lid AND service_id = @sid " +
|
|
|
|
|
"AND source_address = @srcaddr AND destination_address = @dstaddr AND destination_port = @dstport AND tsi = @tsi";
|
|
|
|
|
command.Parameters.AddWithValue("@nid", NpgsqlDbType.Integer, (int)key.NetworkId);
|
|
|
|
|
command.Parameters.AddWithValue("@cid", NpgsqlDbType.Integer, (int)key.CarrierId);
|
|
|
|
|
command.Parameters.AddWithValue("@lid", NpgsqlDbType.Integer, (int)key.LinkId);
|
|
|
|
|
command.Parameters.AddWithValue("@sid", NpgsqlDbType.Integer, (int)key.ServiceId);
|
|
|
|
|
command.Parameters.AddWithValue("@srcaddr", NpgsqlDbType.Inet, key.SourceAddress);
|
|
|
|
|
command.Parameters.AddWithValue("@dstaddr", NpgsqlDbType.Inet, key.DestinationAddress);
|
|
|
|
|
command.Parameters.AddWithValue("@dstport", NpgsqlDbType.Integer, (int)key.DestinationPort);
|
|
|
|
|
command.Parameters.AddWithValue("@tsi", NpgsqlDbType.Integer, key.TSI);
|
|
|
|
|
SetNulls(command);
|
|
|
|
|
NpgsqlDataReader dataReader = command.ExecuteReader();
|
|
|
|
|
if (result = dataReader.Read())
|
|
|
|
|
{
|
|
|
|
|
_knownNipMulticastGatewayConfigurationTransportSessions.Add(key);
|
|
|
|
|
}
|
|
|
|
|
dataReader.Close();
|
|
|
|
|
command.Dispose();
|
|
|
|
|
connection.Close();
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void DvbNipInsertMulticastGatewayConfigurationTransportSession(NipActualCarrierInformation carrier,
|
|
|
|
|
MulticastGatewayConfigurationTransportSessionType multicastGatewayConfigurationTransportSession)
|
|
|
|
|
MulticastEndpointAddressType multicastGatewayConfigurationTransportSession)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
EnqueueTask(x => DvbNipInsertMulticastGatewayConfigurationTransportSessionEx(x, carrier, multicastGatewayConfigurationTransportSession));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DvbNipInsertMulticastGatewayConfigurationTransportSessionEx(NpgsqlConnection connection, NipActualCarrierInformation carrier, MulticastEndpointAddressType multicastEndpointAddressType)
|
|
|
|
|
{
|
|
|
|
|
DatabaseKeyNipMulticastGatewayConfigurationTransportSession key = new DatabaseKeyNipMulticastGatewayConfigurationTransportSession(carrier, multicastEndpointAddressType);
|
|
|
|
|
_knownNipMulticastGatewayConfigurationTransportSessions.Add(key);
|
|
|
|
|
NpgsqlCommand command = connection.CreateCommand();
|
|
|
|
|
command.CommandText = "INSERT INTO dvbnip_multicast_gateway_configuration_transport_sessions VALUES (@nid,@cid,@lid,@sid,@srcaddr,@dstaddr,@dstport,@tsi,DEFAULT)";
|
|
|
|
|
command.Parameters.AddWithValue("@nid", NpgsqlDbType.Integer, (int)key.NetworkId);
|
|
|
|
|
command.Parameters.AddWithValue("@cid", NpgsqlDbType.Integer, (int)key.CarrierId);
|
|
|
|
|
command.Parameters.AddWithValue("@lid", NpgsqlDbType.Integer, (int)key.LinkId);
|
|
|
|
|
command.Parameters.AddWithValue("@sid", NpgsqlDbType.Integer, (int)key.ServiceId);
|
|
|
|
|
command.Parameters.AddWithValue("@srcaddr", NpgsqlDbType.Inet, key.SourceAddress);
|
|
|
|
|
command.Parameters.AddWithValue("@dstaddr", NpgsqlDbType.Inet, key.DestinationAddress);
|
|
|
|
|
command.Parameters.AddWithValue("@dstport", NpgsqlDbType.Integer, (int)key.DestinationPort);
|
|
|
|
|
command.Parameters.AddWithValue("@tsi", NpgsqlDbType.Integer, key.TSI);
|
|
|
|
|
int executeNonQuery = command.ExecuteNonQuery();
|
|
|
|
|
if (executeNonQuery != 1)
|
|
|
|
|
throw new DataException(String.Format("Expected to insert {0} rows, but it were {1}", 1, executeNonQuery));
|
|
|
|
|
command.Dispose();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|