using System;
using System.Linq.Expressions;
using Brizco.Domain.Dtos.SmallDtos;
using Brizco.Domain.Entities.Task;

namespace Brizco.Domain.Mappers
{
    public static partial class TaskShiftMapper
    {
        public static TaskShift AdaptToTaskShift(this TaskShiftSDto p1)
        {
            return p1 == null ? null : new TaskShift()
            {
                TaskId = p1.TaskId,
                ShiftId = p1.ShiftId
            };
        }
        public static TaskShift AdaptTo(this TaskShiftSDto p2, TaskShift p3)
        {
            if (p2 == null)
            {
                return null;
            }
            TaskShift result = p3 ?? new TaskShift();
            
            result.TaskId = p2.TaskId;
            result.ShiftId = p2.ShiftId;
            return result;
            
        }
        public static Expression<Func<TaskShiftSDto, TaskShift>> ProjectToTaskShift => p4 => new TaskShift()
        {
            TaskId = p4.TaskId,
            ShiftId = p4.ShiftId
        };
        public static TaskShiftSDto AdaptToSDto(this TaskShift p5)
        {
            return p5 == null ? null : new TaskShiftSDto()
            {
                ShiftId = p5.ShiftId,
                TaskId = p5.TaskId
            };
        }
        public static TaskShiftSDto AdaptTo(this TaskShift p6, TaskShiftSDto p7)
        {
            if (p6 == null)
            {
                return null;
            }
            TaskShiftSDto result = p7 ?? new TaskShiftSDto();
            
            result.ShiftId = p6.ShiftId;
            result.TaskId = p6.TaskId;
            return result;
            
        }
        public static Expression<Func<TaskShift, TaskShiftSDto>> ProjectToSDto => p8 => new TaskShiftSDto()
        {
            ShiftId = p8.ShiftId,
            TaskId = p8.TaskId
        };
    }
}