public IEnumerable <ServiceTypeVM> GetAllServiceTypes(bool withDeleted = false) { var serviceTypes = _serviceTypes.FindAll(withDeleted); var serviceTypeVMs = serviceTypes.Select(x => new ServiceTypeVM { Id = x.Id, TypeName = x.TypeName, Services = _services.GetServicesByTypeId(x.Id).Select(s => new ServiceVM { Id = s.Id, ServiceName = s.ServiceName }), IsDeleted = x.IsDeleted }).ToList(); return(serviceTypeVMs); }