5 Replies - 484 Views - Last Post: 20 October 2017 - 09:41 AM Rate Topic: -----

#1 t3cho  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 222
  • Joined: 27-May 14

crued operations with class ( OOP )

Posted 19 October 2017 - 12:03 PM

Hey guys I'm new in C# programing which means I'm still learning it.

Now i'm looking for best class which i can use for basic CRUED operations ( Insert, Update, Delete ) on MS SQL server.

If you have some class you use i would love to see how you make it. For now as best solution i have so far is from this link https://dotnetdaily....lete-operations

Is it a good habbit to use property for each table field ?? Or it would be better to pass those values through parameters collections . ?

Anyway i would love to see classes you use as example.

Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: crued operations with class ( OOP )

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13482
  • View blog
  • Posts: 53,820
  • Joined: 12-June 08

Re: crued operations with class ( OOP )

Posted 19 October 2017 - 12:34 PM

I typically use C# variants of these:
http://www.dreaminco...-adapter-setup/
http://www.dreaminco...-command-setup/
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5884
  • View blog
  • Posts: 20,086
  • Joined: 05-May 12

Re: crued operations with class ( OOP )

Posted 19 October 2017 - 07:44 PM

View Postt3cho, on 19 October 2017 - 03:03 PM, said:

Is it a good habbit to use property for each table field ?? Or it would be better to pass those values through parameters collections . ?


No. If you are writing truly object oriented code, your data access layer will only take domain objects as inputs and outputs. It will completely encapsulate the data persistence implementation. You should be able to tell, or even care, if the DAL is saving to one table, multiple tables, to a flat file, to a key-value store, or a real object database. So in short, your object won't necessarily have fields that map directly to a table.
Was This Post Helpful? 0
  • +
  • -

#4 t3cho  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 222
  • Joined: 27-May 14

Re: crued operations with class ( OOP )

Posted 20 October 2017 - 04:51 AM

If i understood well i should bypass those mapping with all table fields and proceed with other option. Sql parameter collections.

Do you have some class as example ? Doesn't have to be for demo purpose
Was This Post Helpful? 0
  • +
  • -

#5 tlhIn`toq  Icon User is offline

  • Xamarin Cert. Dev.
  • member icon

Reputation: 6507
  • View blog
  • Posts: 14,372
  • Joined: 02-June 10

Re: crued operations with class ( OOP )

Posted 20 October 2017 - 09:26 AM

I'm not taking a dig... I'm wondering if this is a new/updated term: CRUED

I'm old enough to know it as CRUD - Create Read Update Delete

Is there are new workflow that is 'E' ?
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 5884
  • View blog
  • Posts: 20,086
  • Joined: 05-May 12

Re: crued operations with class ( OOP )

Posted 20 October 2017 - 09:41 AM

At first I though that the OP was just a poor speller like me. But apparently, CRUDE, CRUET, CRAFT and CURDLE are acronyms for operations, too. I'm old school and only know about CRUD as well.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1