static void Main(string[] args)
        {
            Console.WriteLine("Starting Uploading");

            var inputFile = @"D:\Projects\xRevolico\Scrapping Anuncios from FB\Mayo 12\Output\output2.txt";

            var anuncios = AnuncioManual.Load(inputFile);

            var context = new RevContext();

            var count = 0;

            foreach (var anuncioManual in anuncios)
            {
                if (anuncioManual.Categoria > 10000 || string.IsNullOrEmpty(anuncioManual.Titulo))
                {
                    continue;
                }

                count++;

                var now = DateTime.Now;

                var anuncioCMG = new AnuncioCMG()
                {
                    Titulo                 = anuncioManual.Titulo,
                    Descripcion            = anuncioManual.Texto,
                    Telefono               = anuncioManual.Telefono,
                    Seccion                = anuncioManual.Categoria / 100,
                    Categoria              = anuncioManual.Categoria,
                    Precio                 = 0,
                    Creado                 = now,
                    ModificadoPorUltimaVez = now,
                    Visitas                = 1,
                };

                context.AnunciosCMG.Add(anuncioCMG);
            }

            context.SaveChanges();

            Console.WriteLine($"Done. Agregados: {count}");
        }
Ejemplo n.º 2
0
 public FontesController(RevContext context)
 {
     _context = context;
 }
Ejemplo n.º 3
0
 public RegistroServico(RevContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public UsuarioService(RevContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public TiposController(TipoServico tipoServico, RevContext context)
 {
     _tipoServico = tipoServico;
     _context     = context;
 }
Ejemplo n.º 6
0
 public RegistroRecordService(RevContext context)
 {
     _context = context;
 }
Ejemplo n.º 7
0
 public DepartmentService(RevContext context)
 {
     _context = context;
 }
Ejemplo n.º 8
0
 public DepartmentsController(RevContext context)
 {
     _context = context;
 }
Ejemplo n.º 9
0
 public TipoServico(RevContext context)
 {
     _context = context;
 }
Ejemplo n.º 10
0
 public LoginsController(UsuarioService usuarioService, RevContext context)
 {
     _context        = context;
     _usuarioService = usuarioService;
 }
Ejemplo n.º 11
0
 public FonteService(RevContext context)
 {
     _context = context;
 }