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
1
vote
1 answer

Automapper vs Value Injecter Performance and Flexiblitiy as of 2014

From Automapper and Value Injecter which one is the fastest, which one is the flexible one? as of 2014 (today) not the evaluation of the past
Mosby
  • 53
  • 1
  • 8
1
vote
1 answer

Map DTO to Domain Model

I have a DTO as follows: class ProjectDTO{ string Title; string Data; } Then domain model as follows: class Project{ Content Content {set;get;} } class Content{ string Title string Data; } I am using…
DarthVader
  • 52,984
  • 76
  • 209
  • 300
1
vote
1 answer

ValueInjecter mapping subobjects from a collection

I try to map a list of objects with ValueInjecter using a LINQ query like this : var thingsCollection = rep.Things.Select(x => new ThingDTO().InjectFrom(x) as ThingDTO) .OrderByDescending(x =>…
Patrice Cote
  • 3,572
  • 12
  • 43
  • 72
1
vote
1 answer

How to control depth of unflattening using ValueInjecter

Im sure the solution is blindingly obvious but any ideas on how i would do the following with value injecter? Say you have the following model: public class Foo{ public int BarId{get;set;} public Bar Bar{get;set;} } public class Bar{ …
nakchak
  • 498
  • 1
  • 3
  • 13
1
vote
2 answers

Specify more than one rule in ValueInjecter's ConventionInjection(s)

I'm new to ValueInjecter. I knew how to match properties with the same name but different caps: public class IgnoreCaseInjection : ConventionInjection { protected override bool Match(ConventionInfo c) { return…
Louis Rhys
  • 34,517
  • 56
  • 153
  • 221
1
vote
1 answer

QueryableExtensions for ValueInjecter

Does anything like QueryableExtensions for Automapper exist for ValueInjecter? For those unfamiliar with this functionality it allows for the automatic projection of properties to be performed for linq queries so that only the needed columns are…
DanP
  • 6,310
  • 4
  • 40
  • 68
1
vote
1 answer

Trouble loading a child model in MVC 4

I have an OrderViewModel that includes an instance of a child _DetailsViewModel. The OrderViewModel has order header information and the _DetailsViewModel holds order detail information. Despite being separate Models, both have the same single data…
user2167861
  • 179
  • 4
  • 12
1
vote
1 answer

ValueInjecter - converting some properties of source into a list in target

Just started using Value Injector: http://valueinjecter.codeplex.com/, and I have a question: I have a Source class that has many properties. Some properties have a common suffix of "Profile". These properties are not always String, but mostly are.…
Echiban
  • 849
  • 2
  • 11
  • 21
1
vote
3 answers

EF4 var object mapping to DTO using valueinjecter

I have linQ query like the one below var records = (from P in Person join B in BankAccount on P.ID equals B.PersonID select new { P, B}).ToList(); The person table has a lot of fields but I need to…
user20358
  • 14,182
  • 36
  • 114
  • 186
1
vote
1 answer

What is NHibernate doing to my Iesi.Collections.ISet?

I'm trying to test a service of mine that is called GetUsersForRole. It takes in a simple string and is passes this off to my RoleRepository to deal with NHibernate and get a collection of Roles with the passed in string for its RoleName. To do…
Tyler Wright
  • 795
  • 1
  • 9
  • 28
1
vote
2 answers

Using mapping framework with drastically different Domain and view-models ?

If I have two models that are very different, is it defeating the purpose to even use a mapping framework such as Auto Mapper or Value Injecter? For example, say I have two models that are structurally identical, but every property name is…
Jerad Rose
  • 15,235
  • 18
  • 82
  • 153
1
vote
1 answer

ValueInjecter - Joins multiple result sets into 1 collection LINQ?

How do I use ValueInjecter with a LINQ join that joins multiple result sets? For example, this code inject result values into CombinedResult object, but I also want some of errorsAndWarning values into CombinedResult. The properties have the same…
Saxman
  • 5,009
  • 11
  • 51
  • 72
0
votes
3 answers

ValueInjector with Dynamic Proxy objects

I have the standard repository pattern with a service layer and I need to map a POCO object called Game: public class Game { public int Id { get; set; } public int GameTypeId { get; set; } public int GameStateId { get; set; } …
Ryan
  • 4,354
  • 2
  • 42
  • 78
0
votes
1 answer

I can't directly cast object in my Entity Framework query using ValueInjecter

I'm trying to use ValueInjecter to map my entities to my DTOs in my asp.net core project. Could someone explain me why this works: var list = _context.Assets .ToList(); var vm = list .Select(a => new…
R.Haughton
  • 227
  • 4
  • 16
0
votes
1 answer

ValueInjecter not binding properties correctly

I am having trouble getting SourceModel data getting mapped to DestinationModel data. The DestinationModel has complex object type. Although the name matches but I don't see any data getting bind correctly. I am new to ValueInjector and as per my…
Alvin
  • 290
  • 5
  • 25