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
0 answers

value injector for cloning one class to another object type

I am using this however, I do not see any values of properties being cloned/injected from the source to the target object. I know I am not correctly doing it, could someone please help me? Protected Overrides Function SetValue(c As ConventionInfo)…
Jasmine
  • 5,186
  • 16
  • 62
  • 114
1
vote
1 answer

A.InjectFrom(c) in VB.NET

We have a similar implementation in C# in our project. However, we use VB code in other project and need the same implementation. A is an object C is an object B is a cloneinjection class Thus A.InjectFrom(C) Says that CloneInjection…
Jasmine
  • 5,186
  • 16
  • 62
  • 114
1
vote
1 answer

ValueInjecter with public fields

I am having trouble understating if this is a basic feature on omu.valueinjecter. I have 2 identical Classes (difference is basically namespaces) and the Source class has public fields instead of public properties. Is it possible to make…
1
vote
1 answer

Valueinjecter mapping complex objects

I have this simple code: using Omu.ValueInjecter; namespace InjectionTest { public class Partner { public int Id { get; set; } public string Name { get; set; } public City City { get; set; } } public class…
zszep
  • 4,450
  • 4
  • 38
  • 58
1
vote
0 answers

How can you output properties that were NOT mapped using Value Injecter?

I am using Value Injecter to map DTO->VM and vice versa. Since all models and DTOs are still very much under development, I was wondering if there is a way to output the source object's property names/values that were NOT mapped to the target…
John
  • 3,591
  • 8
  • 44
  • 72
1
vote
2 answers

Mapper supporting both : "mapping from xml" and "unflattening"

rI know two tools : Value injector and Automapper. Each of them is currently supporting one of the feature, that i realy need. :) Background: i'm using stored procedure to load data from DB. relations 1 to many are handled as XML properties. Let's…
1
vote
1 answer

ValueInjecter Null Values

I'am using ValueInjector(3.x) over AutoMapper but I have some questions. First, I don't understand the difference between UnflatLoopInjection and FlatLoopInjection. Also i want to set values in complex types. Class Product { public string Id {…
Marco Talento
  • 2,335
  • 2
  • 19
  • 31
1
vote
1 answer

convert int[] to Entities using Value Injecter

In the "ProDinner" project, ValueInjecter is used for mapping.I use the newest version, which replace ConventionInjection with LoopInjection when convert between entities and int[],I have got the code of EntitiesToInts class: public class…
darrenji
  • 75
  • 1
  • 5
1
vote
1 answer

Mapping SubCategories to list Categories using valueInjecter mvc

I want to map sub categories model which has foreign key for category model to categories model using "valueinjecter" mapping. I have made "viewmodel" and write list type property in it and now I want to bind sub categories to it. Tables…
1
vote
1 answer

ValueInjecter v3.0 Exception when target type property has no setter

we updated our solution to ValueInjecter v3.0 and now we have big problems because in this version an exception is raised if a property has no setter. This is different to Version 2.3.3. We have a lot of classes where the missing setter is possible,…
1
vote
0 answers

How to use Omu.ValueInjecter Asp.net Mvc

First I retrieve a list of AtdChannels of type IEnumerable: IEnumerable DataSource = _context.AtdChannels.Where(x => x.AtdId == AtdId); Secondly I create an empty IEnumerable of type atdChannelSummaryList: IEnumerable
MinhNguyen
  • 816
  • 1
  • 11
  • 26
1
vote
2 answers

Domain model mapping

I have domain model and data model: Domain model (DoM) is designed for business layers to simplify the operations. Data model (DaM) is automatically generated from the data base using entity framework. I would like to map DoM <> DaM in both…
BanditoBunny
  • 3,658
  • 5
  • 32
  • 40
1
vote
2 answers

ValueInjecter ViewModel to EF poco

I have the following ViewModel: public class MessageViewModel { public string Text { get; set; } public int ContactID { get; set; } } public class Message { public string Text { get; set; } [ForeignKey("Contact")] public int…
LuckyStrike
  • 1,483
  • 3
  • 12
  • 23
1
vote
1 answer

ICollectionView throw Entity Framework Attach exception

When i try to save a Object to EF it throw this exception: An exception of type 'System.InvalidOperationException' occurred in EntityFramework.dll but was not handled in user code. Additional information: Attaching an entity of…
Danilo Breda
  • 1,092
  • 1
  • 15
  • 30
1
vote
1 answer

Omu.ValueInjecter Mapping with Navigation Properties in EF

According to Valueinjecter mapping with source and Target are usually done with naming convention. But it doesn't work in my case , How could i manage mapping of navigation properties. DTO public class EmployeeDTO { public long EmployeeId { get;…
Eldho
  • 7,795
  • 5
  • 40
  • 77