HappYness-Project / Happy-EventSourcing

Event sourcing
10 stars 1 forks source link

Remove Duplicated/Unnecessary properties from the HP solution #64

Closed hyunbin7303 closed 1 year ago

hyunbin7303 commented 1 year ago

Since we are going to keep the user secure data within the Identity service, we don't need to keep those in HP service. Find duplicated properties and remove it.

hyunbin7303 commented 1 year ago
    public record Email
    {
        public Email(string emailAddr)
        {
            if (string.IsNullOrWhiteSpace(emailAddr))
                throw new ArgumentNullException(nameof(emailAddr));

            if (!emailAddr.Contains('@'))
                throw new ArgumentException($"Invalid email address: {EmailAddr}", nameof(EmailAddr));

            EmailAddr = emailAddr;
        }

        public string EmailAddr { get; }
        public override string ToString() => this.EmailAddr;
    }