C# Class CTCClassSchedule.Common.SubjectInfo

Static helper class to return data related to a given subject.
These helper methods handle common pitfalls such as NullReferenceExceptions for entities which do not exist.
Show file Open project: BellevueCollege/ClassSchedule

Public Methods

Method Description
GetSubject ( string slug ) : Subject

Finds a Subject based on its slug identifier

GetSubject ( string slug, ClassScheduleDb context ) : Subject

Finds a Subject based on its slug identifier and returns it using the provided ClassScheduleDb

GetSubjectFromPrefix ( string prefix ) : Subject

Takes a course prefix parameter and returns all Subjects which own the prefix Subject entity.

GetSubjectInfo ( string slug ) : SubjectInfoResult

Gathers a Subject's related Department, Division, and SubjectsCoursePrefixs

GetSubjectInfoFromPrefix ( string prefix ) : SubjectInfoResult

Gathers a Subject's related Department, Division, and SubjectsCoursePrefixs

GetSubjectPrefixes ( string slug ) : IList

Gathers a List of SubjectsCoursePrefix based on the Subject's slug identifier

Method Details

GetSubject() public static method

Finds a Subject based on its slug identifier
public static GetSubject ( string slug ) : Subject
slug string The slug identifier for a given
return CTCClassSchedule.Models.Subject

GetSubject() public static method

Finds a Subject based on its slug identifier and returns it using the provided ClassScheduleDb
public static GetSubject ( string slug, ClassScheduleDb context ) : Subject
slug string The slug identifier for a given
context CTCClassSchedule.Models.ClassScheduleDb The database context to use during the lookup
return CTCClassSchedule.Models.Subject

GetSubjectFromPrefix() public static method

Takes a course prefix parameter and returns all Subjects which own the prefix Subject entity.
public static GetSubjectFromPrefix ( string prefix ) : Subject
prefix string
return CTCClassSchedule.Models.Subject

GetSubjectInfo() public static method

Gathers a Subject's related Department, Division, and SubjectsCoursePrefixs
public static GetSubjectInfo ( string slug ) : SubjectInfoResult
slug string The slug identifier for a given
return SubjectInfoResult

GetSubjectInfoFromPrefix() public static method

Gathers a Subject's related Department, Division, and SubjectsCoursePrefixs
public static GetSubjectInfoFromPrefix ( string prefix ) : SubjectInfoResult
prefix string The prefix identifier for a given
return SubjectInfoResult

GetSubjectPrefixes() public static method

Gathers a List of SubjectsCoursePrefix based on the Subject's slug identifier
public static GetSubjectPrefixes ( string slug ) : IList
slug string The slug identifier for a given
return IList