public IList <CourseSignatureDto> GetAllSignatures() { try { return(CourseSignatureDto.Map(new Repository <CourseModel>().GetAll().ToList())); } catch (Exception ex) { Logger.Error("Error : CourseService.GetAllSignatures - {0}", ex.Message); return(new List <CourseSignatureDto>()); } }
public IList <CourseSignatureDto> GetCourseSignaturesByProfileId(int profileId) { WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Origin", "*"); try { using (var session = DataAccess.OpenSession()) { var courses = session.CreateCriteria(typeof(CourseModel)).List <CourseModel>().Where(c => c.Group.Users.Any(p => p.ID == profileId)).ToList(); return(CourseSignatureDto.Map(courses)); } } catch (Exception ex) { Logger.Error("Error : CourseService.GetCourseSignaturesByProfileId - {0}", ex.Message); return(new List <CourseSignatureDto>()); } }