コード例 #1
0
        public static Location toLocation(this LocationV1DTO item)
        {
            if (item == null)
            {
                throw new ArgumentException(nameof(item));
            }

            Location location = new Location();

            location.CopyFromLocationV1DTO(item);
            return(location);
        }
コード例 #2
0
        public static void CopyFromLocation(this LocationV1DTO to, Location from)
        {
            to.LocationId      = from.LocationId;
            to.LocationTypeId  = from.LocationTypeId;
            to.BuildingId      = from.BuildingId;
            to.LocationAddress = from.LocationAddress;
            to.RoomNumber      = from.RoomNumber;
            to.FloorNumber     = from.FloorNumber;
            to.LocationName    = from.LocationName;

            to.LocationTypeDTO = from.LocationType?.ToLocationTypeV1DTO();
        }
コード例 #3
0
        public static LocationV1DTO ToLocationV1DTO(this Location item)
        {
            if (item == null)
            {
                throw new ArgumentException(nameof(item));
            }

            LocationV1DTO locationV1DTO = new LocationV1DTO();

            locationV1DTO.CopyFromLocation(item);
            return(locationV1DTO);
        }