ResultValueExt.cs 826 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Linq;
  3. using Quadarax.Foundation.Core.Data.Interface.Entity;
  4. using Quadarax.Foundation.Core.Data.Interface.Entity.Dto;
  5. namespace BO.AppServer.Metadata.Extensions
  6. {
  7. public static class ResultValueExt
  8. {
  9. public static bool HasNoDataException<TDto>(this ResultValueDto<TDto> result) where TDto : IDto, new()
  10. {
  11. if (result == null)
  12. throw new ArgumentNullException(nameof(result));
  13. return result.Errors.Any(x => x.Code == 1099);
  14. }
  15. public static bool HasNoDataException<TDto>(this ResultsValueDto<TDto> result) where TDto : IDto, new()
  16. {
  17. if (result == null)
  18. throw new ArgumentNullException(nameof(result));
  19. return result.Errors.Any(x => x.Code == 1099);
  20. }
  21. }
  22. }