Questions tagged [valueinjecter]

ValueInjecter lets you define your own convention-based matching algorithms (ValueInjections) in order to match up (inject) source values to destination values.

ValueInjecter lets you define your own convention-based matching algorithms (ValueInjections) in order to match up (inject) source values to destination values.

Source code: https://github.com/omuleanu/ValueInjecter

151 questions
5
votes
3 answers

Value Injecter : Dto to Domain Model (NHibernate)

I am using ValueInjecter to map properties from a Domain model to a DTO served up via a Service Layer. The service in question also accepts updates... so an updated DTO is passed in and this is then injected to the domain object and saved. //…
Galen
  • 309
  • 1
  • 3
  • 15
5
votes
1 answer

Use ValueInjecter to copy an EntityFramework POCO to a DTO without triggering lazy load lists and properties

I am having an issue with using ValueInjecter to create deep clones of EntityFramework POCO's into similar DTO classes. In cases where I am injecting from a complicated POCO object with multiple related entities/child entities with navigation…
thornhill
  • 632
  • 7
  • 17
5
votes
1 answer

Error when saving fields with special characters using EntityFramework and MVC ModelBinding

I am having problems with (2) fields when saving entities in my ASP.NET MVC4 application: email phone As you know, these fields will have special characters @ and - typically. Here is my code from the controller using ValueInjecter to inject my…
atconway
  • 20,624
  • 30
  • 159
  • 229
4
votes
2 answers

Does Value Injecter map collection properties?

I'm trying to map a collection of EntityFramework objects with a collection of view models. public class Channel { public Guid Id { get; set; } public string Name { get; set; } public IEnumerable Reports { get; set;…
NullReference
  • 4,404
  • 12
  • 53
  • 90
4
votes
1 answer

.NET Object mapping, grouping objects

Lets say that I have a list of objects like so: public class FlatModel { public string groupName { get; set; } public decimal value1 { get; set; } public decimal value2 { get; set; } public decimal value3 { get; set; } } and I want…
mystictheory
  • 110
  • 1
  • 7
4
votes
0 answers

Using AutoMapper Config with ValueInjecter

For all who are interessted, I created a ValueInjecter extension in order to use your existing AutoMapper Mapping Configuration with ValueInjecter. I created this extension because I had to switch over to ValueInjecter, because I could not compile…
BitKFu
  • 3,649
  • 3
  • 28
  • 43
4
votes
1 answer

AutoMapper strings to enum descriptions

Given the requirement: Take an object graph, set all enum type properties based on the processed value of a second string property. Convention dictates that the name of the source string property will be that of the enum property with a postfix of…
6footunder
  • 1,318
  • 18
  • 29
4
votes
1 answer

How to specify custom match rules in ValueInjecter 3.1?

In older version of ValueInjecter (Version 2.3) I created classes that extended ConventionInjection in order to control which properties matched - this enabled me to do thing like: public class UnderscoreInjector : ConventionInjection { …
Kaine
  • 1,285
  • 2
  • 16
  • 30
4
votes
1 answer

Can I configure AutoMapper to read from custom column names when mapping from IDataReader?

Psuedo code for mapping configuration (as below) is not possible since the lambda only lets us access Type IDataReader, wheras when actually mapping, AutoMapper will reach into each "cell" of each IDataRecord while IDataReader.Read() == true: var…
rohancragg
  • 5,030
  • 5
  • 36
  • 47
4
votes
2 answers

ValueInjecter: how to ignore some properties while performing .InjectFrom(data)?

I'm using ValueInjecter instead of AutoMapper. I'm trying to perform unflattening operation using .InjectFrom(model) It works, but I would also like to specity some properties to ignore during the unflattening operation,…
Alessandro
  • 61
  • 6
4
votes
1 answer

ValueInjecter to ignore cases when mapping properties

For example, I want to map property Foo.ID to Bar.Id, is it possible?
Louis Rhys
  • 34,517
  • 56
  • 153
  • 221
4
votes
1 answer

ValueInjector Stack Overflow on mapping entities with parent entities

I am using ValueInjecter to handle mapping my POCO entities to my DTO entities. I have been using Automapper Simulation as my main mapper. This allows me to simply write a mapping like this: var entity = GetEntityFromDatabase(); var dto =…
Tyler Wright
  • 795
  • 1
  • 9
  • 28
4
votes
3 answers

Map between enums with ValueInjecter

Is it possible to map between 2 different enums? That is, I want to take one enum value and map it to a corresponding value in a different enum type. I know how to do this with AutoMapper: // Here's how to…
Cocowalla
  • 13,822
  • 6
  • 66
  • 112
4
votes
1 answer

Glue vs Automapper vs Emit vs ValueInjecter entity mappers

I'm working on a DDD project where a lot of field mapping is going on. I'm looking for a fast and solid mapping library as opposed to writing all the mappings by hand and there seems to be a lot of options out there. At the moment I'm leaning more…
GFoley83
  • 3,439
  • 2
  • 33
  • 46
4
votes
3 answers

How do I stop ValueInjecter from mapping null values?

I am using ValueInjecter to map two identical objects. The problem I am having is that ValueInjector copies null values from my source over my target. So I am loosing lots of data to null values. Here's an example of my object which is sometimes…
LivingOnACloud
  • 1,151
  • 1
  • 11
  • 20
1
2
3
10 11