Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Removed unecessarry private methods.

  • Loading branch information...
commit 052aa5ff6c2a76cea818b922f3caa217316d0162 1 parent db189aa
@JimBobSquarePants authored
View
BIN  EFBootstrap.suo
Binary file not shown
View
26 EFBootstrap/CodeFirst/CodeFirstReadOnlySession.cs
@@ -119,7 +119,7 @@ public CodeFirstReadOnlySession(DbContext context)
/// <typeparam name="T">The type of entity for which to provide the method.</typeparam>
public T First<T>(Expression<Func<T, bool>> expression) where T : class, new()
{
- return this.Any(expression).FirstOrDefault(expression);
+ return this.Any(expression).FirstOrDefault();
}
/// <summary>
@@ -207,30 +207,6 @@ protected virtual void Dispose(bool disposing)
}
#endregion
#endregion
-
- #region Private
- /// <summary>
- /// Returns the name of the type retrieved from the context.
- /// </summary>
- /// <returns>The name of the type retrieved from the context.</returns>
- /// <typeparam name="T">The type of entity for which to provide the method.</typeparam>
- /// <remarks>
- /// If you get an error here it's because your namespace
- /// for your EDM doesn't match the partial model class
- /// to change - open the properties for the EDM FILE and change "Custom Tool Namespace"
- /// Note - this IS NOT the Namespace setting in the EDM designer - that's for something
- /// else entirely. This is for the EDMX file itself (r-click, properties)
- /// </remarks>
- private string GetSetName<T>()
- {
- PropertyInfo entitySetProperty =
- this.context.GetType().GetProperties()
- .Single(p => p.PropertyType.IsGenericType && typeof(IQueryable<>)
- .MakeGenericType(typeof(T)).IsAssignableFrom(p.PropertyType));
-
- return entitySetProperty.Name;
- }
- #endregion
#endregion
}
}
View
2  EFBootstrap/CodeFirst/CodeFirstSession.cs
@@ -103,7 +103,7 @@ public CodeFirstSession(DbContext context)
/// <typeparam name="T">The type of entity for which to provide the method.</typeparam>
public T First<T>(Expression<Func<T, bool>> expression) where T : class, new()
{
- return this.Any(expression).FirstOrDefault(expression);
+ return this.Any(expression).FirstOrDefault();
}
/// <summary>
View
2  EFBootstrap/DbFirst/DbFirstReadOnlySession.cs
@@ -118,7 +118,7 @@ public DbFirstReadOnlySession(ObjectContext context)
/// <typeparam name="T">The type of entity for which to provide the method.</typeparam>
public T First<T>(Expression<Func<T, bool>> expression) where T : class, new()
{
- return this.Any(expression).FirstOrDefault(expression);
+ return this.Any(expression).FirstOrDefault();
}
/// <summary>
View
2  EFBootstrap/DbFirst/DbFirstSession.cs
@@ -102,7 +102,7 @@ public DbFirstSession(ObjectContext context)
/// <typeparam name="T">The type of entity for which to provide the method.</typeparam>
public T First<T>(Expression<Func<T, bool>> expression) where T : class, new()
{
- return this.Any(expression).FirstOrDefault(expression);
+ return this.Any(expression).FirstOrDefault();
}
/// <summary>
Please sign in to comment.
Something went wrong with that request. Please try again.