1

I have the following in a using statement:

var result = await db.Database.SqlQuery<ModelLookup>("EXEC prGetModel", new {ManufacturerId = manufacturerId}).ToListAsync();

And a ModelLookup class :

public class ModelLookup
{
    public int ManufacturerId { get; set; }
    public int ModelId { get; set; }
    public string ModelDesc { get; set; }
}

Some of the DB columns have a different name.

Is there a quick way (or data annotation) that I can use to take a column from the database and map to the desired field?

(without having to add the procedure to a DbContext)

Thanks,

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
DazManCat
  • 3,540
  • 5
  • 30
  • 33

0 Answers0