Skip to content

Instantly share code, notes, and snippets.

@xperiandri
Last active December 5, 2020 08:03
Show Gist options
  • Save xperiandri/3fe6ef563ecc0e9e44ec4212a7d6ac6e to your computer and use it in GitHub Desktop.
Save xperiandri/3fe6ef563ecc0e9e44ec4212a7d6ac6e to your computer and use it in GitHub Desktop.
let asyncGetGrupo (ctx : ResolveFieldContext) _ = asyncResult {
let container = ctx.Root.BibliotekoDatabase.GrupojContainer
let! grupoId = ctx.ArgId
return! asyncGetGrupo container grupoId |> AsyncResult.mapError ErrorMappings.mapGrupoError
}
public Task<Grupo> GetGrupoAsync(ResolveFieldContext: ctx, Root: _)
{
var cointainer = ctx.Root.BibliotekoDatabase.GrupojContainer;
Guid grupoId = ctx.ArgId ?? throw new ArgumentNullException("id");
return await GetGrupoAsync(container, grupoId);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment