Ejemplo n.º 1
0
        public DataPacket Serialize <T>(IContext ctx, ModelActionOption modelAction, IEnumerable <T> list, IEnumerable <TypedItem> items) where T : class, new()
        {
            DataPacket item = new DataPacket()
            {
                Context     = (ApplicationContext)ctx,
                Typename    = GetTypename <List <T> >(),
                ModelAction = modelAction,
                Criteria    = new Criterion()
                {
                    Items = items
                },
                Items  = GenerateMessage <T>(ctx, modelAction),
                Buffer = GenericSerializer.GenericListToByteArray <T>(list.ToList())
            };

            return(item);
        }