You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
642 B
21 lines
642 B
3 years ago
|
using System.Collections.Generic;
|
||
|
using System.Linq;
|
||
|
|
||
|
namespace Sanhe.Abp.Notifications
|
||
|
{
|
||
|
public static class NotificationDataMappingDictionaryItemExtensions
|
||
|
{
|
||
|
public static NotificationDataMappingDictionaryItem GetOrNullDefault(
|
||
|
this IEnumerable<NotificationDataMappingDictionaryItem> items,
|
||
|
string name)
|
||
|
{
|
||
|
var item = items.FirstOrDefault(i => i.Name.Equals(name));
|
||
|
if (item == null)
|
||
|
{
|
||
|
return items.FirstOrDefault(i => i.Name.Equals(NotificationDataMappingDictionary.DefaultKey));
|
||
|
}
|
||
|
return item;
|
||
|
}
|
||
|
}
|
||
|
}
|