Beispiel #1
0
        /// <summary>
        /// Converts this instance of <see cref="ClientDTO"/> to an instance of <see cref="Client"/>.
        /// </summary>
        /// <param name="dto"><see cref="ClientDTO"/> to convert.</param>
        public static Client ToEntity(this ClientDTO dto)
        {
            if (dto == null)
            {
                return(null);
            }

            var entity = new Client();

            entity.ClientID  = dto.ClientID;
            entity.FirstName = dto.FirstName;
            entity.LastName  = dto.LastName;

            dto.OnEntity(entity);

            return(entity);
        }