Whats your current query? I also don't see any FK or Indexs.
There is an IQueryable where if thats found here: Abp.Linq.Extensions
Ismcagas is a dev for ASPNetZero. Do you need us to reference links for you or something? Not sure what you want to know. You can follow mile stones in GitHub if you want to know what 5.4 will involve. They tend to follow a monthly release schedule, so next moth would contain more "major" changes. Merging their code with your should be super simple, most of the time you wont be extending what they already wrote.
<cite>ismcagdas: </cite> by ismcagdas » Wed Mar 28, 2018 9:39 am Thanks @BBakerMMC :).
You will always have to merge in changes if you wish to stay up to date. Not sure what your issue is? There are numerous post about how to do this. Its part of the development process if you are using a 3rd party framework, you pick and choose what updates you take and when.
Example: We are still on 4.6 since we want to scaffold/template out a bunch of code for the next v5+ when we goto it. But I pull in selected changes from files as I see necessary.
Use the migration tool, it will update your DBs for you.
Yes.
They can change the db on any release. Just run the migrations.
Context:
using Abp.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using MMC.Platform.DMPModels;
namespace MMC.Platform.EntityFrameworkCore
{
public class DMPContext : AbpDbContext
{
//EX
public DbSet<CompanyAddress> CompanyAddress { get; set; }
public DbSet<CompanyAddressType> CompanyAddressType { get; set; }
public DbSet<CompanyPhone> CompanyPhone { get; set; }
public DbSet<CompanyEmail> CompanyEmail { get; set; }
public DbSet<CompanyIdentifier> CompanyIdentifier { get; set; }
public DbSet<CompanyNote> CompanyNote { get; set; }
public DMPContext(DbContextOptions<DMPContext> options)
: base(options)
{
}
}
}
configurer:
using System.Data.Common;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
namespace MMC.Platform.EntityFrameworkCore
{
public static class DMPContextConfigurer
{
public static void Configure(DbContextOptionsBuilder<DMPContext> builder, string connectionString)
{
builder.UseSqlServer(connectionString, o => o.UseRowNumberForPaging());
}
public static void Configure(DbContextOptionsBuilder<DMPContext> builder, DbConnection connection)
{
builder.UseSqlServer(connection, o => o.UseRowNumberForPaging());
}
}
}
Factory:
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.Extensions.Configuration;
using MMC.Platform.Configuration;
using MMC.Platform.Web;
namespace MMC.Platform.EntityFrameworkCore
{
/* This class is needed to run "dotnet ef ..." commands from command line on development. Not used anywhere else */
public class DMPContextFactory : IDesignTimeDbContextFactory<DMPContext>
{
public DMPContext CreateDbContext(string[] args)
{
var builder = new DbContextOptionsBuilder<DMPContext>();
var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder());
DMPContextConfigurer.Configure(builder, configuration.GetConnectionString(PlatformConsts.ConnectionStringName));
return new DMPContext(builder.Options);
}
}
}
In EF * CoreModules Add:
Configuration.Modules.AbpEfCore().AddDbContext<DMPContext>(options =>
{
//DMPContextConfigurer.Configure(configuration.DbContextOptions, configuration.ConnectionString);
if (options.ExistingConnection != null)
{
DMPContextConfigurer.Configure(options.DbContextOptions, options.ExistingConnection);
}
else
{
DMPContextConfigurer.Configure(options.DbContextOptions, options.ConnectionString);
}
});
Usage
private readonly IRepository<Company> _repositoryCompany;
Agree, forums should be dropped and just use GitHub and/or stackoverflow. It seems like alot of the same basic questions asked over and over again like "How do I publish to Azure".
Did you configure your appsetting to look for {TenancyName} in the URL per the development documentation.
There seems to be issues with checking if the tenant is valid, seems to always return the host.
See: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/873">https://github.com/aspnetzero/aspnet-ze ... issues/873</a>
Are you doing this:
Single Deployment - Multiple Database
ln this approach, we run a single instance of the application on a server. We have a master (host) database to store tenant metadata (like tenant name and subdomain) and a separate database for each tenant. Once we identify the current tenant (for example; from subdomain or from a user login form), then we can switch to that tenant's database to perform operations.
In this approach, the application should be designed as multi-tenant at some level, but most of the application can remain independent from it.
We create and maintain a separate database for each tenant, this includes database migrations. If we have many customers with dedicated databases, it may take a long time to migrate the database schema during an application update. Since we have a separated database for each tenant, we can backup its database separately from other tenants. We can also move the tenant database to a stronger server if that tenant needs it.
This is what we do, then you can just use the standard AspNetZero repos to get the data out.