LinqToQuerystring
LinqToQuerystring copied to clipboard
Limit/Restrict Queryable fields.
Is there any way to restrict what fields we will allow users to query? If so would you mind directing me to how to properly do this.
Yes. Create an interface with the properties that are queryable. For example, make only the status queryable:
public interface IHavingStatus
{
ContentStatus Status { get; set; }
}
public class Agenda : IHavingStatus
{
public int Id { get; set; }
//All other properties
public ContentStatus Status { get; set; }
}