public ProfessionalDto GetProfessional(RequestDto <ComposeKey <Guid, decimal> > keys) { var professionalId = keys.GetId().SecundaryKey; var code = keys.GetId().PrimaryKey; if (professionalId <= 0) { RaiseNotification(nameof(professionalId)); } if (code == Guid.Empty) { RaiseNotification(nameof(code)); } if (Notification.HasNotification()) { return(new ProfessionalDto()); } var entity = _service.GetProfessional(keys); var dto = entity.MapTo <ProfessionalDto>(); dto.RemoveExpandable(keys); return(dto); }
private ProfessionalPoco GetProfessionalPoco(RequestDto <ComposeKey <Guid, decimal> > requestDto) { var dbEntity = Context.Professionals .IncludeByRequestDto(requestDto) .Where(w => w.ProfessionalId == requestDto.GetId().SecundaryKey&& w.Code == requestDto.GetId().PrimaryKey) .SelectFieldsByRequestDto(requestDto) .SingleOrDefault(); return(dbEntity); }
public Professional GetProfessional(RequestDto <ComposeKey <Guid, decimal> > keys) { if (!_professionalRepository.ExistsProfessional(keys.GetId())) { Notification.Raise(NotificationEvent.DefaultBuilder .WithNotFoundStatus() .WithMessage(AppConsts.LocalizationSourceName, Professional.Error.CouldNotFindProfessional) .Build()); return(null); } return(_professionalRepository.GetProfessional(keys)); }
public Specialty GetSpecialty(RequestDto requestDto) { if (!_specialtyRepository.ExistsSpecialty(requestDto.GetId())) { Notification.Raise(NotificationEvent.DefaultBuilder .WithNotFoundStatus() .WithMessage(AppConsts.LocalizationSourceName, Specialty.Error.CouldNotFindSpecialty) .Build()); return(null); } return(_specialtyRepository.GetSpecialty(requestDto)); }
public SpecialtyDto GetSpecialty(RequestDto id) { if (id.GetId() <= 0) { RaiseNotification(nameof(id)); } if (Notification.HasNotification()) { return(new SpecialtyDto()); } var entity = _service.GetSpecialty(id); return(entity.MapTo <SpecialtyDto>()); }
public async Task <PresidentDto> GetPresidentById(RequestDto <string> id) { if (string.IsNullOrWhiteSpace(id.GetId())) { RaiseNotification(nameof(id)); } if (Notification.HasNotification()) { return(new PresidentDto()); } var entity = await _whiteHouserService.GetPresidentById(id); return(entity.MapTo <PresidentDto>()); }
public async Task <President> GetPresidentById(RequestDto <string> requestDto) { var presidentData = await GetAsync(requestDto.GetId()); return(presidentData.MapTo <President>()); }
public Task <President> GetPresidentById(RequestDto <string> requestDto) { _presidents.TryGetValue(requestDto.GetId(), out PresidentPoco presidentpoco); return(Task.FromResult(presidentpoco.MapTo <President>())); }
public Professional GetProfessional(RequestDto <ComposeKey <Guid, decimal> > requestDto) { var professional = FirstOrDefault(w => w.ProfessionalId == requestDto.GetId().SecundaryKey&& w.Code == requestDto.GetId().PrimaryKey); return(professional.MapTo <Professional>()); }