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.

Data Source

In this lesson we will take a look on the data source property of the list module. The data source property of the list module expects a collection type object of the list module entity. If no data source is defined M# fetches all the record of the related entity from database.

In this lesson we have a list module on entity “Employee” and we have implemented static methods to get all the Employee records. M# discourages calling Database methods directly in module attributes and advises the use of business logic.

On providing a custom data source, M# generates the overridden “GetBaseDataSource” method, which returns the given data source. The retuned object from this method is used in data binding. This method is also very useful when implementing data filters and list searching.