public Insurance Create(Insurance insurance) { _carShopDbContext.Add(insurance); if (_carShopDbContext.SaveChanges() > 0) { return(insurance); } return(null); }
public void Add(AddCarFormViewModel car, string ownerId) { db.Add(new Car { Model = car.Model, Year = car.Year, PictureUrl = car.Image, PlateNumber = car.PlateNumber, OwnerId = ownerId, }); db.SaveChanges(); }