Skip to content

Add ExecuteSectionAsync methods to ILogManager #836

@YevgeniyShunevych

Description

@YevgeniyShunevych

In addition to ExecuteSection methods of ILogManager new async method versions are added:

Task ExecuteSectionAsync(LogSection section, Func<Task> function);

Task<TResult> ExecuteSectionAsync<TResult>(LogSection section, Func<Task<TResult>> function);

Usage

await AtataContext.Current.Log.ExecuteSectionAsync(
    new LogSection("Do some async work without result"),
    async () =>
    {
        //...
    });

var result = await AtataContext.Current.Log.ExecuteSectionAsync(
    new LogSection("Do some async work with result"),
    async () =>
    {
        return await SomeActionAsync();
    });

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions