123456789101112131415161718192021222324252627 |
- using System;
- using System.Collections.Generic;
- using Luticate2.Auth.Utils.Dbo.Result;
- using Luticate2.Auth.Utils.Interfaces;
-
- namespace Luticate2.Auth.Utils.Business.Converters
- {
- public class LuConvertersTypeConverter : ILuConvertersTypeConverter
- {
- protected IDictionary<Type, Type> Types { get; set; }
-
- public LuConvertersTypeConverter(IDictionary<Type, Type> types)
- {
- Types = types;
- }
-
- public LuResult<Type> ConvertType(Type typeFrom)
- {
- if (Types.ContainsKey(typeFrom))
- {
- return LuResult<Type>.Ok(Types[typeFrom]);
- }
-
- return LuResult<Type>.Ok(typeFrom);
- }
- }
- }
|