當前位置: 首頁>>代碼示例>>C#>>正文


C# Service.List類代碼示例

本文整理匯總了C#中Service.List的典型用法代碼示例。如果您正苦於以下問題:C# List類的具體用法?C# List怎麽用?C# List使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


List類屬於Service命名空間,在下文中一共展示了List類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetCourseRating

        public float GetCourseRating(int course_id, ref List<string> errors)
        {
            var courseRating = 0;
            List<CapeReview> capeReviewList = new List<CapeReview>();
            var reviewCount = 0;

            //// can never fail default to == 0 for all service layers
            if (string.IsNullOrEmpty(course_id.ToString()))
            {
                errors.Add("Invalid course id");
                throw new ArgumentException();
            }

            capeReviewList = this.repository.FindCapeReviewsByCourseId(course_id, ref errors);
            foreach (CapeReview cr in capeReviewList)
            {
                if (cr.CourseRating > 0)
                {
                    reviewCount++;
                    courseRating += cr.CourseRating;
                }
            }

            return courseRating / reviewCount;
        }
開發者ID:fastily,項目名稱:cse136,代碼行數:25,代碼來源:CapeReviewService.cs

示例2: GetAdminList

        public List<Admin> GetAdminList()
        {
            var service = new AdminService(new AdminRepository(this.entities));
            var errors = new List<string>();

            return service.GetAdminList(ref errors);
        }
開發者ID:fastily,項目名稱:cse136,代碼行數:7,代碼來源:AdminController.cs

示例3: InsertTa

        public void InsertTa(Ta ta, ref List<string> errors)
        {
            if (ta == null)
            {
                errors.Add("Ta cannot be null");
                throw new ArgumentException();
            }

            if (string.IsNullOrEmpty(ta.FirstName))
            {
                errors.Add("Ta first name cannot be null");
                throw new ArgumentException();
            }

            if (string.IsNullOrEmpty(ta.LastName))
            {
                errors.Add("Ta last name cannot be null");
                throw new ArgumentException();
            }

            if (this.repository.IsNotDuplicateTa(ta, ref errors))
            {
                this.repository.AddTa(ta, ref errors);
            }
            else
            {
                errors.Add("Duplicate Ta");
            }
        }
開發者ID:fastily,項目名稱:cse136,代碼行數:29,代碼來源:TaService.cs

示例4: GetTaList

 public List<Ta> GetTaList()
 {
     var errors = new List<string>();
     var repository = new TaRepository(this.entities);
     var service = new TaService(repository);
     return service.GetTaList(ref errors);
 }
開發者ID:fastily,項目名稱:cse136,代碼行數:7,代碼來源:TaController.cs

示例5: GetCourse

 public Course GetCourse(int id)
 {
     var errors = new List<string>();
     var repository = new CourseRepository(this.entities);
     var service = new CourseService(repository);
     return service.GetCourse(id, ref errors);
 }
開發者ID:fastily,項目名稱:cse136,代碼行數:7,代碼來源:CourseController.cs

示例6: GetStudent

 public Student GetStudent(string id)
 {
     var errors = new List<string>();
     var repository = new StudentRepository();
     var service = new StudentService(repository);
     return service.GetStudent(id, ref errors);
 }
開發者ID:danielcristiancazares,項目名稱:Course-Management-Site,代碼行數:7,代碼來源:StudentController.cs

示例7: GetShippingRatesSyncParallel

        public ShippingRate[] GetShippingRatesSyncParallel(decimal weight, string originZipCode, string destinationZipCode)
        {
            // create object that will store results
            List<ShippingRate> rates = new List<ShippingRate>();

            // launch asynchronous requests, which will complete in parallel
            WebRequest fedExRequest = CreateFedExRequest(weight, originZipCode, destinationZipCode);
            IAsyncResult fedExResult = fedExRequest.BeginGetResponse(null, null);

            WebRequest upsRequest = CreateUpsRequest(weight, originZipCode, destinationZipCode);
            IAsyncResult upsResult = upsRequest.BeginGetResponse(null, null);

            WebRequest uspsRequest = CreateUspsRequest(weight, originZipCode, destinationZipCode);
            IAsyncResult uspsResult = uspsRequest.BeginGetResponse(null, null);

            // wait for all requests; each EndGetResponse will block if the request hasn't completed

            using (WebResponse response = fedExRequest.EndGetResponse(fedExResult))
                rates.AddRange(GetFedExRates(response));

            using (WebResponse response = upsRequest.EndGetResponse(upsResult))
                rates.AddRange(GetUpsRates(response));

            using (WebResponse response = uspsRequest.EndGetResponse(uspsResult))
                rates.AddRange(GetUspsRates(response));

            return rates.ToArray();
        }
開發者ID:bgrainger,項目名稱:AsyncIoDemo,代碼行數:28,代碼來源:ShippingRatesProvider.cs

