M# Tutorials

Learn to build .NET applications with M#. Our step-by-step tutorials will get you up-to-speed rapidly.
If you already know ASP.NET and C#, you can master M# in a week or two.

Number Property

M# Number is a high level representation of a number.
By adding a Numeric property, M# will generate a standard C# int/double property with its XML documentation.
M# gives you flexibility by using some specific Numeric attributes allowing you to change the behaviour in your C# logic or the generated SQL code.

Creation

When typing the numeric property, M# displays a list of different types:

  • Integer
  • Double: Double precision number
  • Money: Amount
  • Percentage: Rate
  • Auto number: Auto incremented number

Attributes

Is currency

The currency attribute automatically displays the currency symbol next to the amount in all M# generated UIs. It has no effect on the database column definition or the generated C# class.

Is percentage

The percentage attribute automatically displays the percentage symbol next to the number in all M# generated UIs. It has no effect on the database column definition or the generated C# class.

Lower bound

Lower bound will have no effect on the database column definition.
That will only add a new validation rule to your entity to make sure that the number entered is not less than your value.
For example if the user must be 25 or older, you can set this attribute to 25.

Use this attribute with "Upper bound" to specify a range for the value.

Scale

Scale represents the precision of the number. The generated C# Type will be a Double and the SQL column type a numeric(27,2) if your scale is 2.

Upper bound

Upper bound will have no effect on the database column definition.
Instead a new validation rule will be added to your entity to make sure that the number entered is not more than your value.
For example if the user must be a maximum of 60 years old, you can set this attribute to 60.

Use this attribute with "Lower bound" to specify a range for the value.