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); } }
public async Task ChangePassword([FromBody] ChangePasswordViewModel changePassword) { await _iUserBus.ChangePassword(UserIdExtractor.GetUserIdFromRequest(Request), changePassword); }
public async Task Delete() { await _iUserBus.DeleteUserById(UserIdExtractor.GetUserIdFromRequest(Request)); }
public async Task <UserDTO> Edit([FromBody] EditProfileViewModel editProfile) { return(await _iUserBus.EditProfile(UserIdExtractor.GetUserIdFromRequest(Request), editProfile)); }
public async Task Update([FromUri] int id, [FromBody] HorseAdDTO horseAdDTO) { await _iHorseAdBus.EditHorseAd(id, horseAdDTO, UserIdExtractor.GetUserIdFromRequest(Request)); }
public async Task Post([FromBody] HorseAdDTO horseAdDTO) { await _iHorseAdBus.Add(horseAdDTO, UserIdExtractor.GetUserIdFromRequest(Request)); }
public bool CheckPostOwner([FromUri] int adId) { return(_iHorseAdBus.CheckPostOwner(adId, UserIdExtractor.GetUserIdFromRequest(Request))); }
public void SetAsAdProfilePicture([FromUri] int imageId) { _iHorseAdBus.SetHorseAdProfilePicture(imageId, UserIdExtractor.GetUserIdFromRequest(Request)); }
public async Task <int> SaveNewImage([FromUri] int adId, string imageName) { return(await _iHorseAdBus.SaveNewImage(adId, imageName, UserIdExtractor.GetUserIdFromRequest(Request))); }
public void AddToFavorite([FromUri] int id) { _iHorseAdBus.AddToFavorite(id, UserIdExtractor.GetUserIdFromRequest(Request)); }
public async Task Delete([FromUri] int id, bool isSold) { await _iHorseAdBus.Delete(id, UserIdExtractor.GetUserIdFromRequest(Request), isSold); }