Cast IFeature to polygon

Nov 22, 2014 at 6:12 PM
Hi,I am using SelectByAttribute function which gives me a list of IFeature,I know my Features are polygon.So How can I cast an item in the list to a polygon type?
Is it possible?

Thank you very much
Editor
Nov 23, 2014 at 8:55 AM
var polygon = (DotSpatial.Topology.IPolygon) DotSpatial.Topology.Geometry.FromBasicGeometry((DotSpatial.Topology.IBasicGeometry)feature);
// or
polygon = (DotSpatial.Topology.IPolygon) DotSpatial.Topology.Geometry.FromBasicGeometry(feature.BasicGeometry);
Nov 23, 2014 at 11:15 AM
Dear FObermair,
Thank you so much for your help