Ejemplo n.º 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();
        }
Ejemplo n.º 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
     });
 }
Ejemplo n.º 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);
        }