26 lines
611 B
C#
26 lines
611 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Atesa.Utilitarios
|
|
{
|
|
public static class Extensiones
|
|
{
|
|
public static TSource ClearProperties<TSource>(this TSource source)
|
|
{
|
|
foreach (PropertyInfo info in source.GetType().GetProperties())
|
|
{
|
|
if (info.GetGetMethod().IsVirtual)
|
|
{
|
|
info.SetValue(source, null, null);
|
|
}
|
|
}
|
|
return source;
|
|
}
|
|
|
|
|
|
}
|
|
}
|