Files
moadiran/Back/Features/IgnorePropertiesResolver.cs

25 lines
796 B
C#
Raw Normal View History

2025-10-03 23:30:01 +03:30

2024-07-09 23:04:19 +03:30
using System.Reflection;
namespace Back.Features
{
2025-10-03 23:30:01 +03:30
//public class IgnorePropertiesResolver : DefaultContractResolver
//{
// private readonly HashSet<string> ignoreProps;
// public IgnorePropertiesResolver(IEnumerable<string> propNamesToIgnore)
// {
// this.ignoreProps = new HashSet<string>(propNamesToIgnore);
// }
2024-07-09 23:04:19 +03:30
2025-10-03 23:30:01 +03:30
// protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
// {
// JsonProperty property = base.CreateProperty(member, memberSerialization);
// if (this.ignoreProps.Contains(property.PropertyName))
// {
// property.ShouldSerialize = _ => false;
// }
// return property;
// }
//}
2024-07-09 23:04:19 +03:30
}