Base solution for your next web application

Activities of "nobruds"

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

Answer

Hi,

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

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

<cite>daws: </cite> With Hibernate, I don't know. I use EF with multiple dbcontext without problem :) (multiple db context for oracle, sqlserver & sqlite)

Yeah, hikalkan did an sample for EF.

I am trying to adapt for NH yet =)

Well, for me, as I am not an expert, I can say that I am having trouble trying to implement the Multiple dbcontext for multiple databases, using NHibernate.

That would solve 90% of my problems :) But maybe its not an disadvantage of the framework, I am the who can't figure this out...yet.

cya

Oh, great..

And should I use the "IocManager.Instance.Release(myService);" after use?

as said on Resolve method Summary

Thanks a lot

Yes, I did some but not according that last article.

I made changes on AbpNHibernateModule.cs, AbpNHibernateConfigurationExtensions.cs and NhRepositoryInstaller.cs.

I will adapt it and post here.

thanks

edit: the article [http://fabiomaulo.blogspot.com.br/2009/09/configure-sessionfactory-providers.html])

Showing 1 to 10 of 29 entries