I have the following 3 classes.
A workflow configuration has one brand and one workflowtype.
I need one method in linq or EF that gets me all the brands of existing workflowconfiguration and another method that gets me all the brands of non existing workflow configuration.
I am lost cause I dont know where to start.
public class Brand
{
public int BrandId { get; set; }
public string Name { get; set; }
}
public class WorkflowType
{
public int WorkflowTypeId { get; set; }
public string Name { get; set; }
}
public class WorkflowConfiguration
{
public int WorkflowConfigurationId { get; set; }
public WorkflowType WorkflowType { get; set; }
public Brand Brand { get; set; }
public virtual ICollection<Approver> Approvers { get; set; }
}
Update1 Here are how my tables would look like and the expected result
Brand
Audi
Volkswagen
Mercedes
WorkflowTYpes
type 1
type 2
type 3
WorkflowConfiguration
brandid, workflowtype id
1 ------------ 1
1 -------------2
List<string> GetBrandsForExistingWorkflowType(string worfklowtype)
If I pass type1 to this method it should return: Audi because for type1, audi exists on the table
List<string> GetBrandsForNonExistingWorkflowType(string workflowType)
If I pass type1 to this method it should return. Volkswagen and Mercedes because for type1, those 2 brands are not in the relationship.