Publish from private repository

This commit is contained in:
Gitea Actions
2026-08-01 11:48:55 +00:00
commit 814c39f5ce
617 changed files with 65073 additions and 0 deletions
@@ -0,0 +1,17 @@
using AutoMapper;
using MyOffice.Core;
namespace MyOffice.Services;
public static class AutomapperExtensions
{
public static List<TTo> ToDto<TTo>(this IEnumerable<IDataModel> list, IMapper mapper)
{
return mapper.Map<List<TTo>>(list);
}
public static TTo ToDto<TTo>(this IDataModel item, IMapper mapper)
{
return mapper.Map<TTo>(item);
}
}
@@ -0,0 +1,12 @@
using MyOffice.Services.Identity;
namespace MyOffice.Services.Mapper;
public class BaseMappingAction
{
protected readonly IContextProvider ContextProvider;
public BaseMappingAction(IContextProvider contextProvider)
{
ContextProvider = contextProvider;
}
}
+13
View File
@@ -0,0 +1,13 @@
using AutoMapper;
namespace MyOffice.Services.Mapper;
public class BaseProfile<TSource, TDestination> : Profile
{
protected IMappingExpression<TSource, TDestination> Mapping;
public BaseProfile()
{
Mapping = CreateMap<TSource, TDestination>();
}
}
@@ -0,0 +1,21 @@
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;
}
}