예제 #1
0
        private async Task CkeckBikermotorAsync(BikerEntity biker, MotorBikeSpareEntity bikespare)
        {
            var bikermotor = new BikerMotorEntity
            {
                Biker          = biker,
                MotorBikeSpare = bikespare
            };

            await _dataContext.BikerMotors.AddAsync(bikermotor);

            await _dataContext.SaveChangesAsync();
        }
예제 #2
0
 public AddMotorBikeSpareViewModel ToMotorBikeSpareViewModel(MotorBikeSpareEntity model)
 {
     return(new AddMotorBikeSpareViewModel
     {
         Id = model.Id,
         BikerMotors = model.BikerMotors,
         ImageUrl = model.ImageUrl,
         MotorBike = model.MotorBike,
         MotorbikeId = model.MotorBike.Id,
         YearSince = model.YearSince,
         YearUntil = model.YearUntil
     });
 }
예제 #3
0
        private async Task <MotorBikeSpareEntity> CheckMotorBikeSpareAsync(int yearsince, int until, MotorBikeEntity motorBike)
        {
            var bikespare = new MotorBikeSpareEntity
            {
                YearSince   = yearsince,
                YearUntil   = until,
                MotorBike   = motorBike,
                BikerMotors = new List <BikerMotorEntity>()
            };

            _dataContext.MotorBikeSpares.Add(bikespare);

            await _dataContext.SaveChangesAsync();

            return(bikespare);
        }