Base solution for your next web application

Activities of "jesse"

Question

When I get user ID from apb.session.userid,first time it works well.but when i logout,Change the user logon apb.session.userid is Last logon user ID,it was caching. how can i get apb.session.userid Real-time

Thank you for your answer,I have modified my code.

public int? UserId
        {
            get
            {
                var userId = HttpContext.Current.Session["UserId"];
                if (userId == null)
                {
                    return null;
                }
                return Convert.ToInt32(userId);
            }
            set { throw new NotImplementedException(); }
        }

but I'm worried about high concurrency and Multithreading, session will have problem,And mobile App can use like this?

Hi

I Use HttpContext.Current.Session int my project ,when I login succeed,I Assign values to the AbpSession object's properties , but when I refresh my page, abpSession object's properties always is null . but sometimes it's ok .how can I Keep Session State。Do I need to Assign values in Application_BeginRequest(AbpWebApplication ) method ?

thank you

Question

hi, I stored Localization text in .NET's resource files.L method in MVC Views is also localized into English,when changing the language . but it work well in Application layer and Controller layer thank you !

<cite>hikalkan: </cite> Hi,

ProductAppService waiting for IProuctRepository but you're registering IRepository<Prouct>. You can change injected repository to IRepository<Prouct> or implement IProuctRepository by deriving from AdoRepositoryBase<Product>.

This is my implementation class has been deriving from GalaxyRepositoryBase<Product>,but cannot automatic injection

//Galaxy.Ado--ProductRepository.cs
  public class ProductRepository : GalaxyRepositoryBase<Product>, IProuctRepository
    {
        public List<Product> GetAll(int? id)
        {
            var products = new List<Product> { new Product { Id = 1 } };
            return products;
        }
    }
//Galaxy.Ado--GalaxyRepositoryBase.cs
public abstract class GalaxyRepositoryBase<TEntity, TPrimaryKey> : AdoRepositoryBase<TEntity, TPrimaryKey>
       where TEntity : class, IEntity<TPrimaryKey>
    {

    }
    public abstract class GalaxyRepositoryBase<TEntity> : GalaxyRepositoryBase<TEntity, int>
        where TEntity : class, IEntity<int>
    {
    }

When I coded this works good,But I want to automatically inject.

//Galaxy.Ado--GalaxyDataModule.cs
[DependsOn(typeof(GalaxyCoreModule), typeof(GalaxyDBModule))]
    public class GalaxyDataModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.IocContainer.Register(
                       Component.For<IProuctRepository>().ImplementedBy<ProductRepository>().LifestyleTransient()
                );
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }

I am a Chinese coder, my English is poor. Thank for you .

Hi I want to use the Ado.net to Save Data. I created a class library “Abp.Ado” just ike "Abp.EntityFramework" , then I created a class "AdoRepositoryInstaller.cs"

internal class AdoRepositoryInstaller : IWindsorInstaller
    {
        public void Install(IWindsorContainer container, IConfigurationStore store)
        {
            container.Register(
                Component.For(typeof(IRepository<>)).ImplementedBy(typeof(AdoRepositoryBase<>)).LifestyleTransient(),
                Component.For(typeof(IRepository<,>)).ImplementedBy(typeof(AdoRepositoryBase<,>)).LifestyleTransient()
                );
        }
    }

then Create a module "GalaxyDBModule.cs"

public override void Initialize()
        {
            IocManager.IocContainer.Install(new AdoRepositoryInstaller());
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());          
        }

But running error

Can't create component 'Galaxy.Application.Products.ProductAppService' as it has dependencies to be satisfied.

'Galaxy.Application.Products.ProductAppService' is waiting for the following dependencies:

- Service 'Galaxy.Core.Products.IProuctRepository' which was not registered.

thank you

Showing 1 to 6 of 6 entries