I have a static method in my DataLayer GetCompany. I made it because i need a company object to be compared with the property. The question is for the following code should i make another object and assign the returned Company Object to it or just use that in the conditions.
Which is the best way according to performance.
if (property != null && property.CompanyNum > 0)
{
if (property is PersonalDetail &&
(Property.GetCompany(property.CompanyNum)).
CompanyType.ToUpper() != "COI")
{
if (property.TaxSubTypeId != 19)
{
if (property.CompanyNum == 81 && property.TaxSubTypeId == 11)
{
// Tax Sub Type of Compressor & Company Name
// Midcon Compression LLC
SetPersonalNonCOI81Inputs();
}
}
}
}
I have many conditions below so I am just mentioning couple of them just let me know if how can I optimize it.