public async Task <LoginUserLicensesResult> SaveAsync(string SessionKey, int CompanyId, string[] LicenseKeys) { return(await authorizationProcessor.DoAuthorizeAsync(SessionKey, async token => { var licenses = LicenseKeys.Select(x => new LoginUserLicense { CompanyId = CompanyId, LicenseKey = x }).ToArray(); var result = (await loginUserLicenseProcessor.SaveAsync(licenses, token)).ToList(); return new LoginUserLicensesResult { ProcessResult = new ProcessResult { Result = true }, LoginUserLicenses = result }; }, logger)); }
public async Task <ActionResult <IEnumerable <LoginUserLicense> > > Save(IEnumerable <LoginUserLicense> licenses, CancellationToken token) => (await loginUserLicenseProcessor.SaveAsync(licenses, token)).ToArray();