コード例 #1
0
        public static BehaviourTypeApiModel FromBehaviourType(BehaviourType behaviourType)
        {
            var model = new BehaviourTypeApiModel();

            model.BehaviourTypeId = behaviourType.BehaviourTypeId;
            model.Name            = behaviourType.Name;
            return(model);
        }
コード例 #2
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     BehaviourTypes = await _context.BehaviourTypes.Select(x => BehaviourTypeApiModel.FromBehaviourType(x)).ToListAsync()
 };
コード例 #3
0
 public async Task <Response> Handle(Request request, CancellationToken cancellationToken)
 => new Response()
 {
     BehaviourType = BehaviourTypeApiModel.FromBehaviourType(await _context.BehaviourTypes.FindAsync(request.BehaviourTypeId))
 };