/// <inheritdoc /> public override int GetHashCode() { unchecked { return(((InvitationLink is null ? 0 : InvitationLink.GetHashCode()) * 397) ^ (InvitationCode is null ? 0 : InvitationCode.GetHashCode())); } }
public async Task <AddResult> AddInvitationLink( InvitationLink link ) { try { db.InvitationLinks.Add(link); await db.SaveChangesAsync(); return(AddResult.Success); } catch (DbUpdateException) { return(AddResult.Forbidden); } }
public string AdminInvitationLink(int systemUserId) { var systemUser = _systemUserRepository.GetFirstOrDefault(predicate: a => a.SystemUserId == systemUserId); var randomUrl = RandomString(5); var model = new InvitationLink() { CreatedBy = systemUser.SystemUserId, BusinessID = systemUser.BusinessId, SystemUserID = systemUser.SystemUserId, CreatedOn = DateTime.UtcNow, InvitationType = 4, UniqueUrl = randomUrl }; _invitationLinkRepository.Insert(model); _unitOfWork.SaveChanges(); return(randomUrl); }