private object BuildReferenceDto(Product item)
 {
     return new{
         StringId = _stringConverter.ToString(item),
         Description = item.ToString(),
     };
 }
示例#2
0
 public virtual bool Equals(Product other)
 {
     if(ReferenceEquals(null, other))
     {
         return false;
     }
     if(ReferenceEquals(this, other))
     {
         return true;
     }
     if(ProductId != default(int))
     {
         return other.ProductId == ProductId;
     }
     return other.ProductId == ProductId && other.ProductName == ProductName && other.QuantityPerUnit == QuantityPerUnit && other.UnitPrice == UnitPrice && other.UnitsInStock == UnitsInStock && other.UnitsOnOrder == UnitsOnOrder && other.ReorderLevel == ReorderLevel && other.Discontinued == Discontinued && other.Category == Category && other.Supplier == Supplier;
 }
 private object BuildFullDto(Product item)
 {
     return new{
         StringId = _stringConverter.ToString(item),
         item.ProductId,
         item.ProductName,
         item.QuantityPerUnit,
         item.UnitPrice,
         item.UnitsInStock,
         item.UnitsOnOrder,
         item.ReorderLevel,
         item.Discontinued,
         item.Category,
         // item.Supplier, // Skip bacause is inverse association
     };
 }
 public void Update(Product v)
 {
     _northwind.GetCurrentSession().Update(v);
 }
 public void Delete(Product v)
 {
     _northwind.GetCurrentSession().Delete(v);
 }
 public void Create(Product v)
 {
     _northwind.GetCurrentSession().Save(v);
 }
 public void Update(Product v)
 {
     _Northwind.Update(v);
 }
 public void Delete(Product v)
 {
     _Northwind.Delete(v);
 }
 public void Create(Product v)
 {
     _Northwind.Save(v);
 }
 public string ToString(Product obj)
 {
     return obj.ProductId.ToString();
 }