public static FrequencyTypeApiModel FromFrequencyType(FrequencyType frequencyType)
        {
            var model = new FrequencyTypeApiModel();

            model.FrequencyTypeId = frequencyType.FrequencyTypeId;
            model.Name            = frequencyType.Name;
            return(model);
        }
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     FrequencyType = FrequencyTypeApiModel.FromFrequencyType(await _context.FrequencyTypes.FindAsync(request.FrequencyTypeId))
 };
Beispiel #3
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     FrequencyTypes = await _context.FrequencyTypes.Select(x => FrequencyTypeApiModel.FromFrequencyType(x)).ToListAsync()
 };