summaryrefslogtreecommitdiff
path: root/csharp/test/Ice/defaultServant/MyObjectI.cs
blob: 40163662120c212d0c4d584f66018ea405522f34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) ZeroC, Inc. All rights reserved.

using System.Threading;
using System.Threading.Tasks;

namespace ZeroC.Ice.Test.DefaultServant
{
    public sealed class MyObject : IMyObject
    {
        public ValueTask IcePingAsync(Current current, CancellationToken cancel)
        {
            string name = current.Identity.Name;

            if (name == "ObjectNotExist")
            {
                throw new ObjectNotExistException();
            }
            return default;
        }

        public string GetName(Current current, CancellationToken cancel)
        {
            string name = current.Identity.Name;

            if (name == "ObjectNotExist")
            {
                throw new ObjectNotExistException();
            }
            return name;
        }
    }
}