namespace MyOffice.Services.Mapper;

using AutoMapper;
using Identity;

public class UserIdResolver : IValueResolver<object, object, Guid>
{
	private readonly IContextProvider _contextProvider;

	public UserIdResolver(
		IContextProvider contextProvider
	)
	{
		_contextProvider = contextProvider;
	}

	public Guid Resolve(object source, object destination, Guid member, ResolutionContext context)
	{
		return _contextProvider.UserId;
	}
}