Skip to content

Latest commit

 

History

74 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Be.Vlaanderen.Basisregisters.AspNetCore.Mvc.ModelBinding.GuidHeader Build Status

An MVC ModelBinder for GUID type or GUID as string, which also looks in the header.

Usage

[AttributeUsage(AttributeTargets.Parameter | AttributeTargets.Property)]
public class FromCommandIdAttribute : Attribute, IModelNameProvider, IBinderTypeProviderMetadata
{
    public BindingSource BindingSource => BindingSource.Header;

    public string Name => "CommandId";

    public Type BinderType => typeof(GuidHeaderModelBinder);
}

Controller

public async Task<IActionResult> Post(
            [FromCommandId] Guid commandId,
            [FromBody] ...,
            CancellationToken cancellationToken)
{
    ...
}

About

An MVC ModelBinder for GUID type or GUID as string, which also looks in the header.

Topics

Resources

Stars

1 star

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages