/// <summary>
  /// Converts the dto to entities.
  /// </summary>
  /// <param name="_EmployeePayHistoryDto">The EmployeePayHistory dto</param>
  /// <param name="efEmployeePayHistory">已存在的EmployeePayHistory EF model</param>
  /// <returns>EmployeePayHistory</returns>
 public EmployeePayHistory ConvertDtoToEntities(EmployeePayHistoryDto _EmployeePayHistoryDto, EmployeePayHistory efEmployeePayHistory)
 {
      if (_EmployeePayHistoryDto==null && efEmployeePayHistory==null)
      {
           throw new ArgumentNullException("models should not be null");
      }
       ConvertObject(_EmployeePayHistoryDto, efEmployeePayHistory);
       return efEmployeePayHistory;
 }
          /// <summary>
          /// Converts the dto to entities.
          /// </summary>
          /// <param name="_ EmployeePayHistoryDto">The  EmployeePayHistory dto.</param>
          /// <param name="ef EmployeePayHistory">已存的EntityFramework实体 ef EmployeePayHistory</param>
          /// <param name="skipNullPropertyValue">if set to <c>true</c> [skip null property value].</param>
          /// <returns>EmployeePayHistory</returns>
        public EmployeePayHistory ConvertDtoToEntities(EmployeePayHistoryDto _EmployeePayHistoryDto, EmployeePayHistory efEmployeePayHistory, bool skipNullPropertyValue)
        {
               if (_EmployeePayHistoryDto==null && efEmployeePayHistory==null)
               {
                    throw new ArgumentNullException("models should not be null");
               }
 
              ConvertObjectWithCheckNull(_EmployeePayHistoryDto, skipNullPropertyValue, efEmployeePayHistory);
              return efEmployeePayHistory;
        }
예제 #3
0
        public void TransformEmployeePayHistory()
        {
            var adapter = new TypeAdapter();
            var eph = new EmployeePayHistory()
            {
                EmployeeID = 1,
                ModifiedDate = DateTime.Now
            };
            var dto = adapter.Transform<EmployeePayHistory, EmployeePayHistoryDto>(eph);

            Assert.Equal(1, dto.EmployeeID);
        }
 public void TestEmployeePayHistoryRepositoryDelete(EmployeePayHistory _EmployeePayHistory)
 {
     var _EmployeePayHistoryRepository = RepositoryHelper.GetEmployeePayHistoryRepository();
    _EmployeePayHistoryRepository.Repository.Delete(_EmployeePayHistory);
    _EmployeePayHistoryRepository.Save();
 }
 public void TestEmployeePayHistoryRepositoryAdd(EmployeePayHistory _EmployeePayHistory)
 {
     var _EmployeePayHistoryRepository = RepositoryHelper.GetEmployeePayHistoryRepository();
     _EmployeePayHistoryRepository.Add(_EmployeePayHistory);
     _EmployeePayHistoryRepository.Save();
 }
  private static void ConvertObjectWithCheckNull(EmployeePayHistoryDto _EmployeePayHistoryDto, bool skipNullPropertyValue, EmployeePayHistory efEmployeePayHistory)
  {
       efEmployeePayHistory.EmployeeID=_EmployeePayHistoryDto.EmployeeID;
            efEmployeePayHistory.RateChangeDate=_EmployeePayHistoryDto.RateChangeDate;
            efEmployeePayHistory.Rate=_EmployeePayHistoryDto.Rate;
            efEmployeePayHistory.PayFrequency=_EmployeePayHistoryDto.PayFrequency;
            efEmployeePayHistory.ModifiedDate=_EmployeePayHistoryDto.ModifiedDate;
 
    }
 public EmployeePayHistoryDto ConvertEntitiesToDto(EmployeePayHistory _EmployeePayHistory)
 {
     return new EmployeePayHistoryDto();
 }
 public EmployeePayHistory ConvertDtoToEntities(EmployeePayHistoryDto _EmployeePayHistoryDto, EmployeePayHistory efEmployeePayHistory)
 {
     return new EmployeePayHistory();
 }
 public EmployeePayHistory ConvertDtoToEntities(EmployeePayHistoryDto _EmployeePayHistoryDto, EmployeePayHistory efEmployeePayHistory, bool skipNullPropertyValue)
 {
     return new EmployeePayHistory();
 }
 private static void ConvertObject(EmployeePayHistoryDto _EmployeePayHistoryDto, EmployeePayHistory efEmployeePayHistory)
 {
     efEmployeePayHistory.EmployeeID=_EmployeePayHistoryDto.EmployeeID; 
        efEmployeePayHistory.RateChangeDate=_EmployeePayHistoryDto.RateChangeDate; 
        efEmployeePayHistory.Rate=_EmployeePayHistoryDto.Rate; 
        efEmployeePayHistory.PayFrequency=_EmployeePayHistoryDto.PayFrequency; 
        efEmployeePayHistory.ModifiedDate=_EmployeePayHistoryDto.ModifiedDate; 
    }
        /// <summary>
        /// Converts the entities to dto.
       /// </summary>
       /// <param name="_EmployeePayHistory">The EmployeePayHistory entity</param>
       /// <returns>EmployeePayHistoryDto</returns>
      public EmployeePayHistoryDto ConvertEntitiesToDto(EmployeePayHistory  _EmployeePayHistory)
     {
           if (_EmployeePayHistory==null)
           {
                    throw new ArgumentNullException("models should not be null");
           }
 
          var _EmployeePayHistoryDto =new EmployeePayHistoryDto();
                      _EmployeePayHistoryDto.EmployeeID=_EmployeePayHistory.EmployeeID; 
               _EmployeePayHistoryDto.RateChangeDate=_EmployeePayHistory.RateChangeDate; 
               _EmployeePayHistoryDto.Rate=_EmployeePayHistory.Rate; 
               _EmployeePayHistoryDto.PayFrequency=_EmployeePayHistory.PayFrequency; 
               _EmployeePayHistoryDto.ModifiedDate=_EmployeePayHistory.ModifiedDate; 
              return _EmployeePayHistoryDto;
     }
		/// <summary>
        /// Deletes the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
		public void Delete(EmployeePayHistory entity)
		{
			Repository.Delete(entity);
		}
		 /// <summary>
        /// Attaches the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
		public void Attach(EmployeePayHistory entity)
		{
		    Repository.Attach(entity);
		}
		 /// <summary>
        /// Adds the specified entity.
        /// </summary>
        /// <param name="entity">The entity.</param>
		public void Add(EmployeePayHistory entity)
		{
			Repository.Add(entity);
		}