Exemple #1
0
        public void DeleteAdvertisement(DTO.Advertisement advertisement, DTO.User user)
        {
            var repo = UnitOfWork.GetRepository <IAdvertisementRepository>() as IRepository <DAL.Model.Advertisement>;

            repo.Get(a => AuthenticateUser(advertisement, user, a));
            repo.Delete(advertisement.AdvertisementId);
            UnitOfWork.Save();
        }
Exemple #2
0
 private static bool AuthenticateUser(DTO.Advertisement advertisement, DTO.User user, DAL.Model.Advertisement a)
 {
     return(a.User.Login == user.Login && a.User.Password == user.Password && a.AdvertisementId == advertisement.AdvertisementId);
 }