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

Activities of "carelearning"

Thank you

await CurrentUnitOfWork.SaveChangesAsync();

flushes the changes to the database and now my queries are working appropriately without errors.

This issue has been resolved!

Dear alirizaadiyahsi, thank you for the reply.

Below are the fluent mappings for the two classes.

UserImportConfiguration

namespace MyCompanyName.AbpZeroTemplate.Configuration
{
    using System.Data.Entity.ModelConfiguration;
    using UserImport;

    public class UserImportConfiguration : EntityTypeConfiguration<UserImport>
    {
        public UserImportConfiguration()
            : this("dbo")
        {
        }

        public UserImportConfiguration(string schema)
        {
            ToTable(schema + ".UserImports");
            HasKey(x => x.Id);

            Property(x => x.Id).HasColumnName("Id").IsRequired().HasColumnType("int").HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.None);
            Property(x => x.Position).HasColumnName("Position").IsRequired().HasColumnType("int");
            Property(x => x.Last).HasColumnName("LastName").IsRequired().HasColumnType("nvarchar").HasMaxLength(50);
            Property(x => x.First).HasColumnName("FirstName").IsRequired().HasColumnType("nvarchar").HasMaxLength(50);
            Property(x => x.DepartmentId).HasColumnName("DepartmentId").IsRequired().HasColumnType("nvarchar").HasMaxLength(50);
            Property(x => x.Date).HasColumnName("Date").IsOptional().HasColumnType("datetime");
            Property(x => x.IdBadge).HasColumnName("IdBadge").IsOptional().HasColumnType("nvarchar").HasMaxLength(15);
            Property(x => x.JobCodeId).HasColumnName("JobCodeId").IsOptional().HasColumnType("nvarchar").HasMaxLength(50);
            Property(x => x.EmailAddress).HasColumnName("EmailAddress").IsOptional().HasColumnType("nvarchar").HasMaxLength(254);
        }
    }
}

UserImportPresentation

namespace MyCompanyName.AbpZeroTemplate.Configuration
{
    using System.Data.Entity.ModelConfiguration;
    using UserImport;

    public class UserImportPresentationConfiguration : EntityTypeConfiguration<UserImportPresentation>
    {
        public UserImportPresentationConfiguration()
            : this("dbo")
        {
        }

        public UserImportPresentationConfiguration(string schema)
        {
            ToTable(schema + ".UserImportPresentations");

            HasKey(x => new { x.UserImportId });

            Property(x => x.Name).HasColumnName("Name").IsRequired().HasColumnType("nvarchar").HasMaxLength(66);
            Property(x => x.Department).HasColumnName("Department").IsRequired().HasColumnType("nvarchar").HasMaxLength(103);
            Property(x => x.JobCode).HasColumnName("JobCode").IsRequired().HasColumnType("nvarchar").HasMaxLength(103);

            Ignore(x => x.Id);

            HasRequired(x => x.UserImport);
        }
    }
}

Attached is the schema for both tables (see included image below).

I can comment out the UserImportPresentation insert statement and run the application the data will be added.

foreach (var import in imports)
            {
                await userImportRepository.InsertAsync(import);

                // var presentationUser = BuildUserImportPresentationResult(import, departments, jobCodes);
                // await userImportPresentationRepository.InsertAsync(presentationUser);
            }

Next stop the application and fetch the UserImport records and I can then comment out the UserImport insert statement and run the application a second time and the data will be added.

var import = await userImportRepository.GetAllListAsync();
foreach (var import in imports)
            {
                // await userImportRepository.InsertAsync(import);

                var presentationUser = BuildUserImportPresentationResult(import, departments, jobCodes);
                await userImportPresentationRepository.InsertAsync(presentationUser);
            }

The problem appears to be trying to insert the data on the same run, the second insert fails because the first is not in the table yet.

Thank you for your time and effort.

Hello,

Thank you for your reply. This issue was caused by a number of factors:

  1. We had development databases with the simpleStringCipher issue here:https://github.com/aspnetboilerplate/aspnetboilerplate/pull/2071/commits/7cf02f9362f9067052f83a30d81490758659d76c. So to easily correct this, we deleted and recreated our host database.
  2. We forgot to add the friendships and appchatmessages tables from this issue https://forum.aspnetboilerplate.com/viewtopic.php?f=5&t=3892&p=8739#p8739
  3. When that error happens and we are running in debug mode but with "start without debugging" (also known as ctrl-F5 instead of just F5 in visual studio) then we do not see the error from #2 above, but get the signalR error in javascript.

This is not a problem with the upgrade. If it is possible to add better error handling for this situation, we would be be very grateful.

Thank you.

Hello,

I apologize for the confusion, but yes. To be precise, we updated to the latest version of the "dev" branch in ASPNetZero here: https://github.com/aspnetzero/aspnet-zero/commit/683de0612490f512be79af464ec87e6f5e1bf3b6

Thank you for your help.

Thank you so much. This works!

We sent FTP credential information to <a href="mailto:[email protected]">[email protected]</a> this morning, Monday, March 6th, 2017 to access the project.

Hello, Sure as long as your email servers can accept a 20mb zip file or larger. Otherwise we may need somewhere to upload this project for you. Let us know if the email does not arrive. Thanks

Thanks for the quick reply.

When we encountered the issue we created a sample project to replicate using the latest version from the dev branch of aspnetzero/aspnet-zero (commit sha1 is bb2c66009d859afc5b466dbee228ba9e32bac9fb).

Answer

That works! Thank you.

Answer

Replaced contents of AbpZeroDbMigrator with TenantDbContext version.

namespace MyCompanyName.AbpZeroTemplate.EntityFramework
{
    using Abp.Dependency;
    using Abp.Domain.Uow;
    using Abp.MultiTenancy;
    using Abp.Zero.EntityFramework;

    public class AbpZeroDbMigrator : AbpZeroDbMigrator<AbpZeroTemplateTenantDbContext, AbpZeroTemplateTenant.Configuration>
    {
        public AbpZeroDbMigrator(
            IUnitOfWorkManager unitOfWorkManager,
            IDbPerTenantConnectionStringResolver connectionStringResolver,
            IIocResolver iocResolver) :
            base(
                unitOfWorkManager,
                connectionStringResolver,
                iocResolver)
        {
        }
    }
}

Is there a way to override the IOC container registration to use our custom class AbpZeroTenantDbMigrator, instead of the replacing the contents of the AbpZeroDbMigrator?

Showing 41 to 50 of 65 entries