Home - MookieRah/TeamRocket GitHub Wiki

Welcome to the TeamRocket wiki!

Database related:

Seeding:

The seeding is initiated from Webbsida.Models.ApplicationDbContext constructor, with this line: Database.SetInitializer(new AgilaMetoderProjektDbInitializer());

AgilaMetoderProjektDbInitializer.cs

  1. To make the database recreate itself with fresh seeded data EVERY time you test the page, uncomment the line inheriting "DropCreateDatabaseAlways". (REMEMBER to close all open connections to the database, including open tabs with database-data!)

  2. To make it recreate itself as above ONLY when the db-model changes, uncomment the line inheriting "DropCreateDatabaseIfModelChanges". The result of this is that you can persist data in the db between different test runs!

  3. Feel free to change the amount of Profiles, Events and EventSignups (called EventProfiles in the code) being seeded by setting the respective integer, for example: var profiles = Builder.CreateListOfSize(667).

Seeded User-accounts

The accounts [email protected]/password and [email protected]/password is always seeded, with corresponding ASP.NET.IDENTITY ROLES. Their profiles will be any one of the randomly created.

web.config

The uiCulture and culture is forced to en-US at the moment (makes it easier to work with coordinates for example).

The new connection string should work for more cases.

<add name="Webbsida" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=Webbsida;Integrated Security=True" providerName="System.Data.SqlClient" />

GeoLocation:

To use the geoScriptsV2.js in your view, follow these 2 steps:

First, Add a section scripts, like so:

@section Scripts {<script async defer src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBlemvE5X2QVIkrj0r4r_rJkLRilNdK9xg&callback=GoogleMapsEventController.initSingleEventDisplayingMap"></script>}

UPDATE: No need to include a script-tag for geoScriptsV2.js any more, as it is bundled and included in every view using section scripts! (yes, copy the code above, this note refers to an earlier version of the wiki)

NOTE: you choose which functionality you want to use in the src above, after "callback="

Possible choices:

GoogleMapsEventController.initAllEventsDisplayingMap GoogleMapsEventController.initSingleEventDisplayingMap GoogleMapsEventController.initPickerMap

For the "initSingleEventDisplayingMap" a hidden field is required, like so: @Html.HiddenFor(n => n.Id)

Then, Create a div with id=map to hold the map:

<div id="map"></div>

There is no sane implementation to use for the map on the contact page as of now, but that can very easily be hardcoded as we did in the HTML-course.

⚠️ **GitHub.com Fallback** ⚠️