using Entity.DbModel.Station; using HybirdFrameworkCore.Autofac.Attribute; using Repository.Station; namespace Service.Station; [Scope("SingleInstance")] public class ElecPriceModelVersionService : BaseServices { ElecPriceModelVersionRepository _elecPriceModelVersionRepository; public ElecPriceModelVersionService(ElecPriceModelVersionRepository dal) { _elecPriceModelVersionRepository = dal; BaseDal = dal; } /// /// 返回当前版本号 /// /// public async Task GetNowVersion() { ElecPriceModelVersion elecPriceModelVersion =await _elecPriceModelVersionRepository.QueryByClauseAsync(u => u.EndTime > DateTime.Now); if (elecPriceModelVersion != null) return elecPriceModelVersion.Version; else return 0; } }