Base solution for your next web application

Activities of "eu11111"

I noticed that you recently made quite a big change to module-zero-core-template, adding docker support.

I am looking forward to upgrade my application, adding these new changes to it. Usually I do it manually, reading the changelogs and changing file by file. I would like to know if there is a reasonable way of doing it automatically. I thought about pulling the changes from the repo, but the names won't match during the merge, such as AbpCompanyName.AbpProjectName.

Could someone tell me what is the best way of doing it?

Thanks in advance.

I am working with jqueryvalidation library and it has localization files for each country/language combination. I would like to know the best way to work with bundling of localized files.

Can I inject localization manager inside BundleConfig class and localize the file name there?

Is there a way to access cookies in the Application module? I am trying to create an Attribute capable of verifying a flag in an attribute and can't seem to access Request.Cookies from it.

Thanks in advance

Hey. I am trying to run a bulk insert inside the database. My problem is that I need to us a SqlConnection to do so, inside an AppService. Should I use the Core layer instead?

Anyway, is there a way of accessing th ConnectionString from appsettings.json inside the Web project from another project? Or getting a SqlConnection object from the dbContext or something related?

Thanks in advance

I am trying to generate an email confirmation token, but I am getting the following error:

Exception thrown: 'System.ObjectDisposedException' in mscorlib.dll

var user = await GetCurrentUserAsync();            
var token = _userManager.GenerateEmailConfirmationToken(user.Id);

EDIT > I also tried

var user = await GetCurrentUserAsync();            
var token = UserManager.GenerateEmailConfirmationToken(user.Id);

Could somebody help me? Thanks in advance.

EDIT> I got it working by setting the provider manually

var provider = new DpapiDataProtectionProvider("AppName");

_userManager.UserTokenProvider = new DataProtectorTokenProvider<User, long>(provider.Create("TokenPurpose")) as IUserTokenProvider<User, long>;
Question

Good afternoon! I need some help to send emails through ABP

Here is what I did so far:

Created this class

class EmailSettingProvider : SettingProvider
{
    public override IEnumerable<SettingDefinition> GetSettingDefinitions(SettingDefinitionProviderContext context)
    {
        return new[]
                {
                    new SettingDefinition(EmailSettingNames.Smtp.Host, "smtp.gmail.com", L("SmtpHost"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.Smtp.Port, "465", L("SmtpPort"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.Smtp.UserName, "****@gmail.com", L("Username"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.Smtp.Password, "*****", L("Password"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.Smtp.Domain, "gmail.com", L("DomainName"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.Smtp.EnableSsl, "true", L("UseSSL"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.Smtp.UseDefaultCredentials, "true", L("UseDefaultCredentials"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.DefaultFromAddress, "****@gmail.com", L("DefaultFromSenderEmailAddress"), scopes: SettingScopes.Application | SettingScopes.Tenant),
                    new SettingDefinition(EmailSettingNames.DefaultFromDisplayName, "My Name", L("DefaultFromSenderDisplayName"), scopes: SettingScopes.Application | SettingScopes.Tenant)
                };
    }

    private static LocalizableString L(string name)
    {
        return new LocalizableString(name, AbpConsts.LocalizationSourceName);
    }
}

On my Application Module

public override void PreInitialize()
{
     Configuration.Settings.Providers.Add<EmailSettingProvider>();
}

Created an App Service

public class EmailAppService : NHiveAppServiceBase, IEmailAppService
{
    private readonly ISmtpEmailSender _smtpEmailSender;

    public EmailAppService(
        ISmtpEmailSender smtpEmailSender)
    {
        _smtpEmailSender = smtpEmailSender;
    }

    public async Task SendTestEmail()
    {
        _smtpEmailSender.Send("[email protected]", "[email protected]", "test",  false);
    }
}

Did I do it correctly? As I understood from my google searches, SmtpEmailSender gets the settings automatically from the PreInitialize method. Is that correct?

It failed to send the e-mail, though.

Thanks in advance,

Could somebody explain me the conceptual difference between a Store and a Manager?

I would like to implement some Custom Maps. Where would be the perfect place to do so? In my application module?

Question

How should I implement removerange using the defaul IRepository?

Thanks in advance.

I've been trying to create some modules in my solution. At the moment I have 2 core modules (inside a single project), 2 application modules (inside a single project) and one data module. I also have 2 web applications (alongside 2 apis) for different purposes. Whenever I try to run any of these web applications, I get the following error:

Component AbpCompanyName.AbpProjectName could not be registered. There is already a component with that name. Did you want to modify the existing component instead? If not, make sure you specify a unique name.

Should I separate my modules in different projects to make it work? Or should I unify my modules into one?

Thanks!

Showing 1 to 10 of 11 entries