entity framework computed stored procedure -
is there way in entity framework 6 code first use stored procedure updates column, provided user? i've tried that, unfortunatelly without success.
my sp looks following one:
alter procedure [dbo].[hotel_insert] @bezeichnung [nvarchar](max), @sterne [int], @regioncode [int], @version [int] begin insert [dbo].[hotels]([bezeichnung], [sterne], [regioncode], [version]) values (@bezeichnung + '!', @sterne, @regioncode, @version) select [bezeichnung] bezeichnung , [hotelid] [dbo].[hotels] t0 @@rowcount > 0 , t0.[hotelid] = scope_identity() end
i've tried define property computed result (see below).
is there wrong or ef not support such scenario?
wishes, manfred
modelbuilder.entity<hotel>().maptostoredprocedures(s => s.insert(proc => proc .hasname("hotel_insert") .parameter(h => h.bezeichnung, "bezeichnung") .parameter(h => h.sterne, "sterne") .parameter(h => h.regioncode, "regioncode") .result(h => h.hotelid, "hotelid") .result(h => h.bezeichnung, "bezeichnung") ) .update(proc => proc .hasname("hotel_update") .parameter(h => h.hotelid, "hotelid") .parameter(h => h.bezeichnung, "bezeichnung") .parameter(h => h.sterne, "sterne") .parameter(h => h.regioncode, "regioncode") // .parameter(h => h.region.regioncode, "regioncode") ) .delete(proc => proc .hasname("hotel_delete") .parameter(h => h.hotelid, "hotelid")));
Comments
Post a Comment