valueinjecter

Copying NHibernate POCO to DTO without triggering lazy load or eager load

岁酱吖の 提交于 2019-11-28 08:48:23
问题 I need to create DTOs from NHibernate POCO objects. The problem is that the POCO objects contain dynamic proxies , which should not be copied to the DTO. I eager load all the collections and references I need to transfer in advance, I don't want NHibernate to start loading referenced collections which I did not load in advance. Several similar questions on SO received answers which either: Suggest Session.GetSessionImplementation().PersistenceContext.Unproxy(); Suggest turning off Lazy

ValueInjecter and DataTable

孤者浪人 提交于 2019-11-28 01:03:17
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 to give it a shot. Maybe Omu or some other users of this library will answer. here is my DataRow injector public class DataRowInjection: KnownSourceValueInjection<DataRow> { protected override void Inject(DataRow source, object target) { for (var i = 0; i < source.ItemArray.Count(); i++) { //TODO: Read from attributes or target type var activeTarget

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

柔情痞子 提交于 2019-11-27 13:48:38
问题 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 Name {get;set;} public string Address {get;set;} public string Phone {get;set;} } And I have a ViewModel that looks like this public class StudentDetailVM { public string Name {get;set;} public string Address {get;set;} public string Phone {get;set;} public

How to map lists with ValueInjector

依然范特西╮ 提交于 2019-11-27 11:11:56
问题 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<LoopValueInjection>(person) .InjectFrom<CountryToLookup>(person); I have a grid on my Index view. Each row is an instance of a CategoryViewModel . So what I do is to get a list of all the categories and then map each Category to a CategoryViewModel, and then pass this list of CategoryViewModels

ValueInjecter and DataTable

夙愿已清 提交于 2019-11-26 21:49:37
问题 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 to give it a shot. Maybe Omu or some other users of this library will answer. here is my DataRow injector public class DataRowInjection: KnownSourceValueInjection<DataRow> { protected override void Inject(DataRow source, object target) { for (var i

AutoMapper vs ValueInjecter [closed]

一个人想着一个人 提交于 2019-11-26 16:46:58
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) ? as the creator of ValueInjecter , I can tell you that I did it because I wanted something simple and very flexible I really don't like writing much or writing lots of monkey code like: Prop1.Ignore, Prop2.Ignore etc. CreateMap<Foo,Bar>(); CreateMap<Tomato, Potato>(); etc. ValueInjecter is something like mozilla with it's plugins, you create ValueInjections and use them there are

AutoMapper vs ValueInjecter [closed]

心已入冬 提交于 2019-11-26 04:56:47
问题 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) ? 回答1: as the creator of ValueInjecter, I can tell you that I did it because I wanted something simple and very flexible I really don't like writing much or writing lots of monkey code like: Prop1.Ignore, Prop2.Ignore etc. CreateMap<Foo,Bar>(); CreateMap<Tomato, Potato>(); etc.