예제 #1
0
        public override async Task <AutoDto> GetById(GetAutoByIdRequest request, ServerCallContext context)
        {
            AutoManager manager = new AutoManager();
            Auto        auto    = await manager.GetById(request.Id);

            AutoDto result = auto.ConvertToDto();

            return(result);
        }
예제 #2
0
        public async Task DeleteAutoTest()
        {
            var autoRequest = new GetAutoByIdRequest {
                Id = 1
            };
            var auto = await _target.GetByIdAsync(autoRequest);

            _target.Delete(auto);
            Assert.Throws <RpcException>(() => _target.GetById(autoRequest));
        }