提交 b77e5384 编写于 作者: J Johan Danforth

Merge pull request #335 from ithero7/master

Little changes :)
......@@ -126,7 +126,7 @@ private static bool IsWriteable(PropertyInfo pi)
if (keys.Count() > 1)
throw new DataException("Get<T> only supports an entity with a single [Key] property");
if (!keys.Any())
throw new DataException("Get<T> only supports en entity with a [Key] property");
throw new DataException("Get<T> only supports an entity with a [Key] property");
var onlyKey = keys.First();
......@@ -232,9 +232,9 @@ private static string GetTableName(Type type)
else
{
//NOTE: This as dynamic trick should be able to handle both our own Table-attribute as well as the one in EntityFramework
var tableattr = type.GetCustomAttributes(false).SingleOrDefault(attr => attr.GetType().Name == "TableAttribute") as dynamic;
if (tableattr != null)
name = tableattr.Name;
var tableAttr = type.GetCustomAttributes(false).SingleOrDefault(attr => attr.GetType().Name == "TableAttribute") as dynamic;
if (tableAttr != null)
name = tableAttr.Name;
else
{
name = type.Name + "s";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册