RepoTenant.cs 846 B

12345678910111213141516171819202122
  1. using Quadarax.Application.QLiberace.Base.Entities;
  2. using Quadarax.Application.QLiberace.Common.Domain;
  3. using Quadarax.Foundation.Core.Data;
  4. using Quadarax.Foundation.Core.Data.Repository;
  5. using Quadarax.Foundation.Core.Data.Domain;
  6. using Quadarax.Foundation.Core.Data.Interface.Domain;
  7. namespace Quadarax.Application.QLiberace.Base.Repositories
  8. {
  9. public class RepoTenant: EntityRepository<long, Tenant>
  10. {
  11. public RepoTenant(IUnitOfWork<IDataDomain> unitOfWork, QlbrcContext operationContext) : base(unitOfWork, operationContext)
  12. {
  13. }
  14. public Tenant? GetByCode(string tenantCode)
  15. {
  16. if (string.IsNullOrEmpty(tenantCode)) throw new ArgumentNullException(nameof(tenantCode));
  17. return Query(Paging.NoPaging()).FirstOrDefault(x => Equals(x.Code, tenantCode));
  18. }
  19. }
  20. }