智慧建筑第三方功能集成微服务,目的是聚集所有涉及到第三方厂商调用的功能,按照业务功能划分不同微服务
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using WeiCloud.Core.Common;
|
|
|
|
|
|
|
|
|
|
|
|
namespace WeiCloud.Core.BaseCore
|
|
|
|
|
|
{
|
|
|
|
|
|
//public interface GrainFactory
|
|
|
|
|
|
//{
|
|
|
|
|
|
// T GetGrain<T>(long guid) where T : WeiCloud.Core.BaseCore.IGrainWithIntegerKey;
|
|
|
|
|
|
//}
|
|
|
|
|
|
public class GrainFactory //: GrainFactory
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly IServiceProvider _serviceProvider;
|
|
|
|
|
|
public GrainFactory(IServiceProvider serviceProvider)
|
|
|
|
|
|
{
|
|
|
|
|
|
_serviceProvider = serviceProvider;
|
|
|
|
|
|
}
|
|
|
|
|
|
public T GetGrain<T>(long guid) where T : WeiCloud.Core.BaseCore.IGrainWithIntegerKey
|
|
|
|
|
|
{
|
|
|
|
|
|
return (T)_serviceProvider.GetService(typeof(T));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|