Ejemplo n.º 1
0
        /// <summary>
        /// Get by url
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        public static MenuModel GetByUrl(string url)
        {
            // check url
            if (string.IsNullOrEmpty(url))
            {
                return(null);
            }

            // init condition
            var condition = "[LinkUrl]='{0}'".FormatWith(url.TrimStart('/').EscapeQuote());

            // get by condition
            var entity = MenuServices.GetByCondition(condition);

            // return
            return(entity != null ? new MenuModel(entity) : null);
        }