You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.
public class Product
{
public int Id { get; set; }
}
public class Order
{
public int Id { get; set; }
}
With this convention:
public class PrefixConvention : Convention
{
public PrefixConvention()
{
Properties<int>()
.Where(p => p.Name.ToLower() == "id")
.Configure(config => config.HasColumnName("autID");
}
}
Causes an exception which tells you that duplicate mappings are found for the column autID since it finds the PropertyMap instance for Order and Product. A check for the property type should be added to the filter predicate.
The text was updated successfully, but these errors were encountered:
public class Category
{
public int Id { get; set; }
public string Name { get; set; }
public string Definition { get; set; }
public int ParentId { get; set; }
}
public class Brand
{
public int Id { get; set; }
public string Name { get; set; }
public string Definition { get; set; }
}
{
public int Id { get; set; }
// public int UnitId { get; set; }
public Unit Unit { get; set; }
// public int CategoryId { get; set; }
public Category Category { get; set; }
// public int BrandId { get; set; }
public Brand Brand { get; set; }
public string Name { get; set; }
public string Definition { get; set; }
}
Select p.Id, p.Name, p.Definition,
p.UnitId, u.Name, u.Definition,
p.CategoryId, c.Name, c.Definition,
p.BrandId, b.Name, b.Definition
FROM Products p
LEFT join Units u ON p.UnitId = u.Id
LEFT JOIN Categories c ON c.Id = p.CategoryId
LEFT JOIN Brands b ON b.Id = p.BrandId
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
For example these models:
With this convention:
Causes an exception which tells you that duplicate mappings are found for the column
autID
since it finds thePropertyMap
instance forOrder
andProduct
. A check for the property type should be added to the filter predicate.The text was updated successfully, but these errors were encountered: