public UserBaseEntity Construct(bool isValid = true) { switch (_type) { case "AdminEntity": return(AdminEntity.GetEntity(isValid, _fixedStrValues)); case "FarmerEntity": return(FarmerEntity.GetEntity(isValid, _fixedStrValues)); default: throw new Exception($"Cannot find entity type {_type}"); } }
public BaseEntity Construct(bool isValid = true) { return(_type switch { "TradingPostListingEntity" => TradingPostListingEntity.GetEntity(isValid, _fixedStrValues), "TradingPostCategoryEntity" => TradingPostCategoryEntity.GetEntity(isValid, _fixedStrValues), "AdminEntity" => AdminEntity.GetEntity(isValid, _fixedStrValues), "FarmEntity" => FarmEntity.GetEntity(isValid, _fixedStrValues), "MilkTestEntity" => MilkTestEntity.GetEntity(isValid, _fixedStrValues), "FarmerEntity" => FarmerEntity.GetEntity(isValid, _fixedStrValues), "ImportantDocumentCategoryEntity" => ImportantDocumentCategoryEntity.GetEntity(isValid, _fixedStrValues), "TechnicalDocumentCategoryEntity" => TechnicalDocumentCategoryEntity.GetEntity(isValid, _fixedStrValues), "QualityDocumentCategoryEntity" => QualityDocumentCategoryEntity.GetEntity(isValid, _fixedStrValues), "QualityDocumentEntity" => QualityDocumentEntity.GetEntity(isValid, _fixedStrValues), "TechnicalDocumentEntity" => TechnicalDocumentEntity.GetEntity(isValid, _fixedStrValues), "ImportantDocumentEntity" => ImportantDocumentEntity.GetEntity(isValid, _fixedStrValues), "NewsArticleEntity" => NewsArticleEntity.GetEntity(isValid, _fixedStrValues), "AgriSupplyDocumentCategoryEntity" => AgriSupplyDocumentCategoryEntity.GetEntity(isValid, _fixedStrValues), "SustainabilityPostEntity" => SustainabilityPostEntity.GetEntity(isValid, _fixedStrValues), "AgriSupplyDocumentEntity" => AgriSupplyDocumentEntity.GetEntity(isValid, _fixedStrValues), "PromotedArticlesEntity" => PromotedArticlesEntity.GetEntity(isValid, _fixedStrValues), _ => throw new Exception($"Cannot find entity type {_type}"), });