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); }
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); } }