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.
24 lines
702 B
24 lines
702 B
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)); |
|
} |
|
} |
|
} |