Pass variable as parameter to where clause in Linq RRS feed

  • Question

  • User1624753842 posted

    Hi All,

          How to pass one variable value as parameter to where clause in Linq? Like In ado.net we using parameter to avoid sql injection. Below i providing my code.

        SettingsManager manager = new SettingsManager();
        var timeZone = manager.GetTImeZone().Where(x => x.TimeZoneId == timeZoneId.ToString()).FirstOrDefault();

    Wednesday, October 11, 2017 8:55 AM

All replies