Note that there are some explanatory texts on larger screens.

plurals
  1. POEF DatabaseIntializer looping through list methods with overloads,
    primarykey
    data
    text
    <p>Below is my <code>Intializer.cs</code> and I was told in order to keep my Guids i had to use Navigation properties so that i had the right relations in my database(<a href="https://stackoverflow.com/questions/14492367/reusing-a-guid-in-ef-code-first-databaseintializer">Reusing a GUID in EF Code First DatabaseIntializer</a>). That seems to solves the issues i had earlier but now that i want to take my information and use a Seed to actually add it to the database, i am not sure how to satisfy this error. I get the error for <code>addUsers(Applications apps)</code>"eflogin.Models.Applications is a 'type' being used like a variable." I got the feeling i am doing this way wrong.</p> <pre><code>public class DatabaseIntializer : DropCreateDatabaseIfModelChanges&lt;DataContext&gt; { protected override void Seed(DataContext context) { addApplications().ForEach(a =&gt; context.Applications.Add(a)); addUsers(Applications apps).ForEach(u =&gt; context.User.Add(u)); // if i take out Applications apps // i get No overload for method"addUsers" takes 0 arguments } private static List&lt;Applications&gt; addApplications() { var apps = new List&lt;Applications&gt; { new Applications { ApplicationId = Guid.NewGuid(), ApplicationName = "Test Login" } }; return apps; } private static List&lt;Users&gt; addUsers(Applications apps) { var use = new List&lt;Users&gt; { new Users { UserId = Guid.NewGuid(), UserApplication = apps, UserName = "Ralph", IsAnonymouse = false, LastActivityDate = System.DateTime.Now } }; return use; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload