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.

[Proposal] API redesign discussion

See original GitHub issue

API design proposal, as mentioned in PR #15 This would make the API designs more semetically pretty.

dbContext.Items.UpsertRange(newItems)
    .OnConflict(x => x.IdentitcalField)
    .DoUpdate((matched, newItem) => new Item()
    {
        Field = newItem.Field,
		Visit = matched.Visit + 1
    });
dbContext.Items.UpsertRange(newItems)
    .OnConflict(x => x.IdentitcalField)
    .DoUpdateAsync((matched, newItem) => new Item()
    {
        Field = newItem.Field,
		Visit = matched.Visit + 1
    });
dbContext.Items.UpsertRange(newItems)
    .OnConflict(x => x.IdentitcalField)
    .DoUpdate();
dbContext.Items.UpsertRange(newItems)
    .OnConflict(x => x.IdentitcalField)
    .DoUpdateAsync();
dbContext.Items.UpsertRange(newItems)
    .OnConflict(x => x.IdentitcalField)
    .DoNothing();
dbContext.Items.UpsertRange(newItems)
    .OnConflict(x => x.IdentitcalField)
    .DoNothingAsync();

// Infer the match fields to detected primary keys or alternative keys,
// this would make OnConflict funcional call optional
dbContext.Items.UpsertRange(newItems);
dbContext.Items.UpsertRangeAsync(newItems);

@artiomchi

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
LonghronShencommented, Sep 6, 2018

OK, good timing…

0reactions
artiomchicommented, Sep 19, 2018

This has now been released in 2.0.0, including referencing elements from the “inserted” set

Read more comments on GitHub >

github_iconTop Results From Across the Web

API Design, Proposal and Evaluation
There is no "recipe" for designing or evaluating an API. An API is a clean, clear expression of a set of behaviors and...
Read more >
Proposal for API Redesign · Issue #435
The aim of this issue is to discuss a redesign of the current API that will able us to: 1. Be more concise...
Read more >
Package Manager Manifest API Redesign - swift-evolution
This is a proposal for redesigning the Package.swift manifest APIs provided by Swift Package Manager. This proposal only redesigns the existing public APIs...
Read more >
API Design Reviews Are Dead. Long Live API Design Reviews!
For any new API proposed, a functional overview with use cases and basic naming should be reviewed as early as possible. This ensures...
Read more >
Proposal: The Interactivity API – A better developer ...
The API's design is open to debate, and any feedback is key to ensuring the Interactivity API accounts for the entirety of WordPress'...
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