I have the following code that gives a warning in the header. I am pretty sure that I did something similar before, but it did not give any warnings. I would like to ask two things from these posts. 1) What can cause the problem here? 2) Do I need to fix it?
The reason I'm asking is because this code is working fine, as I expect it to be so clear that this warning does not cause a problem. I can not resist warnings, etc. In my code, although I would like this solution, I also want to know why this warning occurs, and if it is harmful in any case.
the code:
public class AttributeType
{
private string m_attributeNameField;
public string AttributeName
{
get { return m_attributeNameField; }
set { m_attributeNameField = value; }
}
}
private StandardResponseType ValidateAttributes(string featureType, IEnumerable<AttributeType> attributeList, string userCategory)
{
StandardResponseType standardResponse =
new StandardResponseType(DateTime.Now.ToString(CultureInfo.InvariantCulture), "RWOL_UTILS.Get_Item_Attributes", "", "OK");
if (attributeList.Any())
{
foreach (AttributeType attribute in attributeList)
{
if (attribute.AttributeName == null) continue;
{
}
}
}
else
{
standardResponse.Message = "Error: No attributes passed in the list. ValidateAttributes().";
standardResponse.ResponseCode = "FAIL";
return standardResponse;
}
}
EDIT: There is more code in this method, but it does not affect this problem.
: follwing, . ? , ? - . , , isnt. .
List<AttributeType> newlist = attributeList.ToList();
if (newlist.Count() != 0)
{
foreach (AttributeType attribute in newlist)
............