I have been struggling with obsolete handling, I know what is the usage of obsolete in c#. But my question is not the usage of obsolete is managing.
I have a class such as salestransactionstep that contains name, description, and quantity, like the below:
public class salestransactionstep
{
string name;
string description;
int quantity;
}
I want to change the quantity field data type to float. Because the int field does not meet my demand anymore. But some customers may use the int field but others don't. So, I don't want to change the field and I added a new field which data type is float like this and I add obsolete property to my old field.
public class salestransactionstep
{
string name;
string description;
[Obsolete]
int quantity;
float quantity_float;
}
So some of the old customers use the int field, others use the float field. I use SQL query for taking the data which sometimes calculate int field for meeting the old customer demand, and sometimes calculate float field for meeting new customer. Like;
select count(quantity) from salestransactionstep
OR
select count(quantity_float) from salestransactionstep
But in my vision, I don't manage this usage properly. So how can I manage this, handle the obsolete field properly?