Example #1
0
        public async Task <List <LocationsDto> > GetLocationsAsync(int?parentCode)
        {
            var locations = await _repository.GetByParentCodeAsync(parentCode);

            return(locations?.Select(l => new LocationsDto
            {
                Code = l.Code,
                ParentCode = l.ParentCode,
                Name = l.Name,
                MergeName = l.MergeName,
                Latitude = l.Latitude,
                Longitude = l.Longitude,
                Level = l.Level
            }).ToList());
        }