Higher-level GeographyUpdates added
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.Common;
|
||||
using System.Globalization;
|
||||
using Swarmops.Basic.Enums;
|
||||
using Swarmops.Basic.Types;
|
||||
using Swarmops.Basic.Types.Structure;
|
||||
@@ -42,6 +43,33 @@ namespace Swarmops.Database
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
public BasicGeographyUpdate GetGeographyUpdate(int identity)
|
||||
{
|
||||
using (DbConnection connection = GetMySqlDbConnection())
|
||||
{
|
||||
connection.Open();
|
||||
|
||||
DbCommand command =
|
||||
GetDbCommand(
|
||||
"SELECT " + geographyUpdateFieldSequence + " WHERE GeographyUpdateId=" + identity.ToString(CultureInfo.InvariantCulture), connection);
|
||||
|
||||
using (DbDataReader reader = command.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
return ReadGeographyUpdateFromDataReader(reader);
|
||||
}
|
||||
|
||||
throw new ArgumentException ("No such GeographyUpdate: " +
|
||||
identity.ToString (CultureInfo.InvariantCulture));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public BasicGeographyUpdate[] GetAllGeographyUpdates()
|
||||
{
|
||||
List<BasicGeographyUpdate> result = new List<BasicGeographyUpdate>();
|
||||
|
||||
Reference in New Issue
Block a user