public async Task <bool> Create(MotorOilServiceModel motorOilServiceModel) { MotorOil motorOil = AutoMapper.Mapper.Map <MotorOil>(motorOilServiceModel); this.context.MotorOils.Add(motorOil); int result = await context.SaveChangesAsync(); return(result > 0); }
public async Task <bool> Create(TyreServiceModel tyreServiceModel) { Tyre tyre = AutoMapper.Mapper.Map <Tyre>(tyreServiceModel); context.Tyres.Add(tyre); int result = await context.SaveChangesAsync(); return(result > 0); }
private async Task SeedData(SntDbContext context) { context.AddRange(GetDummyData()); await context.SaveChangesAsync(); }