You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuFieldsExpressionsString.cs 881B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Linq.Expressions;
  3. using Luticate2.Auth.Business.Fields;
  4. using Luticate2.Auth.Dbo.Fields;
  5. using Luticate2.Auth.Dbo.Result;
  6. namespace Luticate2.Auth.Business.FieldsExpressions.Basic
  7. {
  8. public class LuFieldsExpressionsString : LuFieldsExpressions<string, string>
  9. {
  10. public LuFieldsExpressionsString(IServiceProvider serviceProvider) : base(serviceProvider)
  11. {
  12. }
  13. protected override LuResult<Expression<Func<TType1, object>>> GetExpressionInternal<TType1>(Expression<Func<TType1, string>> modelProperty, LuFieldDbo field)
  14. {
  15. if (field.StartsWith<string>(x => x.Length))
  16. {
  17. return GetSubField<TType1, int, int>(modelProperty, field, x => x.Length);
  18. }
  19. return base.GetExpressionInternal(modelProperty, field);
  20. }
  21. }
  22. }