Source

TrafficLight / src / Core / Persistence / Queries / InsertIndicatorQuery.cs

Full commit
using System.Data;
using RossCode.TrafficLight.Core.Domain;
using RossCode.TrafficLight.Core.Utilities.Extensions;

namespace RossCode.TrafficLight.Core.Persistence.Queries
{
    public class InsertIndicatorQuery : IQuery
    {
        private readonly IndicatorType indicator;

        public InsertIndicatorQuery(IndicatorType indicator)
        {
            this.indicator = indicator;
        }

        public void Prepare(IDbCommand command)
        {
            command.CommandText = "insert into Indicators (Id) values (@id);";
            command.AddParameter("@id", (int)indicator);
        }
    }
}