예제 #1
0
파일: Target.cs 프로젝트: haremikura/Myrepo
        public DBContexTestTemplate(TextDBName textDbName)
        {
            IEnumerable <IEntity> dataEntity
                = textListContena.GetTextList(textDbName);

            DbContext = GetArticleDbContext();

            switch (textDbName)
            {
            case TextDBName.TextFile:
                DbContext.TextFilesList.AddRange((IEnumerable <TextFilesList>)dataEntity);
                DbContext.SaveChanges();
                testList = DbContext.TextFilesList.ToList();
                break;

            case TextDBName.ServiceUser:
                DbContext.ServiceUser.AddRange((IEnumerable <ServiceUser>)dataEntity);
                DbContext.SaveChanges();
                testList = DbContext.TextFilesList.ToList();
                break;
            }
        }
예제 #2
0
 public static Type GetEntityType(this TextDBName textDBName)
 {
     return(dictionary[textDBName]);
 }
예제 #3
0
 public IEnumerable <IEntity> GetTextList(TextDBName dbName)
 => testDictionary[dbName];