using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata; using Orleans; using Orleans.Runtime; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pole.Orleans.Provider.EntityframeworkCore { public abstract class GrainStorageOptions { internal string KeyPropertyName { get; set; } internal string KeyExtPropertyName { get; set; } internal string ETagPropertyName { get; set; } internal string PersistenceCheckPropertyName { get; set; } internal IProperty ETagProperty { get; set; } internal bool CheckForETag { get; set; } internal Func ConvertETagObjectToStringFunc { get; set; } internal Type ETagType { get; set; } public bool ShouldUseETag { get; set; } internal bool IsConfigured { get; set; } internal bool PreCompileReadQuery { get; set; } = true; } public class GrainStorageOptions : GrainStorageOptions where TContext : DbContext where TEntity : class { internal Func> DbSetAccessor { get; set; } internal Func IsPersistedFunc { get; set; } internal Func GetETagFunc { get; set; } internal Func GuidKeySelector { get; set; } internal Func KeyExtSelector { get; set; } internal Func LongKeySelector { get; set; } public bool IsRelatedData { get; set; } internal Func> ReadStateAsync { get; set; } internal Action SetEntity { get; set; } internal Func GetEntity { get; set; } } }