LinqToQuerystring icon indicating copy to clipboard operation
LinqToQuerystring copied to clipboard

Limit/Restrict Queryable fields.

Open mapete94 opened this issue 10 years ago • 1 comments

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.

mapete94 avatar Jun 26 '15 14:06 mapete94

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; }
    }

Jogai avatar Jul 13 '16 10:07 Jogai