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
     };
 }
Пример #4
0
 public void Update(Product v)
 {
     _northwind.GetCurrentSession().Update(v);
 }
Пример #5
0
 public void Delete(Product v)
 {
     _northwind.GetCurrentSession().Delete(v);
 }
Пример #6
0
 public void Create(Product v)
 {
     _northwind.GetCurrentSession().Save(v);
 }
Пример #7
0
 public void Update(Product v)
 {
     _Northwind.Update(v);
 }
Пример #8
0
 public void Delete(Product v)
 {
     _Northwind.Delete(v);
 }
Пример #9
0
 public void Create(Product v)
 {
     _Northwind.Save(v);
 }
 public string ToString(Product obj)
 {
     return obj.ProductId.ToString();
 }