Exemple #1
0
        public IResult Update(Rental rental)
        {
            CarRentalProjectContext context = new CarRentalProjectContext();

            _rentalDal.Update(rental);
            context.SaveChanges();

            return(new SuccessResult());
        }
Exemple #2
0
 public void Delete(Color entity)
 {
     using (CarRentalProjectContext context = new CarRentalProjectContext())
     {
         var deletedEntity = context.Entry(entity);
         deletedEntity.State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Exemple #3
0
 public void Update(Color entity)
 {
     using (CarRentalProjectContext context = new CarRentalProjectContext())
     {
         var updatedEntity = context.Entry(entity);
         updatedEntity.State = EntityState.Modified;
         context.SaveChanges();
     }
 }
Exemple #4
0
 public void Add(Color entity)
 {
     using (CarRentalProjectContext context = new CarRentalProjectContext())
     {
         var addedEntity = context.Entry(entity);
         addedEntity.State = EntityState.Added;
         context.SaveChanges();
     }
 }