A5.1 Security: Authorization. Steps of adding Authorization to the application (Wpf, Xamarin) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki

The steps are the same as for adding regular Entities, Views, WebApi Services, user interface and Features using CS2WPF. An insignificant difference is that some WebApi services and some Entities have already been implemented in AspNet WebApi application. For instance, individual AspNet security includes Users and Roles.

CS2WPF includes generator scripts to create predefined Entities, Dbcontext. The developer does not need to manually define "UIforms" and "UIlists", but rather import the definition from a custom json file.

Here's how to find such a json file.

At first, we have to find the folder of installed CS2WPF files. To do this run File explorer and type "%appdata%" and press Enter.

picture

Then go to "%appdata%\local"

picture

At the end open the folder "%appdata%\Local\Microsoft\VisualStudio\XXX\Extensions\YYY", where "XXX" and "YYY" are the names that were defined during the CS2WPF installation and may differ from those shown in the figure below. This is the folder where CS2WPF was installed.

picture

Inside the folder where CS2WPF was installed open "Templates\ContextsToImport"-folder and copy "aspnetchckdbcontext.json"-file. Paste "aspnetchckdbcontext.json"-file to your desktop or another place, which will then be easy to navigate. "aspnetchckdbcontext.json"-file will be used to import View definitions.

picture