public static IList <ServiceWorkflow> GetFunctionServiceWorkflows(MemberUser memberUser, int functionId, string serviceCode) { try { var fwf = new List <ServiceWorkflow>(); foreach (var fw in memberUser.GetEffectiveCreatorServiceWorkflows().Where(fw => fw.MemberFunction.FunctionID == functionId && ContainsService(fw.WorkflowServices, serviceCode))) { fwf.Add(fw); } return(fwf); } catch (NullReferenceException) { throw new NullReferenceException("function work flow is null"); } }
public static ServiceWorkflow GetFunctionServiceWorkflow(MemberUser memberUser, int functionId) { try { var fwf = new ServiceWorkflow(); foreach (var fw in memberUser.GetEffectiveCreatorServiceWorkflows().Where(fw => fw.MemberFunction.FunctionID == functionId)) { fwf = fw; break; } return(fwf); } catch (NullReferenceException) { throw new NullReferenceException("function work flow is null"); } }