Compare commits
No commits in common. "c53cbe009668f81c53900b93c45c8747dce78f9f" and "c9bb863108617dbb733132d94e0220dd20a065f0" have entirely different histories.
c53cbe0096
...
c9bb863108
@ -10,8 +10,8 @@
|
||||
</packageRestore>
|
||||
<packageSources>
|
||||
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="LocalNugetServer" value="%LOCAL_NUGET_SERVER%" />
|
||||
<add key="Local file repository" value="%LOCAL_NUGET%" />
|
||||
<add key="Local repository" value="%LOCAL_NUGET%" />
|
||||
</packageSources>
|
||||
|
||||
<disabledPackageSources />
|
||||
</configuration>
|
@ -59,9 +59,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -58,9 +58,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
@ -1,16 +1,14 @@
|
||||
using Connected.Configuration.Authentication;
|
||||
using Connected.Configuration.Endpoints;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Connected.Configuration;
|
||||
|
||||
internal class ConfigurationService : IConfigurationService
|
||||
{
|
||||
public ConfigurationService(IConfiguration configuration)
|
||||
public ConfigurationService()
|
||||
{
|
||||
Endpoint = new EndpointConfiguration(configuration.GetSection("endpoint"));
|
||||
|
||||
Storage = new StorageConfiguration(configuration.GetSection("storage"));
|
||||
Endpoint = new EndpointConfiguration();
|
||||
Storage = new StorageConfiguration();
|
||||
}
|
||||
|
||||
public IEndpointConfiguration Endpoint { get; }
|
||||
|
@ -40,9 +40,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -1,18 +1,19 @@
|
||||
using System.Collections.Immutable;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Connected.Configuration
|
||||
{
|
||||
internal class DatabaseConfiguration : IDatabaseConfiguration
|
||||
{
|
||||
private readonly List<string> _shards;
|
||||
private List<string> _shards;
|
||||
|
||||
public DatabaseConfiguration(IConfiguration configuration)
|
||||
public DatabaseConfiguration()
|
||||
{
|
||||
DefaultConnectionString = "";
|
||||
/*
|
||||
* TODO: read from config
|
||||
*/
|
||||
DefaultConnectionString = "server=PIT-ZBOOK\\sqlexpress; database=connected; trusted_connection=true;TrustServerCertificate=True;multiple active result sets=true";
|
||||
|
||||
_shards = new();
|
||||
configuration.Bind(this);
|
||||
configuration.Bind("shards", _shards);
|
||||
}
|
||||
|
||||
public string? DefaultConnectionString { get; init; }
|
||||
|
@ -1,14 +1,7 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Connected.Configuration.Endpoints
|
||||
namespace Connected.Configuration.Endpoints
|
||||
{
|
||||
internal sealed class EndpointConfiguration : IEndpointConfiguration
|
||||
{
|
||||
public EndpointConfiguration(IConfiguration configuration)
|
||||
{
|
||||
configuration.Bind(this);
|
||||
}
|
||||
|
||||
public string? Address { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ namespace Connected.Configuration
|
||||
{
|
||||
public interface IDatabaseConfiguration
|
||||
{
|
||||
string? DefaultConnectionString { get; }
|
||||
string DefaultConnectionString { get; }
|
||||
|
||||
ImmutableList<string> Shards { get; }
|
||||
}
|
||||
|
@ -1,12 +1,10 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
namespace Connected.Configuration
|
||||
namespace Connected.Configuration
|
||||
{
|
||||
internal class StorageConfiguration : IStorageConfiguration
|
||||
{
|
||||
public StorageConfiguration(IConfiguration configuration)
|
||||
public StorageConfiguration()
|
||||
{
|
||||
Databases = new DatabaseConfiguration(configuration.GetSection("databases"));
|
||||
Databases = new DatabaseConfiguration();
|
||||
}
|
||||
|
||||
public IDatabaseConfiguration Databases { get; }
|
||||
|
@ -62,9 +62,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -152,11 +152,7 @@ internal class EntityStorage<TEntity> : IAsyncEnumerable<TEntity>, IStorage<TEnt
|
||||
|
||||
await Execute(new StorageContextArgs(operation));
|
||||
|
||||
var clone = entity.Clone();
|
||||
|
||||
ReturnValueBinder.Bind(operation, clone);
|
||||
|
||||
return clone;
|
||||
return entity;
|
||||
}
|
||||
/// <summary>
|
||||
/// Performs the update on the specified entity with optional concurrency callback support.
|
||||
@ -275,6 +271,10 @@ internal class EntityStorage<TEntity> : IAsyncEnumerable<TEntity>, IStorage<TEnt
|
||||
*/
|
||||
if (recordsAffected == 0 && args.Operation.Concurrency == DataConcurrencyMode.Enabled)
|
||||
throw new DBConcurrencyException($"{SR.ErrDataConcurrency} ({typeof(Entity).Name})");
|
||||
/*
|
||||
* Bind storage parameters with operation parameters.
|
||||
*/
|
||||
ReturnValueBinder.Bind(writer, args.Operation);
|
||||
|
||||
return recordsAffected;
|
||||
}
|
||||
|
@ -6,36 +6,47 @@ using Connected.Interop;
|
||||
|
||||
namespace Connected.Data.Storage
|
||||
{
|
||||
internal static class ReturnValueBinder
|
||||
internal static class ReturnValueBinder
|
||||
{
|
||||
public static void Bind(IStorageOperation operation, object entity)
|
||||
public static void Bind(IStorageWriter w, IStorageOperation operation)
|
||||
{
|
||||
if (operation is null || operation.Parameters is null)
|
||||
List<PropertyInfo> properties = null;
|
||||
|
||||
if (w.Operation.Parameters is null)
|
||||
return;
|
||||
|
||||
foreach (var parameter in operation.Parameters)
|
||||
foreach (var parameter in w.Operation.Parameters)
|
||||
{
|
||||
if (parameter.Direction != ParameterDirection.ReturnValue && parameter.Direction != ParameterDirection.Output)
|
||||
continue;
|
||||
|
||||
if (parameter.Value == DBNull.Value)
|
||||
continue;
|
||||
|
||||
var properties = new List<PropertyInfo>();
|
||||
|
||||
var all = entity.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
foreach (var prop in all)
|
||||
if (properties is null)
|
||||
{
|
||||
if (prop.FindAttribute<ReturnValueAttribute>() is not null)
|
||||
properties.Add(prop);
|
||||
properties = new List<PropertyInfo>();
|
||||
|
||||
var all = operation.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
foreach (var prop in all)
|
||||
{
|
||||
if (prop.FindAttribute<ReturnValueAttribute>() is not null)
|
||||
properties.Add(prop);
|
||||
}
|
||||
}
|
||||
|
||||
PropertyInfo? property = null;
|
||||
PropertyInfo property = null;
|
||||
|
||||
foreach (var prop in properties)
|
||||
if (property is null)
|
||||
{
|
||||
if (string.Equals(prop.Name, parameter.Name, StringComparison.Ordinal))
|
||||
foreach (var prop in properties)
|
||||
{
|
||||
property = prop;
|
||||
break;
|
||||
if (string.Equals(prop.Name, parameter.Name, StringComparison.Ordinal))
|
||||
{
|
||||
property = prop;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -54,9 +65,9 @@ namespace Connected.Data.Storage
|
||||
if (property is null)
|
||||
{
|
||||
var candidates = new List<string>
|
||||
{
|
||||
parameter.Name.Replace("@", string.Empty)
|
||||
};
|
||||
{
|
||||
parameter.Name.Replace("@", string.Empty)
|
||||
};
|
||||
|
||||
foreach (var prop in properties)
|
||||
{
|
||||
@ -74,28 +85,26 @@ namespace Connected.Data.Storage
|
||||
}
|
||||
}
|
||||
|
||||
if (property is null)
|
||||
continue;
|
||||
|
||||
var existingValue = property.GetValue(entity);
|
||||
var overwriteAtt = property.FindAttribute<ReturnValueAttribute>();
|
||||
|
||||
if (overwriteAtt is null)
|
||||
continue;
|
||||
|
||||
switch (overwriteAtt.ValueBehavior)
|
||||
if (property is not null)
|
||||
{
|
||||
case PropertyValueBehavior.OverwriteDefault:
|
||||
var defaultValue = property.PropertyType.GetDefault();
|
||||
var existingValue = property.GetValue(operation);
|
||||
var overwriteAtt = property.FindAttribute<ReturnValueAttribute>();
|
||||
|
||||
if (Equals(existingValue, defaultValue))
|
||||
property.SetValue(entity, TypeConversion.Convert(parameter.Value, property.PropertyType));
|
||||
break;
|
||||
case PropertyValueBehavior.AlwaysOverwrite:
|
||||
property.SetValue(entity, TypeConversion.Convert(parameter.Value, property.PropertyType));
|
||||
break;
|
||||
switch (overwriteAtt.ValueBehavior)
|
||||
{
|
||||
case PropertyValueBehavior.OverwriteDefault:
|
||||
var defaultValue = property.PropertyType.GetDefault();
|
||||
|
||||
if (Equals(existingValue, defaultValue))
|
||||
property.SetValue(operation, parameter.Value);
|
||||
break;
|
||||
case PropertyValueBehavior.AlwaysOverwrite:
|
||||
property.SetValue(operation, parameter.Value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,12 +28,10 @@ internal abstract class CommandBuilder
|
||||
|
||||
if (TryGetExisting(out StorageOperation? existing))
|
||||
{
|
||||
if (existing is null)
|
||||
return null;
|
||||
/*
|
||||
* We need to rebuild an instance since StorageOperation
|
||||
* is immutable
|
||||
*/
|
||||
* We need to rebuild an instance since StorageOperation
|
||||
* is immutable
|
||||
*/
|
||||
var result = new StorageOperation
|
||||
{
|
||||
CommandText = existing.CommandText,
|
||||
@ -45,21 +43,20 @@ internal abstract class CommandBuilder
|
||||
if (result.Parameters is null)
|
||||
return result;
|
||||
|
||||
foreach (var parameter in existing.Parameters)
|
||||
foreach (var parameter in result.Parameters)
|
||||
{
|
||||
if (ResolveProperty(parameter.Name) is PropertyInfo property)
|
||||
if (parameter.Direction == ParameterDirection.Input)
|
||||
{
|
||||
result.AddParameter(new StorageParameter
|
||||
if (ResolveProperty(parameter.Name) is PropertyInfo property)
|
||||
{
|
||||
Value = parameter.Direction switch
|
||||
result.AddParameter(new StorageParameter
|
||||
{
|
||||
ParameterDirection.Input => GetValue(property),
|
||||
_ => default
|
||||
},
|
||||
Name = parameter.Name,
|
||||
Type = parameter.Type,
|
||||
Direction = parameter.Direction
|
||||
});
|
||||
Value = GetValue(property),
|
||||
Name = parameter.Name,
|
||||
Type = parameter.Type,
|
||||
Direction = parameter.Direction
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -10,122 +10,118 @@ using System.Collections.Immutable;
|
||||
namespace Connected.Entities.Caching;
|
||||
|
||||
public abstract class EntityCacheClient<TEntity, TPrimaryKey> : StatefulCacheClient<TEntity, TPrimaryKey>, IEntityCacheClient<TEntity, TPrimaryKey>
|
||||
where TEntity : class, IPrimaryKey<TPrimaryKey>, IEntity
|
||||
where TPrimaryKey : notnull
|
||||
where TEntity : class, IPrimaryKey<TPrimaryKey>, IEntity
|
||||
where TPrimaryKey : notnull
|
||||
{
|
||||
protected EntityCacheClient(IEntityCacheContext context, string key) : base(context.Cache, key)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
protected EntityCacheClient(IEntityCacheContext context, string key) : base(context.Cache, key)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
|
||||
private IEntityCacheContext Context { get; }
|
||||
private IEntityCacheContext Context { get; }
|
||||
|
||||
protected override sealed async Task OnInitializing()
|
||||
{
|
||||
using var ctx = Context.ContextProvider.Create();
|
||||
protected override sealed async Task OnInitializing()
|
||||
{
|
||||
using var ctx = Context.ContextProvider.Create();
|
||||
|
||||
var transaction = ctx.GetService<ITransactionContext?>();
|
||||
var transaction = ctx.GetService<ITransactionContext?>();
|
||||
|
||||
try
|
||||
{
|
||||
if (await OnInitializing(ctx) is ImmutableList<TEntity> ds)
|
||||
{
|
||||
foreach (var r in ds)
|
||||
Set(r.Id, r, TimeSpan.Zero);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (await OnInitializing(ctx) is ImmutableList<TEntity> ds)
|
||||
{
|
||||
foreach (var r in ds)
|
||||
Set(r.Id, r, TimeSpan.Zero);
|
||||
}
|
||||
|
||||
if (transaction is not null)
|
||||
await transaction.Commit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (transaction is not null)
|
||||
await transaction.Rollback();
|
||||
if (transaction is not null)
|
||||
await transaction.Commit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (transaction is not null)
|
||||
await transaction.Rollback();
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual async Task<ImmutableList<TEntity>?> OnInitializing(IContext context)
|
||||
{
|
||||
if (context.GetService<IStorageProvider>() is not IStorageProvider db)
|
||||
return default;
|
||||
protected virtual async Task<ImmutableList<TEntity>?> OnInitializing(IContext context)
|
||||
{
|
||||
if (context.GetService<IStorageProvider>() is not IStorageProvider db)
|
||||
return default;
|
||||
|
||||
return await (from dc in db.Open<TEntity>()
|
||||
select dc).AsEntities();
|
||||
}
|
||||
return await (from dc in db.Open<TEntity>()
|
||||
select dc).AsEntities();
|
||||
}
|
||||
|
||||
protected override async Task OnInvalidate(TPrimaryKey id)
|
||||
{
|
||||
using var ctx = Context.ContextProvider.Create();
|
||||
var transaction = ctx.GetService<ITransactionContext>();
|
||||
protected override async Task OnInvalidate(TPrimaryKey id)
|
||||
{
|
||||
using var ctx = Context.ContextProvider.Create();
|
||||
var transaction = ctx.GetService<ITransactionContext>();
|
||||
|
||||
try
|
||||
{
|
||||
if (OnInvalidating(ctx, id) is TEntity entity && entity is IPrimaryKey<TPrimaryKey> pk)
|
||||
Set(pk.Id, entity, TimeSpan.Zero);
|
||||
try
|
||||
{
|
||||
if (OnInvalidating(ctx, id) is TEntity entity && entity is IPrimaryKey<TPrimaryKey> pk)
|
||||
Set(pk.Id, entity, TimeSpan.Zero);
|
||||
|
||||
if (transaction is not null)
|
||||
await transaction.Commit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (transaction is not null)
|
||||
await transaction.Rollback();
|
||||
if (transaction is not null)
|
||||
await transaction.Commit();
|
||||
}
|
||||
catch
|
||||
{
|
||||
if (transaction is not null)
|
||||
await transaction.Rollback();
|
||||
|
||||
throw;
|
||||
}
|
||||
}
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual async Task<TEntity?> OnInvalidating(IContext context, TPrimaryKey id)
|
||||
{
|
||||
if (context.GetService<IStorageProvider>() is not IStorageProvider provider)
|
||||
return default;
|
||||
protected virtual async Task<TEntity?> OnInvalidating(IContext context, TPrimaryKey id)
|
||||
{
|
||||
if (context.GetService<IStorageProvider>() is not IStorageProvider provider)
|
||||
return default;
|
||||
|
||||
var entities = await provider.Open<TEntity>().AsEntities();
|
||||
return await (from dc in provider.Open<TEntity>()
|
||||
where TypeComparer.Compare(dc.Id, id)
|
||||
select dc).AsEntity();
|
||||
}
|
||||
|
||||
var entity = entities.FirstOrDefault(e => e.Id.Equals(id));
|
||||
async Task IEntityCacheClient<TEntity, TPrimaryKey>.Refresh(TPrimaryKey id)
|
||||
{
|
||||
await Refresh(id);
|
||||
}
|
||||
|
||||
return await (from dc in provider.Open<TEntity>()
|
||||
where TypeComparer.Compare(dc.Id, id)
|
||||
select dc).AsEntity();
|
||||
}
|
||||
async Task IEntityCacheClient<TEntity, TPrimaryKey>.Remove(TPrimaryKey id)
|
||||
{
|
||||
await Remove(id);
|
||||
}
|
||||
|
||||
async Task IEntityCacheClient<TEntity, TPrimaryKey>.Refresh(TPrimaryKey id)
|
||||
{
|
||||
await Refresh(id);
|
||||
}
|
||||
protected override void Set(TPrimaryKey id, TEntity instance)
|
||||
{
|
||||
Set(id, instance, TimeSpan.Zero);
|
||||
}
|
||||
|
||||
async Task IEntityCacheClient<TEntity, TPrimaryKey>.Remove(TPrimaryKey id)
|
||||
{
|
||||
await Remove(id);
|
||||
}
|
||||
protected override void Set(TPrimaryKey id, TEntity instance, TimeSpan duration)
|
||||
{
|
||||
if (instance is IConcurrentEntity<TPrimaryKey> concurrent)
|
||||
{
|
||||
if (Get(id) is TEntity existing && existing is IConcurrentEntity<TPrimaryKey> existingConcurrent)
|
||||
{
|
||||
lock (existingConcurrent)
|
||||
{
|
||||
if (existingConcurrent.Sync != concurrent.Sync)
|
||||
throw new InvalidOperationException(SR.ErrConcurrent);
|
||||
|
||||
protected override void Set(TPrimaryKey id, TEntity instance)
|
||||
{
|
||||
Set(id, instance, TimeSpan.Zero);
|
||||
}
|
||||
concurrent.GetType().GetProperty(nameof(IConcurrentEntity<TPrimaryKey>.Sync))?.SetValue(concurrent, concurrent.Sync + 1);
|
||||
|
||||
protected override void Set(TPrimaryKey id, TEntity instance, TimeSpan duration)
|
||||
{
|
||||
if (instance is IConcurrentEntity<TPrimaryKey> concurrent)
|
||||
{
|
||||
if (Get(id) is TEntity existing && existing is IConcurrentEntity<TPrimaryKey> existingConcurrent)
|
||||
{
|
||||
lock (existingConcurrent)
|
||||
{
|
||||
if (existingConcurrent.Sync != concurrent.Sync)
|
||||
throw new InvalidOperationException(SR.ErrConcurrent);
|
||||
Set(id, instance, duration);
|
||||
|
||||
concurrent.GetType().GetProperty(nameof(IConcurrentEntity<TPrimaryKey>.Sync))?.SetValue(concurrent, concurrent.Sync + 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Set(id, instance, duration);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
base.Set(id, instance, duration);
|
||||
}
|
||||
base.Set(id, instance, duration);
|
||||
}
|
||||
}
|
||||
|
@ -56,9 +56,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -85,14 +85,6 @@ public static class EntitiesExtensions
|
||||
return Serializer.Merge(newEntity, existing, modifier, new StateModifier { State = state }, sources);
|
||||
}
|
||||
|
||||
public static TEntity Clone<TEntity>(this TEntity existing)
|
||||
where TEntity : IEntity
|
||||
{
|
||||
var newEntity = Activator.CreateInstance<TEntity>();
|
||||
|
||||
return Serializer.Merge(newEntity, existing);
|
||||
}
|
||||
|
||||
public static async Task<ImmutableList<TSource>> AsEntities<TSource>(this IQueryable<TSource> source, CancellationToken cancellationToken = default)
|
||||
{
|
||||
if (source is null)
|
||||
|
@ -42,9 +42,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -40,8 +40,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -56,8 +56,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -71,8 +71,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -13,10 +13,7 @@ namespace Connected.Instance
|
||||
var options = new WebApplicationOptions();
|
||||
config.Bind(options);
|
||||
|
||||
var builder = WebApplication
|
||||
.CreateBuilder(options);
|
||||
|
||||
builder.Configuration.AddConfiguration(config);
|
||||
var builder = WebApplication.CreateBuilder(options);
|
||||
|
||||
var startups = Assemblies.QueryImplementations<IStartup>();
|
||||
|
||||
|
@ -55,13 +55,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -41,8 +41,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -61,8 +61,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -41,8 +41,5 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
@ -61,8 +61,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -43,8 +43,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -58,8 +58,5 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
|
||||
</Project>
|
||||
|
@ -61,8 +61,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -55,8 +55,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
@ -56,8 +56,4 @@
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
<Copy SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).snupkg" DestinationFolder="$([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET'))" />
|
||||
</Target>
|
||||
<Target Name="UploadLocalPackages" AfterTargets="CopyPackages" >
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).nupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
<Exec Command="dotnet nuget push -s LocalNugetServer $(OutputPath)..\$(PackageId).$(PackageVersion).snupkg --api-key $([System.Environment]::GetEnvironmentVariable('LOCAL_NUGET_SERVER_TOKEN'))" IgnoreExitCode="true"></Exec>
|
||||
</Target>
|
||||
</Project>
|
||||
|
Loading…
x
Reference in New Issue
Block a user