An issue with modifying the value of an object in EF ... (When the field is super many)

Source: Internet
Author: User

The general EF modifies the value of a single object, which is how I handle it.

such as: DBEntities db=new dbentities ();

Student Stu = Db.student.firstOrdefault (m=>m.id==id);

Stu.name= "SB";

stu.age=11;

......

Db. SaveChange ();

If there are fewer fields, there is no problem (there seems to be a modified method in EF, regardless of it).

What if 200 fields? Are you going to go to a. Attribute?

I can solve this problem with reflection. Concrete method See younger brother before writing essays (clone What, what deep copy, shallow copy of the trial under unsuccessful. Do not know whether to open the wrong way)

Other solutions please the great God to enlighten you!

An issue with modifying the value of an object in EF ... (When the field is super many)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.