예제 #1
0
 public XmlContext(IOptions <XmlConfiguration> options = default)
 {
     _options = options.Value;
     if (string.IsNullOrWhiteSpace(_options.DataFolderName))
     {
         _options.DataFolderName = "Data";
     }
     _filePath = Path.Combine(_options.DataFolderName, typeof(T).Name + ".xml");
     Setup();
 }
예제 #2
0
        public XmlContext(IOptions <XmlConfiguration>?options = default)
        {
            _options = options !.Value;

            _collection     = new List <TEntity>();
            _tempCollection = new List <TEntity>();

            if (string.IsNullOrWhiteSpace(_options.Folder))
            {
                _options.Folder = Path.Combine(Directory.GetCurrentDirectory(), "Data");
            }
            _filePath = Path.Combine(_options.Folder, typeof(TEntity).Name + ".xml");
            Setup();
        }