doc/articles/guides/silverlight-migration/98-timeentry-samples.md
The sample application is made up of 3 solutions containing multiple projects and has a dependency on a SQL database. The source for the app can be found in the Uno.Platform Samples repository:
https://github.com/unoplatform/Uno.Samples
There are 3 solutions:
The applications rely upon the existence of a SQL database. Within the TimeEntryServices solution is a folder that contains a SQL Script that will create the tables and seed the database with sample data.
The following steps outline the approach to create the database and update the TimeEntryApi project to access it.
Open SQL Server management tools and create a database named TimeEntry.
Load the TimeEntryServices\Database\CreateTablesAndData.sql and execute.
The script will take a few minutes to complete.
The database schema looks like this:
Update the database security as required - i.e. add the current user as owner, configure sa, etc.
Once the database is created, populated, and security is configured, the TimeEntryApi project must be updated to use the correct connection string.
Open the TimeEntryApi project.
Open the Models\TimeEntryContext.cs file.
Locate the OnConfiguring method and update the connection string as required.
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
if (!optionsBuilder.IsConfigured)
{
optionsBuilder.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=TimeEntry;Trusted_Connection=True;");
}
}
In order to run the app, both server projects must be running as well as the client. The TimeEntryServices solution is configured to launch both the IdentityServer and TimeEntryApi projects. These web projects are configured to "self-host" so have no dependency on IIS, etc. Once the server projects are running, the client solution TimeEntryUno, configured to run as UWP or WASM, can be launched.
The TimeEntryRia sample is a Visual Studio 2015 solution and is, of course, dependent on the TimeEntry database. Here is the Visual Studio configuration:
Open the TimeEntryRia solution in Visual Studio 2012.
Within the TimeEntryRia.Web project, locate and open the Web.config file.
Scroll to the bottom of the Web.Config file to locate the connection string. Update as required.
<connectionStrings>
<add name="TimeEntryEntities"
connectionString="metadata=res://*/TimeEntryModel.csdl|res://*/TimeEntryModel.ssdl|res://*/TimeEntryModel.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;initial catalog=TimeEntry;integrated security=True;multipleactiveresultsets=True;App=EntityFramework""
providerName="System.Data.EntityClient" />
</connectionStrings>
In order to execute the Silverlight application, the Silverlight 5 SDK must be installed and Internet Explorer 11 must be configured as your default browser. The app can be run by launching from Visual Studio 2012