/// <summary> /// Turn a location into an entity location /// </summary> /// <param name="location"></param> /// <returns></returns> public static Entities.LocationEntity Map(Domain.Models.Location location) { return(new Entities.LocationEntity { Id = location.ID, Name = location.LocationName }); }
/// <summary> /// This turns a Location Model into a Location entity, by assigning each relavent property /// to a column in the Location table /// </summary> /// <param name="location">The location model.</param> /// <returns new Entity.Location></returns> public static Entities.LocationEntity MapLocationWithOrders(Domain.Models.Location location) { return(new Entities.LocationEntity { Id = location.ID, Name = location.LocationName, Orders = location.OrderHistory.Select(MapperOrder.Map).ToList() }); }