mirror of
https://github.com/Govor-team/Govor.git
synced 2026-07-21 19:54:55 +00:00
22 lines
690 B
C#
22 lines
690 B
C#
using AutoMapper;
|
|
using Govor.Application.Interfaces.UserOnlineStatus;
|
|
using Govor.Application.Profiles;
|
|
using Govor.Contracts.DTOs;
|
|
using Govor.Core.Models.Users;
|
|
|
|
namespace Govor.API.Common.Mapping;
|
|
|
|
public class UserProfileToUserProfileDtoMappingAction : IMappingAction<UserProfile, UserProfileDto>
|
|
{
|
|
private readonly IOnlineUserStore _onlineUserStore;
|
|
|
|
public UserProfileToUserProfileDtoMappingAction(IOnlineUserStore onlineUserStore)
|
|
{
|
|
_onlineUserStore = onlineUserStore;
|
|
}
|
|
|
|
public void Process(UserProfile source, UserProfileDto destination, ResolutionContext context)
|
|
{
|
|
destination.IsOnline = _onlineUserStore.IsOnline(source.Id);
|
|
}
|
|
} |