Example #1
0
        public DataFieldInfo GetFieldInfoForPath(string path)
        {
            var name = path.StartsWith(".", StringComparison.Ordinal) ? path.Substring(1) : path;
            var info = _model.GetAggregateData(name);

            if (!Equals(info, null))
            {
                return(info);
            }

            throw new LightDataException(string.Format(SR.CanNotFindTheSpecifiedFieldViaPath, path));
        }
        public override DataFieldInfo GetDataFieldInfo(string fullPath)
        {
            var index = fullPath.IndexOf(".", StringComparison.Ordinal);

            if (index < 0)
            {
                throw new LambdaParseException(LambdaParseMessage.ExpressionFieldPathError, fullPath);
            }
            var name = fullPath.Substring(0, index);
            var path = fullPath.Substring(index + 1);

            if (aggregateName != name)
            {
                throw new LambdaParseException(LambdaParseMessage.ExpressionFieldPathNotExists, fullPath);
            }
            var info = aggregateModel.GetAggregateData(path);

            return(info);
        }