mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-06-26 21:13:13 +00:00
demo
This commit is contained in:
18
Esiur.Examples.StandaloneWebServerDemo/Demo.cs
Normal file
18
Esiur.Examples.StandaloneWebServerDemo/Demo.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Esiur.Resource;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Esiur.Examples.StandaloneWebServerDemo
|
||||
{
|
||||
[Export]
|
||||
[Resource]
|
||||
public partial class Demo
|
||||
{
|
||||
[Export] int age { get; set; }
|
||||
[Export] string name { get; set;}
|
||||
[Export]
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Esiur" Version="2.4.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
22
Esiur.Examples.StandaloneWebServerDemo/Program.cs
Normal file
22
Esiur.Examples.StandaloneWebServerDemo/Program.cs
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
using Esiur.Net.IIP;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Stores;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
private static async Task Main(string[] args)
|
||||
{
|
||||
// Create a store to keep objects.
|
||||
var system = await Warehouse.Put("sys", new MemoryStore());
|
||||
// Create a distibuted server
|
||||
var esiurServer = await Warehouse.Put("sys/server", new DistributedServer());
|
||||
// Add your object to the store
|
||||
var service = await Warehouse.Put("sys/demo", new EsiurGreeter());
|
||||
|
||||
|
||||
// Start your server
|
||||
await Warehouse.Open();
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user