static public int GetCompanyMiddlemanId(string companyName, string middlemanName) { int idCompanyMiddleman = db.CompanyMiddlemen.Where(cm => cm.IdCompany == CompanyDataManipulation.GetId(companyName) && cm.IdMiddleman == MiddlemanDataManipulation.GetId(middlemanName)) .Select(cm => cm.Id).FirstOrDefault(); return(idCompanyMiddleman); }
static public List <string> GetCompanyMiddlemenName(Company company) { var idMiddlemen = db.CompanyMiddlemen.Where(ci => ci.IdCompany == company.Id).Select(cm => cm.IdMiddleman); List <string> middlemen = new List <string>(); foreach (var id in idMiddlemen) { middlemen.Add(MiddlemanDataManipulation.GetName(id)); } return(middlemen); }