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

Activities of "joemo"

What is the recommended way to return the full username all the to the client (angular) when using FullAuditedEntity ? e.g. get the full user name from the CreatorUserId

I have created a Customer entity...

[Required]
public string Name {get;set;}

public virtual ICollection<Document> Documents { get; set; }

public Customer()
        {
            Documents = new HashSet<Document>();
        }

... which as you can see each contain Document collections...

[Required]
public string Type {get;set;}

public virtual int CustomerId { get; set; }
[ForeignKey("CustomerId")]
public virtual Customer Customer { get; set; }

And in my DTOs I just declare and set the CustomerId... (not the virtual Customer - this seems to be how you do it in the SimpleTaskSystem example)...

public class CreateDocumentInput : IInputDto
{
    [Required]
    public string Type {get;set;}

    public in CustomerId {get;set;}
}

public void CreateDocument(CreateDocumentInput input)
{
    var document = new Document 
    {
        Type = input.Type,
        CustomerId = input.CustomerId
    };
}

I've written application services that read and write to both these entities. This all works fine UNTIL I start adding Document entities, and then the original GetCustomers web service call fails with a 500 internal server error. It seems to be because I have added related Documents to the Customer and it is having problems getting the data. Where am I going wrong? I've read outside of ABP that this can happen with lazy loading. Adding this line to DBContext prevents the error:-

this.Configuration.ProxyCreationEnabled = false;

But I don't want to break the benefits of ABP...

What is the correct way to share data from a service without re-retrieving the data each time?

For example, I have created a getCustomers service. But I want to use the data in both a header controller, and in the controller for a particular page.

At present this results in separate calls to the service each time - but I would like to just retrieve the data once and make it available globally.

Question

How can I retrieve a list of AbpUsers users, preferably async? For example, to populate a dropdown list of users to assign a task to. I've tried using UserManager _userManager but it only seems relevant to finding or retrieving one users' details at a time. Is there an IQueryable collection of users? I'd like to be able to then filter that list based on roles

:roll:

Showing 11 to 14 of 14 entries