Пример #1
0
        public static CoreModel DbEntityToCoreModel(this DbEntity dbEntity)
        {
            CoreModel coreModel = new CoreModel()
            {
                Id        = dbEntity.Id,
                FirstName = dbEntity.FirstName,
                LastName  = dbEntity.LastName,
                Username  = dbEntity.Username,
                Password  = dbEntity.Password,
                Location  = dbEntity.Location,
                Interests = dbEntity.Interests,
                Gender    = (bool)dbEntity.Gender,
                About     = dbEntity.About
            };

            return(coreModel);
        }
Пример #2
0
        public static DbEntity CoreModelToDbEntity(this CoreModel coreModel)
        {
            DbEntity dbEntity = new DbEntity()
            {
                FirstName = coreModel.FirstName,
                LastName  = coreModel.LastName,
                Username  = coreModel.Username,
                Password  = coreModel.Password,
                Id        = coreModel.Id,
                PhotoId   = coreModel.Photo.Id,
                Location  = coreModel.Location,
                About     = coreModel.About,
                Interests = coreModel.Interests,
                Gender    = coreModel.Gender
            };

            return(dbEntity);
        }