public ISollarSystemDto GetSollarSystemById(int id) { SolarSystem sollarSystem = this.unitOfWork.SolarSystemsDbRepository.Find(id); ISollarSystemDto sollarSystemDto = new SollarSystemDto() { Id = sollarSystem.Id, Name = sollarSystem.Name, }; return(sollarSystemDto); }
public IEnumerable <ISollarSystemDto> GetSollarSystemByName(string name) { IList <SolarSystem> sollarSystems = this.unitOfWork.SolarSystemsDbRepository.GetAll(ss => ss.Name == name).ToList(); IList <ISollarSystemDto> sollarSystemDtos = new List <ISollarSystemDto>(sollarSystems.Count()); foreach (SolarSystem sollarSystem in sollarSystems) { ISollarSystemDto sollarSystemDto = new SollarSystemDto() { Id = sollarSystem.Id, Name = sollarSystem.Name }; sollarSystemDtos.Add(sollarSystemDto); } return(sollarSystemDtos); }