예제 #1
0
 public ProfileContract GetByUserId(int userId, bool includeImages)
 {
     using (var dbConnector = new DBConnector())
     {
         ProfileManager profileManager = new ProfileManager(dbConnector.DataContext);
         var            profile        = profileManager.GetByUserId(userId, includeImages);
         return(ProfilesTranslator.ConvertToProfileContract(profile));
     }
 }
예제 #2
0
 public List <ProfileContract> GetAll()
 {
     using (var dbConnector = new DBConnector())
     {
         ProfileManager profileManager = new ProfileManager(dbConnector.DataContext);
         var            profiles       = profileManager.GetAll();
         return(ProfilesTranslator.ConvertToProfileContract(profiles).ToList());
     }
 }
예제 #3
0
 public List <ProfileContract> Search(Func <dynamic, bool> criteria)
 {
     using (var dbConnector = new DBConnector())
     {
         ProfileManager       profileManager  = new ProfileManager(dbConnector.DataContext);
         Func <Profile, bool> profileCriteria = (Func <Profile, bool>)criteria;
         return(ProfilesTranslator.ConvertToProfileContract(profileManager.Search(profileCriteria)).ToList());
     }
 }
예제 #4
0
 public ProfileContract GetById(int profileId)
 {
     using (var dbConnector = new DBConnector())
     {
         ProfileManager profileManager = new ProfileManager(dbConnector.DataContext);
         var            profile        = profileManager.GetById(profileId);
         return(ProfilesTranslator.ConvertToProfileContract(profile));
     }
 }