Ejemplo n.º 1
0
        public async Task ExecuteAsync()
        {
            var projectItems = await _referenceHandler.GetUnresolvedReferencesAsync(_selectedConfiguredProject);

            var item = projectItems
                       .FirstOrDefault(c => c.EvaluatedInclude == _itemSpecification);

            if (item != null)
            {
                await item.Metadata.SetPropertyValueAsync(ProjectReference.TreatAsUsedProperty, PropertySerializer.SimpleTypes.ToString(false), null);
            }
        }
        private async Task <IProjectItem> GetProjectItemAsync()
        {
            var projectItems = await _referenceHandler.GetUnresolvedReferencesAsync(_selectedConfiguredProject);

            var item = projectItems
                       .FirstOrDefault(c => string.CompareOrdinal(c.EvaluatedInclude, _itemSpecification) == 0);

            return(item);
        }