| | |
| | | using WIDESEA_Core.DB.Models; |
| | | using WIDESEA_Core.Enums; |
| | | using WIDESEA_Core.Helper; |
| | | |
| | | //using WIDESEA_Core.HostedService; |
| | | using WIDESEA_Core.Utilities; |
| | | using ICacheService = WIDESEA_Core.Caches.ICacheService; |
| | |
| | | } |
| | | |
| | | private PropertyInfo[] _propertyInfo { get; set; } = null; |
| | | |
| | | public PropertyInfo[] TProperties |
| | | { |
| | | get |
| | |
| | | string? value = propertyValue?.ToString(); |
| | | if (value == null) return p => true; |
| | | |
| | | |
| | | parameter = parameter ?? Expression.Parameter(typeof(TEntity), "x"); |
| | | //创建节点的属性p=>p.name 属性name |
| | | MemberExpression memberProperty = Expression.PropertyOrField(parameter, propertyName); |
| | |
| | | case LinqExpressionType.Equal: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.Equal(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.NotEqual: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.NotEqual(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.GreaterThan: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.GreaterThan(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.LessThan: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.LessThan(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.ThanOrEqual: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.GreaterThanOrEqual(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.LessThanOrEqual: |
| | | expression = Expression.Lambda<Func<TEntity, bool>>(Expression.LessThanOrEqual(member, constant), parameter); |
| | | break; |
| | | |
| | | case LinqExpressionType.Contains: |
| | | case LinqExpressionType.NotContains: |
| | | MethodInfo? method = typeof(string).GetMethod("Contains", new[] { typeof(string) }); |
| | |
| | | expression = p => true; |
| | | } |
| | | break; |
| | | |
| | | default: |
| | | expression = p => false; |
| | | break; |
| | |
| | | } |
| | | return new Dictionary<string, OrderByType> { { "CreateDate", pageData.Order?.ToLower() == OrderByType.Asc.ToString() ? OrderByType.Asc : OrderByType.Desc } }; |
| | | } |
| | | |
| | | |
| | | |
| | | //private string GetDataRole(Type type) |
| | | //{ |
| | |
| | | { |
| | | content = WebResponseContent.Instance.Error("未找到主表主键值"); |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | return content; |
| | | } |
| | | } |
| | | } |
| | | } |