コード例 #1
0
        protected T AddBaseText <T>(
            ISession session,
            string name,
            short format,
            string text,
            string cultureName,
            string dictionaryScope,
            string modificationUser,
            DateTime modificationTime
            ) where T : BaseTextEntity, new()
        {
            var cultureRepository         = new CultureRepository(session);
            var dictionaryScopeRepository = new DictionaryScopeRepository(session);

            var culture = cultureRepository.GetCultureByName(cultureName);
            var scope   = dictionaryScopeRepository.GetScopeByName(dictionaryScope);

            var baseTextEntity = new T
            {
                Culture          = culture,
                DictionaryScope  = scope,
                Name             = name,
                Format           = format,
                Text             = text,
                ModificationTime = modificationTime,
                ModificationUser = modificationUser,
            };

            return(baseTextEntity);
        }
コード例 #2
0
        public virtual DictionaryScopeEntity GetScopeByName(string cultureName)
        {
            using (var session = GetSession())
            {
                var dictionaryScopeRepository = new DictionaryScopeRepository(session);

                var resultList = dictionaryScopeRepository.GetScopeByName(cultureName);

                return(resultList);
            }
        }