示例#1
0
        public override IQueryOver <Menu, Menu> CreateQueryForRetrieval(IQueryOver <Menu, Menu> query, string filter, IDictionary <string, object> additionalParameters)
        {
            var menuId = InputProcessingMethods.GetValue <string>(additionalParameters, "MenuId");

            if (!String.IsNullOrWhiteSpace(menuId))
            {
                query = query.Where(m => m.ParentMenu.Id == menuId);
            }
            else
            {
                query = query.Where(m => m.ParentMenu == null);
            }

            if (!String.IsNullOrWhiteSpace(filter))
            {
                query = query.WhereRestrictionOn(x => x.Name).IsLike(filter, MatchMode.Anywhere);
            }

            query = query.OrderBy(m => m.Position).Asc();

            return(query);
        }
示例#2
0
 public string GetValue(string propertyName)
 {
     return(InputProcessingMethods.GetValue <string>(InputData, propertyName));
 }
示例#3
0
 public T GetValue <T>(string propertyName, T defaultValue = default(T))
 {
     return(InputProcessingMethods.GetValue(InputData, propertyName, defaultValue));
 }