using DbAPI.Connections;
using DTS.Common.Interface.Database;
using DTS.Common.Interface.Graphs;
namespace DbAPI.TestSetups
{
///
/// defines functions to create, retrieve, update, delete graphs
///
public interface IGraphs
{
///
/// retrieves all graph records matching search criteria
///
/// user making query
/// connection query is being made on
/// graph id to retrieve (can be null)
/// test setup graph belongs to
/// all matching records found
/// 0 (ERROR_SUCCESS) on success, all other values are error codes
ulong GraphsGet(IUserDbRecord user, IConnectionDetails connection, int? graphId, int? testSetupId, out IGraphRecord[] records);
///
/// updates a record in the database
///
/// user updating record
/// connection record is being updated on
/// record to update
/// 0 (ERROR_SUCCESS) on success, all other values are error codes
ulong GraphsUpdate(IUserDbRecord user, IConnectionDetails connection, IGraphRecord record);
///
/// inserts a record into the db, updates GraphId of record after insert with database id
///
/// user inserting record
/// connection record is being inserted on
/// record being inserted
/// 0 (ERROR_SUCCESS) on success, all other values are error codes
ulong GraphsInsert(IUserDbRecord user, IConnectionDetails connection, ref IGraphRecord record);
///
/// removes a record from the db
///
/// user removing record
/// connection record is being removed on
/// database id of record being removed
/// 0 (ERROR_SUCCESS) on success, all other values are error codes
ulong GraphsDelete(IUserDbRecord user, IConnectionDetails connection, int graphId);
}
}