2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-26 21:13:13 +00:00

Resource Proxy

This commit is contained in:
2019-07-23 06:22:24 +03:00
parent 2d9f61c0d9
commit a2f4238933
12 changed files with 238 additions and 23 deletions

View File

@ -11,7 +11,7 @@
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/esiur/esiur-dotnet/</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.2.0</Version>
<Version>1.2.2</Version>
</PropertyGroup>
<ItemGroup>

View File

@ -11,6 +11,7 @@ using System.Threading.Tasks;
using Esiur.Resource.Template;
using System.Linq;
using Esiur.Security.Permissions;
using Esiur.Proxy;
namespace Esiur.Stores.MongoDB
{
@ -100,8 +101,9 @@ namespace Esiur.Stores.MongoDB
return new AsyncReply<IResource>(null);
var document = list[0];
var type = Type.GetType(document["classname"].AsString);
IResource resource = (IResource)Activator.CreateInstance(Type.GetType(document["classname"].AsString));
IResource resource = (IResource)Activator.CreateInstance(ResourceProxy.GetProxy(type));
resources.Add(document["_id"].AsObjectId.ToString(), resource);
Warehouse.Put(resource, document["name"].AsString, this);