public async Task <IActionResult> Put(int id, [FromBody] AnnouncementSaveDto value)
        {
            if (ModelState.IsValid)
            {
                var response = await _announcementService.EditAnnouncement(id, value);

                if (response.IsSuccessful)
                {
                    return(Ok());
                }
                else if (response.IsClientError)
                {
                    if (response.Payload != null)
                    {
                        return(Ok());
                    }
                    return(BadRequest("Resource doesnt exists!"));
                }
                else
                {
                    return(StatusCode(500, response.Message));
                }
            }
            else
            {
                return(BadRequest(String.Join(" ,", OtherServices.ReturnAllModelErrors(ModelState))));
            }
        }
        public async Task <IActionResult> Post([FromBody] AnnouncementSaveDto value)
        {
            if (ModelState.IsValid)
            {
                var currentName = User.Identity.Name;
                var response    = await _announcementService.CreateAnnouncement(value, currentName);

                if (response.IsSuccessful)
                {
                    return(Ok());
                }
                else
                {
                    return(StatusCode(500, response.Message));
                }
            }
            else
            {
                return(BadRequest(String.Join(" ,", OtherServices.ReturnAllModelErrors(ModelState))));
            }
        }
        public async Task <IActionResult> Put(int id, AdvertisementSaveDto ad)
        {
            if (ModelState.IsValid)
            {
                var currentId = await GetCurrentUserId();

                var result = await _advertisementService.EditAdvertisement(currentId, id, ad);

                if (result.IsSuccessful)
                {
                    return(Ok());
                }

                if (result.IsClientError)
                {
                    return(BadRequest(result.Message));
                }

                return(StatusCode(500));
            }
            return(BadRequest(OtherServices.ReturnAllModelErrors(ModelState)));
        }