public tblT_Cost CreateFromDTO(CostDTO costDTO, DateTime dateStamp) { if (costDTO == null) { throw new ArgumentNullException("Cost model is null."); } costDTO.Status_FK = (int)RecordStatus.Active; costDTO.CreatedBy = User.Username; costDTO.CreatedDate = dateStamp; costDTO.UpdatedBy = User.Username; costDTO.UpdatedDate = dateStamp; tblT_Cost cost = costDTO.ToObject <tblT_Cost>(); return(cost); }