コード例 #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> 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());
     }
 }
コード例 #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);
     }
 }
コード例 #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);
     }
 }
コード例 #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());
     }
 }
コード例 #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));
     }
 }