public IEntityVariantSetup GetEntityVariant(string?alias) { if (string.IsNullOrWhiteSpace(alias) || SubEntityVariants == null || EntityVariant.Alias == alias) { return(EntityVariant); } else { return(SubEntityVariants.FirstOrDefault(x => x.Alias == alias) ?? throw new InvalidOperationException($"Entity variant with alias {alias} does not exist.")); } }
internal EntityVariant GetEntityVariant(string?alias) { if (string.IsNullOrWhiteSpace(alias) || SubEntityVariants == null) { return(EntityVariant); } else { return(SubEntityVariants.First(x => x.Alias == alias)); } }
public IEntityVariantSetup GetEntityVariant(string?alias) { if (string.IsNullOrWhiteSpace(alias) || SubEntityVariants == null || EntityVariant.Alias == alias) { return(EntityVariant); } else { return(SubEntityVariants.First(x => x.Alias == alias)); } }
public IEntityVariantSetup GetEntityVariant(IEntity entity) { return(SubEntityVariants?.FirstOrDefault(x => x.Type == entity.GetType()) ?? EntityVariant); }
internal EntityVariant GetEntityVariant(IEntity entity) { return(SubEntityVariants?.FirstOrDefault(x => x.Type == entity.GetType()) ?? EntityVariant); }