Stored proc and EDM

Last post 04-23-2008 5:11 AM by Balyk. 0 replies.

Sort Posts:

  • Stored proc and EDM

    04-23-2008, 5:11 AM
    • Loading...
    • Balyk
    • Joined on 04-23-2008, 5:09 AM
    • Posts 3
    For simple Example, I've 2 tables (and Entities), Prices (PriceID primary key, CategoryID, price) and Category (CategoryID primary key, CategoryName). I've relation FK_Prices_Category I was made EDM with stored proc - all OK. But I can't make Deleting prom Price entity. My code: 01 VmzkoPricesEntities ctx = new VmzkoPricesEntities(); 02 VmzkoPricesModel.Prices pr = ctx.GetPriceByID(newsID).First(); 03 ctx.DeleteObject(pr); 04 ctx.SaveChanges(true); GetPriceByID - is an imported stored proc with output of all fields of Prices (PriceID, CategoryID, price) BUT if I expand 'pr' object (line 02) then property Category is NULL. After that deleting is not available: Entities in 'VmzkoPricesEntities.Prices' participate in the 'FK_Prices_Category' relationship. 0 related 'Category' were found. Between 1 and 1 'Category' are expected. How can I fill Category property inside Prices object by using stored proc??? How can I fill that by alternative method?
Page 1 of 1 (1 items)