0

Problem with: Dapper Extensions dbConnection.Get(personId)

I have a model called Person:

Person
{
    public int PersonId { get; set; }
    public string Name { get; set; }
}

In the database I have this table:

data.Persons
    Pers_Id
    Pers_Name

When I try this without any kind of custom mapping, I get an error "Invalid object name 'Person'." I believe this is a mapping issue, because when I completely map the model with the prefix 'Pers_', and use 'data.Persons' Get works.

But is there a way to automatically map with a prefix? The database I'm using has many different tables with different prefices.

I also have everything already mapped to Entity framework. Is there a possibility of getting the map settings from Entity DbModelBuilder?


Create one image in javascript

I have the following code to create an image with JavaScipt, the image appear on a button click. The problem is when the image is created and i click again the button another one appear, and i don't want that.

How i can solve that?

var img = new Image();
var div = document.getElementById('Table');

img.onload = function() {
  div.appendChild(img);
};

img.src = 'Images/Email.png';
4

1 に答える 1