Ejemplo n.º 1
0
        /// <summary>
        /// 设置指定实体类的UnitOfWork
        /// </summary>
        public static void SetEntityUnitOfWork(this ScopedDictionary dict, Type entityType, IUnitOfWork unitOfWork)
        {
            string key = $"UnitOfWork_EntityType_{entityType.FullName}";

            dict.TryAdd(key, unitOfWork);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 设置连接串的UnitOfWork
        /// </summary>
        public static void SetConnUnitOfWork(this ScopedDictionary dict, string connString, IUnitOfWork unitOfWork)
        {
            string key = $"UnitOfWork_ConnString_{connString}";

            dict.TryAdd(key, unitOfWork);
        }