#region ========================================================================= USING =====================================================================================
using Lumina.Application.Common.DataAccess.Entities.UsersManagement;
using Lumina.Domain.Core.BoundedContexts.UserManagementBoundedContext.UserAggregate;
#endregion
namespace Lumina.Application.Common.Mapping.UsersManagement.Users;
///
/// Extension methods for converting .
///
public static class UserMapping
{
///
/// Converts to .
///
/// The domain entity to be converted.
/// The repository entity containing sensitive information not mapped to the Domain entity.
///
/// Because Authentication and Authorization are Application Layer concerns, the members involved in those concerns are not mirrored in the Domain entity.
/// However, since Entity Framework updates an entire entity, when mapping from the Domain entity to the DAL entity, one still needs to provide the
/// values of the non-included members, such that they are not overriden with . Those values should come in the requested .
///
/// The converted repository entity.
public static UserEntity ToRepositoryEntity(this User domainEntity, UserEntity repositoryEntity)
{
repositoryEntity.Username = domainEntity.Username;
return repositoryEntity;
}
}