question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

linq2db.aspnet configuration

See original GitHub issue

Hi,

I’m trying migrate my configurations to linq2db.aspnet and I use custom mapping schema convertors. Which options are there?

before:

MappingSchema.Default.SetConverter<string, JArray>(JsonConvert.DeserializeObject<JArray>);
services.AddLinqToDbContext<BrandCloudDb>((provider, options) =>
{
  var schema = new MappingSchema();
  schema.SetConverter<string, JArray>(JsonConvert.DeserializeObject<JArray>);

  options
    .UseSqlServer(Configuration.GetConnectionString("BcConnection"))
    .UseDefaultLogging(provider)
    .UseMappingSchema(schema);
});

Is there better solutions or is it right?

Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
sdanylivcommented, Dec 3, 2020

What is the problem? You have created new MappingSchena, defined converter. This is right way.

0reactions
sdanylivcommented, Dec 3, 2020

Don’t forget to cache mapping schema. Otherwise you will slowdown your queries.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configuring LINQ To DB for ASP.NET Core
Configuring LINQ To DB for ASP.NET Core. Available since: 3.0.0-rc.0. In this walkthrough, you will configure an ASP.NET Core application to access a...
Read more >
linq2db.AspNet 4.0.0-preview.5
LINQ to DB ASP.NET Core Extensions adds ability to configure ASP.NET Core application for Linq To DB usage.
Read more >
GitHub - linq2db/linq2db: Linq to database provider.
This method lets you configure your mapping dynamically at runtime. Furthermore, it lets you to have several different configurations if you need so....
Read more >
c# - linq2db exception: "Configuration string is not provided ...
I keep getting the error when I run a test which uses linq2db: LinqToDB.LinqToDBException : Configuration string is not provided. I guess it's ......
Read more >
[Fix]-How could i manage multiple database in linq2db
How to configure multiple ASPNETCORE_ENVIRONMENT on same machine? How can you use multiple directories for static files in an aspnet core app? How...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found