using EFCore.BulkExtensions;
using Model.Models.VitrosModels;
using System.Collections.Generic;

namespace VitrosConsole.Persistence
{
    public class PersistenceService
    {
        private readonly ApplicationDbContext _dbContext;

        public PersistenceService(ApplicationDbContext dbContext)
        {
            _dbContext = dbContext;
        }

        public void Save(List<Sample> samples)
        {
            //_dbContext.Samples.AddRange(samples);
            //_dbContext.SaveChanges();
            _dbContext.BulkInsert(samples, b => b.IncludeGraph = true);
        }
    }
}
