Instantly share code, notes, and snippets.

View fiddle-test.cs
// @nuget: EntityFramework
using System;
using System.Data.Entity;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
public class Program
View EsvZyg-hap-load--from-file-.cs
// Description: HAP - Load (From File)
// Website: https://html-agility-pack.net/
// Run: https://dotnetfiddle.net/EsvZyg
// @nuget: HtmlAgilityPack
using System;
using System.Xml;
using HtmlAgilityPack;
View 02Mjoy-efe-bulk-update-entity-graph.cs
// Description: EFE - Bulk-Update - Entity Graph
// Website: https://entityframework-extensions.net/
// Run: https://dotnetfiddle.net/02Mjoy
// @nuget: EntityFramework
// @nuget: EntityFramework.SqlServerCompact
// @nuget: Microsoft.SqlServer.Compact
// @nuget: Z.EntityFramework.Extensions
using System.Data.Entity;
View gist:d3a9307f2254edf18ea7eec2fceddc5e
public class Program {
public static void Main(){
int i = 2 + 2;
System.Console.WriteLine("Hello World:" + i);
}
}
View test1.schema
CREATE Table
View test-hap.cs
// From File
var doc = new HtmlDocument();
doc.Load(filePath);
// From String
var doc = new HtmlDocument();
doc.LoadHtml(html);
// From Web
var url = "http://html-agility-pack.net/";
View entity-framework-extensions-docs-how-soft-delete-example-1.cs
using (var ctx = new CurrentContext())
{
var lastLogin = DateTime.Now.AddYears(-2);
var list = ctx.Customers.Where(x => x.LastLogin < lastLogin).ToList();
ctx.Customers.RemoveRange(list);
// HOW to automatically handle soft delete?
ctx.BulkSaveChanges();
}