|
OK. Your code is broken, so debug it, find out why it's not working and fix it!
There, you've been guided.
Really, what did you expect for an answer given the complete lack of information in your original post? We can't see your screen, your code, your hard drive, nothing. We have to rely entirely on what you put in your post to try and help with and what did you give us to work with? NOTHING.
modified 22-Feb-15 15:31pm.
|
|
|
|
|
Don't post this here - if you got the code from an article, then there is a "Add a Comment or Question" button at the bottom of that article, which causes an email to be sent to the author. They are then alerted that you wish to speak to them.
Posting this here relies on them "dropping by" and realising it is for them.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
Probably because you were so lame that you didn't even try to bother looking for an answer by searching for the problem that was shown to you by the Visual Studio.
You should always try to search for answers, not to be always-desperate and left to ask for help.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I am currently working with a DB table and I need to map extra properties from DAO to BE class.
I have to produce XML like the following:
<Zoos>
<Zoo>
<ZooId>234OI456<ZooId>
<Name>The Zoo</Name>
<Address>3456 Kramer</Address
<ZipCode>92345-8922</ZipCode>
<Animals>
<Animal Type="REPTILE">Cobra</Animal>
<Animals>
<Zoo>
<Zoos>
The extra columns in the db view are like so:
ANI_TYPE VARCHAR(20)
ANI_VALUE VARCHAR(20)
Previously when I didn't have the extra columns I mapped the values like this for each Zoo
Mapper.CreateMap<ZooDAO, ZooBE>()
.ForMember(d => d.ZooId, e => e.ZOO_ID))
.ForMember(d => d.Name, e => e.ZOO_NAME))
.ForMember(d => d.Address, e => e.ZOO_ADDRESS))
.ForMember(d => d.ZipCode, e => e.ZOO_ZIPCODE));
How would I go about mapping these 2 columns(ANI_TYPE, ANI_VALUE) so i can create the structure shown in the xml in regards to Animals?
I have a c# class for Animal type which has the following
public enum AnimalType
{
INVALID,
REPTILE,
MAMMAL,
INSECT
}
My C# class for the Animal looks like this but i guess it will require rework. Feel free to provide suggestions/examples:
Currently this is what my classes look like:
public class Zoo
{
public int ZooId {get; set;}
public string Name { get; set; }
public string Address {get; set; }
public string ZipCode {get; set;}
public List<Animal> Animals {get; set;}
}
This is my current setup for Animal entity
public class Animal
{
public string Type {get; set;}
public string Text { get; set; }
}
I appreciate if someone can assist me with the above.
Thanks,
|
|
|
|
|
Which mapper are you using?
|
|
|
|
|
I am using Automapper. Can you assist please? Thanks.
modified 23-Feb-15 5:29am.
|
|
|
|
|
Have you tried to create a mapping from AnimalDAO to AnimalBE ? Like you're doing here:
Mapper.CreateMap<ZooDAO, ZooBE>()
.ForMember( etc.. )
That should be all it needs if your AnimalDAO(edit) ZooDAO class also holds the Animals in some type of collection.
Take a look here[^] - he's essentially doing the same.
modified 23-Feb-15 5:56am.
|
|
|
|
|
Message Closed
modified 22-Feb-15 15:08pm.
|
|
|
|
|
Member 11388199 wrote: running even after Formatting System. Is it Possible? No.
«I'm asked why doesn't C# implement feature X all the time. The answer's always the same: because no one ever designed, specified, implemented, tested, documented, shipped that feature. All six of those things are necessary to make a feature happen. They all cost huge amounts of time, effort and money.» Eric Lippert, Microsoft, 2009
|
|
|
|
|
Thankfully.
I can't think of a single legitimate reason for wanting to do that...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
I have a growing suspicion that some questions here are posted solely for the amusement of the asker.
|
|
|
|
|
Wouldn't it be comforting to believe that they actually are that intelligent?
|
|
|
|
|
|
Let's assume that the earth is square...
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Message Removed
modified 22-Feb-15 15:07pm.
|
|
|
|
|
Hello needs some help with this one:
I have a 384 days of rates a rate price and date.
I am trying to fill a graph by day of rates.
I am allowing the user to select 30, 60 or 90 days of rates within a start and end date of choosing.
I am trying to use linq to return only 30, 60 or 90 days of rates based on the start and end dates. The issue is the start and end date range could be less then let's say 30 days so I still want to return 30 days of rates.
I have not been very successful.
Thanks so much for the help.
|
|
|
|
|
And without showing your query code, there is very little anyone can do to help you.
|
|
|
|