Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "aaron"

EF Core allows me to remove migrations sequences only, which is I think correct. because If I remove an in-between migration, later migration might fail due to dependency on old migrations.

Exactly.

But If there is no dependency it should allow me to remove or disable.

It's infeasible for EF Core to go through every migration and figure out if there is a dependency, especially for SQL statements.

How to remove a particular migration?

There's an answer to this though! If you are sure there is no dependency, create an empty migration, then copy the "Up" and "Down" in the 56th migration into the opposite ("Down" and "Up") of the new migration. This is what Git does too: to reverse an old commit, create a new commit that does the opposite.

Is there an easy way to bring the version or I have to import one fix at a time?

How to migrate existing solution: https://github.com/aspnetzero/aspnet-zero/issues/96#issuecomment-268093697

For this fix, you can just make that single-line change.

Yes, I tried it. Next time, you can too.

You are implementing from Entity not from FullAuditedEntity. So any disadvantage or side effect of not using FullAuditedEntity.

No.

I added them now, that wasn't clear in the Docs.

I'll update the docs in a bit. Thanks for your feedback!

but the value in this.appSession.application.features['SignalR'] and ['SignalR.AspNetCore'] are always false, I guess I should set them to True somehow

You can simply force them to be true, or define:

For Angular, did you add:

Code:

public class Test : Entity
{
    // PK
    public string TestId { get; set; }

    // Unique constraint
    public int TestId2 { get; set; }
}

public class AbpProjectNameDbContext : AbpZeroDbContext<Tenant, Role, User, AbpProjectNameDbContext>
{
    /* Define a DbSet for each entity of the application */    
    public DbSet<Test> Tests { get; set; }
    
    public AbpProjectNameDbContext(DbContextOptions<AbpProjectNameDbContext> options) : base(options) {}

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

        modelBuilder.Entity<Test>().Property(t => t.Id).ValueGeneratedOnAdd(); // Auto increment
        modelBuilder.Entity<Test>().HasKey(t => t.TestId);                     // PK
        modelBuilder.Entity<Test>().HasIndex(t => t.TestId2).IsUnique();       // Unique constraint
    }
}

Generated migration:

protected override void Up(MigrationBuilder migrationBuilder)
{
    migrationBuilder.CreateTable(
        name: "Tests",
        columns: table => new
        {
            TestId = table.Column<string>(nullable: false),
            Id = table.Column<int>(nullable: false)
                .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
            TestId2 = table.Column<int>(nullable: false)
        },
        constraints: table =>
        {
            table.PrimaryKey("PK_Tests", x => x.TestId);
        });

    migrationBuilder.CreateIndex(
        name: "IX_Tests_TestId2",
        table: "Tests",
        column: "TestId2",
        unique: true);
}

Usage:

public async Task<IActionResult> Index()
{
    await _repository.InsertAndGetIdAsync(new Test
    {
        TestId = "One",
        TestId2 = 1
    });

    // Valid
    await _repository.InsertAndGetIdAsync(new Test
    {
        TestId = "Two",
        TestId2 = 2
    });

    try
    {
        await _repository.InsertAndGetIdAsync(new Test
        {
            TestId = "One", // PK conflict
            TestId2 = 3
        });
    }
    catch (Exception e)
    {
    }

    try
    {
        await _repository.InsertAndGetIdAsync(new Test
        {
            TestId = "Three",
            TestId2 = 1 // Unique constraint conflict
        });
    }
    catch (Exception e)
    {
        throw;
    }

    return Redirect("/swagger");
}

Abp.Owin does not support netcoreapp2.0.

this._procurementService.createPEvent(this.pevent)
    .then(result => {
        this.newEventProduct.EventId = result.Id;
        this._procurementService.addEventProduct(this.newEventProduct).subscribe(
            result => {
                this.editingPevent.eventProducts.push(result);
                this.newEventProduct.quantity = 1;
                this.notify.success(this.l('SavedSuccessfully'))
            });
    })
    .finally(() => this.saving = false)
    .subscribe(() => {
        this.notify.info(this.l('SavedSuccessfully'));              
    });
Showing 961 to 970 of 1543 entries