예제 #1
0
        public async Task <VehicleMake> UpdateAsync(VehicleMake updatedItem)
        {
            var updatedItemEntity = await repository.UpdateAsync(mapper.Map <VehicleMakeEntity>(updatedItem));

            return(mapper.Map <VehicleMake>(updatedItemEntity));



            //var item = repository.repository.context.VehicleMakes.Update(mapper.Map<VehicleMakeEntity>(updatedItem));

            //item.State = EntityState.Modified;

            //await repository.repository.context.SaveChangesAsync();

            //return updatedItem;


            //var existingItem = await repository.GetAsync((mapper.Map<VehicleMakeEntity>(updatedItem)).Id);

            //repository.repository.context.Update(existingItem);
            //repository.repository.context.SaveChanges();

            //return mapper.Map<VehicleMake>(existingItem);
        }
예제 #2
0
 public async Task <IVehicleMake> UpdateAsync(IVehicleMake updatedItem)
 {
     return(await repository.UpdateAsync(updatedItem));
 }