Esempio n. 1
0
        public virtual async Task <OrganizationUnit> GetLastChildOrNullAsync(long?parentId)
        {
            var query = OrganizationUnitRepository.GetAll()
                        .Where(ou => ou.ParentId == parentId)
                        .OrderByDescending(ou => ou.Code);

            return(await AsyncQueryableExecuter.FirstOrDefaultAsync(query));
        }
Esempio n. 2
0
        public virtual OrganizationUnit GetLastChildOrNull(long?parentId)
        {
            var query = OrganizationUnitRepository.GetAll()
                        .Where(ou => ou.ParentId == parentId)
                        .OrderByDescending(ou => ou.Code);

            return(query.FirstOrDefault());
        }