Пример #1
0
        public long AddViolationForUser(Violations violation)
        {
            Citizen user = _userService.GetUser();

            violation.PolicemanId = user.Policeman.Id;

            _violationsRepository.Save(violation);

            return(violation.Id);
        }
Пример #2
0
        public long AddViolationForUser(Violations violation)
        {
            long?userId = _userService.GetUser()?.Id;

            long policemanId = _policeRepo.GetAll().SingleOrDefault(p => p.CitizenId == userId).Id;

            violation.PolicemanId = policemanId;

            _violationsRepository.Save(violation);

            return(violation.Id);
        }