Skip to content

How to indicate that specific entity attribute is not to be updated? #114

@arangari

Description

@arangari

I would like to know if we can define if specific attribute of the entity is not to be updated.
eg.
public class myclass {
public string col1;
public string col2;
publict int col3;
myclass () { col1 = col2 = string.Empty, col3 = 0}
}

I receive myclass object in through post/put request. I know that col3 is set to 0 by default. However while updating the db, i do not want to update col3 value if entity already exists.

can i define something like
updategraph(myclass_obj, map=> map.donotmodify(obj=>obj.col3) )

if so, can we do something as below:

foo(myclass entity, Expression<> dontmodify)
{
updategraph(entity, mm=>mm.OwnerCollection().AddToMap(dontmodify))
}

where AddToMap adds into the the maps of IUpdateconfiguration.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions