コード例 #1
0
        private Certification CertificationFromDto(CertificationDto dto)
        {
            Certification cert = new Certification();

            cert.CreatedDate = dto.CreatedDate;
            cert.Description = dto.Description;
            cert.Expiry      = dto.Expiry;
            cert.User        = this;
            cert.UserId      = Id;

            return(cert);
        }
コード例 #2
0
        public async Task <Certification> AddCertification(CertificationDto cert, UserManager <ApplicationUser> _userManager)
        {
            Certification certification = CertificationFromDto(cert);

            Certifications.Add(certification);

            Task <IdentityResult> result = _userManager.UpdateAsync(this);

            if (result.Result.Succeeded)
            {
                return(certification);
            }
            else
            {
                return(null);
            }
        }