Base solution for your next web application

Activities of "nikko"

I want to change column datatype. For example I don't need all the columns to be nvarchar and also I think 256 is too much for an e-mail column. What would be the best way of achieving this?

I tried to override OnModelCreating with:

base.OnModelCreating(modelBuilder); modelBuilder.ChangeAbpTablePrefix<Tenant, Role, User>(""); modelBuilder.Properties<string>().Configure(p => p.IsUnicode(false));

But I get this error when trying to update the database:

The index 'IX_Discriminator_TenantId_Name' is dependent on column 'Name'. The index 'IX_Discriminator_EditionId_Name' is dependent on column 'Name'. The index 'IX_TenantId_Name' is dependent on column 'Name'. ALTER TABLE ALTER COLUMN Name failed because one or more objects access this column.

Any ideas?

I am developing a single tenant application. Users can buy subscriptions and they have different features and permissions. For example

Basic - cant send emails. Intermediate - can send 10 emails. Advanced - can send 30 emails.

From my understanding I cannot assign editions directly to users. What would be the best way to implement this in ABP? Should i create Roles like basic, intermediate and adanced and assign to the users and assign permissions to the Roles? The problem with permissions is that basic does not have and intermediate and advanced have but how do I control the amount of emails they can send?

Thanks.

Hello!

I like to maintain the same feel of client and server validation errors when displaying it to the user. Usually i use the mvc built-in helpers to build the errors for me (ValidationSummary and ValidationFor). When the request gets to the controller if it's a regular post there's no problem we just do:

if (!ModelState.IsValid()) 
{
 return View();
}

And the errors get displayed. The 'problem' starts when we use an AJAX request. Today what i do is read the errors from the ModelState and build a JSON that is returned to the client. Then using jquery i add the errors to the generated html of ValidationSummary and ValidationFor.

I noticed that when a validation error occurs we should use UserFriendlyException. Then i could just implement abp.message.error in the client and it will be done. But the thing is that i can only return one error to the client using this exception. What if i have more errors on my modelstate from multiple properties? Is there anyway to solve this? Also is there a built-in way convert the modelstate errors to this exception?

Thank you for your effort on this project it's really awesome!

Showing 1 to 3 of 3 entries