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}");
        }
 public FontesController(RevContext context)
 {
     _context = context;
 }
 public RegistroServico(RevContext context)
 {
     _context = context;
 }
Example #4
0
 public UsuarioService(RevContext context)
 {
     _context = context;
 }
Example #5
0
 public TiposController(TipoServico tipoServico, RevContext context)
 {
     _tipoServico = tipoServico;
     _context     = context;
 }
Example #6
0
 public RegistroRecordService(RevContext context)
 {
     _context = context;
 }
Example #7
0
 public DepartmentService(RevContext context)
 {
     _context = context;
 }
Example #8
0
 public DepartmentsController(RevContext context)
 {
     _context = context;
 }
Example #9
0
 public TipoServico(RevContext context)
 {
     _context = context;
 }
Example #10
0
 public LoginsController(UsuarioService usuarioService, RevContext context)
 {
     _context        = context;
     _usuarioService = usuarioService;
 }
Example #11
0
 public FonteService(RevContext context)
 {
     _context = context;
 }