From c245fa5fc60b16005bc65e7b866634cfd80cdcc0 Mon Sep 17 00:00:00 2001 From: beppemarazzi Date: Tue, 7 Jan 2020 08:30:31 +0100 Subject: [PATCH] System.ComponentModel.DataAnnotations.KeyAttribute is not mandatory --- src/Uno.CodeGen/EqualityGenerator.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Uno.CodeGen/EqualityGenerator.cs b/src/Uno.CodeGen/EqualityGenerator.cs index 2b35c48..188d7c7 100644 --- a/src/Uno.CodeGen/EqualityGenerator.cs +++ b/src/Uno.CodeGen/EqualityGenerator.cs @@ -128,7 +128,7 @@ namespace Uno _equalityHashAttributeSymbol = GetMandatoryTypeSymbol("Uno.EqualityHashAttribute"); _equalityKeyAttributeSymbol = GetMandatoryTypeSymbol("Uno.EqualityKeyAttribute"); _equalityComparerOptionsAttributeSymbol = GetMandatoryTypeSymbol("Uno.Equality.EqualityComparerOptionsAttribute"); - _dataAnnonationsKeyAttributeSymbol = GetMandatoryTypeSymbol("System.ComponentModel.DataAnnotations.KeyAttribute"); + _dataAnnonationsKeyAttributeSymbol = context.Compilation.GetTypeByMetadataName("System.ComponentModel.DataAnnotations.KeyAttribute"); _isPureAttributePresent = context.Compilation.GetTypeByMetadataName("System.Diagnostics.Contracts.Pure") != null; _generateKeyEqualityCode = _iKeyEquatableSymbol != null;