Base solution for your next web application

Activities of "aaron"

Pass in an IConfigurationProvider instance:

var config = new MapperConfiguration(configuration =>
{
    configuration.CreateAutoAttributeMaps(typeof(TagDto));
});

var tagsDto = await _tagRepository.GetAll().ProjectTo<TagDto>(config).ToListAsync();

Resolve the class:

using (var vehicleTrackingFieldAccessHtmlHandler = IocManager.Instance.ResolveAsDisposable<VehicleTrackingFieldAccessHtmlHandler>())
{
    return vehicleTrackingFieldAccessHtmlHandler.Object.ProcessFields(vtField, VT_ID, OU_ID).Result;
}

UserId is checked in AuthorizationHelper. You can implement IAuthorizationHelper:

internal class AccountAuthorizationHelper : IAuthorizationHelper, ITransientDependency
{
}

Replace the default AuthorizationHelper in your module:

public override void PreInitialize()
{
    Configuration.ReplaceService<IAuthorizationHelper, AccountAuthorizationHelper>();  
}
Answer

Hi, can you show where you are doing that?

Answer

Can you show actual code of how you inject and use PersonAppService in UserAppService?

This uses IocManager.Instance, which is an IIocResolver, to resolve VehicleTrackingFieldAccessHtmlHandler like DI. ResolveAsDisposable returns IDisposableDependencyObjectWrapper, so ".Object" accesses your resolved "Handler". The disposable wrapper is assigned in a "using" statement to ensure that "Handler" is released to avoid memory leak.

Read more in ABP documentation:

  • Dependency Injection: <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Dependency-Injection#DocIocHelper">https://aspnetboilerplate.com/Pages/Doc ... cIocHelper</a>

Do you mean you do a HTTP call in your desktop app, then launch browser and expect the browser to know you're logged in?

Answer

Use dependency injection for AbpSession to be initialized properly.

public class StudentAppService : OKYSFastAppServiceBase, IStudentAppService
{
    private readonly IRepository<VStudentInfo> _StudentRepository;
    private readonly IPersonAppService _PersonAppService;

    public StudentAppService(
        IRepository<VStudentInfo> studentRepository,
        IPersonAppService personAppService)
        : base()
    {
        _StudentRepository = studentRepository;
        _PersonAppService = personAppService;
    }

    public async Task<ProcessResult> RegisterStudent(StudentInpuOutputDto input)
    {
        ProcessResult result = new ProcessResult(true);

        input.StudentPerson = await _PersonAppService.Insert(input.StudentPerson);
        input.Student.PersonId = input.StudentPerson.PersonId;
        input.Student = await Insert(input.Student);
        result.RecordID = input.Student.StudentId;
        return result;
    }
}

Read more in ABP documentation:

  • Dependency Injection: <a class="postlink" href="https://aspnetboilerplate.com/Pages/Documents/Dependency-Injection#DocConstructorInjection">https://aspnetboilerplate.com/Pages/Doc ... rInjection</a>

Hi @moustafa, Try making GetRecord "virtual".

Hi @JeromeVoxTeneo, Try making the internal method "protected virtual". Make sure the caller method disabled UnitOfWork.

Delete the bin folder in your Web project and rebuild the solution.

Showing 1 to 10 of 1543 entries