public async Task <IEnumerable <Student> > GetByCampusAsync(Campuses campus)
 {
     return(await _context.Students.Where(s => s.Campus == campus).ToListAsync());
 }
예제 #2
0
 /// <summary>
 /// Helper method for converting a campus' guid to its name
 /// </summary>
 /// <returns>The identifier to name.</returns>
 public string CampusGuidToName(Guid campusGuid)
 {
     // guard against old, bad values.
     Rock.Client.Campus campusObj = Campuses.Find(c => c.Guid == campusGuid);
     return(campusObj != null ? campusObj.Name : "");
 }
예제 #3
0
 /// <summary>
 /// Helper method for converting a campus' name to its ID
 /// </summary>
 /// <returns>The name to identifier.</returns>
 public int CampusNameToId(string campusName)
 {
     Rock.Client.Campus campusObj = Campuses.Find(c => c.Name == campusName);
     return(campusObj != null ? campusObj.Id : 0);
 }
예제 #4
0
 public Rock.Client.Campus CampusFromId(int campusId)
 {
     return(Campuses.Find(c => c.Id == campusId));
 }