2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-06-27 05:23:13 +00:00
This commit is contained in:
2024-03-25 17:59:55 +03:00
parent 81f9f92755
commit 8ab0e811bd
21 changed files with 255 additions and 100 deletions

View File

@ -11,14 +11,14 @@
<PackageProjectUrl>http://www.esiur.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/esiur/esiur-dotnet/</RepositoryUrl>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<Version>1.5.5</Version>
<Version>1.5.6</Version>
<PackageId>Esiur.Stores.MongoDB</PackageId>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MongoDB.Bson" Version="2.12.3" />
<PackageReference Include="MongoDB.Driver" Version="2.12.3" />
<PackageReference Include="MongoDB.Bson" Version="2.24.0" />
<PackageReference Include="MongoDB.Driver" Version="2.24.0" />
</ItemGroup>
<ItemGroup>

View File

@ -51,15 +51,15 @@ public class MongoDBStore : IStore
KeyList<string, WeakReference> resources = new KeyList<string, WeakReference>();
[Public]
[Export]
public event ResourceEventHandler<IResource> ResourceAdded;
[Public]
[Export]
public event ResourceEventHandler<IResource> ResourceRemoved;
int count = 0;
[Public]
[Export]
public virtual int Count
{
get
@ -109,7 +109,7 @@ public class MongoDBStore : IStore
return true;
}
[Public]
[Export]
public bool Remove(IResource resource)
{
var objectId = resource.Instance.Variables["objectId"].ToString();

View File

@ -35,7 +35,7 @@ namespace Esiur.Stores.MongoDB
{
public class MongoDBStore<T> : MongoDBStore where T:IResource
{
[Public]
[Export]
public async AsyncReply<T> New(string name = null, object properties = null)
{
var resource = await Warehouse.New<T>(name, this, null, null, null, properties);
@ -43,7 +43,7 @@ namespace Esiur.Stores.MongoDB
return resource;
}
[Public]
[Export]
public async AsyncReply<IResource[]> Slice(int index, int limit)
{
var list = await this.Instance.Children<IResource>();