public Accident CreateAccident(string location, string picture, string description, int carId, string userId) { var accidentToAdd = new Accident { Location = location, Picture = picture, Date = DateTime.UtcNow, Description = description, CarId = carId, UserId = userId }; this.accidents.Add(accidentToAdd); this.accidents.SaveChanges(); return accidentToAdd; }
public void UpadteAccident(Accident accidentToUpdate) { this.accidents.Update(accidentToUpdate); this.accidents.SaveChanges(); }