Hi @sedulen - Brian
I really appreciate for sparing time and writing well detailed solution. I will check and try to implement that.If anything goes wrong I will write again.
Thanks
@musa.demir
User clickes on link which is going to public page on my site, I get token from the URL and pass it to API as parametere. In the Api, I decode the hash and get required data from it.
That is simple api which accept a string as aparameter. What I am asking is how to rewrite whole process to make it more OOP.
public async Task<PagedResultDto<DocumentSharedObject>> GetRelatedDocuments(string token, GetAllRelatedDocumentsInput input)
{
//validate token
RentalApplicationApplicantFormToken parsedToken = new RentalApplicationApplicantFormToken();
try
{
parsedToken = _aESEncryptionManager.ValidateAndParseToken(token);
}
catch (Exception)
{
throw new UserFriendlyException(400, L("InvalidToken"));
}
//set tenant Id
using (_unitOfWorkManager.Current.SetTenantId(parsedToken.TenantId))
{
//Continue
}
}
Actually my question is for writing better code based on Zero logic.