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
208
votes
4 answers

AutoMapper vs ValueInjecter

Everytime I'm looking for AutoMapper stuff on StackOverflow, I'm reading something about ValueInjecter. Can somebody tell me the pros and cons between them (performance, features, API usage, extensibility, testing) ?
Rookian
  • 19,841
  • 28
  • 110
  • 180
25
votes
5 answers

How to map lists with ValueInjector

I am using ASP.NET MVC 3. Can someone please help me clarify what's happening here: var person = new PersonRepository().Get(); var personViewModel = new PersonViewModel(); personViewModel.InjectFrom(person) …
Brendan Vogt
  • 25,678
  • 37
  • 146
  • 234
19
votes
1 answer

Which is faster: Automapper, Valuinjector, or manual mapping? To what degree is each one faster?

Suppose I have this object in my DAL (ORM etc) public class Student { public string Name {get;set;} public string Address {get;set;} public string Phone {get;set;} public Parent Parent {get;set;} } public class Parent { public string…
makerofthings7
  • 60,103
  • 53
  • 215
  • 448
15
votes
3 answers

Checking for IEnumerable with reflection

EDIT The bare-bones version of this question is, if I have some object o, how would I check to see if o is of some type that implements IEnumerable with reflection? The original question is much more specific, but an answer to the above…
Adam Rackis
  • 82,527
  • 56
  • 270
  • 393
13
votes
1 answer

Deep Copy of Complex Third Party Objects/Classes

I'm have been working on a project to create PDF forms using PDFView4Net. While the library is generally good, the forms creator is primitive and lacking basic features (such as copy/paste, alignment, formatting, etc.) when working with form fields…
mslissap
  • 413
  • 4
  • 14
12
votes
2 answers

How to deep clone objects containing an IList property using AutoMapper

I am trying to deep clone the following class using AutoMapper: public class MainData { public MainData() { Details = new List(); } public int Id { get; private set; } public DateTime LastUpdate { get; private…
Piers Myers
  • 10,611
  • 6
  • 46
  • 61
11
votes
5 answers

Successful Model Editing without a bunch of hidden fields

In Short: How do I successfully edit a DB entry without needing to include every single field for the Model inside of the Edit View? UPDATE So I have an item in the DB (an Article). I want to edit an article. The article I edit has many properties…
Caleb Bergman
  • 858
  • 1
  • 8
  • 18
8
votes
2 answers

Using ValueInjecter to map between objects with different property names

How do I map a property from an object to another object with a different property name? I have a Product class that looks like this: public class Product : IEntity { public int Id { get; set; } public string Name { get; set; } } And the…
Brendan Vogt
  • 25,678
  • 37
  • 146
  • 234
8
votes
1 answer

ValueInjecter and DataTable

I was trying to figure out ValueInjecter so i can use it in our home-grown little ORM. Since i should support DataRow and DataTable mapping, i am trying to implement mappers for this types. And honestly documentation is not good enough and i wanted…
adt
  • 4,320
  • 5
  • 35
  • 54
7
votes
2 answers

omu.valueinjecter deep clone unlike types

I think I'm missing a simple concept with valueinjecter and/or AutoMapper, but how do you deep clone a parent dto.Entity to biz.Entity and include all children? For example, biz.person.InjectFrom(dto.person). I want the dto.person.AddressList…
user52212
  • 603
  • 3
  • 8
  • 18
7
votes
2 answers

Map string to enum with Automapper

My problem is hydrating a Viewmodel from a Linq2Sql object that has been returned from the database. We have done this in a few areas and have a nice layered pattern worked up for it but the latest item calls for some enums to be used and this has…
Andy Allison
  • 765
  • 9
  • 19
7
votes
1 answer

can automapper create an object graph from flatted object?

Is possible with Automapper to map a flat object to complex object graph? Mapper.CreateMap() Map PersonDto.BirthCertificateFatherName to Person.BirthCertificate.FatherName
user39880
6
votes
2 answers

Inject from ExpandoObject with ValueInjecter

I'm using ValueInjecter for object mapping and I'm trying to inject from an ExpandoObject. I found an example of injecting from a dynamic. public class Ac { public string Aa { get; set; } } [Test] public void Aa() { …
jdennis
  • 63
  • 4
6
votes
2 answers

Do I have to Load/Get an entity before SaveOrUpdate in Nhibernate?

in my ASP.NET MVC application I've separated the domain model from the view model. I transform my entity in a viewmodel object so I can "feed" my views with only the data needed (I used valueinjecter for this purpose). During the save process my…
LeftyX
  • 35,328
  • 21
  • 132
  • 193
5
votes
1 answer

ValueInjecter: Where should I download the binaries? CodePlex or NuGet?

I think I have 2 options: 1) Download from CodePlex: http://valueinjecter.codeplex.com/ 2) Download from NuGet official package source (currently download count is only 133). I prefer to download from NuGet, but I'm a little worried about its…
user593358
1
2 3
10 11