Exemplo n.º 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);
     }
 }
Exemplo n.º 2
0
 public static IOrmEntity ToOrm(IDalEntity entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException(nameof(entity));
     }
     return(ToOrm((dynamic)entity));
 }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
 public CommentBL([Dependency("Db")]IDalEntity<Comment> iCommentDal)
 {
     _iCommentDal = iCommentDal;
 }
Exemplo n.º 5
0
 public CategoryBL([Dependency("Db")]IDalEntity<Category> iDalCategory)
 {
     _iDalCategory = iDalCategory;
 }
Exemplo n.º 6
0
 public ArticleBL([Dependency("Db")]IDalEntity<Article> iArticleDal, [Dependency("Db")]IDalEntity<Comment> iCommentDal, [Dependency("Db")]IDalEntity<Category> iCategoryDal)
 {
     _iArticleDal = iArticleDal;
     _iCommentDal = iCommentDal;
     _iCategoryDal = iCategoryDal;
 }