I'm using Automapper in a VB.NET project, and am trying to make it ignore a member. I can see how to do this in C#, but not in VB.NET. Does anyone have a quick example of using the ForMember method.
Thanks,
Paul
Here's how you do it :)
Mapper.CreateMap(Of incomingModel, outgoingModel)().ForMember(Function(x) x.FieldToIgnore, Sub(y) y.Ignore())
The thing that is important, and likely what messed up you is the Sub instead of the function for the second part.
this also only works in vs2010. older versions you can't do it.
There is now (AutoMapper 2.0) an IgnoreMap attribute.
Related
I a little lost, need some help. I inherited vba code looking up sumbitters for my company. The utility is using forms and needs a missing library added. I don't know which reference is missing. I use sqldeveloper and don't normally use vba. Any thoughts?
Honestly don't know what try. I know I need to add a libary reference, but not sure where and how to do this..
When I create a DAC for using that object on the code, worked on the version 4.20.2344
invoice.(somethig)
But when I try to call the same object on version 5.3, it does not appear in visual Studio and I can't compile it, could you help me with this issue? Some one has the same problem?
I leave some images for explaining what happened
Here is the example on v4.20
Here is the error example in the v5.3 can't use the same
You must create a cache extension object for the DAC udfs and then create an instance of it in your code. See the code attached to the question here. NOTE, the code has a slight bug in it, make sure you read the answer!
I am stuck with this issue and I cant seem to solve it. I have my logic in a PCL and a a .Droid and .iOS clients.
I need to use the [serializable] attribute in my logic so I need to add a reference to system.runtime.serialization. The problem is there is a different dll for android and iOS how can I manage this? I did not encounter this problem before because I used shared files between the projects so each project had its own reference to the correct system.runtime.serialization and I could use the [serializable] attribute with no problems.
Have I missed something?
Thanks
Amit
In general I'd recommend avoiding trying to use the SerializableAttribute in portable code. That type of serialization is basically not portable. However, if you really need to do it, that attribute is actually treated specially and is represented by a bit on the type as opposed to a normal attribute. So if you define your own attribute with the same name and namespace in a PCL, the compiler will emit the bit and everything may just work like you need it to.
I have been trying to develop in MonoDevelop for about a week now, my boss asked me to get WEPopOver working on a particular project. I have seen the github documentation and looked at examples, but can't seem to get a working model for MonoDevelop.
Can ANYONE give me an example of how to use this WEPopOver in MonoDevelop?
thank you in advance!
Rick
Did you see/try the sample solution that comes with the bindings ?
If so then you'll need to be more explicit (edit your question) about what you want to do with it.
We have started using Resharper 4.5 and the naming style functionality that comes with it.
There is some tedious work applying the naming styles.
What I would whould like is to apply my naming styles or part of it as a part of my Code cleanup profile.
Any1 know how to do it, or atleast a less tedious job than spaming + PgDown, + + ?
It does not worth the while for legacy code. I suggest you start using new style for new code and slowly migrate existing code.
Macros would be my suggestion, you should be able to handle this with macros.
VisualAssist might help you significantly in renaming/refactoring (trial-version can be downloaded from http://www.wholetomato.com).
But it is not something to enforce your coding guidelines, though.