コード例 #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
ファイル: Mapper.cs プロジェクト: shland0omax/EPAM_Project
 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);
 }
コード例 #4
0
 public CommentBL([Dependency("Db")]IDalEntity<Comment> iCommentDal)
 {
     _iCommentDal = iCommentDal;
 }
コード例 #5
0
 public CategoryBL([Dependency("Db")]IDalEntity<Category> iDalCategory)
 {
     _iDalCategory = iDalCategory;
 }
コード例 #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;
 }