示例#1
0
 /// <summary>Updates the specified NWService.Dal.EntityClasses.OrderEntity entity with the values stored in the dto object specified</summary>
 /// <param name="toUpdate">the entity instance to update.</param>
 /// <param name="dto">The dto object containing the source values.</param>
 /// <remarks>The PK field of toUpdate is set only if it's not marked as readonly.</remarks>
 public static void UpdateFromOrder(this NWService.Dal.EntityClasses.OrderEntity toUpdate, NWService.Dtos.DtoClasses.Order dto)
 {
     if ((toUpdate == null) || (dto == null))
     {
         return;
     }
     toUpdate.CustomerId     = dto.CustomerId;
     toUpdate.EmployeeId     = dto.EmployeeId;
     toUpdate.Freight        = dto.Freight;
     toUpdate.OrderDate      = dto.OrderDate;
     toUpdate.RequiredDate   = dto.RequiredDate;
     toUpdate.ShipAddress    = dto.ShipAddress;
     toUpdate.ShipCity       = dto.ShipCity;
     toUpdate.ShipCountry    = dto.ShipCountry;
     toUpdate.ShipName       = dto.ShipName;
     toUpdate.ShippedDate    = dto.ShippedDate;
     toUpdate.ShipPostalCode = dto.ShipPostalCode;
     toUpdate.ShipRegion     = dto.ShipRegion;
     toUpdate.ShipVia        = dto.ShipVia;
 }
示例#2
0
 /// <summary>Extension method which produces a projection to NWService.Dtos.DtoClasses.Order which instances are projected from the
 /// NWService.Dal.EntityClasses.OrderEntity entity instance specified, the root entity of the derived element returned by this method.</summary>
 /// <param name="entity">The entity to project from.</param>
 /// <returns>NWService.Dal.EntityClasses.OrderEntity instance created from the specified entity instance</returns>
 public static NWService.Dtos.DtoClasses.Order ProjectToOrder(this NWService.Dal.EntityClasses.OrderEntity entity)
 {
     return(_compiledProjector(entity));
 }