public async Task <dynamic> GetStaffAssignmentByEmail(string email) { try { var data = (await _positionAssignRepo.StaffAssigEmail(email)).OrderBy(m => m.StaffStartDate).ToList(); var seasons = _geographyRepo.GetSeasons(); dynamic currentPositionAssign = null; dynamic nextPositionAssign = null; dynamic followingPositionAssign = null; dynamic nextFollowingPositionAssign = null; for (var assignobj = 0; assignobj < data.Count; assignobj++) { switch (assignobj) { case 0: currentPositionAssign = data[assignobj]; break; case 1: nextPositionAssign = data[assignobj]; break; case 2: followingPositionAssign = data[assignobj]; break; case 3: nextFollowingPositionAssign = data[assignobj]; break; } } return(new { currentPositionAssign, nextPositionAssign, followingPositionAssign, nextFollowingPositionAssign }); } catch (Exception e) { var a = e; Console.Write(a); throw; } }
public async Task <IEnumerable <Sourcemarket> > GetSeasons() { return(await _geographyRepo.GetSeasons()); }