public async Task <TEntity> GetEntityAsync(Guid id) { if (!Readable()) { throw new NotSupportedException("Service doesn't support."); } bool timeout; TEntity entity = _Cache.GetEntity(id, out timeout); if (entity != null) { if (timeout) { ReloadAsync(id).Start(); } return(entity); } else { entity = ServiceEntityProxyBuilder.CreateEntityProxy <TEntity>(); } var values = await GetEntityCoreAsync(id); if (values == null) { return(null); } MapToEntity(entity, values); return(entity); }
public TEntity Create() { return(ServiceEntityProxyBuilder.CreateEntityProxy <TEntity>()); }