CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Entity Framework
SQL
-- 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
 
by Rick Strahl   March 29, 2012 @ 6:59pm
241 Views
1 comments
 
C#
/// <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">
by Sigurður Bjarnason   October 10, 2011 @ 8:53am
72 Views
no comments
 
C#
 [TestMethod]
 public void TestRenamedbContextMenu()
 {
     dbContext context = new dbContext();
 
     // Load the first menu
     Menu menu = context.Menus.FirstOrDefault();
 
     // force a change
     menu.ModifiedOn = DateTime.Now;
by Rick Strahl   September 27, 2011 @ 4:43am
277 Views
no comments
 
C#
#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);
by Shimmy Weitzhandler   May 18, 2011 @ 8:13pm
620 Views
no comments
 
C#
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
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate