Skip to content

How to configure in Minimal API #131

@AhmedMa3rouf

Description

@AhmedMa3rouf

how i can configure .net 6 (Minimal API) to use the JsonApiSerializer as a default Json format??
i can set it in each map but i want to set it as an default format

this is will working
app.MapGet("/GetAll", async (AppDBContext db) =>
JsonConvert.SerializeObject(await db.Banks.ToArrayAsync(), new JsonApiSerializerSettings()));

but the output is a text not json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions