Base solution for your next web application

Activities of "nobruds"

Hello,

I am getting an error while using asp net mvc controller and view with RazorGenerator.

I have an web app that has only a Login view and controller, I use the razor generator to create a dll and use this "Log On" page on all my websites, so I don't need to duplicate code, on this site I need to use abp framework.

This used to work fine, but now I am getting the "service not found" error on this controller

I tried to add the framework and use ApbController base class but didn't work.

What Am I missing here ? :?:

Thanks

Summary: Website 1: common Logon view and controller to use in other sites, like an asp.net ascx control.

Website 2: My main site that references website 1 dll, the page start is the Logon view from Website 1.

After base.Application_Start(sender, e); got the error : "No component for supporting the service Pine.ToolBox.Controllers.AccountController was found"

Hello

Tks GuillaumeMorin, that filter helped to reduce the time a lot, and with the GlobalAssemblyCache filter its now acceptable

Now I will see I can do something on the Modules PreInitialize, Initialize and PostInitialize, its taking 2-3 seconds for 26 modules.

thanks again

Well, I gained 2 seconds by adding this filter:

Class: WebAssemblyFinder - Method: GetAllAssembliesInternal

Before:

List<Assembly> allReferencedAssemblies = BuildManager.GetReferencedAssemblies().Cast<Assembly>().ToList();

After:

List<Assembly> allReferencedAssemblies = BuildManager.GetReferencedAssemblies().Cast<Assembly>().Where(a => !a.GlobalAssemblyCache).ToList();

How can I optimize more ? should I make it async ?

Thanks

hello

I am having a problem with the initialization of my modules, its taking too long (10-15 seconds) to load, is it normal ?

here's the Log:

[DEBUG]-[2016-05-18 12:16:15,255] AbpModuleManager - Loading Pine modules... [DEBUG]-[2016-05-18 12:16:20,112] AbpModuleManager - Found 26 Pine modules in total.

The first 5 or more seconds is on this code :

var moduleTypes = AddMissingDependedModules(_moduleFinder.FindAll());

That goes to class WebAssemblyFinder to get all assemblies

List<Assembly> GetAllAssembliesInternal()

Then logs all my modules names

[DEBUG]-[2016-05-18 12:16:20,123] AbpModuleManager - 26 modules loaded.

But then more 7+ seconds until this part:

[DEBUG]-[2016-05-18 12:16:27,257] LocalizationManager - Initializing 2 localization sources.

That is on the PreInitialize, initialize and postInitialize methods for every module

var sortedModules = _modules.GetSortedModuleListByDependency();

sortedModules.ForEach(module => module.Instance.PreInitialize());
sortedModules.ForEach(module => module.Instance.Initialize());
sortedModules.ForEach(module => module.Instance.PostInitialize());

Is 26 too many modules ? or my configuration is wrong in some part ?

Thanks

Answer

Hi,

Whys there's not an NHibernate option to generate from template anymore ?

thanks

Hello,

I am getting an error on WindsorControllerFactory, GetControllerInstance method. its trying to resolve my javascripts files as controllers. Why is Castle Windsor trying to resolve 'Scripts' as a controller? is an configuration ?

I saw on stackoverflow that I should use MVCContrib lib for that.

Thanks

I think he means like this: (i do like this)

public interface ICustomRepository : IRepository<YourEntity>
{
        void CustomMethodProcCall_1(int someParameter);
        void CustomMethodProcCall_2();
}

public class CustomRepository: NhRepositoryBase<YourEntity>, ICustomRepository 
{
        private readonly string _procExecCommand01 = "Exec procName @Parameter = N'{0}' ";
        private readonly string _procExecCommand02 = "Exec procName02";

        public CustomRepository(ISessionProvider sessionProvider)
            : base(sessionProvider)
        {
        }

        public void CustomMethodProcCall_1(int someParameter)
        {
                var sqlQuery = string.Format(_procExecCommand01, someParameter);
                Session.CreateSQLQuery(sqlQuery).ExecuteUpdate();
        }
        public void CustomMethodProcCall_2()
        {
                Session.CreateSQLQuery(_procExecCommand02).ExecuteUpdate();
        }

}

<cite>Tarcisis: </cite> Hi there,

Can you be more specific?

Great

thanks hikalkan

<cite>hikalkan: </cite> Hi,

If you need to filter/sort entities and get a list of entities, you have two options:

  1. In application service, just call Repository.GetAll().Where(...).OrderBy(...).ToList(); I prefer it normally. Because App services can use repository. And this filters is UI and case specific, not related to your domain logic at all. They should not be in domain service.

  2. Add a custom repository method for each such query. This has just one advantage: If you need to replace query by a stored procedure or change EF to a different ORM which does not supports IQueryable, your application services does not effected, you just change the repository method implementation.

So, it's your choice. If you don't think to change to an non queryable ORM, then prefer 1st one.

Oh, i missed the domain services. I will check it, thanks.

Edit: But... As you can see on [http://aspnetboilerplate.com/Pages/Documents/Application-Services]) CreatePerson method has:

var person = _personRepository.FirstOrDefault(p => p.EmailAddress == input.EmailAddress);

SearchPeople method has:

var query = _personRepository.GetAll();

so my point is, those filters (rules) should be on Application Services not in a Custom Repository right ?

thanks

Hello,

I think I am doing something wrong about custom repositories.

If I need some logic or filters to be made, I create a custom repository I put that in there, not right ?

I saw on ModuleZeroSampleProject that if you need to perform filters on DB you put that on the ApplicationService

So, What is the best practice here: NHibernate Layer (custom repository)

var result = Session.QueryOver<ConfiguracaoProduto>()
                        .Where(c => c.ProdutoEstruturaID == produtoEstruturaID)
                        .SingleOrDefault();

or

Application layer (service)

private readonly IRepository<ConfiguracaoProduto> _produtoRepository;
var result = _produtoRepository.Single(p => p.ProdutoEstruturaID == produtoEstruturaID);
Showing 1 to 10 of 40 entries