public static Feature ToFeature(this ServerFeature feature)
{
if (feature != null)
{
Feature f = new Feature();
if (feature.Geometry != null)
{
f.Geometry = feature.Geometry.ToGeometry();
}
if (feature.FieldNames != null && feature.FieldNames.Count > 0 && feature.FieldValues != null && feature.FieldValues.Count > 0)
{
for (int i = 0; i < feature.FieldNames.Count; i++)
{
f.Attributes.Add(feature.FieldNames[i].ToString(), feature.FieldValues[i]);
}
}
return f;
}
return null;
}