Base solution for your next web application

Activities of "mdframe"

Hi, I am a new to ASPNET.Zero and have been working on some samples for understanding the architecture. I created a Contacts application from the RAD Tool with ASP.NET Core and Angular. When I look at the change logs I see the details of which fields were changed from their old value to the new one however I do not see a Reason description as I set in the service module.

I have the entity class defined as:

[Table("Contacts")]
    [Audited]
    public class Contact : FullAuditedEntity , IMayHaveTenant
    {
		public int? TenantId { get; set; }

Then in my ApplicationService I have the following:

        [AbpAuthorize(AppPermissions.Pages_Contacts_Edit)]       
        private async Task Update(CreateOrEditContactDto input)
         {
            var contact = await _contactRepository.FirstOrDefaultAsync((int)input.Id);

            var reason = string.Format("User: {0} was updated!", input.UserId.ToString());            
            using (_reasonProvider.Use(reason))
            {
                ObjectMapper.Map(input, contact);                
            }
            
         }

I do not have the UnitOfWork defined per the sample as I am assuming the DTO Mapper is taking care of the actual data layer so I made an assumption on how to set the Reason. What should I do and where would I see the Reason once it is recorded correctly?

Thank you,

Matt

Yes, I have read through the documentation several times. I have also applied the UseCase attribute, per the documentation, to the function and still no reason description other than the standard shows in the table for logging. I am not receiving any errors in the logs or in the application.

Thanks I see where I missed the declaration of private not being supported. For a quick test I made a change to the location and function with the UseCase declaration to see if I would get a different result. Even after making a change with the following method I am still seeing the URL as the Reason in the database.

[UseCase(Description = "Updating User Contact Information")] public async Task CreateOrEdit(CreateOrEditContactDto input) { if(input.Id == null){ await Create(input); } else{ await Update(input); }

    }

I know I am missing something and that it is not the framework, just trying to learn.

Thanks,

Matt

Thank you Aaron! That was the missing piece. I see the entity reason code I set now. An update to the screen now will complete the requirement I have for my customer.

Thanks again,

Matt

I want to verify I am thinking Organization Unit is what I think it should support. If I have a tenant with multiple warehouses then the Organization Unit could be used to support each warehouse under the tenant as a separate controllable facility for users and products.

An example of what I am trying to accomplish. Tenant ID 1 has an East coast warehouse A and a West coast warehouse B. Users defined for Tenant 1 will have permissions to work in both warehouses. If I define specific users in each warehouse they can only work within that warehouse or Organization Unit. The product master would be available to each warehouse however actual stock only exists in Organization Unit, warehouse, A and Organization Unit, warehouse B.

Would someone verify I am thinking of Organization Unit correctly in this instance? If this is incorrect please elaborate on how I should support this type of business case with ASP.Net Boilerplate.

Thank you for your help.

Matt

Thank you for the quick response and details of the situation. If I do not need the separation of users and roles would the Organization Unit still be a good fit for multiple warehouses under a tenant? I am trying to identify the best supporting method from the framework to support separation of data and transactions.

We are very small IT organization and using as much of the ASP.NET Zero framework to support our customers is very beneficial.

Thank you,

Matt

I have a situation where a tenant has multiple warehouses. Users can work in a single warehouse or change periodically based on duties and needs. I am looking for insight with ASPNET.Zero on how best to implement. I was thinking they could sign in and set a warehouse id and add that to the session or extend the user entity. I prefer not to make customs to Abp if possible but if the community feels this is the best method then I must. I also wonder if a user wants to set this every time they log in as well.

Thoughts on how to approach this solution with the great framework?

Thanks,

Matt

Thank you very much for the speedy reply and information! I really appreciate providing this level of feedback to my needs. I will read through the documentation and let you know if I have any other questions.

Thanks again,

Matt

How difficult would it be to have a QA environment with MySQL and production environment with SQL Server? We are looking to save some dollars on our hosting where MySQL is free and then pay for a SQL Server license in production. Anyone done something like this already or have any advice?

We are attempting our fist simple deployment to understand the solution and best methods. We created our project as two separate projects in Angular and ASP.NET Core. The documentation we have found seems to prefer a single solution for deployment so our first question is should we have two projects for separation? We felt this was the best solution for our team but could be wrong.

For deployment, we have many options between app.config, appsettings.json, appsettings.staging.json, appsettings.production.json and web.config. Is there documentation or recommendations on each and what the settings perform? I understand some of this is outside of the community however it is challenging us. We get the server side is deployed from the publish process and the Angular is done after compile command however we are not have any success in getting the basic application to work on the hosting provider and we feel its our misinterpretation of deployment details.

Would anyone be able to share your best practices and guidelines for setup and deployment?

Thank you very much!

Matt Frame

Showing 1 to 10 of 82 entries