Пример #1
0
        /// <summary>
        /// 获取指定实体类的UnitOfWork
        /// </summary>
        public static IUnitOfWork GetEntityUnitOfWork(this ScopedDictionary dict, Type entityType)
        {
            string key = $"UnitOfWork_EntityType_{entityType.FullName}";

            return(dict.GetValue <IUnitOfWork>(key));
        }
Пример #2
0
        /// <summary>
        /// 获取连接串的UnitOfWork
        /// </summary>
        public static IUnitOfWork GetConnUnitOfWork(this ScopedDictionary dict, string connString)
        {
            string key = $"UnitOfWork_ConnString_{connString}";

            return(dict.GetValue <IUnitOfWork>(key));
        }