0

I'm working on a legacy where some fields uses special encodings. Is it somehow possible to set an decode the fields in the linq instead of doing as I'm doing now:

XisoEncoding enc = new XisoEncoding()

var q = from b in ent.Basket
            where b.ID == 22038
            select b;

Basket basket = query.First();
basket.STOMAN_MESSAGE = enc.DecodeString(basket.STOMAN_MESSAGE);

.....
1
  • yes, the STOMAN_MESSAGE value is a database retrieved field Commented Nov 6, 2009 at 9:49

1 Answer 1

1

Entity classes are defined as partial classes. You could add a new property to the Basket class, for example DecodedStomanMessage, which returns the decoded message.

I would not modify the STOMAN_MESSAGE property itself, since this will mark the entity as modified, and you could end up sending the decoded version back to the database.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.