| Visual Basic (Declaration) | |
|---|---|
<ExtensionAttribute()> Public Overloads Shared Function FirstOrNullEntity(Of TEntity As Class)( _ ByVal source As IQueryable(Of TEntity) _ ) As TEntity | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim source As IQueryable(Of TEntity) Dim value As TEntity value = EntityQueryExtensions.FirstOrNullEntity(Of TEntity)(source) | |
| C# | |
|---|---|
[ExtensionAttribute()] public static TEntity FirstOrNullEntity<TEntity>( IQueryable<TEntity> source ) where TEntity: class | |
| C++/CLI | |
|---|---|
[ExtensionAttribute()] public: static TEntity^ FirstOrNullEntitygeneric<typename TEntity> ( IQueryable<TEntity^>^ source ) where TEntity: ref class | |
Parameters
- source
Type Parameters
- TEntity
| C# | Copy Code |
|---|---|
var mgr1 = new DomainModelEntityManager(); Customer cust = mgr1.Customers.Where(c => c.Country == "UK").FirstOrNullEntity(); | |
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family