Exemplo n.º 1
0
 public override void AddValue(NpgsqlCommand command)
 {
     if (_value == null)
     {
         command.AddParam(VariableName, DBNull.Value);
     }
     else
     {
         command.AddParam(VariableName, _value.Id.Value);
     }
 }
Exemplo n.º 2
0
 public override void AddValue(NpgsqlCommand command)
 {
     if (_value.HasValue)
     {
         command.AddParam(VariableName, (int)(object)_value);
     }
     else
     {
         command.AddParam(VariableName, DBNull.Value);
     }
 }
Exemplo n.º 3
0
        public NpgsqlCommand BuildCommand(string sql, object[] args)
        {
            var cmd = new NpgsqlCommand(sql);

            if (args == null)
            {
                return(cmd);
            }
            foreach (var arg in args)
            {
                cmd.AddParam(arg);
            }
            return(cmd);
        }
Exemplo n.º 4
0
 public override void AddValue(NpgsqlCommand command)
 {
     command.AddParam(VariableName, _value.ToJson().ToString());
 }
Exemplo n.º 5
0
 public override void AddValue(NpgsqlCommand command)
 {
     command.AddParam(VariableName, (int)(object)_value);
 }
Exemplo n.º 6
0
        public override void AddValue(NpgsqlCommand command)
        {
            var array = new JArray(_value.ToArray());

            command.AddParam(VariableName, array.ToString());
        }