public static ServerFeature ToServerFeature(this Feature feature)
{
if (feature != null)
{
ServerFeature f = new ServerFeature();
f.FieldNames = new List<string>();
f.FieldValues = new List<string>();
if (feature.Geometry != null)
{
f.Geometry = feature.Geometry.ToServerGeometry();
}
if (feature.Attributes != null && feature.Attributes.Count > 0)
{
foreach (KeyValuePair<string, object> kv in feature.Attributes)
{
f.FieldNames.Add(kv.Key);
f.FieldValues.Add(kv.Value != null ? kv.Value.ToString() : "null");
}
}
return f;
}
return null;
}