E
ESPNSTI
Hi,
Is there a way for the compiler to warn about constants that are not used?
For example in the code below, could the compiler (with some sort of
attribute setting or something like that) throw an error or warning stating
that the DBParameters.Column2 isnt used?
Thanks,
Erik
____________________________________________________________________________
__________
public class DBParameters
{
public const string Column1 = "Column1";
public const string Column2 = "Column2"; // Throw a compiler error /
warning stating this isn't used.
public const string Column3 = "Column3";
}
public class Entity
{
int column1;
int column2;
int column3;
[DBParameter(Name = DBParameters.Column1)]
public int Column1
{
get { return m_column1; }
set { m_column1 = value; }
}
public int Column2
{
get { return m_column2; }
set { m_column2 = value; }
}
[DBParameter(Name = DBParameters.Column3)]
public int Column3
{
get { return m_column3; }
set { m_column3 = value; }
}
}
Is there a way for the compiler to warn about constants that are not used?
For example in the code below, could the compiler (with some sort of
attribute setting or something like that) throw an error or warning stating
that the DBParameters.Column2 isnt used?
Thanks,
Erik
____________________________________________________________________________
__________
public class DBParameters
{
public const string Column1 = "Column1";
public const string Column2 = "Column2"; // Throw a compiler error /
warning stating this isn't used.
public const string Column3 = "Column3";
}
public class Entity
{
int column1;
int column2;
int column3;
[DBParameter(Name = DBParameters.Column1)]
public int Column1
{
get { return m_column1; }
set { m_column1 = value; }
}
public int Column2
{
get { return m_column2; }
set { m_column2 = value; }
}
[DBParameter(Name = DBParameters.Column3)]
public int Column3
{
get { return m_column3; }
set { m_column3 = value; }
}
}