using System.Collections.Generic; using Datory; using GxPress.Repository.Interface.Vip; using AutoMapper; using Microsoft.Extensions.Options; using GxPress.Common.AppOptions; using GxPress.Common.Tools; namespace GxPress.Repository.Implement.Vip { public class VipRepository : IVipRepository { private readonly Repository _repository; private readonly IMapper _mapper; public VipRepository(IOptionsMonitor dbOptionsAccessor, IMapper mapper) { var databaseType = StringUtils.ToEnum(dbOptionsAccessor.CurrentValue.DatabaseType, DatabaseType.MySql); var database = new Database(databaseType, dbOptionsAccessor.CurrentValue.ConnectionString); _repository = new Repository(database); _mapper = mapper; } public IDatabase Database => _repository.Database; public string TableName => _repository.TableName; public List TableColumns => _repository.TableColumns; } }