public String[] Get() { IDALTienda it = new DALTiendaEF(); List<Tienda> lt = it.ObtenerTodasTiendas(); String[] ret = new String[lt.Count]; int i = 0; foreach (Tienda t in lt) { ret[i] = t.TiendaID; i++; } return ret; }
// Please set the following connection strings in app.config for this WebJob to run: // AzureWebJobsDashboard and AzureWebJobsStorage //Hace broadcast a topic, para todas las instancias del worker role. static void Main() { string QueueName = "recomendacion"; string connectionString = CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString"); QueueClient Client; Client = QueueClient.CreateFromConnectionString(connectionString, QueueName); IDALTienda tdal = new DALTiendaEF(); var tiendas = tdal.ObtenerTodasTiendas(); foreach (var t in tiendas) { Console.WriteLine(t.TiendaID); var message = new BrokeredMessage(t.TiendaID); Client.Send(message); } }