public void Refresh() { const string queryTemplate = @"SELECT Entity.FullName, Entity.Namespace, Entity.BaseType, (Entity.Type ISA 'System.Indication') AS IsIndication, Entity.Properties.Name, Entity.Properties.Type, Entity.Properties.IsNavigable, Entity.Properties.IsInherited, Entity.Properties.IsKey, Entity.Verbs.EntityName, Entity.Verbs.Name, Entity.IsAbstract{0} FROM Metadata.Entity"; const string crudFragment = ", Entity.CanCreate, Entity.CanDelete, Entity.CanInvoke, Entity.CanRead, Entity.CanUpdate"; string query = string.Format(queryTemplate, SupportsAccessControl() ? crudFragment : string.Empty); entities = info.Query <Entity>(query).ToDictionary(entity => entity.FullName); foreach (var entity in entities.Values) { Entity baseEntity; if (entity.BaseType != null && entities.TryGetValue(entity.BaseType, out baseEntity)) { entity.BaseEntity = baseEntity; } } EntitiesRefreshed?.Invoke(this, new EventArgs()); }
public void Refresh() { string query = $"SELECT {string.Join(",", MetadataAttributes)} FROM Metadata.Entity"; entities = info.Query <Entity>(query).ToDictionary(entity => entity.FullName); foreach (var entity in entities.Values) { if (entity.BaseType != null && entities.TryGetValue(entity.BaseType, out var baseEntity)) { entity.BaseEntity = baseEntity; } } EntitiesRefreshed?.Invoke(this, new EventArgs()); }