public static void DeleteAll(int id) { using var context = new zorrarth_archiveContext(); var query = from t in context.SiteVisits where t.Id == id select t; foreach (var item in query) { context.Remove(item); } //context.SaveChanges(); }
//public static async Task asyncUpdate(int id) //{ // using var context = new zorrarth_archiveContext(); // var query = from t in context.SiteVisits // where t.Id == id // select t; // foreach (var item in query) // { // item.DateCreated = DateTime.Now; // } // await context.SaveChangesAsync(); //} public static void Entity(int id) { using var context = new zorrarth_archiveContext(); var query = from t in context.SiteVisits where t.Id == id select t; foreach (var item in query) { item.DateCreated = null; } //context.SaveChanges(); }
public static void Entity(dynamic entity) { using var context = new zorrarth_archiveContext(); context.SiteVisits.Add(entity); context.SaveChanges(); }
//public static Tuple<List<dynamic>, List<dynamic>> ReadTuple(string email) //{ // using var context1 = new zorrarth_archiveContext(); // var c = context1.P4hCreators.Where(z => z.Email == email).ToList(); // using var context2 = new zorrarth_archiveContext(); // var cd = context2.P4hProjects.Where(z => z.IdGuid == c[0].IdGuid).ToList(); // return Tuple.Create(c, cd); //} public static dynamic Single(int id) { using var context = new zorrarth_archiveContext(); return(context.SiteVisits.Where(z => z.Id == id).ToList()); }