Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9017765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:21:21+00:00 2026-06-16T04:21:21+00:00

Imagine you have a method on the server side, in one of your entities

  • 0

Imagine you have a method on the server side, in one of your entities Repository.

This method INSERTS or UPDATES Foo entities in the Db.

And you need to name this method.

From the naming convention point of view, can you explain the differences -if there is- between those names:

  • SaveFoo(Foo foo)
  • PersistFoo(Foo foo)
  • CreateFoo(Foo foo)
  • SaveOrUpdate(Foo foo)

Or what is the naming convention for such methods that only INSERTS or UPDATES to Db?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:21:22+00:00Added an answer on June 16, 2026 at 4:21 am

    If you work in a team, you should first try to find out if there is a convention there, as it’s usually more important to be consistent than to find the absolute best name for something.

    Using Save or Persist would work, as they don’t imply anything about the previous state.

    Using Create would imply that the item doesn’t already exists, i.e. an insert.

    Using SaveOrUpdate could be somewhat confusing, as Update implies that the item already exists, but Save doesn’t imply anything about the state, so they overlap.

    Perhaps InsertOrUpdate would be an alternative, or CreateOrUpdate. Either would work as Insert and Create implies that the item doesn’t exist yet, and Update implies that it does exist, so they don’t overlap. They are also more precise than Save or Persist, as the names specifically say that they handle both insert and update.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Imagine we have a server side application that generates streaming content full of JavaScript
Imagine I have a method: void Method(bool parameter){ if(parameter){ // first case } else
Imagine you have class A which has code which runs as method M. And
Imagine I have following table: NAME DATE OTHER_CONTANT 'A' '2012-06-05' 'baz' 'A' '2012-06-04' 'bar'
Imagine I have this table: Column A | Column B | Column C ------------------------------
Imagine you have an entity that has some relations with other entities and you
Imagine you have Listener class that will connect on app start to some server
I have a server which feeds several applications. Please imagine that I'm a user
Imagine I have a C# app sitting on a server somewhere that is creating
Imagine I have a method having a contract : public void Do(string value) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.