Hi,
I am implamanting SignalR Hub. I am injecting IAbpSession as you described in documentation. Problem is that its not injected, only nullinstance is retrieved. On the other hand Logger works as expected. I am using abp version 0.8.4.
public class PrintDigitalHub : Hub, ITransientDependency
{
public ILogger Logger { get; set; }
public IAbpSession AbpSession { get; set; }
private readonly IOnlineClientManager _onlineClientManager;
public PrintDigitalHub(IOnlineClientManager onlineClientManager, IIocResolver iocResolver)
{
_onlineClientManager = onlineClientManager;
Logger = NullLogger.Instance;
AbpSession = NullAbpSession.Instance;
}
public async override Task OnConnected()
{
await base.OnConnected();
var client = new OnlineClient(
Context.ConnectionId,
GetIpAddressOfClient(),
AbpSession.TenantId,
AbpSession.UserId
);
Logger.Debug("A client is connected: " + client);
_onlineClientManager.Add(client);
}
Thanks for your help.
Hi Halil,
What is the best way of deserializing String returned from SettingManager in ApplicationService.
I have a multidimensional setting just like this "[[1, 2],[3, 4,],[5, 6],[7, 8]]"
Currently I am using NewtonsoftJson.
var z = JsonConvert.DeserializeObject<Double[][]>(await SettingManager.GetSettingValueAsync("MaxDigitalSheetCounts"));
Is it possible to extend SettingManager to return Array from String?
Thank you Ivan
Hello,
In my ApplicationService I need to deserialize list of objects send from client to concrete classes which inherits abstract class Module.
public ModulesDto
{
public List<Module> {...}
}
public abstract class Module
{...}
public class Module1: Module
{...}
public class Module2: Module
{...}
but I got null.
Is there a way to do it? I found interesting article, and even more interesting comment bellow, how to implement it.
var settings = new JsonSerializerSettings {TypeNameHandling = TypeNameHandling.Auto};
<a class="postlink" href="http://www.tomdupont.net/2014/04/deserialize-abstract-classes-with.html">http://www.tomdupont.net/2014/04/deseri ... -with.html</a>
Thanks. :)