score:2
Accepted answer
var today = datetime.today;
schedules.where(x=> today >= x.startdate && today <= x.enddate)
Source: stackoverflow.com
Related Query
- Unable to marshal host object to interpreter space
- Unable to cast object of type 'System.Linq.Expressions.UnaryExpression' to type 'System.Linq.Expressions.MemberExpression'
- Unable to cast object of type WhereSelectListIterator 2 System.Collections.Generic.List
- Unable to cast object of type 'System.Data.Linq.DataQuery`1[System.Int32]' to type 'System.IConvertible'
- Unable to cast object of type 'WhereEnumerableIterator`1' to type 'System.Collections.Generic.ICollection`1
- Unable to cast object of type 'System.Collections.Generic.List`1[System.Decimal]' to type 'System.IConvertible'
- Unable to cast object of type 'System.Int32' to type 'System.String'
- Unable to cast a object of type 'SZArrayEnumerator' to type 'System.Collections.Generic.IEnumerator' 1[System.String]'
- Unable to cast object of type WhereSelectListIterator
- Unable to cast object of type 'System.Linq.EnumerableQuery to type 'Microsoft.Azure.Documents.Linq.IDocumentQuery
- Unable to cast object of type System.Func`2 with Int64
- Unable to cast object of type 'System.Data.Entity.Infrastructure.DbQuery`1[]' using linq lambda expression
- Unable to cast object of type '<>f__AnonymousType5`6
- Linq cast conversion Xelement error: Unable to cast object of type 'System.Xml.Linq.XElement' to type 'System.IConvertible'
- Unable to cast object of type 'System.Data.Common.DataRecordInternal' to type 'System.Data.IDataReader'
- Unable to cast object of type 'WhereSelectListIterator` in LINQ
- Unable to cast object of type 'System.Int16' to type 'System.String'
- Unable to cast object of type 'System.Data.Objects.ObjectQuery`1 [Manager.Data.Channel]' to type 'Manager.Data.Channel'
- Unable to cast object of type 'WhereSelectEnumerableIterator
- LINQ Issue: Unable to cast object of type 'System.Reflection.Module' to type 'System.Reflection.Emit.ModuleBuilder
- Dapper unable to cast object of type 'Microsoft.SqlServer.Types.SqlGeography' to type 'System.Data.Entity.Spatial.DbGeography'
- Unable to cast object of type 'System.Linq.Expressions.FieldExpression' to type 'System.Linq.Expressions.ParameterExpression
- Unable to cast object
- Removing duplicates using LINQ returns "Error removing duplicates: Unable to cast object of type 'System.Int32' to type 'System.String'."
- Unable to parse XML object and children having tried both object deserialization and LINQ
- Unable to cast object of type 'System.Decimal' to type 'System.String'
- query problem with linq: Unable to cast object
- Unable to cast object of type 'System.Linq.Expressions.MethodCallExpression' to type 'System.Linq.Expressions.LambdaExpression'
- LINQ with String.Join() error: "System.InvalidCastException: Unable to cast object of type '<DistinctIterator>
- Unable to Select in LINQ to XML, error: Object reference not set to an instance of an object
More Query from same tag
- Caching Linq Query Question
- How to filter only a element from a sequence (IEnumerable) in LINQ
- Temporary variable inside anonymous type
- Dynamic change of Where filters in linq
- Linq-to-SQL combining two Expression<Func<T, bool>> ("where clause") with and/or
- ERROR: IDENTITY_INSERT is set to OFF
- Join two lists and select nested items with linq
- Materialize all queryable objects
- 2d Dictionary or lookup table?
- Determining if an XDocument File Exists
- Group by LINQ vs group by SQL
- let statement and outer join in LINQ to SQL
- FindAll using Lambda expression in LINQ
- IEnumerable as Out Parameter
- Dynamic where clause in LINQ to Objects
- How to trim database data having multiple spaces?
- ReadOnlyCollection IEnumerable
- Reducing code complexity with LINQ
- LINQ error - The method 'Sum' is not supported
- linq paging - get total rows
- LINQ with dynamic where clause in EFCore
- Linq- preferable value in select
- Using int.parse(string) in linq search doesn't work
- LINQ: Select * from Joined Tables then Evaluate them in a repeater
- is there a better performance's way to get only few columns in ASP MVC without getting the whole table and filter it with LinQ?
- Linq2DB adding unnecessary statements to query
- Linq to xml foreach not working
- DateTime.Compare in Linq
- IEnumerable<List<DataRow>> does not contain a definition for ToList()
- Customizing an XML element using LINQ To XML