private async Task CkeckBikermotorAsync(BikerEntity biker, MotorBikeSpareEntity bikespare) { var bikermotor = new BikerMotorEntity { Biker = biker, MotorBikeSpare = bikespare }; await _dataContext.BikerMotors.AddAsync(bikermotor); await _dataContext.SaveChangesAsync(); }
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 }); }
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); }