示例#1
0
 public static IORMEntity ToOrm(this IDalEntity entity)
 {
     if (entity is DalAnswer)
     {
         return((entity as DalAnswer).ToOrmAnswer());
     }
     else if (entity is DalUniversityInfo)
     {
         return((entity as DalUniversityInfo).ToOrmUniversityInfo());
     }
     else if (entity is DalRole)
     {
         return((entity as DalRole).ToOrmRole());
     }
     else if (entity is DalTest)
     {
         return((entity as DalTest).ToOrmTest());
     }
     else if (entity is DalTestType)
     {
         return((entity as DalTestType).ToOrmTestType());
     }
     else if (entity is DalUser)
     {
         return((entity as DalUser).ToOrmUser());
     }
     else if (entity is DalMaterial)
     {
         return((entity as DalMaterial).ToOrmMaterial());
     }
     else
     {
         return(null);
     }
 }
示例#2
0
 public static IOrmEntity ToOrm(IDalEntity entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(nameof(entity));
     }
     return(ToOrm((dynamic)entity));
 }
示例#3
0
 public static void CopyToOrm(this IDalEntity dal, IORMEntity orm, DbContext context)
 {
     if (dal is DalUser && orm is User)
     {
         (dal as DalUser).CopyToOrmUser((User)orm, context);
     }
     //else if (dal is DalTest && orm is Test)
     //    (dal as DalTest).CopyToOrmTest((Test)orm, context);
 }
 public CommentBL([Dependency("Db")]IDalEntity<Comment> iCommentDal)
 {
     _iCommentDal = iCommentDal;
 }
 public CategoryBL([Dependency("Db")]IDalEntity<Category> iDalCategory)
 {
     _iDalCategory = iDalCategory;
 }
 public ArticleBL([Dependency("Db")]IDalEntity<Article> iArticleDal, [Dependency("Db")]IDalEntity<Comment> iCommentDal, [Dependency("Db")]IDalEntity<Category> iCategoryDal)
 {
     _iArticleDal = iArticleDal;
     _iCommentDal = iCommentDal;
     _iCategoryDal = iCategoryDal;
 }