Format:
Recent snippets matching tags of Entity Framework
-- generated from Context.ReportedAbuses.Where(ab => ab.EntryId == entryId).Count() > 0; exec sp_executesql N'SELECT [GroupBy1].[A1] AS [C1] FROM ( SELECT COUNT(1) AS [A1] FROM [dbo].[ReportedAbuses] AS [Extent1] WHERE [Extent1].[EntryId] = @p__linq__0 ) AS [GroupBy1]',N'@p__linq__0 int',@p__linq__0=3
241 Views
1 comments
/// <summary> /// Creates a Connection string from Conf.xml /// </summary> /// <param name="isEntityConnection"> /// The is Entity Connection. /// </param> /// <param name="serverName"> /// The server Name. /// </param> /// <param name="databaseName">
72 Views
no comments
[TestMethod] public void TestRenamedbContextMenu() { dbContext context = new dbContext(); // Load the first menu Menu menu = context.Menus.FirstOrDefault(); // force a change menu.ModifiedOn = DateTime.Now;
277 Views
no comments
#region Get entity set name public string GetEntitySetName(Type entityType) { if (entityType == null) throw new ArgumentNullException("entityType"); if (!entityType.IsSubclassOf(typeof(EntityObject))) throw new ArgumentException("Only subclasses of EntityObject are supported.", "entityType"); return GetEntitySetNameInternal(entityType);
620 Views
no comments
public static class A { private static Func<MyContextEntities, int, Orders> compiledGetById; static A() { compiledGetById = CompiledQuery.Compile<MyContextEntities, int, Orders>(((ctxt, orderId) => (from o in ctxt.Orders where o.Id == orderId select o).FirstOrDefault())); } public static Orders GetOrderById(int orderId)
457 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
