Class EntityState<T>
public class EntityState<T> : IDisposable where T : class, IEntity
Type Parameters
T
- Inheritance
-
EntityState<T>
- Implements
- Inherited Members
Constructors
EntityState(IServices, Options, PersistentComponentState, ILogger<EntityState<T>>)
public EntityState(IServices services, Options options, PersistentComponentState applicationState, ILogger<EntityState<T>> logger)
Parameters
servicesIServicesoptionsOptionsapplicationStatePersistentComponentStateloggerILogger<EntityState<T>>
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
RegisterPersist(T, string)
Serialises entity under key when prerendering completes.
public void RegisterPersist(T entity, string key)
Parameters
entityTkeystring
TryRestore(string, out T?, IEntityContext?)
Deserialises the entity persisted under key by a previous render, re-registering it for any further persistence.
public bool TryRestore(string key, out T? entity, IEntityContext? context = null)
Parameters
keystringentityTcontextIEntityContext