Exemple #1
0
        private static RiakObject ToRiakObject(Order order)
        {
            var orderRiakObjectId = new RiakObjectId(ordersBucketName, order.Id.ToString());
            var riakObject        = new RiakObject(orderRiakObjectId, order);

            IntIndex salesPersonIdIndex = riakObject.IntIndex(ordersSalesPersonIdIndexName);

            salesPersonIdIndex.Add(order.SalesPersonId.ToString());

            BinIndex orderDateIndex = riakObject.BinIndex(ordersOrderDateIndexName);

            orderDateIndex.Add(order.OrderDate.ToString("yyyy-MM-dd"));

            return(riakObject);
        }
Exemple #2
0
        private static RiakObject ToRiakObject(EmpleadoVM empleadoVM)
        {
            var empleadoRiakObjectId = new RiakObjectId(empleadoBucketName, empleadoVM.NumReg.ToString());
            var riakObject           = new RiakObject(empleadoRiakObjectId, empleadoVM);

            BinIndex empleadoNombreIndex = riakObject.BinIndex(empleadoNombreIndexName);

            empleadoNombreIndex.Add(empleadoVM.Nombre);

            if (empleadoVM.Servicio != null)
            {
                BinIndex empleadoSerDescIndex = riakObject.BinIndex(empleadoServicioDescripcionIndexName);
                empleadoSerDescIndex.Add(empleadoVM.Servicio.Descripcion);

                IntIndex empleadoCodSIndex = riakObject.IntIndex(empleadoCodSIndexName);
                empleadoCodSIndex.Add(empleadoVM.Servicio.CodS.ToString());
            }

            return(riakObject);
        }