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.

The role of ToString()

M# uses ToString() in a similar way to the standard ToString() function of a C# object, allowing a specific format to be defined, as needed for your application, but adds some features on top of this.
Generated Web pages can use this function in some cases, for example this will be the text displayed in dropdown lists or used to search for a text. We will exaplin in detail all these features in subsequent chapters.


To implement ToString(), open your Entity in M# and select the attribute "To string expression". At this point, if the value is simple, you can specify the value directly, or for more complex requirements, specify a function.

Generated code

ToString() will have no effect on the database column definition.
 A standard ToString() function will be written in your C# file.