94 references to FirstOrDefault
PresentationFramework (3)
src\Framework\System\Windows\SystemResources.cs (3)
1073
_hwndNotify.Keys.
FirstOrDefault
((hwndDpiContext) => hwndDpiContext.DpiAwarenessContextValue == ProcessDpiAwarenessContextValue) == null)
1100
if (_hwndNotify.Keys.
FirstOrDefault
((hwndDpiContext) => hwndDpiContext.DpiAwarenessContextValue == dpiContextValue) == null)
1640
var hwndDpiInfo = _hwndNotify.Keys.
FirstOrDefault
((hwndDpiContext) => hwndDpiContext.DpiAwarenessContextValue == ProcessDpiAwarenessContextValue);
System.Activities.Presentation (22)
System.Activities.Presentation\System\Activities\Presentation\Converters\ModelPropertyEntryToModelItemConverter.cs (3)
50
values.
FirstOrDefault
<object>(p => p != null && typeof(CategoryEntry).IsAssignableFrom(p.GetType()));
53
values.
FirstOrDefault
<object>(p => p != null && typeof(FrameworkElement).IsAssignableFrom(p.GetType()));
94
property = properties.
FirstOrDefault
<PropertyEntry>(p => string.Equals(p.DisplayName, parameter));
System.Activities.Presentation\System\Activities\Presentation\Metadata\ActivityArgumentHelper.cs (1)
220
ArgumentAccessorWrapper argumentAccessorWrapper = argumentAccessorWrappers.
FirstOrDefault
(wrapper => object.ReferenceEquals(wrapper.Argument.Expression, expression));
System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemCollectionImpl.cs (1)
685
ModelProperty foundProperty = this.sources.
FirstOrDefault
<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemDictionaryImpl.cs (2)
394
this.nameProperty = this.Properties.
FirstOrDefault
<ModelProperty>(p => (0 == string.Compare(p.Name, "Name", StringComparison.OrdinalIgnoreCase)));
640
ModelProperty foundProperty = this.sources.
FirstOrDefault
<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemExtensions.cs (2)
793
var firstVisibleItem = visualItems.
FirstOrDefault
(p => null != p.View && ((UIElement)p.View).IsVisible);
944
.
FirstOrDefault
(p => ModelItem.Equals(this.itemToFocus, p.ModelItem) || p.ModelItem.IsParentOf(this.itemToFocus));
System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemImpl.cs (2)
318
ModelProperty foundProperty = sources.
FirstOrDefault
<ModelProperty>((modelProperty) =>
446
ModelProperty foundProperty = this.sources.
FirstOrDefault
<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
System.Activities.Presentation\System\Activities\Presentation\Model\ModelTreeItemHelper.cs (1)
33
BackPointer backPointer = this.extraPropertyBackPointers.
FirstOrDefault
<BackPointer>((bp) => bp.DestinationVertex == parent && propertyName == bp.PropertyName);
System.Activities.Presentation\System\Activities\Presentation\View\ArgumentDesigner.xaml.cs (3)
364
.
FirstOrDefault
(p => (ModelItem.Equals(p.ReflectedObject, argument)));
377
var wrapper = this.argumentWrapperCollection.
FirstOrDefault
(p => ModelItem.Equals(p.ReflectedObject, argument));
473
DesignTimeArgument duplicate = this.argumentWrapperCollection.
FirstOrDefault
<DesignTimeArgument>(checkForDuplicates);
System.Activities.Presentation\System\Activities\Presentation\View\ParserContext.cs (1)
130
return variables.
FirstOrDefault
<LocationReference>(p =>
System.Activities.Presentation\System\Activities\Presentation\View\VariableDesigner.xaml.cs (6)
161
DesignTimeVariable duplicate = this.variableWrapperCollection.
FirstOrDefault
<DesignTimeVariable>(checkForDuplicates);
228
var validScope = this.scopesList.
FirstOrDefault
(p => ModelItem.Equals(p, root) || root.IsParentOf(p));
420
.
FirstOrDefault
<DesignTimeVariable>(p => (ModelItem.Equals(p.ReflectedObject, variable)));
451
DesignTimeVariable wrapper = this.variableWrapperCollection.
FirstOrDefault
(p => ModelItem.Equals(p.ReflectedObject, variable));
1268
ModelItem scope = (newScope as ModelItem) ?? Editor.ScopesList.
FirstOrDefault
(p => object.Equals(p.GetCurrentValue(), newScope));
1433
ModelItem scope = (newValue as ModelItem) ?? Editor.ScopesList.
FirstOrDefault
(p => object.Equals(p.GetCurrentValue(), newValue));
System.ComponentModel.DataAnnotations (2)
DataAnnotations\Validator.cs (2)
400
RequiredAttribute reqAttr = attributes.
FirstOrDefault
(a => a is RequiredAttribute) as RequiredAttribute;
481
RequiredAttribute required = attributes.
FirstOrDefault
(a => a is RequiredAttribute) as RequiredAttribute;
System.Core (3)
System\Linq\ParallelEnumerable.cs (1)
5588
.
FirstOrDefault
(ExceptionAggregator.WrapFunc<TSource, bool>(predicate, settings.CancellationState));
System\Linq\SequenceQuery.cs (2)
317
MethodInfo mi = _seqMethods[name].
FirstOrDefault
(m => ArgsMatch(m, args, typeArgs));
329
MethodInfo mi = methods.
FirstOrDefault
(m => ArgsMatch(m, args, typeArgs));
System.Data (20)
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Converters\ModelPropertyEntryToModelItemConverter.cs (2)
50
values.
FirstOrDefault
<object>(p => p != null && typeof(CategoryEntry).IsAssignableFrom(p.GetType()));
94
property = properties.
FirstOrDefault
<PropertyEntry>(p => string.Equals(p.DisplayName, parameter));
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Metadata\ActivityArgumentHelper.cs (1)
220
ArgumentAccessorWrapper argumentAccessorWrapper = argumentAccessorWrappers.
FirstOrDefault
(wrapper => object.ReferenceEquals(wrapper.Argument.Expression, expression));
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemCollectionImpl.cs (1)
685
ModelProperty foundProperty = this.sources.
FirstOrDefault
<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemDictionaryImpl.cs (2)
394
this.nameProperty = this.Properties.
FirstOrDefault
<ModelProperty>(p => (0 == string.Compare(p.Name, "Name", StringComparison.OrdinalIgnoreCase)));
640
ModelProperty foundProperty = this.sources.
FirstOrDefault
<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemExtensions.cs (1)
944
.
FirstOrDefault
(p => ModelItem.Equals(this.itemToFocus, p.ModelItem) || p.ModelItem.IsParentOf(this.itemToFocus));
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Model\ModelItemImpl.cs (2)
318
ModelProperty foundProperty = sources.
FirstOrDefault
<ModelProperty>((modelProperty) =>
446
ModelProperty foundProperty = this.sources.
FirstOrDefault
<ModelProperty>((modelProperty) => modelProperty.Name.Equals(propertyName) && modelProperty.Parent == parent);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\Model\ModelTreeItemHelper.cs (1)
33
BackPointer backPointer = this.extraPropertyBackPointers.
FirstOrDefault
<BackPointer>((bp) => bp.DestinationVertex == parent && propertyName == bp.PropertyName);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\ArgumentDesigner.xaml.cs (3)
364
.
FirstOrDefault
(p => (ModelItem.Equals(p.ReflectedObject, argument)));
377
var wrapper = this.argumentWrapperCollection.
FirstOrDefault
(p => ModelItem.Equals(p.ReflectedObject, argument));
473
DesignTimeArgument duplicate = this.argumentWrapperCollection.
FirstOrDefault
<DesignTimeArgument>(checkForDuplicates);
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\ParserContext.cs (1)
130
return variables.
FirstOrDefault
<LocationReference>(p =>
cdf\src\NetFx40\Tools\System.Activities.Presentation\System\Activities\Presentation\View\VariableDesigner.xaml.cs (6)
161
DesignTimeVariable duplicate = this.variableWrapperCollection.
FirstOrDefault
<DesignTimeVariable>(checkForDuplicates);
228
var validScope = this.scopesList.
FirstOrDefault
(p => ModelItem.Equals(p, root) || root.IsParentOf(p));
420
.
FirstOrDefault
<DesignTimeVariable>(p => (ModelItem.Equals(p.ReflectedObject, variable)));
451
DesignTimeVariable wrapper = this.variableWrapperCollection.
FirstOrDefault
(p => ModelItem.Equals(p.ReflectedObject, variable));
1268
ModelItem scope = (newScope as ModelItem) ?? Editor.ScopesList.
FirstOrDefault
(p => object.Equals(p.GetCurrentValue(), newScope));
1433
ModelItem scope = (newValue as ModelItem) ?? Editor.ScopesList.
FirstOrDefault
(p => object.Equals(p.GetCurrentValue(), newValue));
System.Data.Entity (14)
System\Data\Common\CommandTrees\Internal\PatternMatchRules.cs (1)
217
return (elems => elems.
FirstOrDefault
(e => !elementPattern(e)) == null);
System\Data\Common\EntitySql\SemanticAnalyzer.cs (4)
1586
toEnd = (RelationshipEndMember)relationshipType.Members.
FirstOrDefault
(m => m.Name.Equals(relshipExpr.ToEndIdentifier.Name, StringComparison.OrdinalIgnoreCase));
1629
fromEnd = (RelationshipEndMember)relationshipType.Members.
FirstOrDefault
(m => m.Name.Equals(relshipExpr.FromEndIdentifier.Name, StringComparison.OrdinalIgnoreCase));
1712
toEnd = (RelationshipEndMember)relationshipType.Members.
FirstOrDefault
(m => m.Name.Equals(relshipExpr.ToEndIdentifier.Name, StringComparison.OrdinalIgnoreCase));
1729
fromEnd = (RelationshipEndMember)relationshipType.Members.
FirstOrDefault
(m => m.Name.Equals(relshipExpr.FromEndIdentifier.Name, StringComparison.OrdinalIgnoreCase));
System\Data\Mapping\FunctionImportMapping.ReturnTypeRenameMapping.cs (1)
224
FunctionImportReturnTypeStructuralTypeColumn ofTypecolumn = _columnListForType.
FirstOrDefault
(t => t.Type == typeForRename);
System\Data\Mapping\ViewGeneration\QueryRewriting\QueryRewriter.cs (2)
248
Constant defaultValue = oldDomain.
FirstOrDefault
(domainValue => IsDefaultValue(domainValue, currentPath));
254
Constant negatedValue = oldDomain.
FirstOrDefault
(domainValue => domainValue is NegatedConstant);
System\Data\Mapping\ViewGeneration\Structures\ScalarRestriction.cs (1)
270
NegatedConstant negated = (NegatedConstant)this.Domain.Values.
FirstOrDefault
(c => c is NegatedConstant);
System\Data\Metadata\ObjectLayer\ObjectItemConventionAssemblyLoader.cs (4)
389
PropertyInfo clrProperty = clrProperties.
FirstOrDefault
(p => MemberMatchesByConvention(p, cspaceProperty));
423
PropertyInfo clrProperty = clrProperties.
FirstOrDefault
(p => NonPrimitiveMemberMatchesByConvention(p, cspaceProperty));
565
PropertyInfo clrProperty = clrProperties.
FirstOrDefault
(p => MemberMatchesByConvention(p, cspaceProperty));
605
PropertyInfo clrProperty = clrProperties.
FirstOrDefault
(p => MemberMatchesByConvention(p, cspaceProperty));
System\Data\SqlClient\SqlGen\SqlGenerator.cs (1)
1970
DbIsNullExpression isNullExpression = values.
FirstOrDefault
(v => v.ExpressionKind == DbExpressionKind.IsNull) as DbIsNullExpression;
System.Data.Linq (4)
SqlClient\Common\TypeSystem.cs (3)
123
MethodInfo mi = _sequenceMethods[name].
FirstOrDefault
(m => ArgsMatchExact(m, args, typeArgs));
139
MethodInfo mi = _queryMethods[name].
FirstOrDefault
(m => ArgsMatchExact(m, args, typeArgs));
149
.
FirstOrDefault
(m => m.Name == name && ArgsMatchExact(m, args, typeArgs));
SqlClient\Query\SqlBinder.cs (1)
848
MetaDataMember mm = sn.MetaType.PersistentDataMembers.
FirstOrDefault
(p => p.Member == m.Member);
System.Data.Services (8)
System\Data\Services\Epm\EpmContentDeSerializer.cs (1)
162
EpmPropertyToTypeMappingElement mapping = this.PropertyToTypeNameMap.
FirstOrDefault
(e => e.PropertyPath == propertyPath);
System\Data\Services\Epm\EpmContentSerializer.cs (1)
152
EpmNullValuedPropertyNode child = current.Children.
FirstOrDefault
(c => c.Name == segment);
System\Data\Services\Epm\EpmTargetTree.cs (1)
168
EpmTargetPathSegment foundSegment = activeSubSegments.
FirstOrDefault
(
System\Data\Services\MimeTypeAttribute.cs (1)
74
.
FirstOrDefault
(o => o.MemberName == member.Name);
System\Data\Services\Providers\ExpandedProjectionNode.cs (2)
265
return this.nodes.
FirstOrDefault
(
374
ProjectionNode projectionNode = existingNodes.
FirstOrDefault
(
System\Data\Services\Providers\ResourceType.cs (2)
883
return this.Properties.
FirstOrDefault
(p => p.Name == propertyName);
892
return this.PropertiesDeclaredOnThisType.
FirstOrDefault
(p => p.Name == propertyName);
System.Data.Services.Client (2)
parent\Server\System\Data\Services\Epm\EpmTargetTree.cs (1)
168
EpmTargetPathSegment foundSegment = activeSubSegments.
FirstOrDefault
(
System\Data\Services\Client\DataServiceContext.cs (1)
5662
(!IsFlagSet(this.options, SaveChangesOptions.Batch) || null == this.ChangedEntries.
FirstOrDefault
(o => null != o.SaveError)))) ||
System.Data.Services.Design (1)
System\Data\EntityModel\Emitters\NamespaceEmitter.cs (1)
61
.
FirstOrDefault
(c => IsDefaultContainer(c));
System.Runtime.DurableInstancing (2)
System\Runtime\PersistencePipeline.cs (2)
61
return this.modules.
FirstOrDefault
(value => value.IsSaveTransactionRequired) != null;
69
return this.modules.
FirstOrDefault
(value => value.IsLoadTransactionRequired) != null;
System.ServiceModel (3)
System\ServiceModel\Security\IdentityModelServiceAuthorizationManager.cs (2)
564
claimsIdentity.Claims.
FirstOrDefault
(claim => claim.Type == System.Security.Claims.ClaimTypes.AuthenticationMethod);
581
claimsIdentity.Claims.
FirstOrDefault
(claim => claim.Type == System.Security.Claims.ClaimTypes.AuthenticationInstant);
System\ServiceModel\ServiceConfiguration.cs (1)
222
: this.host.ImplementedContracts.Values.
FirstOrDefault
(implementedContract => implementedContract.ContractType == contractType);
System.Web (4)
ModelBinding\DataAnnotationsModelMetadataProvider.cs (2)
27
UIHintAttribute uiHintAttribute = uiHintAttributes.
FirstOrDefault
(a => String.Equals(a.PresentationLayer, "MVC", StringComparison.OrdinalIgnoreCase))
28
?? uiHintAttributes.
FirstOrDefault
(a => String.IsNullOrEmpty(a.PresentationLayer));
ModelBinding\TypeHelpers.cs (1)
9
return (matchesInterface(queryType)) ? queryType : queryType.GetInterfaces().
FirstOrDefault
(matchesInterface);
UI\WebControls\ModelErrorMessage.cs (1)
90
ModelError error = modelState.Errors.
FirstOrDefault
(modelError => !String.IsNullOrEmpty(modelError.ErrorMessage));
System.Web.DynamicData (6)
DynamicData\MetaColumn.cs (1)
656
T uiHintAttribute = presentationLayerSpecified.
FirstOrDefault
(a => presentationLayerPropertyAccessor(a).ToLower(CultureInfo.InvariantCulture) == "webforms" ||
DynamicData\MetaTable.cs (3)
580
return serverSideColumns.
FirstOrDefault
(c => c.IsString && !c.IsPrimaryKey) ??
581
serverSideColumns.
FirstOrDefault
(c => c.IsString) ??
582
serverSideColumns.
FirstOrDefault
(c => c.IsPrimaryKey) ??
DynamicData\ModelProviders\DLinqTableProvider.cs (1)
30
MetaDataMember member = members.
FirstOrDefault
(m => m.Member.Name == propInfo.Name);
DynamicData\ModelProviders\EFAssociationProvider.cs (1)
112
ReferentialConstraint constraint = relationshipType.ReferentialConstraints.
FirstOrDefault
(c => c.ToRole == navigationProperty.ToEndMember);