简体   繁体   中英

How do I Calulate the Sum of several “Money” Columns in a computed property in Lightswitch C#?

I am developing a Lightswitch Application and in one of the Entities I have several currency type properties and I would like to add them all up in one calculated property using C#. For instance:

I have 3 columns Amount1 Amount2 Amount3 And would like the total sum of the 3 fields.

With result = Amount1 + Amount2 + Amount3

The field will compute only if none of the fields have a null value.

Make your field / property Required it wil automaticly initialise: 0

Note:In the latest versions of Lightswitch there is no more Money field: no more hastle

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM