Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        public void UpadteAccident(Accident accidentToUpdate)
        {
            this.accidents.Update(accidentToUpdate);

            this.accidents.SaveChanges();
        }