// COMMENT: in order to match existing objects as foreign keys for other objects, using the same context is required, thus, functions are located here
        public async Task <VehicleAccidentModel> CreateVehicleAccidentReport(VehicleAccidentModel accident)
        {
            var res = _context.Set <VehicleAccidentModel>().Add(accident);
            await _context.SaveChangesAsync();

            return(res);
        }
Example #2
0
 public VehicleAccidentViewModel(VehicleAccidentModel vehicleAccidentModel)
 {
     _vehicleAccident = vehicleAccidentModel;
 }