I am setting up a generic list of SqlParameters:
private List<SqlParameter> _params;
I will be adding the SqlParameters from a method:
where SetParameter returns a parameter.
How do I set List<SqlParameter> up as a property to allow the above initial setup and a normal adding parameter the way you would a normal list?
parameters.Add(database.SetParameter("@UserID", SqlDbType.Int, userID));
Normally, I would do something like:
Thanks,
Tom
private List<SqlParameter> _params;
I will be adding the SqlParameters from a method:
Code:
List<SqlParameter> parameters = new List<SqlParameter>()
{
database.SetParameter("@RoleID", SqlDbType.Int, roleID),
database.SetParameter("@Description", SqlDbType.VarChar,50, description)
};
where SetParameter returns a parameter.
How do I set List<SqlParameter> up as a property to allow the above initial setup and a normal adding parameter the way you would a normal list?
parameters.Add(database.SetParameter("@UserID", SqlDbType.Int, userID));
Normally, I would do something like:
Code:
private List<SqlParameter> _params;
public List<SqlParameter> Params
{
get{ return _params};
set( ; ?????
}
Thanks,
Tom