Exemplo n.º 1
0
 public static TEntity AddProperties <TEntity>(this TEntity entity, object graph, IEnumerable <string> select = null, IEnumerable <string> except = null)
     where TEntity : IPropertyMap
 {
     if (graph != null)
     {
         var compatibleValue = PropertyMap.CreateCompatibleValue(graph, select, except);
         if (compatibleValue is PropertyMap map)
         {
             entity.WithProperties().AddMany(map);
         }
         else
         {
             throw new NotSupportedException("Tipo não suportado: " + graph.GetType().FullName);
         }
     }
     return(entity);
 }