protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        ModelHelpers.SetStringLengths(modelBuilder);

        modelBuilder.Entity <CustomerQuery>().ToSqlQuery(
            @"SELECT ""c"".""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region"" FROM ""Customers"" AS ""c""");
    }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            ModelHelpers.SetStringLengths(modelBuilder);

            modelBuilder.Entity <CustomerView>().HasNoKey().ToQuery(
                () => CustomerQueries.FromSqlInterpolated($@"SELECT ""c"".""CustomerID"" || {_empty} as ""CustomerID"", ""c"".""Address"", ""c"".""City"", ""c"".""CompanyName"", ""c"".""ContactName"", ""c"".""ContactTitle"", ""c"".""Country"", ""c"".""Fax"", ""c"".""Phone"", ""c"".""PostalCode"", ""c"".""Region"" FROM ""Customers"" AS ""c"""
                                                          ));
        }
Beispiel #3
0
 protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext context)
 {
     base.OnModelCreating(modelBuilder, context);
     ModelHelpers.SetStringLengths(modelBuilder);
 }