/// <summary> /// /// </summary> /// <param name="personID"></param> /// <param name="q"></param> /// <param name="asRepo"></param> public static void getUnassociated(int personID, ref IQueryable <Activity> q, MacheteContext db) { var aRepo = db.Set <Activity>().AsNoTracking().AsQueryable(); var asRepo = db.Set <ActivitySignin>().AsNoTracking().AsQueryable(); // //SELECT extent1.* FROM [dbo].[Activities] AS [Extent1] //LEFT OUTER JOIN [dbo].[ActivitySignins] AS [Extent2] ON // ([Extent1].[ID] = [Extent2].[activityID]) AND // ([Extent2].[WorkerID] = <personID> ) //WHERE [Extent2].[activityID] IS NULL q = from b in aRepo join aa in // joins activities (a) to activity signins (az) // where az.personID (from a in q join az in asRepo on a.ID equals az.activityID into grouped from az2 in grouped.DefaultIfEmpty() where az2.personID == personID select a) on b.ID equals aa.ID into h from i in h.DefaultIfEmpty() where i == null select b; }
protected ServiceBase2(IDatabaseFactory dbf, IMapper map) { this.map = map; this.db = dbf.Get(); this.dbset = db.Set <T>(); this.logPrefix = typeof(T).ToString(); }
public static void ClassInitialize(TestContext testContext) { WebServer.StartIis(); // getting Project path for dummy image string solutionDirectory = sharedUI.SolutionDirectory(); //testdir = solutionDirectory + "\\Machete.test\\"; testimagefile = solutionDirectory + "\\jimmy_machete.jpg"; map = new Machete.Web.MapperConfig().getMapper(); driver = new ChromeDriver(ConfigurationManager.AppSettings["CHROMEDRIVERPATH"]); baseURL = "http://localhost:4213/"; ui = new sharedUI(driver, baseURL, map); DB = new MacheteContext(); wsiSet = DB.Set <WorkerSignin>(); wSet = DB.Set <Worker>(); pSet = DB.Set <Person>(); }
/// <summary> /// /// </summary> /// <param name="personID"></param> /// <param name="q"></param> /// <param name="asRepo"></param> public static void getAssociated(int personID, ref IQueryable <Activity> q, MacheteContext db) { var asRepo = db.Set <ActivitySignin>().AsNoTracking().AsQueryable(); q = from a in q join az in asRepo on a.ID equals az.activityID into g from f in g.DefaultIfEmpty() where f.personID == personID select a; }
protected string lookupTextByID(int ID, string locale) { Lookup record; if (ID == 0) { return(null); } try { record = db.Set <Lookup>().Single(s => s.ID == ID); } catch { throw new MacheteIntegrityException("Unable to find Lookup record " + ID); } if (locale == "es" || locale == "ES") { return(record.text_ES); } return(record.text_EN);; //defaults to English }
public static void ClassInitialize(TestContext testContext) { // getting Project path for dummy image string solutionDirectory = sharedUI.SolutionDirectory(); //testdir = solutionDirectory + "\\Machete.test\\"; testimagefile = solutionDirectory + "\\jimmy_machete.jpg"; driver = new ChromeDriver(ConfigurationManager.AppSettings["CHROMEDRIVERPATH"]); baseURL = "http://localhost:4213/"; ui = new sharedUI(driver, baseURL); DB = new MacheteContext(); wsiSet = DB.Set<WorkerSignin>(); wSet = DB.Set<Worker>(); pSet = DB.Set<Person>(); }
protected ServiceBase2(IDatabaseFactory dbf) { this.db = dbf.Get(); this.dbset = db.Set <T>(); }