start working on security group view

This commit is contained in:
2020-08-21 22:23:30 +02:00
parent 8fcd1c4c44
commit 6d975599a3
15 changed files with 243 additions and 110 deletions

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using UserService.Infrastructure.DataModels;
namespace UserService.Infrastructure
{
public static class NodeExtensions
{
public static void MapFields(this User user, Dictionary<string, object> values)
{
if (user == null) throw new ArgumentNullException(nameof(user));
if (values == null) throw new ArgumentNullException(nameof(values));
var properties = user.GetType().GetProperties();
foreach (var keyValuePair in values)
{
var propertyInfo = properties.FirstOrDefault(x => x.Name == keyValuePair.Key);
if (propertyInfo == null) continue;
propertyInfo.SetValue(user, keyValuePair.Value);
}
}
}
}