20 lines
439 B
C#
20 lines
439 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Tnb.Common.Utils
|
|
{
|
|
public static class ObjectPropertyChecker
|
|
{
|
|
public static bool HasProperty<T>(T obj, string propertyName)
|
|
{
|
|
Type type = typeof(T);
|
|
var propertyInfo = type.GetProperty(propertyName);
|
|
return propertyInfo != null;
|
|
}
|
|
}
|
|
|
|
}
|