Activities of "lalitChougule"

I want to create a user from my custom appService i.e I just want to call create() method of UserAppService from my custom appService. Which Interface do I have to inject in my appService ?

Hi,

I am able to create user using IdentityUserManager.CreateAsync method but once the user is created I want to return the inserted userId.

How to get inserted UserId ?

Hi

Suppose this is my DTO

public class AnyDto
{
    [Required(ErrorMessage="Name is required")]
    public string Name { get; set;}
}

Or suppose this is my Validator Class

public class AnyDtoValidator : AbstractValidator<AnyDto>
    {
        public AnyDtoValidator()
        {
            RuleFor(x => x.Name).NotNull().WithMessage("Name is required");
        }
    }

I want to localize my errror message which is Name is required. How do I do it ?

Kindly provide solution in both cases DTO/Fluent Validators

How do we Check Duplicate Entities in Fluent Validators ? Where this duplicate check should be done? Contract/Domain/Application project ? Cause I have my Validator's in Application.Contracts project. Is this the right way to do it?

Thanks @liangshiwei

My DTO's are as below :

CustomerDto

public class CustomerDto : AuditedEntityDto<Guid>
{
    ....
}

AddressDto

public class AddressDto : AuditedEntityDto<Guid>
{
    ....
}

OrderDto

public class OrderDto : AuditedEntityDto<Guid>
{
    public CustomerDto Customer { get; set; }
    
    public AddressDto Address { get; set; }
}

As per your above solution I tried injecting IStringLocalizer<MyProjectResource> localizer as below

CustomerDtoValidator

public class CustomerDtoValidator : AbstractValidator<CustomerDto>
    {
        public CustomerDtoValidator(IStringLocalizer<MyProjectResource> _localizer)
        {
            ....
        }
    }

AddressDtoValidator

public class AddressDtoValidator : AbstractValidator<AddressDto>
    {
        public AddressDtoValidator(IStringLocalizer<MyProjectResource> _localizer)
        {
            ....
        }
    }

But I am not able to Implement below code for OrderDto :

public class OrderDtoValidator:AbstractValidator<SupplierCombinedDto>
    {
        public OrderDtoValidator()
        {
            RuleFor(x => x.Customer).SetValidator(new CustomerDtoValidator()); <-- ERROR
            RuleFor(x => x.Address).SetValidator(new AddressDtoValidator()); <-- ERROR
            
        }
    }

ERROR: There is no argument given that corresponds to the required formal parameter '_localizer' of CustomerDtoValidator(IStringLocalizer

What should I pass as argument ?

Thanks @liangshiwei

It worked, Just last question which remained unanswered before How do we Check Duplicate Entities in Fluent Validators ? I want to cross check from my Address table whether this record is already present in my table ( i.e duplicate address ) Is it possible in Fluent Validator ? And how do I do it ?

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.

  • ABP Framework version: v2.7.0
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): no / Yes
  • Exception message and stack trace: N.A
  • Steps to reproduce the issue: N.A

Hi,

I need to know how the record get inserted into AbpAuditLogs and AbpAuditLogActions as I want to implement a bit customized logging of my own. How can I implement the same for my own tables or you can say I just want to insert only few Http Status code related data to my own custom table.

How can I do it ?

  • ABP Framework version: v2.7.0
  • UI type: Angular
  • Tiered (MVC) or Identity Server Seperated (Angular): no / Yes
  • Exception message and stack trace: User name '里约' is invalid, can only contain letters or digits.
  • Steps to reproduce the issue: Create User as per screenshot attached

I want to create user by providing chinese character as input but came accross this error

How do I set rule to allow chinese letters ?

Hi,

I have implemented Serilog.Sinks.AwsCloudWatch to log my data to AWS-CloudWatch But the problem is according to the documentations of SeriLog I can log data as per LogEventLevel to the CloudWatch which creates huge amout of unnecessary data

What if I want to log only the data which get logged into AuditLog and AuditLogAction table from database to AWS-CloudWatch.

Is this possible and how to implement it ?

Thanks @liangshiwei

It will be very helpfull if u can provide some sample code to demonstrate implementation of custom AudtingStore

Showing 1 to 10 of 132 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11