using System; using System.Collections.Generic; using System.Linq; using _0_Framework.InfraStructure; using Company.Domain.ZoneAgg; using CompanyManagment.App.Contracts.Zone; namespace CompanyManagment.EFCore.Repository; public class ZoneRepository : RepositoryBase, IZoneRepository { private readonly CompanyContext _context; public ZoneRepository(CompanyContext context) : base(context) { _context = context; } public List GetAllZones() { return _context.ZoneSet.Select(x => new ZoneViewModel() { ZoneName = x.ZoneName, CityId = x.CityId }).ToList(); } public List GetZoneListByCityId(int cityId) { return _context.ZoneSet.Select(x => new ZoneViewModel() { ZoneName = x.ZoneName, CityId = x.CityId }).Where(x=>x.CityId == cityId).ToList(); } public EditZone GetDetails(long id) { return _context.ZoneSet.Select(x => new EditZone() { ZoneName = x.ZoneName, CityId = x.CityId }).FirstOrDefault(x=> x.Id == id); } public List Search(ZoneSearchModel searchModel) { throw new NotImplementedException(); } }