Exemple #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));
     }
 }
Exemple #2
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());
     }
 }
Exemple #3
0
 public void Update(ProfileContract user)
 {
     using (var dbConnector = new DBConnector())
     {
         ProfileManager profileManager = new ProfileManager(dbConnector.DataContext);
         var            userEntity     = ProfilesTranslator.ConvertToProfileEntity(user);
         profileManager.Update(userEntity);
     }
 }
Exemple #4
0
 public void Add(ProfileContract profile)
 {
     using (var dbConnector = new DBConnector())
     {
         ProfileManager profileManager = new ProfileManager(dbConnector.DataContext);
         var            profileEntity  = ProfilesTranslator.ConvertToProfileEntity(profile);
         profileManager.Add(profileEntity);
     }
 }
Exemple #5
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());
     }
 }
Exemple #6
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));
     }
 }