using JLHHJSvr.Helper; using System; using System.Collections.Generic; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; namespace LJLib { public class GenericLoader : ICacheLoader where TValue : class, new() { private readonly ICacheMapping _mapping; public GenericLoader(ICacheMapping mapping) { _mapping = mapping ?? throw new ArgumentNullException(nameof(mapping)); } public TValue Load(SqlCommand cmd, TKey id) { return _mapping.GetInstance(cmd, id); } } }