asp.net mvc - VS 2013 telling me Use lamba expression -
my issue comes layers.add part. i'm brand new mvc, razor, linq , telerik's kendoui using map widget. layers.add() function gets green squiggly line message "use lambda expression". why getting this? help. link here
@(html.kendo().map() .name("map") .center(39.6924, -97.3370) .zoom(4) .layers(layers => { layers.add() .style(style => style.fill(fill => fill.opacity(0.7))) .type(maplayertype.shape) .datasource(datasource => datasource .geojson() .read(read => read.url(url.content("~/scripts/gz_2010_us_040_00_500k.js"))) ); }) .events(events => events .shapecreated("onshapecreated") .shapemouseenter("onshapemouseenter") .shapemouseleave("onshapemouseleave") ) )
the ide suggesting shorten lambda. suppose f
function returns void. both of following same:
x => { f(x); } x => f(x)
so code shortened replacing this:
layers => { layers.add() .style(style => style.fill(fill => fill.opacity(0.7))) .type(maplayertype.shape) .datasource(datasource => datasource .geojson() .read(read => read.url(url.content("~/scripts/gz_2010_us_040_00_500k.js"))) ); }
with this:
layers => layers.add() .style(style => style.fill(fill => fill.opacity(0.7))) .type(maplayertype.shape) .datasource(datasource => datasource .geojson() .read(read => read.url(url.content("~/scripts/gz_2010_us_040_00_500k.js"))) )
for legibility reasons may or may not want make change.
Comments
Post a Comment