Base solution for your next web application

Activities of "apexdodge"

Question

Reading this documentation here: <a class="postlink" href="http://aspnetboilerplate.com/Pages/Documents/Data-Transfer-Objects">http://aspnetboilerplate.com/Pages/Docu ... er-Objects</a>

It is recommended to always use a DTO for input and output for all application service methods. That is fine, despite the groans from my devs about the added work -- I see the benefits.

My question is about ViewModels.

Should we have ViewModel for every DTO as well? Or is it common practice to send the DTO straight to the end user in the presentation layer?

Likewise for accepting data -- Should a form submission go to a ViewModel first, which is then mapped to a DTO, which is then mapped to an Entity. Or do form submissions go straight to DTO?

Any reasoning for either option would be much appreciated.

Thanks.

Hi there, so I've created my own custom data filter following these directions: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Data-Filters">http://www.aspnetboilerplate.com/Pages/ ... ta-Filters</a>

However, the whole point of me creating the filter was so that I can call something like _articleRepository.GetAllList() without hassle. But in order to actually use the filter, I have to specify:

using(CurrentUnitOfWork.SetFilterParameter("ProductFilter", "productId", productId))
    {
        var articles = _articleRepository.GetAllList();
    }

If I have to do that every time I call my articleRepository, I might as well just abandon the filter and continue doing _articleRepository.GetAll().Where(p => p.ProductId == productId)...

I would like to know two things:

  1. The built-in filters like IMustHaveTenant and ISoftDelete don't need to be set the filter parameter every time I make a call unless I want to specifically override something. How / where did you set that filter parameter so that it need not be specified every time I make a call?

  2. The parameter of productId is passed in manually but I would like to pull the value from the url automatically like /admin/product/5/articles (5 in this case) --- what's the best way to pull from that when setting filter parameter?

Thanks so much.

I was wondering if anyone had a best practice for tracking which notifications have been read.

Let's assume you have a bubble at the top with the number of unread notifications, like on Facebook.

Currently ABP supports subscribe / publish. But I can't find anywhere automatically built in for tracking which notifications have been read and which haven't.

Anyone do this with ABP's notification framework yet?

I'm thinking I add my own table ReadNotifications with the following columns:

Id UserId NotificationsId CreationTime

Then I only add a row to this table once a notification has been read for this user. If a notification Id along with the user Id does not appear in this table, then you can assume it was not read.

I feel like that is not the best way though? Is it a table scan every time you need to check if each notification was read or not? Could get really slow.

My other idea to add a column to the AbpUsers table:

UnreadNotificationsIds

Then comma separate the notification ids that have not been read there. But I feel this is also not clean? This would be faster than the first approach probably.

Looking for your thoughts.

Thanks!

Question

The problem with Hangfire is with Castle Windsor (or any IoC for that matter). When you run a background task from something like the Services layer, the background task does not have HttpContext and so an exception is thrown.

See:

<a class="postlink" href="http://docs.hangfire.io/en/latest/background-methods/using-ioc-containers.html">http://docs.hangfire.io/en/latest/backg ... iners.html</a>

I tried messing around with it, but not having any luck.

Ideally, I achieve something like this:

private readonly ISearchAppService _searchAppService;

        public CronController(
            ISearchAppService searchAppService)
        {
            _searchAppService = searchAppService;
        }

        public JsonResult InitiateRecurringIndex()
        {
            RecurringJob.AddOrUpdate("nightly-index", () => _searchAppService.DestroyAndCreateArticlesIndex(), Cron.Daily);
            return Json(new { }, JsonRequestBehavior.AllowGet);
        }

Has anyone here figured out how to get Hangfire, Castle Windsor, and ABP to work nicely with each other?

Thanks

Question

Hi there --

I see we can install the nuget package for Redis: <a class="postlink" href="https://www.nuget.org/packages/Abp.RedisCache/">https://www.nuget.org/packages/Abp.RedisCache/</a>

After we install it, is there any special configuration to tell CacheManager to use Redis instead of the default, or does that happen automatically?

Thanks

I see you have added Feature Management and Edition Manager. This is unbelievably awesome and thank you so much for it.

Do you have any example code for edition manager?

I was able to get all tenant and user squared away nicely from the example code and they work in unison like this:

<a class="postlink" href="http://i.imgur.com/KHzLMxN.png">http://i.imgur.com/KHzLMxN.png</a>

So I was wondering where edition manager fits into all this?

Also, is it one edition per tenant or is it one edition per user? or both?

Thanks

Hi there, I upgraded my package and I'm having difficulty with my seed method after running Update-Database

"Can not set TenantId to a different value from the current filter parameter value while MayHaveTenant filter is enabled!"

My Seed Method is to populate the database with some basic data while I build my application.

Take note that I'm not using UnitOfWork manager here in seed method. Do I have to now? Perhaps I'm not using the best practice for Seed Method with ABP?

<a class="postlink" href="http://i.imgur.com/Z5KZ8Dx.png">http://i.imgur.com/Z5KZ8Dx.png</a>

Thanks

Question

Anyone have a best practice on dealing with breadcrumbs? I got the ABP NavigationProvider stuff all figured out and it's working great. But I'm still dissatisfied with how I'm dealing with breadcrumbs and was hoping for a better way. Open to suggestions, thanks.

Module Zero comes with this AuditLog table. It is a cool feature, no doubt, but I need to turn it off for some methods for security reasons.

See: <a class="postlink" href="http://i.imgur.com/46j1lX9.png">http://i.imgur.com/46j1lX9.png</a>

Any method where I am authenticating a user or creating a new account -- I need to turn it off, or at least modify it so it doesn't store the password as plaintext.

Any help? Is there a [NoAuditLog] Attribute I can use or something?

Hey there, I've run into a snag. I need to use multi-tenant and I'm trying to complete the login mechanism.

Here: <a class="postlink" href="http://i.imgur.com/6WlqFQe.png">http://i.imgur.com/6WlqFQe.png</a>

Here's the problem -- by default it seems that AbpSession.TenantId = 1. The TenantId is set to 1 even if you haven't logged in yet.

This is fine, but the problem is _userManager.LoginAsync appears to be filtering based on TenantId. I don't think this makes much sense. You can't filter on Tenant if the Tenant is set to 1.

I tested this by first being able to successfully login with a username and password if the user's TenantId was 1. I then changed the user's TenantId to 2 and I get InvalidUserNameOrEmailAddress.

Unless it's my responsibility to set the tenant session prior to running LoginAsync? That doesn't make sense either since I should only set the tenant upon a successful login.

LoginAsync should not filter on tenant in my opinion, unless I am doing something terribly wrong. Please let me know.

Thanks

Showing 1 to 10 of 11 entries