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

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