示例8: FindGradeChangeByCourseId

 public GradeChange FindGradeChangeByCourseId(int course_id)
 {
     var errors = new List<string>();
     var repository = new GradeChangeRepository(this.entities);
     var service = new GradeChangeService(repository);
     return service.FindGradeChangeByCourseId(course_id, ref errors);
 }
開發者ID:fastily,項目名稱:cse136,代碼行數:7,代碼來源:GradeChangeController.cs

示例9: FindGradeChangeByStudentId

 public GradeChange FindGradeChangeByStudentId(string student_id)
 {
     var errors = new List<string>();
     var repository = new GradeChangeRepository(this.entities);
     var service = new GradeChangeService(repository);
     return service.FindGradeChangeByStudentId(student_id, ref errors);
 }
開發者ID:fastily,項目名稱:cse136,代碼行數:7,代碼來源:GradeChangeController.cs

示例10: GetWaitList

 public List<Waitlist> GetWaitList()
 {
     var errors = new List<string>();
     var repository = new WaitlistRepository();
     var service = new WaitlistService(repository);
     return service.GetWaitlist(ref errors);
 }
開發者ID:danielcristiancazares,項目名稱:Course-Management-Site,代碼行數:7,代碼來源:WaitlistController.cs

示例11: addList

        public List<t_flightmatching> addList(string flightDepartureSelectionne, string flightArrivalSelectionne, t_flightmatching flight)
        {
            /* flight flt = unitOfWork.FlightRepository.GetById(idFlight);
             flt.idStaff = stf.id;
             unitOfWork.FlightRepository.Update(flt);
             unitOfWork.Commit();*/

            //    string dep = flightDepartureSelectionne.departure;
            //    string arr = flightArrivalSelectionne.arrival;
            string dateDep = flight.dateFlightMatchingDep;
            string dateArr = flight.dateFlightMatchingArr;

            List<t_flightmatching> listeAmaj = new List<t_flightmatching>();
            List<t_flightmatching> listeTsLesFlights = utwk.FlightMatchingRepository.GetAll().ToList();

            foreach (t_flightmatching f in listeTsLesFlights)
            {
                // if (f.departure == dep && f.arrival == arr && f.dateFlightMatchingDep == dateDep && f.dateFlightMatchingArr == dateArr)
                if (f.departure == flightDepartureSelectionne && f.arrival == flightArrivalSelectionne)

                {
                    listeAmaj.Add(f);

                }
            }

            return listeAmaj;

            //return utwk.FlightMatchingRepository.GetAll().ToList();
        }
開發者ID:NadiaBourourou,項目名稱:MedtravGtech,代碼行數:30,代碼來源:FlightMatchingService.cs

示例12: GetInstructorRating

 public float GetInstructorRating(int instructorId)
 {
     var errors = new List<string>();
     var repository = new CapeReviewRepository(this.entities);
     var service = new CapeReviewService(repository);
     return service.GetInstructorRating(instructorId, ref errors);
 }
開發者ID:fastily,項目名稱:cse136,代碼行數:7,代碼來源:CapeReviewController.cs

示例13: FindCapeReviewByCourseId

 public List<CapeReview> FindCapeReviewByCourseId(int cid)
 {
     var errors = new List<string>();
     var repository = new CapeReviewRepository(this.entities);
     var service = new CapeReviewService(repository);
     return service.GetCapeReview(cid, ref errors);
 }
開發者ID:fastily,項目名稱:cse136,代碼行數:7,代碼來源:CapeReviewController.cs

示例14: UpdateAdmin

        public void UpdateAdmin(Admin admin, ref List<string> errors)
        {
            if (admin == null)
            {
                errors.Add("Instructor cannot be null");
                throw new ArgumentException();
            }

            if (string.IsNullOrEmpty(admin.FirstName))
            {
                errors.Add("Admin requires a first name.");
                throw new ArgumentException();
            }

            if (string.IsNullOrEmpty(admin.LastName))
            {
                errors.Add("Admin requires a last name.");
                throw new ArgumentException();
            }

            if (string.IsNullOrEmpty(admin.Email))
            {
                errors.Add("Admin requires an email.");
                throw new ArgumentException();
            }

            if (string.IsNullOrEmpty(admin.Password))
            {
                errors.Add("Admin requires a password.");
                throw new ArgumentException();
            }

            this.repository.UpdateAdmin(admin, ref errors);
        }
開發者ID:danielcristiancazares,項目名稱:Course-Management-Site,代碼行數:34,代碼來源:AdminService.cs

示例15: GetTAList

 public List<TA> GetTAList()
 {
     var errors = new List<string>();
     var repository = new TARepository();
     var service = new TaService(repository);
     return service.GetTAList(ref errors);
 }
開發者ID:danielcristiancazares,項目名稱:Course-Management-Site,代碼行數:7,代碼來源:TaController.cs


注:本文中的Service.List類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。