public void UpdateAdvertisment(Advertisement advertisementToUpdate)
 {
     var advertisment = this._uow.AdvertisementRepository.Get(x => x.Id == advertisementToUpdate.Id).Single();
        // TODO:=
     this._uow.AdvertisementRepository.Update(advertisment);
     this._uow.SaveChanges();
 }
        public object CreateAdvertisement(Advertisement advertisement)
        {
            try
            {
                this._advertisementService.CreateAdvertisment(advertisement);
                return new JsonResponse { Successful = true, Error = "", Data = null };
            }

            catch (Exception ex)
            {
                return new JsonResponse { Successful = true, Error = ex.ToString(), Data = null };
            }
        }
 public IEnumerable<Advertisement> GetAdvertisements(Advertisement advertismentSearchCriteria)
 {
     return this._uow.AdvertisementRepository.Get();
 }
 public void CreateAdvertisment(Advertisement advertisementToCreate)
 {
     advertisementToCreate.RegistrationDate = DateTime.Now;
     this._uow.AdvertisementRepository.Insert(advertisementToCreate);
     this._uow.SaveChanges();
 }
        public object SearchAdvertisements(Advertisement advertisement)
        {
            try
            {
                return new JsonResponse
                {
                    Successful = true,
                    Error = null,
                    Data = this._advertisementService.GetAdvertisements(advertisement)

                };
            }

            catch (Exception ex)
            {
                return new JsonResponse { Successful = true, Error = ex.ToString(), Data = null };
            }
        }