コード例 #1
0
        public void Delete([FromUri] int imageId)
        {
            var imageName = _iHorseAdBus.DeleteImage(imageId, UserIdExtractor.GetUserIdFromRequest(Request));

            var horseAdvImageDir = ConfigurationManager.AppSettings["HorseAdsImgDirectory"];
            var serverPath       = HttpContext.Current.Server.MapPath(horseAdvImageDir);

            if (Directory.Exists(Path.GetDirectoryName(serverPath)))
            {
                var path = Path.Combine(serverPath, imageName);
                File.Delete(path);
            }
        }
コード例 #2
0
 public async Task ChangePassword([FromBody] ChangePasswordViewModel changePassword)
 {
     await _iUserBus.ChangePassword(UserIdExtractor.GetUserIdFromRequest(Request), changePassword);
 }
コード例 #3
0
 public async Task Delete()
 {
     await _iUserBus.DeleteUserById(UserIdExtractor.GetUserIdFromRequest(Request));
 }
コード例 #4
0
 public async Task <UserDTO> Edit([FromBody] EditProfileViewModel editProfile)
 {
     return(await _iUserBus.EditProfile(UserIdExtractor.GetUserIdFromRequest(Request), editProfile));
 }
コード例 #5
0
 public async Task Update([FromUri] int id, [FromBody] HorseAdDTO horseAdDTO)
 {
     await _iHorseAdBus.EditHorseAd(id, horseAdDTO, UserIdExtractor.GetUserIdFromRequest(Request));
 }
コード例 #6
0
 public async Task Post([FromBody] HorseAdDTO horseAdDTO)
 {
     await _iHorseAdBus.Add(horseAdDTO, UserIdExtractor.GetUserIdFromRequest(Request));
 }
コード例 #7
0
 public bool CheckPostOwner([FromUri] int adId)
 {
     return(_iHorseAdBus.CheckPostOwner(adId, UserIdExtractor.GetUserIdFromRequest(Request)));
 }
コード例 #8
0
 public void SetAsAdProfilePicture([FromUri] int imageId)
 {
     _iHorseAdBus.SetHorseAdProfilePicture(imageId, UserIdExtractor.GetUserIdFromRequest(Request));
 }
コード例 #9
0
 public async Task <int> SaveNewImage([FromUri] int adId, string imageName)
 {
     return(await _iHorseAdBus.SaveNewImage(adId, imageName, UserIdExtractor.GetUserIdFromRequest(Request)));
 }
コード例 #10
0
 public void AddToFavorite([FromUri] int id)
 {
     _iHorseAdBus.AddToFavorite(id, UserIdExtractor.GetUserIdFromRequest(Request));
 }
コード例 #11
0
 public async Task Delete([FromUri] int id, bool isSold)
 {
     await _iHorseAdBus.Delete(id, UserIdExtractor.GetUserIdFromRequest(Request), isSold);
 }