Esempio n. 1
0
        public async Task <CustomerPocoOut> AsyncPocosContextDefaultSerializer(CustomerPocoIn data, ILambdaContext context)
        {
            Console.WriteLine($"Context.RemainingTime: '{context.RemainingTime}'");
            Console.WriteLine($"Sleeping for {delayTime}...");
            await Task.Delay(delayTime);

            Console.WriteLine($"Context.RemainingTime: '{context.RemainingTime}'");

            return(new CustomerPocoOut($"Hi '{data.Data}'!"));
        }
        public T Deserialize <T>(Stream requestStream)
        {
            var type = typeof(T);

            if (type == typeof(CustomerPoco))
            {
                object poco = new CustomerPoco(Common.GetString(requestStream));
                return((T)poco);
            }
            if (type == typeof(CustomerPocoIn))
            {
                object poco = new CustomerPocoIn(Common.GetString(requestStream));
                return((T)poco);
            }
            if (type == typeof(CustomerPocoOut))
            {
                object poco = new CustomerPocoOut(Common.GetString(requestStream));
                return((T)poco);
            }

            throw new InvalidCastException();
        }
Esempio n. 3
0
 public CustomerPocoOut ErrorSerializerMethod(CustomerPocoIn input)
 {
     return(new CustomerPocoOut(input.Data));
 }
Esempio n. 4
0
 public static CustomerPocoOut PocoInPocoOutStatic(CustomerPocoIn data)
 {
     Common.LogCommonData("PocoInPocoOutStatic", data.Data);
     return(new CustomerPocoOut("(([PocoInPocoOutStatic]))"));
 }